Skip to content

Commit

Permalink
Merge pull request #37814 from frappe/mergify/bp/version-14/pr-37812
Browse files Browse the repository at this point in the history
fix: fetch asset received but not billed account only when needed (#37737)
  • Loading branch information
deepeshgarg007 authored Nov 1, 2023
2 parents 0f848fd + 487aa35 commit 222bce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,6 @@ def make_gl_entries(self, gl_entries=None, from_repost=False):

def get_gl_entries(self, warehouse_account=None):
self.auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company)
self.asset_received_but_not_billed = self.get_company_default("asset_received_but_not_billed")

if self.auto_accounting_for_stock:
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
Expand Down Expand Up @@ -946,10 +945,11 @@ def make_item_gl_entries(self, gl_entries):
)

stock_rbnb = (
self.asset_received_but_not_billed
self.get_company_default("asset_received_but_not_billed")
if item.is_fixed_asset
else self.stock_received_but_not_billed
)

if not negative_expense_booked_in_pr:
gl_entries.append(
self.get_gl_dict(
Expand Down

0 comments on commit 222bce6

Please sign in to comment.