fix: fetch asset received but not billed account only when needed
(cherry picked from commit 3a8736374c)
This commit is contained in:
@@ -592,7 +592,6 @@ class PurchaseInvoice(BuyingController):
|
|||||||
|
|
||||||
def get_gl_entries(self, warehouse_account=None):
|
def get_gl_entries(self, warehouse_account=None):
|
||||||
self.auto_accounting_for_stock = erpnext.is_perpetual_inventory_enabled(self.company)
|
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:
|
if self.auto_accounting_for_stock:
|
||||||
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
|
self.stock_received_but_not_billed = self.get_company_default("stock_received_but_not_billed")
|
||||||
@@ -946,10 +945,11 @@ class PurchaseInvoice(BuyingController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
stock_rbnb = (
|
stock_rbnb = (
|
||||||
self.asset_received_but_not_billed
|
self.get_company_default("asset_received_but_not_billed")
|
||||||
if item.is_fixed_asset
|
if item.is_fixed_asset
|
||||||
else self.stock_received_but_not_billed
|
else self.stock_received_but_not_billed
|
||||||
)
|
)
|
||||||
|
|
||||||
if not negative_expense_booked_in_pr:
|
if not negative_expense_booked_in_pr:
|
||||||
gl_entries.append(
|
gl_entries.append(
|
||||||
self.get_gl_dict(
|
self.get_gl_dict(
|
||||||
|
|||||||
Reference in New Issue
Block a user