Skip to content

Commit

Permalink
fix: Purchase Receipt GL Entries
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed Oct 23, 2023
1 parent d1ec0a6 commit 80392a7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,17 +545,19 @@ def make_divisional_loss_gl_entry(item, outgoing_amount):
d, gl_entries, self.posting_date, d.get("provisional_expense_account")
)
elif flt(d.qty) and (flt(d.valuation_rate) or self.is_return):
is_asset_pr = any(d.is_fixed_asset for d in self.get("items"))
remarks = self.get("remarks") or _("Accounting Entry for {0}").format(
"Asset" if is_asset_pr else "Stock"
"Asset" if d.is_fixed_asset else "Stock"
)

if not (erpnext.is_perpetual_inventory_enabled(self.company) or is_asset_pr):
if not (
(erpnext.is_perpetual_inventory_enabled(self.company) and d.item_code in stock_items)
or d.is_fixed_asset
):
return

stock_asset_rbnb = (
self.get_company_default("asset_received_but_not_billed")
if is_asset_pr
if d.is_fixed_asset
else self.get_company_default("stock_received_but_not_billed")
)
landed_cost_entries = get_item_account_wise_additional_cost(self.name)
Expand Down

0 comments on commit 80392a7

Please sign in to comment.