[transaction] [fix] fix in purchase transactions
This commit is contained in:
parent
53b7342b09
commit
e961af40fc
@ -224,8 +224,9 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
if(this.frm.doc.doctype != "Purchase Invoice") {
|
if(this.frm.doc.doctype != "Purchase Invoice") {
|
||||||
wn.meta.docfield_map[this.tname]["rate"] = $.extend({},
|
// hack!
|
||||||
wn.meta.docfield_map[this.tname]["purchase_rate"]);
|
wn.meta.docfield_copy[this.tname][this.frm.doc.name]["rate"] = $.extend({},
|
||||||
|
wn.meta.docfield_copy[this.tname][this.frm.doc.name]["purchase_rate"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$.each(this.frm.item_doclist, function(i, item) {
|
$.each(this.frm.item_doclist, function(i, item) {
|
||||||
@ -241,6 +242,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
me._set_in_company_currency(item, "import_rate", "rate");
|
me._set_in_company_currency(item, "import_rate", "rate");
|
||||||
me._set_in_company_currency(item, "import_amount", "amount");
|
me._set_in_company_currency(item, "import_amount", "amount");
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
calculate_net_total: function() {
|
calculate_net_total: function() {
|
||||||
@ -299,7 +301,8 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({
|
|||||||
// except in purchase invoice, rate field is purchase_rate
|
// except in purchase invoice, rate field is purchase_rate
|
||||||
// reset fieldname of rate
|
// reset fieldname of rate
|
||||||
if(this.frm.doc.doctype != "Purchase Invoice") {
|
if(this.frm.doc.doctype != "Purchase Invoice") {
|
||||||
delete wn.meta.docfield_map[this.tname]["rate"];
|
// clear hack
|
||||||
|
delete wn.meta.docfield_copy[this.tname][this.frm.doc.name]["rate"];
|
||||||
|
|
||||||
$.each(this.frm.item_doclist, function(i, item) {
|
$.each(this.frm.item_doclist, function(i, item) {
|
||||||
item.purchase_rate = item.rate;
|
item.purchase_rate = item.rate;
|
||||||
|
@ -310,7 +310,8 @@ def validate_currency(args, item, meta=None):
|
|||||||
|
|
||||||
# round it
|
# round it
|
||||||
args.conversion_rate = flt(args.conversion_rate,
|
args.conversion_rate = flt(args.conversion_rate,
|
||||||
get_field_precision(meta.get_field("conversion_rate"), args))
|
get_field_precision(meta.get_field("conversion_rate"),
|
||||||
|
webnotes._dict({"fields": args})))
|
||||||
|
|
||||||
# validate price list conversion rate
|
# validate price list conversion rate
|
||||||
if meta.get_field("price_list_currency") and args.price_list_name and \
|
if meta.get_field("price_list_currency") and args.price_list_name and \
|
||||||
@ -320,6 +321,7 @@ def validate_currency(args, item, meta=None):
|
|||||||
|
|
||||||
# round it
|
# round it
|
||||||
args.plc_conversion_rate = flt(args.plc_conversion_rate,
|
args.plc_conversion_rate = flt(args.plc_conversion_rate,
|
||||||
get_field_precision(meta.get_field("plc_conversion_rate"), args))
|
get_field_precision(meta.get_field("plc_conversion_rate"),
|
||||||
|
webnotes._dict({"fields": args})))
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user