diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index b40092abfaa..c56f1840ab7 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -1590,7 +1590,7 @@ if ($action == 'create') {
$shipping_method_id = 0;
if ($socid > 0) {
print '
';
- print $soc->getNomUrl(1);
+ print $soc->getNomUrl(1, 'customer');
print ' ';
print ' ';
if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD) && !empty($soc->shipping_method_id)) {
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 49d86c1ceb6..b31d65fdcaf 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -3053,7 +3053,7 @@ if ($action == 'create') {
// If thirdparty known and not a predefined invoiced without a recurring rule
print ''.$langs->trans('Customer').' ';
print '';
- print $soc->getNomUrl(1);
+ print $soc->getNomUrl(1, 'customer');
print ' ';
// Outstanding Bill
$arrayoutstandingbills = $soc->getOutstandingBills();
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)).' ';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index ad2876c894e..942a76585cc 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -223,19 +223,19 @@ $arrayfields = array(
'p.numbuyprice'=>array('label'=>"BuyingPriceNumShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>43),
'p.pmp'=>array('label'=>"PMPValueShort", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>44),
'p.cost_price'=>array('label'=>"CostPrice", 'checked'=>0, 'enabled'=>(!empty($user->rights->fournisseur->lire)), 'position'=>45),
- 'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service'), 'position'=>50),
- 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service'), 'position'=>51),
- 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service'), 'position'=>52),
- 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && $contextpage != 'service' && $virtualdiffersfromphysical), 'position'=>53),
+ 'p.seuil_stock_alerte'=>array('label'=>"StockLimit", 'checked'=>0, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>50),
+ 'p.desiredstock'=>array('label'=>"DesiredStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>51),
+ 'p.stock'=>array('label'=>"PhysicalStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES))), 'position'=>52),
+ 'stock_virtual'=>array('label'=>"VirtualStock", 'checked'=>1, 'enabled'=>(!empty($conf->stock->enabled) && $user->rights->stock->lire && ($contextpage != 'servicelist' || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) && $virtualdiffersfromphysical), 'position'=>53),
'p.tobatch'=>array('label'=>"ManageLotSerial", 'checked'=>0, 'enabled'=>(!empty($conf->productbatch->enabled)), 'position'=>60),
'p.fk_country'=>array('label'=>"Country", 'checked'=>0, 'position'=>100),
'p.fk_state'=>array('label'=>"State", 'checked'=>0, 'position'=>101),
- $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'position'=>400),
- $alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>401),
- $alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'position'=>402),
- $alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'position'=>403),
- $alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC, 'position'=>404),
- $alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'position'=>405),
+ $alias_product_perentity . '.accountancy_code_sell'=>array('label'=>"ProductAccountancySellCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>400),
+ $alias_product_perentity . '.accountancy_code_sell_intra'=>array('label'=>"ProductAccountancySellIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>401),
+ $alias_product_perentity . '.accountancy_code_sell_export'=>array('label'=>"ProductAccountancySellExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>402),
+ $alias_product_perentity . '.accountancy_code_buy'=>array('label'=>"ProductAccountancyBuyCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>403),
+ $alias_product_perentity . '.accountancy_code_buy_intra'=>array('label'=>"ProductAccountancyBuyIntraCode", 'checked'=>0, 'enabled'=>$isInEEC && empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>404),
+ $alias_product_perentity . '.accountancy_code_buy_export'=>array('label'=>"ProductAccountancyBuyExportCode", 'checked'=>0, 'enabled'=>empty($conf->global->PRODUCT_DISABLE_ACCOUNTING), 'position'=>405),
'p.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
'p.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
'p.tosell'=>array('label'=>$langs->transnoentitiesnoconv("Status").' ('.$langs->transnoentitiesnoconv("Sell").')', 'checked'=>1, 'position'=>1000),