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 03ca4afd2..ef7b9704c 100644 --- a/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py +++ b/india_compliance/gst_india/doctype/purchase_reconciliation_tool/__init__.py @@ -439,6 +439,9 @@ def get_query(self, additional_fields=None, is_return=False): ) ) + if self.company: + query = query.where(self.company == self.PI.company) + if self.company_gstin == "All": query = query.where(self.PI.company_gstin.notnull()) else: @@ -587,6 +590,14 @@ def get_query(self, additional_fields=None): .select(*fields, ConstantColumn("Bill of Entry").as_("doctype")) ) + if self.company: + query = query.where(self.company == self.BOE.company) + + if self.company_gstin == "All": + query = query.where(self.BOE.company_gstin.notnull()) + else: + query = query.where(self.company_gstin == self.BOE.company_gstin) + if self.include_ignored == 0: query = query.where(IfNull(self.BOE.reconciliation_status, "") != "Ignored")