mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-29 09:54:47 +00:00
Get exchange rate only if date and currency is present (#8712)
* Get exchange rate only if date and currency is present * Update transaction.js
This commit is contained in:
@@ -204,7 +204,7 @@ class PurchaseInvoice(BuyingController):
|
|||||||
if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
|
if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes':
|
||||||
for d in self.get('items'):
|
for d in self.get('items'):
|
||||||
if not d.purchase_order:
|
if not d.purchase_order:
|
||||||
throw(_("Purchse Order number required for Item {0}").format(d.item_code))
|
throw(_("Purchase Order number required for Item {0}").format(d.item_code))
|
||||||
|
|
||||||
def pr_required(self):
|
def pr_required(self):
|
||||||
stock_items = self.get_stock_items()
|
stock_items = self.get_stock_items()
|
||||||
|
|||||||
@@ -500,6 +500,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) {
|
get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) {
|
||||||
|
if !(transaction_date && from_currency && to_currency) return;
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
method: "erpnext.setup.utils.get_exchange_rate",
|
method: "erpnext.setup.utils.get_exchange_rate",
|
||||||
args: {
|
args: {
|
||||||
@@ -762,7 +763,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
|
if(calculate_taxes_and_totals) me.calculate_taxes_and_totals();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.frm.call({
|
return this.frm.call({
|
||||||
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule",
|
method: "erpnext.accounts.doctype.pricing_rule.pricing_rule.apply_pricing_rule",
|
||||||
args: { args: args },
|
args: { args: args },
|
||||||
@@ -1117,4 +1117,4 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
|
|
||||||
return method
|
return method
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user