mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
feat(UAE VAT 21): add fixed width to columns
This commit is contained in:
@@ -1,21 +1,27 @@
|
|||||||
{%
|
{%
|
||||||
var report_columns = report.get_columns_for_print();
|
var report_columns = report.get_columns_for_print();
|
||||||
report_columns = report_columns.filter(col => !col.hidden);
|
report_columns = report_columns.filter(col => !col.hidden);
|
||||||
|
|
||||||
if (report_columns.length > 8) {
|
|
||||||
frappe.throw(__("Too many columns. Export the report and print it using a spreadsheet application."));
|
|
||||||
}
|
|
||||||
%}
|
%}
|
||||||
|
<style>
|
||||||
|
.print-format {
|
||||||
|
padding: 10mm;
|
||||||
|
font-size: 8.0pt !important;
|
||||||
|
font-family: Tahoma, sans-serif;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<h1 style="margin-top:0; text-align: center;">{%= __(report.report_name) %}</h1>
|
<h1 style="margin-top:0; text-align: center;">{%= __(report.report_name) %}</h1>
|
||||||
|
|
||||||
<h3 style="margin-top:0">{%= __("VAT on Sales and All Other Outputs") %}</h2>
|
<h3 style="margin-top:0; font-weight:500">{%= __("VAT on Sales and All Other Outputs") %}</h2>
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
{% for (let i=0; i<report_columns.length; i++) { %}
|
<th style="width: 13">{%= report_columns[0].label %}</th>
|
||||||
<th >{%= report_columns[i].label %}</th>
|
<th style="width: {%= 100 - (report_columns.length - 1) * 13%}%">{%= report_columns[1].label %}</th>
|
||||||
|
|
||||||
|
{% for (let i=2; i<report_columns.length; i++) { %}
|
||||||
|
<th style="width: 13">{%= report_columns[i].label %}</th>
|
||||||
{% } %}
|
{% } %}
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
@@ -38,17 +44,20 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<h3 style="margin-top:0">{%= __("VAT on Expenses and All Other Inputs") %}</h2>
|
<h3 style="margin-top:0; font-weight:500">{%= __("VAT on Expenses and All Other Inputs") %}</h2>
|
||||||
|
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
{% for (let i=0; i<report_columns.length; i++) { %}
|
<th style="width: 13">{%= report_columns[0].label %}</th>
|
||||||
<th >{%= report_columns[i].label %}</th>
|
<th style="width: {%= 100 - (report_columns.length - 1) * 13%}%">{%= report_columns[1].label %}</th>
|
||||||
|
|
||||||
|
{% for (let i=2; i<report_columns.length; i++) { %}
|
||||||
|
<th style="width: 13">{%= report_columns[i].label %}</th>
|
||||||
{% } %}
|
{% } %}
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for (let j=13; j<data.length; j++) { %}
|
{% for (let j=14; j<data.length; j++) { %}
|
||||||
{%
|
{%
|
||||||
var row = data[j];
|
var row = data[j];
|
||||||
%}
|
%}
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ frappe.query_reports["UAE VAT 21"] = {
|
|||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"reqd": 1,
|
"reqd": 1,
|
||||||
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -3),
|
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -3),
|
||||||
"width": "80"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "to_date",
|
"fieldname": "to_date",
|
||||||
|
|||||||
@@ -17,27 +17,29 @@ def get_columns():
|
|||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
"fieldname": "no",
|
"fieldname": "no",
|
||||||
"label": "No",
|
"label": _("No"),
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"width": 50
|
"width": 50
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "legend",
|
"fieldname": "legend",
|
||||||
"label": "Legend",
|
"label": _("Legend"),
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"width": 300
|
"width": 300
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "amount",
|
"fieldname": "amount",
|
||||||
"label": "Amount (AED)",
|
"label": _("Amount (AED)"),
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"width": 100
|
"width": 125,
|
||||||
|
"options": "currency"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "vat_amount",
|
"fieldname": "vat_amount",
|
||||||
"label": "VAT Amount (AED)",
|
"label": _("VAT Amount (AED)"),
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"width": 100
|
"width": 150,
|
||||||
|
"options": "currency"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -46,7 +48,7 @@ def get_data(filters = None):
|
|||||||
data = []
|
data = []
|
||||||
data.append({
|
data.append({
|
||||||
"no": '',
|
"no": '',
|
||||||
"legend": 'VAT on Sales and All Other Outputs',
|
"legend": _('VAT on Sales and All Other Outputs'),
|
||||||
"amount": '',
|
"amount": '',
|
||||||
"vat_amount": ''
|
"vat_amount": ''
|
||||||
})
|
})
|
||||||
@@ -64,14 +66,14 @@ def get_data(filters = None):
|
|||||||
|
|
||||||
for d, emirate in enumerate(emirates, 97):
|
for d, emirate in enumerate(emirates, 97):
|
||||||
if emirate in amounts_by_emirate:
|
if emirate in amounts_by_emirate:
|
||||||
amounts_by_emirate[emirate]["no"] = f'1{chr(d)}'
|
amounts_by_emirate[emirate]["no"] = _(f'1{chr(d)}')
|
||||||
amounts_by_emirate[emirate]["legend"] = f'Standard rated supplies in {emirate}'
|
amounts_by_emirate[emirate]["legend"] = _(f'Standard rated supplies in {emirate}')
|
||||||
data.append(amounts_by_emirate[emirate])
|
data.append(amounts_by_emirate[emirate])
|
||||||
else:
|
else:
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": f'1{chr(d)}',
|
"no": _(f'1{chr(d)}'),
|
||||||
"legend": f'Standard rated supplies in {emirate}',
|
"legend": _(f'Standard rated supplies in {emirate}'),
|
||||||
"amount": 0,
|
"amount": 0,
|
||||||
"vat_amount": 0
|
"vat_amount": 0
|
||||||
}
|
}
|
||||||
@@ -79,8 +81,8 @@ def get_data(filters = None):
|
|||||||
|
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": '2',
|
"no": _('2'),
|
||||||
"legend": 'Tax Refunds provided to Tourists under the Tax Refunds for Tourists Scheme',
|
"legend": _('Tax Refunds provided to Tourists under the Tax Refunds for Tourists Scheme'),
|
||||||
"amount": (-1) * get_tourist_tax_return_total(filters),
|
"amount": (-1) * get_tourist_tax_return_total(filters),
|
||||||
"vat_amount": (-1) * get_tourist_tax_return_tax(filters)
|
"vat_amount": (-1) * get_tourist_tax_return_tax(filters)
|
||||||
}
|
}
|
||||||
@@ -88,8 +90,8 @@ def get_data(filters = None):
|
|||||||
|
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": '3',
|
"no": _('3'),
|
||||||
"legend": 'Supplies subject to the reverse charge provision',
|
"legend": _('Supplies subject to the reverse charge provision'),
|
||||||
"amount": get_reverse_charge_total(filters),
|
"amount": get_reverse_charge_total(filters),
|
||||||
"vat_amount": get_reverse_charge_tax(filters)
|
"vat_amount": get_reverse_charge_tax(filters)
|
||||||
}
|
}
|
||||||
@@ -97,8 +99,8 @@ def get_data(filters = None):
|
|||||||
|
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": '4',
|
"no": _('4'),
|
||||||
"legend": 'Zero Rated',
|
"legend": _('Zero Rated'),
|
||||||
"amount": get_zero_rated_total(filters),
|
"amount": get_zero_rated_total(filters),
|
||||||
"vat_amount": "-"
|
"vat_amount": "-"
|
||||||
}
|
}
|
||||||
@@ -106,16 +108,23 @@ def get_data(filters = None):
|
|||||||
|
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": '5',
|
"no": _('5'),
|
||||||
"legend": 'Exempt Supplies',
|
"legend": _('Exempt Supplies'),
|
||||||
"amount": get_exempt_total(filters),
|
"amount": get_exempt_total(filters),
|
||||||
"vat_amount": "-"
|
"vat_amount": "-"
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
data.append({
|
data.append({
|
||||||
"no": '',
|
"no": _(''),
|
||||||
"legend": 'VAT on Expenses and All Other Inputs',
|
"legend": _(''),
|
||||||
|
"amount": '',
|
||||||
|
"vat_amount": ''
|
||||||
|
})
|
||||||
|
|
||||||
|
data.append({
|
||||||
|
"no": _(''),
|
||||||
|
"legend": _('VAT on Expenses and All Other Inputs'),
|
||||||
"amount": '',
|
"amount": '',
|
||||||
"vat_amount": ''
|
"vat_amount": ''
|
||||||
})
|
})
|
||||||
@@ -123,7 +132,7 @@ def get_data(filters = None):
|
|||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": '9',
|
"no": '9',
|
||||||
"legend": 'Standard Rated Expenses',
|
"legend": _('Standard Rated Expenses'),
|
||||||
"amount": get_standard_rated_expenses_total(filters),
|
"amount": get_standard_rated_expenses_total(filters),
|
||||||
"vat_amount": get_standard_rated_expenses_tax(filters)
|
"vat_amount": get_standard_rated_expenses_tax(filters)
|
||||||
}
|
}
|
||||||
@@ -131,8 +140,8 @@ def get_data(filters = None):
|
|||||||
|
|
||||||
data.append(
|
data.append(
|
||||||
{
|
{
|
||||||
"no": '10',
|
"no": _('10'),
|
||||||
"legend": 'Supplies subject to the reverse charge provision',
|
"legend": _('Supplies subject to the reverse charge provision'),
|
||||||
"amount": get_reverse_charge_recoverable_total(filters),
|
"amount": get_reverse_charge_recoverable_total(filters),
|
||||||
"vat_amount": get_reverse_charge_recoverable_tax(filters)
|
"vat_amount": get_reverse_charge_recoverable_tax(filters)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user