added new report vat_allocation_tax_articles_report

This commit is contained in:
Ali 2026-02-09 18:10:54 +04:00
parent 211054d0ca
commit b2fd9bbe7b
1 changed files with 4 additions and 4 deletions

View File

@ -85,11 +85,11 @@ def get_vat_allocation_items(filters):
# Фильтр по датам - конвертируем year + month в дату
# Используем STR_TO_DATE для конвертации названия месяца в дату
if filters.get("from_date"):
conditions.append("STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%d %M %Y') >= %s")
conditions.append("STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%%d %%M %%Y') >= %s")
values.append(filters.get("from_date"))
if filters.get("to_date"):
conditions.append("STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%d %M %Y') <= %s")
conditions.append("STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%%d %%M %%Y') <= %s")
values.append(filters.get("to_date"))
# Только submitted документы
@ -108,7 +108,7 @@ def get_vat_allocation_items(filters):
va.name as vat_allocation,
va.year,
va.month,
STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%d %M %Y') as posting_date,
STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%%d %%M %%Y') as posting_date,
vasi.customer,
vasi.tax_article,
vasi.allocated_amount
@ -118,7 +118,7 @@ def get_vat_allocation_items(filters):
`tabVAT allocation sales invoice` vasi ON va.name = vasi.parent
{where_clause}
ORDER BY
STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%d %M %Y') DESC, va.name
STR_TO_DATE(CONCAT('01 ', va.month, ' ', va.year), '%%d %%M %%Y') DESC, va.name
"""
return frappe.db.sql(query, values, as_dict=True)