Skip to content

Commit

Permalink
Merge pull request #1126 from resilient-tech/mergify/bp/version-14-ho…
Browse files Browse the repository at this point in the history
…tfix/pr-1115

fix: set default eligibility for ITC  in Purchase Invoice (backport #1115)
  • Loading branch information
vorasmit authored Oct 10, 2023
2 parents f493af6 + 9672015 commit e09132f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions india_compliance/gst_india/overrides/purchase_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ def is_b2b_invoice(doc):


def update_itc_totals(doc, method=None):
# Set default value
if not doc.eligibility_for_itc:
doc.eligibility_for_itc = "All Other ITC"

# Initialize values
doc.itc_integrated_tax = 0
doc.itc_state_tax = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from frappe import _
from frappe.query_builder import Case
from frappe.query_builder.custom import ConstantColumn
from frappe.query_builder.functions import LiteralValue, Sum
from frappe.query_builder.functions import Ifnull, LiteralValue, Sum
from frappe.utils import cint, get_first_day, get_last_day

from india_compliance.gst_india.utils import get_gst_accounts_by_type
Expand Down Expand Up @@ -142,6 +142,7 @@ def get_itc_from_purchase(self):
& (purchase_invoice.posting_date[self.from_date : self.to_date])
& (purchase_invoice.company == self.company)
& (purchase_invoice.company_gstin == self.company_gstin)
& (Ifnull(purchase_invoice.eligibility_for_itc, "") != "")
)
.groupby(purchase_invoice.name)
)
Expand Down

0 comments on commit e09132f

Please sign in to comment.