mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-22 19:55:29 +00:00
fix: always post to tax account heads if LCV is booked
(cherry picked from commit 0fcd5d5130)
This commit is contained in:
@@ -776,6 +776,13 @@ class PurchaseReceipt(BuyingController):
|
|||||||
posting_date=posting_date,
|
posting_date=posting_date,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def is_landed_cost_booked_for_any_item(self) -> bool:
|
||||||
|
for x in self.items:
|
||||||
|
if x.landed_cost_voucher_amount != 0:
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def make_tax_gl_entries(self, gl_entries, via_landed_cost_voucher=False):
|
def make_tax_gl_entries(self, gl_entries, via_landed_cost_voucher=False):
|
||||||
negative_expense_to_be_booked = sum([flt(d.item_tax_amount) for d in self.get("items")])
|
negative_expense_to_be_booked = sum([flt(d.item_tax_amount) for d in self.get("items")])
|
||||||
is_asset_pr = any(d.is_fixed_asset for d in self.get("items"))
|
is_asset_pr = any(d.is_fixed_asset for d in self.get("items"))
|
||||||
@@ -811,7 +818,7 @@ class PurchaseReceipt(BuyingController):
|
|||||||
i = 1
|
i = 1
|
||||||
for tax in self.get("taxes"):
|
for tax in self.get("taxes"):
|
||||||
if valuation_tax.get(tax.name):
|
if valuation_tax.get(tax.name):
|
||||||
if via_landed_cost_voucher:
|
if via_landed_cost_voucher or self.is_landed_cost_booked_for_any_item():
|
||||||
account = tax.account_head
|
account = tax.account_head
|
||||||
else:
|
else:
|
||||||
negative_expense_booked_in_pi = frappe.db.sql(
|
negative_expense_booked_in_pi = frappe.db.sql(
|
||||||
|
|||||||
Reference in New Issue
Block a user