Skip to content

Commit

Permalink
fix: parenttype in where query for child table
Browse files Browse the repository at this point in the history
(cherry picked from commit 19ba7c2)
  • Loading branch information
ljain112 authored and mergify[bot] committed Aug 13, 2024
1 parent 98c3d83 commit 7d5b14b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ def get_query(self, additional_fields=None):
.left_join(self.GSTR2_ITEM)
.on(self.GSTR2_ITEM.parent == self.GSTR2.name)
.where(IfNull(self.GSTR2.match_status, "") != "Amended")
.where(self.GSTR2_ITEM.parenttype == "GST Inward Supply")
.groupby(self.GSTR2_ITEM.parent)
.select(*fields, ConstantColumn("GST Inward Supply").as_("doctype"))
)
Expand Down Expand Up @@ -418,6 +419,7 @@ def get_query(self, additional_fields=None, is_return=False):
.where(self.PI.docstatus == 1)
.where(IfNull(self.PI.reconciliation_status, "") != "Not Applicable")
.where(self.PI.is_opening == "NO")
.where(self.PI_ITEM.parenttype == "Purchase Invoice")
.groupby(self.PI.name)
.select(
*fields,
Expand Down Expand Up @@ -562,6 +564,7 @@ def get_query(self, additional_fields=None):
.on(self.BOE.purchase_invoice == self.PI.name)
.where(self.BOE.docstatus == 1)
.where(IfNull(self.BOE.reconciliation_status, "") != "Not Applicable")
.where(self.BOE_ITEM.parenttype == "Bill of Entry")
.groupby(self.BOE.name)
.select(*fields, ConstantColumn("Bill of Entry").as_("doctype"))
)
Expand Down

0 comments on commit 7d5b14b

Please sign in to comment.