Merge pull request #37737 from deepeshgarg007/arbnb_account_fetch

fix: fetch asset received but not billed account only when needed
This commit is contained in:
Deepesh Garg 2023-10-29 13:55:24 +05:30 committed by GitHub
commit 83db7c6a65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -585,7 +585,6 @@ class PurchaseInvoice(BuyingController):
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")
@ -937,10 +936,11 @@ class PurchaseInvoice(BuyingController):
)
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(