mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Enable setting exchange rate when converting product prices
This commit is contained in:
parent
464e0b95e0
commit
c3b12ed9e6
@ -1059,6 +1059,15 @@ ko.bindingHandlers.productTypeahead = {
|
||||
|
||||
// optionally handle curency conversion
|
||||
@if ($account->convert_products)
|
||||
var rate = false;
|
||||
if ((account.custom_fields.invoice_text1 || '').toLowerCase() == "{{ strtolower(trans('texts.exchange_rate')) }}") {
|
||||
rate = window.model.invoice().custom_text_value1();
|
||||
} else if ((account.custom_fields.invoice_text1 || '').toLowerCase() == "{{ strtolower(trans('texts.exchange_rate')) }}") {
|
||||
rate = window.model.invoice().custom_text_value1();
|
||||
}
|
||||
if (rate) {
|
||||
cost = cost * rate;
|
||||
} else {
|
||||
var client = window.model.invoice().client();
|
||||
if (client) {
|
||||
var clientCurrencyId = client.currency_id();
|
||||
@ -1079,6 +1088,7 @@ ko.bindingHandlers.productTypeahead = {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@endif
|
||||
|
||||
model.cost(roundToTwo(cost, true));
|
||||
|
Loading…
x
Reference in New Issue
Block a user