fixes in purchase price list
This commit is contained in:
parent
75c85a0ff5
commit
396f47d029
@ -74,7 +74,14 @@ erpnext.buying.BuyingController = erpnext.utils.Controller.extend({
|
|||||||
use_for: "buying"
|
use_for: "buying"
|
||||||
}},
|
}},
|
||||||
callback: function(r) {
|
callback: function(r) {
|
||||||
if(!r.exc && r.message.price_list_currency) {
|
if(!r.exc) {
|
||||||
|
// for now, setting it as 1.0
|
||||||
|
if(me.frm.doc.price_list_currency === me.get_company_currency())
|
||||||
|
me.frm.set_value("plc_conversion_rate", 1.0);
|
||||||
|
else if(me.frm.doc.price_list_currency === me.frm.doc.currency)
|
||||||
|
me.frm.set_value("plc_conversion_rate", me.frm.doc.conversion_rate);
|
||||||
|
|
||||||
|
if(r.message.price_list_currency)
|
||||||
me.price_list_currency();
|
me.price_list_currency();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -80,7 +80,8 @@ def get_item_details(args):
|
|||||||
out.purchase_ref_rate = out.discount_rate = out.purchase_rate = \
|
out.purchase_ref_rate = out.discount_rate = out.purchase_rate = \
|
||||||
out.import_ref_rate = out.import_rate = 0.0
|
out.import_ref_rate = out.import_rate = 0.0
|
||||||
|
|
||||||
if args.doctype in ["Purchase Order", "Purchase Invoice", "Purchase Receipt"]:
|
if args.doctype in ["Purchase Order", "Purchase Invoice", "Purchase Receipt",
|
||||||
|
"Supplier Quotation"]:
|
||||||
# try fetching from price list
|
# try fetching from price list
|
||||||
if args.price_list_name and args.price_list_currency:
|
if args.price_list_name and args.price_list_currency:
|
||||||
rates_as_per_price_list = get_rates_as_per_price_list(args, item_wrapper.doclist)
|
rates_as_per_price_list = get_rates_as_per_price_list(args, item_wrapper.doclist)
|
||||||
@ -100,7 +101,8 @@ def get_rates_as_per_price_list(args, item_doclist=None):
|
|||||||
item_doclist = webnotes.model_wrapper("Item", args.item_code).doclist
|
item_doclist = webnotes.model_wrapper("Item", args.item_code).doclist
|
||||||
|
|
||||||
result = item_doclist.get({"parentfield": "ref_rate_details",
|
result = item_doclist.get({"parentfield": "ref_rate_details",
|
||||||
"price_list_name": args.price_list_name, "ref_currency": args.price_list_currency})
|
"price_list_name": args.price_list_name, "ref_currency": args.price_list_currency,
|
||||||
|
"buying": 1})
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
purchase_ref_rate = flt(result[0].ref_rate) * flt(args.plc_conversion_rate)
|
purchase_ref_rate = flt(result[0].ref_rate) * flt(args.plc_conversion_rate)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user