fixed vat allocation report not being in formula editor

This commit is contained in:
Ali 2026-02-11 15:37:38 +04:00
parent 4d778cf8f1
commit 24740d0b44
3 changed files with 16 additions and 6 deletions

View File

@ -7,19 +7,25 @@
"doctype": "DocType", "doctype": "DocType",
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"classification_name" "classification_name",
"data_jprd"
], ],
"fields": [ "fields": [
{ {
"fieldname": "classification_name", "fieldname": "classification_name",
"fieldtype": "Text", "fieldtype": "Text",
"label": "Classification Name" "label": "Classification Name"
},
{
"fieldname": "data_jprd",
"fieldtype": "Data",
"label": "test"
} }
], ],
"grid_page_length": 50, "grid_page_length": 50,
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2026-01-14 18:25:43.132614", "modified": "2026-02-10 20:51:03.394521",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Taxes Az", "module": "Taxes Az",
"name": "Classification code", "name": "Classification code",

View File

@ -6,9 +6,9 @@
"disabled": 0, "disabled": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"filters": [],
"idx": 0, "idx": 0,
"is_standard": "Yes", "is_standard": "Yes",
"json": "{}",
"letter_head": "", "letter_head": "",
"modified": "2025-11-26 12:00:00.000000", "modified": "2025-11-26 12:00:00.000000",
"modified_by": "Administrator", "modified_by": "Administrator",

View File

@ -59,13 +59,17 @@ def get_columns():
def get_data(filters): def get_data(filters):
"""Get VAT allocation documents and calculate values""" """Get VAT allocation documents and calculate values"""
# Return empty data if filters are not provided (needed for Formula Editor)
if not filters:
return []
# Validate filters # Validate filters
if not filters.get('company'): if not filters.get('company'):
frappe.throw(_("Company is required")) return []
if not filters.get('year'): if not filters.get('year'):
frappe.throw(_("Year is required")) return []
if not filters.get('month'): if not filters.get('month'):
frappe.throw(_("Month is required")) return []
# Find VAT allocation document (max one result due to autoname format) # Find VAT allocation document (max one result due to autoname format)
vat_name = f"VAT-{filters.get('year')}-{filters.get('month')}" vat_name = f"VAT-{filters.get('year')}-{filters.get('month')}"