[fix] Billed Amt does not get updated in Purchase Receipt, if Invoice exists and item has been returned once before

This commit is contained in:
Rohit Waghchaure 2017-06-27 17:34:44 +05:30
parent 7b6e09b9a7
commit eb7eb43dfc
2 changed files with 5 additions and 1 deletions

View File

@ -270,6 +270,9 @@ def make_purchase_receipt(source_name, target_doc=None):
doc = get_mapped_doc("Purchase Order", source_name, {
"Purchase Order": {
"doctype": "Purchase Receipt",
"field_map": {
"per_billed": "per_billed"
},
"validation": {
"docstatus": ["=", 1],
}

View File

@ -119,7 +119,8 @@ class PurchaseReceipt(BuyingController):
frappe.db.set(self, 'status', 'Submitted')
self.update_prevdoc_status()
self.update_billing_status()
if self.per_billed < 100:
self.update_billing_status()
if not self.is_return:
update_last_purchase_rate(self, 1)