From 9e3764ab62efad97c5a04a14a5160f6bc38861b3 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 23 Sep 2020 19:35:49 +0530 Subject: [PATCH] refactor: book loss amount in the COGS instead of stock received but not billed --- erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index be2453373e4..42cc473b18d 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -207,6 +207,7 @@ class PurchaseReceipt(BuyingController): from erpnext.accounts.general_ledger import process_gl_map stock_rbnb = self.get_company_default("stock_received_but_not_billed") + cogs_account = self.get_company_default("default_expense_account") landed_cost_entries = get_item_account_wise_additional_cost(self.name) expenses_included_in_valuation = self.get_company_default("expenses_included_in_valuation") @@ -288,7 +289,7 @@ class PurchaseReceipt(BuyingController): if self.is_return or flt(d.item_tax_amount): loss_account = expenses_included_in_valuation else: - loss_account = stock_rbnb + loss_account = cogs_account gl_entries.append(self.get_gl_dict({ "account": loss_account,