diff --git a/.github/changed-lines-count-labeler.yml b/.github/changed-lines-count-labeler.yml deleted file mode 100644 index 39e663821fb..00000000000 --- a/.github/changed-lines-count-labeler.yml +++ /dev/null @@ -1,3 +0,0 @@ -# Add this tag for any changes for more than 1 line -"Pending analysis of PR (maintenance team)": - min: 1 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 97f218fce4d..00000000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Test github actions -on: - workflow_dispatch: - pull_request: - types: [opened, reopened, synchronize] - push: - -env: - ENVGHT: ${{ secrets.GITHUB_TOKEN }} - ENVGHU: ${{ github.token }} - TEST_ACCESS_KEY: ${{ secrets.TEST_ACCESS_KEY }} - TEST_VAR_REPO: ${{ vars.TEST_VAR_REPO }} - ENVLOCAL: "varenvlocal" - -jobs: - testjob: - runs-on: ubuntu-latest - steps: - - name: Log - run: | - echo "Run action by ${{ github.actor }}" - echo "github.token=${{ github.token }}" - echo "secrets.GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" - echo "GITHUB_EVENT_PATH=$GITHUB_EVENT_PATH" - echo "repo-token: ${{secrets.GITHUB_TOKEN}}" - echo "secret repository TEST_ACCESS_KEY: ${{secrets.TEST_ACCESS_KEY}}" - echo "variable repository : ${{vars.TEST_VAR_REPO}}" - echo "ENVLOCAL: ${{env.ENVLOCAL}}" diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 317ef4e3e33..c7538cf8b6e 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -939,13 +939,12 @@ class Asset extends CommonObject } // Delete old lines - $sql = "DELETE " . MAIN_DB_PREFIX . "asset_depreciation FROM " . MAIN_DB_PREFIX . "asset_depreciation"; - $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab ON ab.doc_type = 'asset' AND ab.fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid"; - $sql .= " WHERE " . MAIN_DB_PREFIX . "asset_depreciation.fk_asset = " . (int) $this->id; - $sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.depreciation_mode = '" . $this->db->escape($mode_key) . "'"; - $sql .= " AND ab.fk_docdet IS NULL"; + $sql = "DELETE FROM " . MAIN_DB_PREFIX . "asset_depreciation"; + $sql .= " WHERE fk_asset = " . (int) $this->id; + $sql .= " AND depreciation_mode = '" . $this->db->escape($mode_key) . "'"; + $sql .= " AND NOT EXISTS (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping WHERE doc_type = 'asset' AND fk_docdet = " . MAIN_DB_PREFIX . "asset_depreciation.rowid)"; if ($last_depreciation_date !== "") { - $sql .= " AND " . MAIN_DB_PREFIX . "asset_depreciation.ref != ''"; + $sql .= " AND ref <> ''"; } $resql = $this->db->query($sql); if (!$resql) { diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 1481678a06c..e8a51987cc4 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -196,6 +196,7 @@ class CashControl extends CommonObject $sql .= ", cash"; $sql .= ", cheque"; $sql .= ", card"; + $sql .= ", fk_user_creat"; $sql .= ") VALUES ("; //$sql .= "'(PROV)', "; $sql .= ((int) $conf->entity); @@ -210,6 +211,7 @@ class CashControl extends CommonObject $sql .= ", ".price2num($this->cash, 'MT'); $sql .= ", ".price2num($this->cheque, 'MT'); $sql .= ", ".price2num($this->card, 'MT'); + $sql .= ", ".((int) $user->id); $sql .= ")"; $this->db->begin(); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8f05d5b5fe6..ed9b2093a67 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1537,6 +1537,9 @@ if (empty($reshook)) { } foreach ($TTotalByTva as $tva => &$total) { + if (empty($amountdeposit[$tva])) { + $amountdeposit[$tva] = 0; + } $coef = $total / $srcobject->total_ttc; // Calc coef $am = $amount * $coef; $amount_ttc_diff += $am; @@ -1561,6 +1564,9 @@ if (empty($reshook)) { if ($qualified) { $totalamount += $lines[$i]->total_ht; // Fixme : is it not for the customer ? Shouldn't we take total_ttc ? $tva_tx = $lines[$i]->tva_tx; + if (empty($amountdeposit[$tva_tx])) { + $amountdeposit[$tva_tx] = 0; + } $amountdeposit[$tva_tx] += ($lines[$i]->total_ht * $valuedeposit) / 100; } } diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e7637b68f75..a9e4213b546 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1147,6 +1147,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { $objecttmp = new $objectclass($db); $nbok = 0; foreach ($toselect as $toselectid) { + $objecttmp->thirdparty = null; // Clear if another value was already set by fetch_thirdparty $result = $objecttmp->fetch($toselectid); if ($result > 0) { $outputlangs = $langs; @@ -1161,7 +1162,7 @@ if (!$error && $massaction == 'generate_doc' && $permissiontoread) { if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && isset($objecttmp->default_lang)) { $newlang = $objecttmp->default_lang; // for thirdparty } - if ($conf->global->MAIN_MULTILANGS && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty + if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && empty($objecttmp->thirdparty)) { //load lang from thirdparty $objecttmp->fetch_thirdparty(); $newlang = $objecttmp->thirdparty->default_lang; // for proposal, order, invoice, ... } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index db674a40dd4..4b0be7d7283 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -641,7 +641,7 @@ class FormMail extends Form // Add also email aliases from the c_email_senderprofile table $sql = "SELECT rowid, label, email FROM ".$this->db->prefix()."c_email_senderprofile"; - $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).")"; + $sql .= " WHERE active = 1 AND (private = 0 OR private = ".((int) $user->id).") AND entity IN (".getEntity('c_email_senderprofile').")"; $sql .= " ORDER BY position"; $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 0d9239aac8e..e02c5be69e4 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -424,7 +424,10 @@ class CommandeFournisseur extends CommonOrder $this->ref = $obj->ref; $this->ref_supplier = $obj->ref_supplier; + $this->socid = $obj->fk_soc; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + $this->fourn_id = $obj->fk_soc; $this->statut = $obj->status; // deprecated $this->status = $obj->status; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index b6260a48a77..994455fee14 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -990,6 +990,8 @@ class FactureFournisseur extends CommonInvoice $this->socid = $obj->socid; + $this->thirdparty = null; // Clear if another value was already set by fetch_thirdparty + // Retrieve all extrafield // fetch optionals attributes and labels $this->fetch_optionals(); diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index 0035f889505..b4a86413b70 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -157,7 +157,7 @@ $year_month = sprintf("%04d", $search_year).'-'.sprintf("%02d", $search_month); $sql = "SELECT cp.rowid, cp.ref, cp.fk_user, cp.date_debut, cp.date_fin, cp.fk_type, cp.description, cp.halfday, cp.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid"; -$sql .= " WHERE cp.rowid > 0"; +$sql .= " WHERE cp.entity IN (".getEntity('holiday').") AND cp.rowid > 0"; $sql .= " AND cp.statut = ".Holiday::STATUS_APPROVED; $sql .= " AND ("; $sql .= " (date_format(cp.date_debut, '%Y-%m') = '".$db->escape($year_month)."' OR date_format(cp.date_fin, '%Y-%m') = '".$db->escape($year_month)."')";