fix: Create ledger entries for discount applied on taxes in make_tax_gl_entries

This commit is contained in:
GangaManoj 2021-07-17 17:42:36 +05:30 committed by Deepesh Garg
parent ff25683378
commit 9dd2a9e897
3 changed files with 10 additions and 3 deletions

View File

@ -888,6 +888,11 @@ class PurchaseInvoice(BuyingController):
"remarks": self.remarks or "Accounting Entry for Stock"
}, item=tax))
enable_discount_accounting = cint(frappe.db.get_single_value('Accounts Settings', 'enable_discount_accounting'))
if enable_discount_accounting and self.get('discount_amount') and self.get('additional_discount_account'):
self.make_gle_for_additional_discount_applied_on_taxes(gl_entries)
def make_internal_transfer_gl_entries(self, gl_entries):
if self.is_internal_transfer() and flt(self.base_total_taxes_and_charges):
account_currency = get_account_currency(self.unrealized_profit_loss_account)

View File

@ -902,6 +902,11 @@ class SalesInvoice(SellingController):
}, account_currency, item=tax)
)
enable_discount_accounting = cint(frappe.db.get_single_value('Accounts Settings', 'enable_discount_accounting'))
if enable_discount_accounting and self.get('discount_amount') and self.get('additional_discount_account'):
self.make_gle_for_additional_discount_applied_on_taxes(gl_entries)
def make_internal_transfer_gl_entries(self, gl_entries):
if self.is_internal_transfer() and flt(self.base_total_taxes_and_charges):
account_currency = get_account_currency(self.unrealized_profit_loss_account)

View File

@ -852,9 +852,6 @@ class AccountsController(TransactionBase):
"project": item.project or self.project
}, account_currency, item=item)
)
if self.get('discount_amount') and self.get('additional_discount_account'):
self.make_gle_for_additional_discount_applied_on_taxes(gl_entries)
def make_gle_for_additional_discount_applied_on_taxes(self, gl_entries):
for tax in self.get("taxes"):