added new report vat_allocation_tax_articles_report
This commit is contained in:
parent
211054d0ca
commit
b2fd9bbe7b
|
|
@ -85,11 +85,11 @@ def get_vat_allocation_items(filters):
|
||||||
# Фильтр по датам - конвертируем year + month в дату
|
# Фильтр по датам - конвертируем year + month в дату
|
||||||
# Используем STR_TO_DATE для конвертации названия месяца в дату
|
# Используем STR_TO_DATE для конвертации названия месяца в дату
|
||||||
if filters.get("from_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"))
|
values.append(filters.get("from_date"))
|
||||||
|
|
||||||
if filters.get("to_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"))
|
values.append(filters.get("to_date"))
|
||||||
|
|
||||||
# Только submitted документы
|
# Только submitted документы
|
||||||
|
|
@ -108,7 +108,7 @@ def get_vat_allocation_items(filters):
|
||||||
va.name as vat_allocation,
|
va.name as vat_allocation,
|
||||||
va.year,
|
va.year,
|
||||||
va.month,
|
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.customer,
|
||||||
vasi.tax_article,
|
vasi.tax_article,
|
||||||
vasi.allocated_amount
|
vasi.allocated_amount
|
||||||
|
|
@ -118,7 +118,7 @@ def get_vat_allocation_items(filters):
|
||||||
`tabVAT allocation sales invoice` vasi ON va.name = vasi.parent
|
`tabVAT allocation sales invoice` vasi ON va.name = vasi.parent
|
||||||
{where_clause}
|
{where_clause}
|
||||||
ORDER BY
|
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)
|
return frappe.db.sql(query, values, as_dict=True)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue