Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: month function issue #24

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ def get_itc_details(self):
FROM `tabPurchase Invoice`
WHERE docstatus = 1
and is_opening = 'No'
and company_gstin != IFNULL(supplier_gstin, "")
and month(posting_date) between %s and %s and year(posting_date) = %s and company = %s
and company_gstin != COALESCE(supplier_gstin, '')
and EXTRACT(MONTH FROM posting_date) BETWEEN %s AND %s
and EXTRACT(YEAR FROM posting_date) = %s
and company = %s
and company_gstin = %s
GROUP BY itc_classification
""",
Expand Down Expand Up @@ -312,9 +314,10 @@ def get_inward_nil_exempt(self, state):
FROM `tabPurchase Invoice` p , `tabPurchase Invoice Item` i
WHERE p.docstatus = 1 and p.name = i.parent
and p.is_opening = 'No'
and p.company_gstin != IFNULL(p.supplier_gstin, "")
and p.company_gstin != COALESCE(p.supplier_gstin, '')
and (i.gst_treatment != 'Taxable' or p.gst_category = 'Registered Composition') and
month(p.posting_date) between %s and %s and year(p.posting_date) = %s
EXTRACT(MONTH FROM posting_date) BETWEEN %s AND %s
and EXTRACT(YEAR FROM posting_date) = %s
and p.company = %s and p.company_gstin = %s
""",
(
Expand Down Expand Up @@ -688,9 +691,10 @@ def get_missing_field_invoices(self):
f"""
SELECT name FROM `tab{doctype}`
WHERE docstatus = 1 and is_opening = 'No'
and month(posting_date) between %s and %s and year(posting_date) = %s
and EXTRACT(MONTH FROM posting_date) BETWEEN %s AND %s
and EXTRACT(YEAR FROM posting_date) = %s
and company = %s and place_of_supply IS NULL
and company_gstin != IFNULL({party_gstin},"")
and company_gstin != COALESCE({party_gstin},'')
and gst_category != 'Overseas'
""",
(
Expand Down