[fix] Divisional loss in purchase receipt
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
index 10c8452..0ce3cd1 100644
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
@@ -361,8 +361,13 @@
d.precision("base_net_amount"))
if divisional_loss:
+ if self.is_return or flt(d.item_tax_amount):
+ loss_account = expenses_included_in_valuation
+ else:
+ loss_account = stock_rbnb
+
gl_entries.append(self.get_gl_dict({
- "account": expenses_included_in_valuation,
+ "account": loss_account,
"against": warehouse_account[d.warehouse]["name"],
"cost_center": d.cost_center,
"remarks": self.get("remarks") or _("Accounting Entry for Stock"),