diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index cdf5a0e62c4..31352ee1bc9 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -163,7 +163,7 @@ if (!empty($conf->facture->enabled) && $user->rights->facture->lire) $sql .= " GROUP BY f.rowid, f.ref, f.datef, f.total, f.tva, f.total_ttc, f.ref_client, f.type, "; $sql .= "s.email, s.nom, s.rowid, s.code_client, s.code_compta, s.code_fournisseur, s.code_compta_fournisseur"; - $sql .= ", cc.rowid as country_id, cc.code as country_code"; + $sql .= ", cc.rowid, cc.code"; // Add Group from hooks $parameters = array(); diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 7783edd4673..cd426e98f2e 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -151,7 +151,7 @@ if ($prev_id > 0 || $ref) } -$rej = new RejetPrelevement($db, $user); +$rej = new RejetPrelevement($db, $user, $type); /* * List errors diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index f827eb39322..f46d4b0c2f8 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -95,7 +95,7 @@ if ($action == 'confirm_rejet') if ($lipre->fetch($id) == 0) { - $rej = new RejetPrelevement($db, $user,$type); + $rej = new RejetPrelevement($db, $user, $type); $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int')); @@ -158,7 +158,7 @@ if ($id) if ($lipre->statut == 3) { - $rej = new RejetPrelevement($db, $user); + $rej = new RejetPrelevement($db, $user, $type); $resf = $rej->fetch($lipre->id); if ($resf == 0) { diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index da2420aed3f..8a16f4ecb76 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -65,7 +65,7 @@ llxHeader('', $title); if ($sortorder == "") $sortorder = "DESC"; if ($sortfield == "") $sortfield = "p.datec"; -$rej = new RejetPrelevement($db, $user); +$rej = new RejetPrelevement($db, $user, $type); $line = new LignePrelevement($db); $hookmanager->initHooks(array('withdrawalsreceiptsrejectedlist')); diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 1d6e1c2a183..c046f2f278e 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -214,7 +214,7 @@ if ($resql) print '%'.$langs->trans("Amount").'%'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/rejetprelevement.class.php'; - $Rejet = new RejetPrelevement($db, $user); + $Rejet = new RejetPrelevement($db, $user, $type); while ($i < $num) { diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 98dc451b5bb..ba0246ca45d 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -461,3 +461,4 @@ InEEC=Europe (EEC) RestOfEurope=Rest of Europe (EEC) OutOfEurope=Out of Europe (EEC) CurrentOutstandingBillLate=Current outstanding bill late +BecarefullChangeThirdpartyBeforeAddProductToInvoice=Be carefull, depending on your product price settings, you should change thirdparty before adding product to POS. diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 2427ac74714..ccb81ad03bc 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2016-2018 Ferran Marcet * Copyright (C) 2017 Gustavo Novaro - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2441,6 +2441,7 @@ class Product extends CommonObject $sql .= " WHERE "; $sql .= " b.entity IN (".getEntity('bom').")"; $sql .= " AND b.fk_product =".$this->id; + $sql .= " GROUP BY b.rowid"; $result = $this->db->query($sql); if ($result) {