diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php index 06790783d48..3946b9d1569 100644 --- a/htdocs/core/modules/societe/mod_codecompta_panicum.php +++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php @@ -78,7 +78,8 @@ class mod_codecompta_panicum extends ModeleAccountancyCode function get_code($db, $societe, $type='') { // Renvoie toujours ok - $this->code = $societe->code_compta; + if ($type == 'supplier') $this->code = $societe->code_compta_fournisseur; + else $this->code = $societe->code_compta; return 0; } } diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 4cedfecf2d7..cf0d74b2df3 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -126,7 +126,7 @@ if (empty($reshook)) $action=""; } - if ($action == 'setaccountancy_code_buy') + if ($action == 'setaccountancy_code_sell') { $object->fetch($id,$ref); $result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']);