Pass buying or selling as filter parameters
Wherever get_exchange_rate is called, pass filter buying or selling on the basis of doctype.
This commit is contained in:
@@ -667,9 +667,14 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
},
|
||||
|
||||
get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) {
|
||||
if (this.frm.doctype == "Purchase Order") {
|
||||
var args = "for_buying";
|
||||
var args;
|
||||
if (["Quotation", "Sales Order", "Delivery Note", "Sales Invoice"].includes(this.frm.doctype)) {
|
||||
args = "for_selling";
|
||||
}
|
||||
else if (["Purchase Order", "Purchase Receipt", "Purchase Invoice"].includes(this.frm.doctype)) {
|
||||
args = "for_buying";
|
||||
}
|
||||
|
||||
if (!transaction_date || !from_currency || !to_currency) return;
|
||||
return frappe.call({
|
||||
method: "erpnext.setup.utils.get_exchange_rate",
|
||||
|
||||
Reference in New Issue
Block a user