mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Update code
This commit is contained in:
parent
371f5ee581
commit
8108a60aac
|
|
@ -540,7 +540,7 @@ if (empty($reshook)) {
|
|||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
}
|
||||
|
||||
|
|
@ -1174,7 +1174,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
$object->forme_juridique_code = GETPOST('forme_juridique_code');
|
||||
|
||||
// We set multicurrency_code if enabled
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $conf->currency;
|
||||
}
|
||||
/* Show create form */
|
||||
|
|
@ -1740,7 +1740,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Capital
|
||||
print '<tr><td>'.$form->editfieldkey('Capital', 'capital', '', $object, 0).'</td>';
|
||||
print '<td colspan="3"><input type="text" name="capital" id="capital" class="maxwidth100" value="'.$object->capital.'"> ';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<span class="hideonsmartphone">'.$langs->trans("Currency".$object->multicurrency_code).'</span></td></tr>';
|
||||
} else {
|
||||
print '<span class="hideonsmartphone">'.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||
|
|
@ -1788,7 +1788,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
|
|
@ -2002,7 +2002,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
}
|
||||
|
||||
// We set multicurrency_code if enabled
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code') ? GETPOST('multicurrency_code') : $object->multicurrency_code;
|
||||
}
|
||||
}
|
||||
|
|
@ -2439,7 +2439,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<tr><td>'.$form->editfieldkey('Capital', 'capital', '', $object, 0).'</td>';
|
||||
print '<td colspan="3"><input type="text" name="capital" id="capital" size="10" value="';
|
||||
print $object->capital != '' ? dol_escape_htmltag(price($object->capital)) : '';
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '"> <span class="hideonsmartphone">'.$langs->trans("Currency".$object->multicurrency_code).'</span></td></tr>';
|
||||
} else {
|
||||
print '"> <span class="hideonsmartphone">'.$langs->trans("Currency".$conf->currency).'</span></td></tr>';
|
||||
|
|
@ -2494,7 +2494,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
|
|
@ -2930,7 +2930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
// Capital
|
||||
print '<tr><td>'.$langs->trans('Capital').'</td><td>';
|
||||
if ($object->capital) {
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($object->multicurrency_code)) {
|
||||
if (isModEnabled("multicurrency") && !empty($object->multicurrency_code)) {
|
||||
print price($object->capital, '', $langs, 0, -1, -1, $object->multicurrency_code);
|
||||
} else {
|
||||
print price($object->capital, '', $langs, 0, -1, -1, $conf->currency);
|
||||
|
|
@ -2971,7 +2971,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
|
||||
print '<td>';
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ if (empty($reshook)) {
|
|||
$object->origin_id = GETPOST('originid');
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
|
||||
}
|
||||
|
||||
|
|
@ -1190,7 +1190,7 @@ if ($action == 'create') {
|
|||
$objectsrc->fetch_optionals();
|
||||
$object->array_options = $objectsrc->array_options;
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
if (!empty($objectsrc->multicurrency_code)) {
|
||||
$currency_code = $objectsrc->multicurrency_code;
|
||||
}
|
||||
|
|
@ -1201,7 +1201,7 @@ if ($action == 'create') {
|
|||
} else {
|
||||
$cond_reglement_id = $soc->cond_reglement_supplier_id;
|
||||
$mode_reglement_id = $soc->mode_reglement_supplier_id;
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($soc->multicurrency_code)) {
|
||||
if (isModEnabled("multicurrency") && !empty($soc->multicurrency_code)) {
|
||||
$currency_code = $soc->multicurrency_code;
|
||||
}
|
||||
}
|
||||
|
|
@ -1334,7 +1334,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<tr>';
|
||||
print '<td>'.$form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0).'</td>';
|
||||
print '<td colspan="3" class="maxwidthonsmartphone">';
|
||||
|
|
@ -1381,7 +1381,7 @@ if ($action == 'create') {
|
|||
}
|
||||
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td colspan="2">'.price($objectsrc->total_ttc)."</td></tr>";
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<tr><td>'.$langs->trans('MulticurrencyAmountHT').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ht).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('MulticurrencyAmountVAT').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_tva)."</td></tr>";
|
||||
print '<tr><td>'.$langs->trans('MulticurrencyAmountTTC').'</td><td colspan="2">'.price($objectsrc->multicurrency_total_ttc)."</td></tr>";
|
||||
|
|
@ -1685,7 +1685,7 @@ if ($action == 'create') {
|
|||
print '</td></tr>';
|
||||
|
||||
// Multicurrency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
// Multicurrency code
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
|
|
@ -1778,7 +1778,7 @@ if ($action == 'create') {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
|
||||
if (isModEnabled("multicurrency") && ($object->multicurrency_code != $conf->currency)) {
|
||||
// Multicurrency Amount HT
|
||||
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
|
||||
print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ht, '', $langs, 0, - 1, - 1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
|
||||
|
|
|
|||
|
|
@ -518,7 +518,7 @@ class SupplierProposal extends CommonObject
|
|||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) {
|
||||
if (isModEnabled("multicurrency") && $pu_ht_devise > 0) {
|
||||
$pu = 0;
|
||||
}
|
||||
|
||||
|
|
@ -720,7 +720,7 @@ class SupplierProposal extends CommonObject
|
|||
$txtva = preg_replace('/\s*\(.*\)/', '', $txtva); // Remove code into vatrate.
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && $pu_ht_devise > 0) {
|
||||
if (isModEnabled("multicurrency") && $pu_ht_devise > 0) {
|
||||
$pu = 0;
|
||||
}
|
||||
|
||||
|
|
@ -1779,7 +1779,7 @@ class SupplierProposal extends CommonObject
|
|||
if (empty($ref_fourn)) {
|
||||
$ref_fourn = $product->ref_supplier;
|
||||
}
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) {
|
||||
if (isModEnabled("multicurrency") && !empty($product->multicurrency_code)) {
|
||||
list($fk_multicurrency, $multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $product->multicurrency_code);
|
||||
}
|
||||
$productsupplier->id = $product->fk_product;
|
||||
|
|
@ -1842,7 +1842,7 @@ class SupplierProposal extends CommonObject
|
|||
$product->tva_tx,
|
||||
$user->id
|
||||
);
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
if (!empty($product->multicurrency_code)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/multicurrency/class/multicurrency.class.php';
|
||||
$multicurrency = new MultiCurrency($this->db); //need to fetch because empty fk_multicurrency and rate
|
||||
|
|
@ -1863,7 +1863,7 @@ class SupplierProposal extends CommonObject
|
|||
|
||||
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'product_fournisseur_price ';
|
||||
$sql .= '(datec, fk_product, fk_soc, ref_fourn, price, quantity, unitprice, tva_tx, fk_user';
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($product->multicurrency_code)) {
|
||||
if (isModEnabled("multicurrency") && !empty($product->multicurrency_code)) {
|
||||
$sql .= ',fk_multicurrency, multicurrency_code, multicurrency_unitprice, multicurrency_price, multicurrency_tx';
|
||||
}
|
||||
$sql .= ') VALUES ('.implode(',', $values).')';
|
||||
|
|
|
|||
|
|
@ -180,11 +180,11 @@ $arrayfields = array(
|
|||
'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
|
||||
'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
|
||||
'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
|
||||
'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
||||
'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
|
||||
'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10),
|
||||
'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||
'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class Target extends CommonObject
|
|||
* Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)"
|
||||
* 'label' the translation key.
|
||||
* 'picto' is code of a picto to show before value in forms
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or '!empty($conf->multicurrency->enabled)' ...)
|
||||
* 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...)
|
||||
* 'position' is the sort order of field.
|
||||
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
|
||||
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user