From 54eb735a47b9451e25650c59d98fb27720a8a477 Mon Sep 17 00:00:00 2001 From: Nijil Date: Tue, 22 Nov 2011 15:12:00 +0530 Subject: [PATCH] Added Discount in Purchase Cycle --- .../accounts/doctype/payable_voucher/payable_voucher.js | 1 + erpnext/buying/doctype/purchase_common/purchase_common.js | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js index 550c0149973..8c61727e000 100644 --- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js +++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js @@ -333,6 +333,7 @@ cur_frm.cscript.calc_total = function(doc) { var el = getchildren('PV Detail',doc.name,'entries'); for(var i in el) { if (flt(el[i].import_rate) > 0){ + set_multiple('PV Detail', el[i].name, {'purchase_ref_rate':flt(el[i].import_ref_rate)*flt(doc.conversion_rate)}, 'entries'); set_multiple('PV Detail', el[i].name, {'rate': flt(doc.conversion_rate) * flt(el[i].import_rate) }, 'entries'); set_multiple('PV Detail', el[i].name, {'import_amount': flt(el[i].qty) * flt(el[i].import_rate) }, 'entries'); } diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index f123fd5cfc2..029a413cccc 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -258,6 +258,7 @@ cur_frm.cscript.calc_amount = function(doc, n) { for(var i=0;i