diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 820596de166afce91d101231d3f9148940c7ec42..4800737528dea569dd43078df823ec4c72b3da62 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -87,10 +87,10 @@ if (! $user->rights->accounting->ventilation->dispatch) accessforbidden(); $formventilation = new FormVentilation($db); - $accounting = new AccountingAccount($db); -$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_SOLD_ACCOUNT); -$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_SOLD_ACCOUNT); +$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT,1); +$aarowid_p = $accounting->fetch('',$conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT,1); + // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) { @@ -278,6 +278,8 @@ if ($result) { $code_sell_p_notset = ''; $objp->aarowid_suggest = $objp->aarowid; + + if (! empty($objp->code_sell)) { $objp->code_sell_p = $objp->code_sell; } else { @@ -290,12 +292,14 @@ if ($result) { } if ($objp->type_l == 1) { $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - if ($objp->aarowid == '') + if ($objp->aarowid == '') { $objp->aarowid_suggest = $aarowid_s; + } } elseif ($objp->type_l == 0) { $objp->code_sell_l = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef")); - if ($objp->aarowid == '') + if ($objp->aarowid == '') { $objp->aarowid_suggest = $aarowid_p; + } } if ($objp->code_sell_l != $objp->code_sell_p) $code_sell_p_l_differ = 'color:red'; @@ -311,10 +315,12 @@ if ($result) { $product_static->id = $objp->product_id; $product_static->type = $objp->type; print '<td>'; + if ($product_static->id) print $product_static->getNomUrl(1); else print ' '; + print '</td>'; print '<td style="' . $code_sell_p_l_differ . '">' . dol_trunc($objp->product_label, 24) . '</td>'; diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 891d8b1439ed0d9cfdcf55bfea652df397f76d76..c94c8612535ba98d61a1c646034a70b166ed03b4 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -94,8 +94,8 @@ $formventilation = new FormVentilation($db); $accounting = new AccountingAccount($db); // TODO: we should need to check if result is a really exist accountaccount rowid..... -$aarowid_s = $accounting->fetch('', ACCOUNTING_SERVICE_BUY_ACCOUNT); -$aarowid_p = $accounting->fetch('', ACCOUNTING_PRODUCT_BUY_ACCOUNT); +$aarowid_s = $accounting->fetch('', $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT,1); +$aarowid_p = $accounting->fetch('', $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT,1); // Purge search criteria if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers