From 19ba7c21acbf787f7a37ff001f5e93183d330c07 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Mon, 12 Aug 2024 12:22:52 +0530 Subject: [PATCH] fix: parenttype in where query for child table --- .../gst_india/doctype/purchase_reconciliation_tool/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py index 30a47b24b..1a5387916 100644 --- a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py +++ b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py @@ -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")) ) @@ -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, @@ -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")) )