diff --git a/taxes_az/taxes_az/report/vat_allocation_tax_articles_report/vat_allocation_tax_articles_report.py b/taxes_az/taxes_az/report/vat_allocation_tax_articles_report/vat_allocation_tax_articles_report.py index f7d19d8..285acfe 100644 --- a/taxes_az/taxes_az/report/vat_allocation_tax_articles_report/vat_allocation_tax_articles_report.py +++ b/taxes_az/taxes_az/report/vat_allocation_tax_articles_report/vat_allocation_tax_articles_report.py @@ -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)