diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 98f264bb09e..49c70b05641 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -2187,106 +2187,108 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
}
- // Accountancy sell code
- print '
| ';
- print $langs->trans("ProductAccountancySellCode");
- print ' | ';
- if (!empty($conf->accounting->enabled)) {
- if (!empty($object->accountancy_code_sell)) {
- $accountingaccount = new AccountingAccount($db);
- $accountingaccount->fetch('', $object->accountancy_code_sell, 1);
-
- print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
- }
- } else {
- print $object->accountancy_code_sell;
- }
- print ' |
';
-
- // Accountancy sell code intra-community
- if ($mysoc->isInEEC()) {
+ if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
+ // Accountancy sell code
print '| ';
- print $langs->trans("ProductAccountancySellIntraCode");
+ print $langs->trans("ProductAccountancySellCode");
print ' | ';
if (!empty($conf->accounting->enabled)) {
- if (!empty($object->accountancy_code_sell_intra)) {
- $accountingaccount2 = new AccountingAccount($db);
- $accountingaccount2->fetch('', $object->accountancy_code_sell_intra, 1);
+ if (!empty($object->accountancy_code_sell)) {
+ $accountingaccount = new AccountingAccount($db);
+ $accountingaccount->fetch('', $object->accountancy_code_sell, 1);
- print $accountingaccount2->getNomUrl(0, 1, 1, '', 1);
+ print $accountingaccount->getNomUrl(0, 1, 1, '', 1);
}
} else {
- print $object->accountancy_code_sell_intra;
+ print $object->accountancy_code_sell;
+ }
+ print ' |
';
+
+ // Accountancy sell code intra-community
+ if ($mysoc->isInEEC()) {
+ print '| ';
+ print $langs->trans("ProductAccountancySellIntraCode");
+ print ' | ';
+ if (!empty($conf->accounting->enabled)) {
+ if (!empty($object->accountancy_code_sell_intra)) {
+ $accountingaccount2 = new AccountingAccount($db);
+ $accountingaccount2->fetch('', $object->accountancy_code_sell_intra, 1);
+
+ print $accountingaccount2->getNomUrl(0, 1, 1, '', 1);
+ }
+ } else {
+ print $object->accountancy_code_sell_intra;
+ }
+ print ' |
';
+ }
+
+ // Accountancy sell code export
+ print '| ';
+ print $langs->trans("ProductAccountancySellExportCode");
+ print ' | ';
+ if (!empty($conf->accounting->enabled)) {
+ if (!empty($object->accountancy_code_sell_export)) {
+ $accountingaccount3 = new AccountingAccount($db);
+ $accountingaccount3->fetch('', $object->accountancy_code_sell_export, 1);
+
+ print $accountingaccount3->getNomUrl(0, 1, 1, '', 1);
+ }
+ } else {
+ print $object->accountancy_code_sell_export;
+ }
+ print ' |
';
+
+ // Accountancy buy code
+ print '| ';
+ print $langs->trans("ProductAccountancyBuyCode");
+ print ' | ';
+ if (!empty($conf->accounting->enabled)) {
+ if (!empty($object->accountancy_code_buy)) {
+ $accountingaccount4 = new AccountingAccount($db);
+ $accountingaccount4->fetch('', $object->accountancy_code_buy, 1);
+
+ print $accountingaccount4->getNomUrl(0, 1, 1, '', 1);
+ }
+ } else {
+ print $object->accountancy_code_buy;
+ }
+ print ' |
';
+
+ // Accountancy buy code intra-community
+ if ($mysoc->isInEEC()) {
+ print '| ';
+ print $langs->trans("ProductAccountancyBuyIntraCode");
+ print ' | ';
+ if (!empty($conf->accounting->enabled)) {
+ if (!empty($object->accountancy_code_buy_intra)) {
+ $accountingaccount5 = new AccountingAccount($db);
+ $accountingaccount5->fetch('', $object->accountancy_code_buy_intra, 1);
+
+ print $accountingaccount5->getNomUrl(0, 1, 1, '', 1);
+ }
+ } else {
+ print $object->accountancy_code_buy_intra;
+ }
+ print ' |
';
+ }
+
+ // Accountancy buy code export
+ print '| ';
+ print $langs->trans("ProductAccountancyBuyExportCode");
+ print ' | ';
+ if (!empty($conf->accounting->enabled)) {
+ if (!empty($object->accountancy_code_buy_export)) {
+ $accountingaccount6 = new AccountingAccount($db);
+ $accountingaccount6->fetch('', $object->accountancy_code_buy_export, 1);
+
+ print $accountingaccount6->getNomUrl(0, 1, 1, '', 1);
+ }
+ } else {
+ print $object->accountancy_code_buy_export;
}
print ' |
';
}
- // Accountancy sell code export
- print '| ';
- print $langs->trans("ProductAccountancySellExportCode");
- print ' | ';
- if (!empty($conf->accounting->enabled)) {
- if (!empty($object->accountancy_code_sell_export)) {
- $accountingaccount3 = new AccountingAccount($db);
- $accountingaccount3->fetch('', $object->accountancy_code_sell_export, 1);
-
- print $accountingaccount3->getNomUrl(0, 1, 1, '', 1);
- }
- } else {
- print $object->accountancy_code_sell_export;
- }
- print ' |
';
-
- // Accountancy buy code
- print '| ';
- print $langs->trans("ProductAccountancyBuyCode");
- print ' | ';
- if (!empty($conf->accounting->enabled)) {
- if (!empty($object->accountancy_code_buy)) {
- $accountingaccount4 = new AccountingAccount($db);
- $accountingaccount4->fetch('', $object->accountancy_code_buy, 1);
-
- print $accountingaccount4->getNomUrl(0, 1, 1, '', 1);
- }
- } else {
- print $object->accountancy_code_buy;
- }
- print ' |
';
-
- // Accountancy buy code intra-community
- if ($mysoc->isInEEC()) {
- print '| ';
- print $langs->trans("ProductAccountancyBuyIntraCode");
- print ' | ';
- if (!empty($conf->accounting->enabled)) {
- if (!empty($object->accountancy_code_buy_intra)) {
- $accountingaccount5 = new AccountingAccount($db);
- $accountingaccount5->fetch('', $object->accountancy_code_buy_intra, 1);
-
- print $accountingaccount5->getNomUrl(0, 1, 1, '', 1);
- }
- } else {
- print $object->accountancy_code_buy_intra;
- }
- print ' |
';
- }
-
- // Accountancy buy code export
- print '| ';
- print $langs->trans("ProductAccountancyBuyExportCode");
- print ' | ';
- if (!empty($conf->accounting->enabled)) {
- if (!empty($object->accountancy_code_buy_export)) {
- $accountingaccount6 = new AccountingAccount($db);
- $accountingaccount6->fetch('', $object->accountancy_code_buy_export, 1);
-
- print $accountingaccount6->getNomUrl(0, 1, 1, '', 1);
- }
- } else {
- print $object->accountancy_code_buy_export;
- }
- print ' |
';
-
// Description
print '| '.$langs->trans("Description").' | '.(dol_textishtml($object->description) ? $object->description : dol_nl2br($object->description, 1, true)).' |
';