diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index c7baf022d8e..d5f9a9e8e73 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -243,7 +243,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { $fk_commandefourndet = "fk_commandefourndet_".$reg[1].'_'.$reg[2]; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); if (!empty($dto)) { $unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU'); @@ -269,7 +269,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { } if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = price2num(GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'), ''); if (empty($dto)) { $dto = 0; @@ -311,7 +311,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { $fk_commandefourndet = 'fk_commandefourndet_'.$reg[1].'_'.$reg[2]; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); if (!empty($dto)) { $unit_price = price2num(GETPOST("pu_".$reg[1]) * (100 - $dto) / 100, 'MU'); @@ -344,7 +344,7 @@ if ($action == 'dispatch' && $permissiontoreceive) { } if (!$error && !empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { $dto = GETPOST("dto_".$reg[1].'_'.$reg[2], 'int'); //update supplier price if (GETPOSTISSET($saveprice)) { @@ -742,7 +742,7 @@ if ($id > 0 || !empty($ref)) { print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { print ''.$langs->trans("Price").''; print ''.$langs->trans("ReductionShort").' (%)'; print ''.$langs->trans("UpdatePrice").''; @@ -991,7 +991,7 @@ if ($id > 0 || !empty($ref)) { print ''; if (!empty($conf->global->SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT)) { - if (empty($conf->multicurrency->enabled) && empty($conf->dynamicprices->enabled)) { + if (!isModEnabled("multicurrency") && empty($conf->dynamicprices->enabled)) { // Price print ''; print ''; diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 8f8d9ec9e47..be1693b7381 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -1243,7 +1243,7 @@ if ($action == 'create') { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print ''; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index f0640681e7f..11b7332f587 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1915,7 +1915,7 @@ if ($action == 'create') { if (GETPOST('socid', 'int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid', 'int')); - if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($societe->multicurrency_code)) { $currency_code = $societe->multicurrency_code; } } @@ -1964,7 +1964,7 @@ if ($action == 'create') { $dateinvoice = empty($conf->global->MAIN_AUTOFILL_DATE) ?-1 : ''; $transport_mode_id = (!empty($objectsrc->transport_mode_id) ? $objectsrc->transport_mode_id : (!empty($soc->transport_mode_id) ? $soc->transport_mode_id : 0)); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { if (!empty($objectsrc->multicurrency_code)) { $currency_code = $objectsrc->multicurrency_code; } @@ -1991,7 +1991,7 @@ if ($action == 'create') { $datetmp = dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int')); $datedue = ($datetmp == '' ?-1 : $datetmp); - if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) { + if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) { $currency_code = $soc->multicurrency_code; } } @@ -2428,7 +2428,7 @@ if ($action == 'create') { } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).''; print ''; @@ -2537,7 +2537,7 @@ if ($action == 'create') { } print ''.$langs->trans('AmountTTC').''.price($objectsrc->total_ttc).""; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''.$langs->trans('MulticurrencyAmountHT').''.price($objectsrc->multicurrency_total_ht).''; print ''.$langs->trans('MulticurrencyAmountVAT').''.price($objectsrc->multicurrency_total_tva).""; print ''.$langs->trans('MulticurrencyAmountTTC').''.price($objectsrc->multicurrency_total_ttc).""; @@ -2613,7 +2613,7 @@ if ($action == 'create') { $resteapayer = price2num($object->total_ttc - $totalpaid - $totalcreditnotes - $totaldeposits, 'MT'); // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $multicurrency_totalpaid = $object->getSommePaiement(1); $multicurrency_totalcreditnotes = $object->getSumCreditNotesUsed(1); $multicurrency_totaldeposits = $object->getSumDepositsUsed(1); @@ -3046,7 +3046,7 @@ if ($action == 'create') { print ''; // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Multicurrency code print ''; print ''; @@ -3169,7 +3169,7 @@ if ($action == 'create') { print ''; - if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) { + if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) { // Multicurrency Amount HT print ''; print ''; @@ -3256,7 +3256,7 @@ if ($action == 'create') { if (!empty($conf->incoterm->enabled)) { $nbrows++; } - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $nbrows += 5; } diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 0072349c06b..305c50b29d5 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -195,13 +195,13 @@ $arrayfields = array( 'u.login'=>array('label'=>"Author", 'checked'=>1), 'dynamount_payed'=>array('label'=>"Paid", 'checked'=>0), 'rtp'=>array('label'=>"Rest", 'checked'=>0), - 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), - 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)), // Not enabled by default because slow + 'f.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'f.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'multicurrency_dynamount_payed'=>array('label'=>'MulticurrencyAlreadyPaid', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), + 'multicurrency_rtp'=>array('label'=>'MulticurrencyRemainderToPay', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)), // Not enabled by default because slow 'f.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500), 'f.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 09507929daf..d9b755fdf4e 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -575,7 +575,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print ''; @@ -612,7 +612,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); // Multicurrency Price - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { $multicurrency_payment = $invoice->getSommePaiement(1); $multicurrency_creditnotes = $invoice->getSumCreditNotesUsed(1); $multicurrency_deposits = $invoice->getSumDepositsUsed(1); @@ -653,7 +653,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } // Multicurrency - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { // Currency print '\n"; @@ -767,7 +767,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Print total print ''; print ''; - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled("multicurrency")) { print ''; print ''; print '';
'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).''.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).''.$langs->trans('RefSupplier').''.$langs->trans('Date').''.$langs->trans('DateMaxPayment').''.$langs->trans('Currency').''.$langs->trans('MulticurrencyAmountTTC').''.$langs->trans('MulticurrencyAlreadyPaid').''.$objp->multicurrency_code."
'.$langs->trans('TotalTTC').':