Minor fix in multicurrency for supplier prices
This commit is contained in:
parent
cf45f78d7e
commit
62a339e582
@ -59,7 +59,7 @@ class modMultiCurrency extends DolibarrModules
|
|||||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
$this->name = preg_replace('/^mod/i', '', get_class($this));
|
||||||
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
|
||||||
$this->description = "Module to enter elements with a foreign currency";
|
$this->description = "Module to manage several foreign currencies in prices and documents";
|
||||||
|
|
||||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
// Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
|
||||||
$this->version = 'dolibarr';
|
$this->version = 'dolibarr';
|
||||||
|
|||||||
@ -552,19 +552,22 @@ if ($id > 0 || $ref)
|
|||||||
// Currency
|
// Currency
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Currency").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->selectMultiCurrency(GETPOST('multicurrency_code')?GETPOST('multicurrency_code'):(isset($object->fourn_multicurrency_code)?$object->fourn_multicurrency_code:''), "multicurrency_code", 1);
|
$currencycodetouse = GETPOST('multicurrency_code')?GETPOST('multicurrency_code'):(isset($object->fourn_multicurrency_code)?$object->fourn_multicurrency_code:'');
|
||||||
|
if (empty($currencycodetouse) && $object->fourn_multicurrency_tx == 1) $currencycodetouse=$conf->currency;
|
||||||
|
print $form->selectMultiCurrency($currencycodetouse, "multicurrency_code", 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Currency tx
|
// Currency tx
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("CurrencyRate").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("CurrencyRate").'</td>';
|
||||||
print '<td><input class="flat" name="multicurrency_tx" size="4" value="'.(GETPOST('multicurrency_tx')?GETPOST('multicurrency_tx'):(isset($object->fourn_multicurrency_tx)?$object->fourn_multicurrency_tx:'')).'">';
|
print '<td><input class="flat" name="multicurrency_tx" size="4" value="'.vatrate(GETPOST('multicurrency_tx')?GETPOST('multicurrency_tx'):(isset($object->fourn_multicurrency_tx)?$object->fourn_multicurrency_tx:'')).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Currency price qty min
|
// Currency price qty min
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("PriceQtyMinCurrency").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("PriceQtyMinCurrency").'</td>';
|
||||||
print '<td><input class="flat" name="multicurrency_price" size="8" value="'.(GETPOST('multicurrency_price')?GETPOST('multicurrency_price'):(isset($object->fourn_multicurrency_price)?$object->fourn_multicurrency_price:'')).'">';
|
$pricesupplierincurrencytouse=(GETPOST('multicurrency_price')?GETPOST('multicurrency_price'):(isset($object->fourn_multicurrency_price)?$object->fourn_multicurrency_price:''));
|
||||||
|
print '<td><input class="flat" name="multicurrency_price" size="8" value="'.$pricesupplierincurrencytouse.'">';
|
||||||
print ' ';
|
print ' ';
|
||||||
print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type')?GETPOST('multicurrency_price_base_type'):'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices
|
print $form->selectPriceBaseType((GETPOST('multicurrency_price_base_type')?GETPOST('multicurrency_price_base_type'):'HT'), "multicurrency_price_base_type"); // We keep 'HT' here, multicurrency_price_base_type is not yet supported for supplier prices
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -602,7 +605,7 @@ if ($id > 0 || $ref)
|
|||||||
$('input[name="disabled_price"]').prop('disabled', true);
|
$('input[name="disabled_price"]').prop('disabled', true);
|
||||||
$('select[name="disabled_price_base_type"]').prop('disabled', true);
|
$('select[name="disabled_price_base_type"]').prop('disabled', true);
|
||||||
update_price_from_multicurrency();
|
update_price_from_multicurrency();
|
||||||
|
|
||||||
$('input[name="multicurrency_price"]').keyup(function () {
|
$('input[name="multicurrency_price"]').keyup(function () {
|
||||||
update_price_from_multicurrency();
|
update_price_from_multicurrency();
|
||||||
}).change(function () {
|
}).change(function () {
|
||||||
@ -610,7 +613,7 @@ if ($id > 0 || $ref)
|
|||||||
}).on('paste', function () {
|
}).on('paste', function () {
|
||||||
update_price_from_multicurrency();
|
update_price_from_multicurrency();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('input[name="multicurrency_tx"]').keyup(function () {
|
$('input[name="multicurrency_tx"]').keyup(function () {
|
||||||
update_price_from_multicurrency();
|
update_price_from_multicurrency();
|
||||||
}).change(function () {
|
}).change(function () {
|
||||||
@ -618,12 +621,12 @@ if ($id > 0 || $ref)
|
|||||||
}).on('paste', function () {
|
}).on('paste', function () {
|
||||||
update_price_from_multicurrency();
|
update_price_from_multicurrency();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('select[name="multicurrency_price_base_type"]').change(function () {
|
$('select[name="multicurrency_price_base_type"]').change(function () {
|
||||||
$('input[name="price_base_type"]').val($(this).val());
|
$('input[name="price_base_type"]').val($(this).val());
|
||||||
$('select[name="disabled_price_base_type"]').val($(this).val());
|
$('select[name="disabled_price_base_type"]').val($(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
var currencies_array = $currencies;
|
var currencies_array = $currencies;
|
||||||
$('select[name="multicurrency_code"]').change(function () {
|
$('select[name="multicurrency_code"]').change(function () {
|
||||||
$('input[name="multicurrency_tx"]').val(currencies_array[$(this).val()]);
|
$('input[name="multicurrency_tx"]').val(currencies_array[$(this).val()]);
|
||||||
@ -844,7 +847,7 @@ SCRIPT;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Modify-Remove
|
// Modify-Remove
|
||||||
print '<td align="center">';
|
print '<td class="center nowraponall">';
|
||||||
if ($user->rights->produit->creer || $user->rights->service->creer)
|
if ($user->rights->produit->creer || $user->rights->service->creer)
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$productfourn->fourn_id.'&action=add_price&rowid='.$productfourn->product_fourn_price_id.'">'.img_edit()."</a>";
|
print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$productfourn->fourn_id.'&action=add_price&rowid='.$productfourn->product_fourn_price_id.'">'.img_edit()."</a>";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user