Skip to content

Commit

Permalink
fix: filter inward supply with company with tentetive gstins
Browse files Browse the repository at this point in the history
(cherry picked from commit f458148)
  • Loading branch information
vorasmit authored and mergify[bot] committed Aug 22, 2024
1 parent 8f7e1ab commit 43414e7
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from frappe.utils import add_months, format_date, getdate, rounded

from india_compliance.gst_india.constants import GST_TAX_TYPES
from india_compliance.gst_india.utils import get_party_for_gstin
from india_compliance.gst_india.utils import get_gstin_list, get_party_for_gstin
from india_compliance.gst_india.utils.gstr_2 import IMPORT_CATEGORY, ReturnType


Expand Down Expand Up @@ -307,7 +307,12 @@ def get_query(self, additional_fields=None):
)

if self.company_gstin == "All":
query = query.where(self.GSTR2.company_gstin.notnull())
if self.company:
gstin_list = get_gstin_list(self.company)
query = query.where(self.GSTR2.company_gstin.isin(gstin_list))
else:
query = query.where(self.GSTR2.company_gstin.notnull())

else:
query = query.where(self.company_gstin == self.GSTR2.company_gstin)

Expand Down Expand Up @@ -653,6 +658,7 @@ def get_all_inward_supply(
self, additional_fields=None, names=None, only_names=False
):
return InwardSupply(
company=self.company,
company_gstin=self.company_gstin,
from_date=self.inward_supply_from_date,
to_date=self.inward_supply_to_date,
Expand All @@ -662,6 +668,7 @@ def get_all_inward_supply(

def get_unmatched_inward_supply(self, category, amended_category):
return InwardSupply(
company=self.company,
company_gstin=self.company_gstin,
from_date=self.inward_supply_from_date,
to_date=self.inward_supply_to_date,
Expand All @@ -671,6 +678,7 @@ def get_unmatched_inward_supply(self, category, amended_category):

def query_inward_supply(self, additional_fields=None):
query = InwardSupply(
company=self.company,
company_gstin=self.company_gstin,
from_date=self.inward_supply_from_date,
to_date=self.inward_supply_to_date,
Expand Down

0 comments on commit 43414e7

Please sign in to comment.