Update code
This commit is contained in:
parent
62529b10e4
commit
371f5ee581
@ -907,7 +907,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray',
|
||||
* 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)
|
||||
|
||||
@ -84,7 +84,7 @@ class MyObject 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)
|
||||
|
||||
@ -634,13 +634,13 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
||||
// Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
|
||||
$prev_progress = $object->lines[$i]->get_prev_progress($object->id);
|
||||
if ($prev_progress > 0 && !empty($object->lines[$i]->situation_percent)) { // Compute progress from previous situation
|
||||
if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
|
||||
if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
|
||||
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
|
||||
} else {
|
||||
$tvaligne = $sign * $object->lines[$i]->total_tva * ($object->lines[$i]->situation_percent - $prev_progress) / $object->lines[$i]->situation_percent;
|
||||
}
|
||||
} else {
|
||||
if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) {
|
||||
if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) {
|
||||
$tvaligne = $sign * $object->lines[$i]->multicurrency_total_tva;
|
||||
} else {
|
||||
$tvaligne = $sign * $object->lines[$i]->total_tva;
|
||||
|
||||
@ -102,7 +102,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
// Access control
|
||||
// TODO Open this page to a given permission so a sale representative can modify change rates. Permission should be added into module multicurrency.
|
||||
// One permission to read rates (history) and one to add/edit rates.
|
||||
if (!$user->admin || empty($conf->multicurrency->enabled)) {
|
||||
if (!$user->admin || !isModEnabled("multicurrency")) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
@ -243,7 +243,7 @@ if (empty($reshook)) {
|
||||
$_POST["price"] = 0;
|
||||
}
|
||||
}
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
if (!GETPOST("multicurrency_code")) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
@ -299,7 +299,7 @@ if (empty($reshook)) {
|
||||
}*/
|
||||
$object->packaging = $packaging;
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
$multicurrency_tx = price2num(GETPOST("multicurrency_tx", 'alpha'));
|
||||
$multicurrency_price = price2num(GETPOST("multicurrency_price", 'alpha'));
|
||||
$multicurrency_code = GETPOST("multicurrency_code", 'alpha');
|
||||
@ -630,7 +630,7 @@ if ($id > 0 || $ref) {
|
||||
</script>';
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
// Currency
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||
print '<td>';
|
||||
@ -973,7 +973,7 @@ END;
|
||||
}
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("PriceQtyMinHT", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print_liste_field_titre("PriceQtyMinHTCurrency", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
if (!empty($arrayfields['pfp.unitprice']['checked'])) {
|
||||
@ -982,7 +982,7 @@ END;
|
||||
if (!empty($arrayfields['pfp.multicurrency_unitprice']['checked'])) {
|
||||
print_liste_field_titre("UnitPriceHTCurrency", $_SERVER["PHP_SELF"], "pfp.multicurrency_unitprice", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print_liste_field_titre("Currency", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
}
|
||||
print_liste_field_titre("DiscountQtyMin", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right ');
|
||||
@ -1089,7 +1089,7 @@ END;
|
||||
print $productfourn->fourn_price ? '<span class="amount">'.price($productfourn->fourn_price).'</span>' : "";
|
||||
print '</td>';
|
||||
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
// Price for the quantity in currency
|
||||
print '<td class="right">';
|
||||
print $productfourn->fourn_multicurrency_price ? '<span class="amount">'.price($productfourn->fourn_multicurrency_price).'</span>' : "";
|
||||
@ -1112,7 +1112,7 @@ END;
|
||||
}
|
||||
|
||||
// Currency
|
||||
if (!empty($conf->multicurrency->enabled)) {
|
||||
if (isModEnabled("multicurrency")) {
|
||||
print '<td class="right nowraponall">';
|
||||
print $productfourn->fourn_multicurrency_code ? currency_name($productfourn->fourn_multicurrency_code) : '';
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user