';
@@ -1994,7 +1994,7 @@ if ($resql) {
// Show shippable Icon (this creates subloops, so may be slow)
if (!empty($arrayfields['shippable']['checked'])) {
print '
';
- if (!empty($show_shippable_command) && !empty($conf->stock->enabled)) {
+ if (!empty($show_shippable_command) && isModEnabled('stock')) {
if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
$generic_commande->loadExpeditions(); // Load array ->expeditions
@@ -2034,7 +2034,7 @@ if ($resql) {
$stock_order = 0;
$stock_order_supplier = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ?
- if (!empty($conf->commande->enabled)) {
+ if (isModEnabled('commande')) {
if (empty($productstat_cache[$obj->fk_product]['stats_order_customer'])) {
$generic_product->load_stats_commande(0, '1,2');
$productstat_cache[$obj->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 0ee77260599..d7728725fec 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -182,7 +182,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('don')) {
$nbElements += $project->getElementCount('donation', 'don');
}
- if (!empty($conf->loan->enabled)) {
+ if (isModEnabled('loan')) {
$nbElements += $project->getElementCount('loan', 'loan');
}
if (isModEnabled('tax')) {
@@ -194,7 +194,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('stock')) {
$nbElements += $project->getElementCount('stock_mouvement', 'stock');
}
- if (!empty($conf->salaries->enabled)) {
+ if (isModEnabled('salaries')) {
$nbElements += $project->getElementCount('salaries', 'payment_salary');
}
if (isModEnabled("banque")) {
diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 0c6d9932bca..07768bcd53f 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -141,7 +141,7 @@ function user_prepare_head(User $object)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
- if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
+ if ((isModEnabled('salaries') && !empty($user->rights->salaries->read))
|| (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))
|| (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))
diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php
index 8a63efbc69d..6749cf64f90 100644
--- a/htdocs/don/payment/card.php
+++ b/htdocs/don/payment/card.php
@@ -216,7 +216,7 @@ if (empty($action)) {
if (!$disable_delete) {
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1);
} else {
- print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), '', 1);
+ print dolGetButtonAction($langs->trans("CantRemovePaymentWithOneInvoicePaid"), $langs->trans('Delete'), '', $_SERVER["PHP_SELF"].'?id='.$object->id.'#', '', 1, [ 'attr' => ['classOverride' => 'butActionRefused']]);
}
}
}
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index 7c448cb314a..9816285e6e4 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -344,7 +344,7 @@ if (empty($conf->global->ECM_AUTO_TREE_HIDEN)) {
$rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
$rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
}
- if (!empty($conf->salaries->enabled)) {
+ if (isModEnabled('salaries')) {
$langs->load("compta");
$rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>isModEnabled('salaries'), 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
}
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 7a3c1060257..7f948153e10 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -648,7 +648,7 @@ if (empty($reshook)) {
$qty = "qtyl".$detail_batch->fk_expeditiondet.'_'.$detail_batch->id;
$batch_id = GETPOST($batch, 'int');
$batch_qty = GETPOST($qty, 'int');
- if (!empty($batch_id) && ($batch_id != $detail_batch->fk_origin_stock || $batch_qty != $detail_batch->qty)) {
+ if (!empty($batch_id)) {
if ($lotStock->fetch($batch_id) > 0 && $line->fetch($detail_batch->fk_expeditiondet) > 0) { // $line is ExpeditionLine
if ($lines[$i]->entrepot_id != 0) {
// allow update line entrepot_id if not multi warehouse shipping
diff --git a/htdocs/loan/class/loanschedule.class.php b/htdocs/loan/class/loanschedule.class.php
index 2618d50c6fd..094ef342dda 100644
--- a/htdocs/loan/class/loanschedule.class.php
+++ b/htdocs/loan/class/loanschedule.class.php
@@ -91,6 +91,10 @@ class LoanSchedule extends CommonObject
*/
public $fk_user_modif;
+ /**
+ * @var LoanSchedule[]
+ * @see LoanSchedule::fetchAll()
+ */
public $lines = array();
/**
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index e13ac6d7c23..9906b3606e7 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -181,7 +181,7 @@ if (ismodEnabled('productbatch') &&
// Purchase price and project
print '