Handle ‘exchange rate’ field in any language

This commit is contained in:
Hillel Coren 2018-01-16 12:36:25 +02:00
parent 43313c4b58
commit 9a91bc7d32

View File

@ -1063,16 +1063,16 @@ ko.bindingHandlers.productTypeahead = {
from: currencyMap[accountCurrencyId].code,
to: currencyMap[clientCurrencyId].code,
});
if ((account.custom_invoice_text_label1 || '').toLowerCase() == 'exchange rate') {
if ((account.custom_invoice_text_label1 || '').toLowerCase() == "{{ strtolower(trans('texts.exchange_rate')) }}") {
window.model.invoice().custom_text_value1(roundToFour(rate, true));
} else if ((account.custom_invoice_text_label2 || '').toLowerCase() == 'exchange rate') {
} else if ((account.custom_invoice_text_label2 || '').toLowerCase() == "{{ strtolower(trans('texts.exchange_rate')) }}") {
window.model.invoice().custom_text_value2(roundToFour(rate, true));
}
}
}
@endif
model.cost(roundSignificant(cost, true));
model.cost(roundToTwo(cost, true));
}
}
if (!model.qty() && ! model.task_public_id()) {