fix(UAE VAT 201): Remove Chart
This commit is contained in:
parent
b0eca23485
commit
7a034595fe
@ -8,8 +8,7 @@ from frappe import _
|
||||
def execute(filters=None):
|
||||
columns = get_columns()
|
||||
data, emirates, amounts_by_emirate = get_data(filters)
|
||||
chart = get_chart(emirates, amounts_by_emirate)
|
||||
return columns, data, None, chart
|
||||
return columns, data
|
||||
|
||||
def get_columns():
|
||||
"""Creates a list of dictionaries that are used to generate column headers of the data table."""
|
||||
@ -49,32 +48,6 @@ def get_data(filters = None):
|
||||
append_vat_on_expenses(data, filters)
|
||||
return data, emirates, amounts_by_emirate
|
||||
|
||||
def get_chart(emirates, amounts_by_emirate):
|
||||
"""Returns chart data."""
|
||||
labels = []
|
||||
amount = []
|
||||
vat_amount = []
|
||||
for emirate in emirates:
|
||||
if emirate in amounts_by_emirate:
|
||||
amount.append(amounts_by_emirate[emirate]["raw_amount"])
|
||||
vat_amount.append(amounts_by_emirate[emirate]["raw_vat_amount"])
|
||||
labels.append(emirate)
|
||||
|
||||
datasets = []
|
||||
datasets.append({'name': _('Amount (AED)'), 'values': amount})
|
||||
datasets.append({'name': _('Vat Amount (AED)'), 'values': vat_amount})
|
||||
|
||||
chart = {
|
||||
"type": "bar",
|
||||
"fieldtype": "Currency",
|
||||
"data": {
|
||||
'labels': labels,
|
||||
'datasets': datasets
|
||||
}
|
||||
}
|
||||
|
||||
return chart
|
||||
|
||||
def append_vat_on_sales(data, filters):
|
||||
"""Appends Sales and All Other Outputs."""
|
||||
append_data(data, '', _('VAT on Sales and All Other Outputs'), '', '')
|
||||
|
@ -59,7 +59,7 @@ def get_tax_accounts(company):
|
||||
if not tax_accounts_list and not frappe.flags.in_test:
|
||||
frappe.throw(_('Please set Vat Accounts for Company: "{0}" in UAE VAT Settings').format(company))
|
||||
for tax_account in tax_accounts_list:
|
||||
for _, name in tax_account.items():
|
||||
for account, name in tax_account.items():
|
||||
tax_accounts_dict[name] = name
|
||||
|
||||
return tax_accounts_dict
|
||||
|
Loading…
x
Reference in New Issue
Block a user