diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 1b04a77083c..3528d5ef299 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1188,11 +1188,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "";
- // Public URL
- print '
';
- if (!empty($conf->accounting->enabled)) {
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
- } else {
- $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
+ if (!empty($conf->accounting->enabled)) {
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT);
+ $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT);
} else {
- $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT);
+ $accountancy_code_sell = (GETPOSTISSET('accountancy_code_sell') ? GETPOST('accountancy_code_sell', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT);
}
- print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print $formaccounting->select_account($accountancy_code_sell, 'accountancy_code_sell', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
print ' ';
- }
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT);
- } else {
- $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_INTRA_ACCOUNT);
+ } else {
+ $accountancy_code_sell_intra = (GETPOSTISSET('accountancy_code_sell_intra') ? GETPOST('accountancy_code_sell_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_INTRA_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+ }
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
- } else {
- $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
print '';
if ($type == 0) {
- $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT);
+ $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_SOLD_EXPORT_ACCOUNT);
} else {
- $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT);
+ $accountancy_code_sell_export = (GETPOST('accountancy_code_sell_export') ? GETPOST('accountancy_code_sell_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_SOLD_EXPORT_ACCOUNT);
}
- print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print $formaccounting->select_account($accountancy_code_sell_export, 'accountancy_code_sell_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_PRODUCT_BUY_ACCOUNT);
+ } else {
+ $accountancy_code_buy = (GETPOST('accountancy_code_buy', 'alpha') ? (GETPOST('accountancy_code_buy', 'alpha')) : $conf->global->ACCOUNTING_SERVICE_BUY_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_buy, 'accountancy_code_buy', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_INTRA_ACCOUNT);
+ } else {
+ $accountancy_code_buy_intra = (GETPOSTISSET('accountancy_code_buy_intra') ? GETPOST('accountancy_code_buy_intra', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_INTRA_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print '';
+ if ($type == 0) {
+ $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT);
+ } else {
+ $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT);
+ }
+ print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
+ print ' ';
+ } else {// For external software
+ if (!empty($accountancy_code_sell)) {
+ $object->accountancy_code_sell = $accountancy_code_sell;
+ }
+ if (!empty($accountancy_code_sell_intra)) {
+ $object->accountancy_code_sell_intra = $accountancy_code_sell_intra;
+ }
+ if (!empty($accountancy_code_sell_export)) {
+ $object->accountancy_code_sell_export = $accountancy_code_sell_export;
+ }
+ if (!empty($accountancy_code_buy)) {
+ $object->accountancy_code_buy = $accountancy_code_buy;
+ }
+ if (!empty($accountancy_code_buy_intra)) {
+ $object->accountancy_code_buy_intra = $accountancy_code_buy_intra;
+ }
+ if (!empty($accountancy_code_buy_export)) {
+ $object->accountancy_code_buy_export = $accountancy_code_buy_export;
+ }
+
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print ' ';
print ' ';
}
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print '';
- if ($type == 0) {
- $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_PRODUCT_BUY_EXPORT_ACCOUNT);
- } else {
- $accountancy_code_buy_export = (GETPOST('accountancy_code_buy_export') ? GETPOST('accountancy_code_buy_export', 'alpha') : $conf->global->ACCOUNTING_SERVICE_BUY_EXPORT_ACCOUNT);
- }
- print $formaccounting->select_account($accountancy_code_buy_export, 'accountancy_code_buy_export', 1, null, 1, 1, 'minwidth150 maxwidth300', 1);
- print ' ';
- } else {// For external software
- if (!empty($accountancy_code_sell)) {
- $object->accountancy_code_sell = $accountancy_code_sell;
- }
- if (!empty($accountancy_code_sell_intra)) {
- $object->accountancy_code_sell_intra = $accountancy_code_sell_intra;
- }
- if (!empty($accountancy_code_sell_export)) {
- $object->accountancy_code_sell_export = $accountancy_code_sell_export;
- }
- if (!empty($accountancy_code_buy)) {
- $object->accountancy_code_buy = $accountancy_code_buy;
- }
- if (!empty($accountancy_code_buy_intra)) {
- $object->accountancy_code_buy_intra = $accountancy_code_buy_intra;
- }
- if (!empty($accountancy_code_buy_export)) {
- $object->accountancy_code_buy_export = $accountancy_code_buy_export;
- }
-
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print ' ';
- print ' ';
}
print '
';
@@ -1708,9 +1722,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print "\n";
// Public Url
- print '';
- if (!empty($conf->accounting->enabled)) {
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ if (empty($conf->global->PRODUCT_DISABLE_ACCOUNTING)) {
+ if (!empty($conf->accounting->enabled)) {
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
print '';
- print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print $formaccounting->select_account($object->accountancy_code_sell, 'accountancy_code_sell', 1, '', 1, 1, 'minwidth150 maxwidth300');
print ' ';
- }
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_sell_intra, 'accountancy_code_sell_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+ }
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
print '';
- print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print $formaccounting->select_account($object->accountancy_code_sell_export, 'accountancy_code_sell_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_buy, 'accountancy_code_buy', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_buy_intra, 'accountancy_code_buy_intra', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print '';
+ print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
+ print ' ';
+ } else {
+ // For external software
+ // Accountancy_code_sell
+ print ''.$langs->trans("ProductAccountancySellCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_sell_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_sell_export
+ print ''.$langs->trans("ProductAccountancySellExportCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy
+ print ''.$langs->trans("ProductAccountancyBuyCode").' ';
+ print ' ';
+ print ' ';
+
+ // Accountancy_code_buy_intra
+ if ($mysoc->isInEEC()) {
+ print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
+ print ' ';
+ print ' ';
+ }
+
+ // Accountancy_code_buy_export
+ print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
+ print ' ';
print ' ';
}
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print '';
- print $formaccounting->select_account($object->accountancy_code_buy_export, 'accountancy_code_buy_export', 1, '', 1, 1, 'minwidth150 maxwidth300');
- print ' ';
- } else {
- // For external software
- // Accountancy_code_sell
- print ''.$langs->trans("ProductAccountancySellCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_sell_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancySellIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_sell_export
- print ''.$langs->trans("ProductAccountancySellExportCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy
- print ''.$langs->trans("ProductAccountancyBuyCode").' ';
- print ' ';
- print ' ';
-
- // Accountancy_code_buy_intra
- if ($mysoc->isInEEC()) {
- print ''.$langs->trans("ProductAccountancyBuyIntraCode").' ';
- print ' ';
- print ' ';
- }
-
- // Accountancy_code_buy_export
- print ''.$langs->trans("ProductAccountancyBuyExportCode").' ';
- print ' ';
- print ' ';
}
print '
';
@@ -2170,9 +2192,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '