Merge pull request #9489 from rohitwaghchaure/billed_amt_issue_in_pr

[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:
Makarand Bauskar 2017-06-30 16:02:31 +05:30 committed by GitHub
commit 4095915bff
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)