feat(UAE VAT 21): add fixed width to columns
diff --git a/erpnext/regional/report/uae_vat_21/uae_vat_21.html b/erpnext/regional/report/uae_vat_21/uae_vat_21.html
index aa6a255..d9b9968 100644
--- a/erpnext/regional/report/uae_vat_21/uae_vat_21.html
+++ b/erpnext/regional/report/uae_vat_21/uae_vat_21.html
@@ -1,21 +1,27 @@
{%
var report_columns = report.get_columns_for_print();
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>
-<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">
<thead>
- {% for (let i=0; i<report_columns.length; i++) { %}
- <th >{%= report_columns[i].label %}</th>
+ <th style="width: 13">{%= report_columns[0].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>
@@ -38,17 +44,20 @@
</tbody>
</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">
<thead>
- {% for (let i=0; i<report_columns.length; i++) { %}
- <th >{%= report_columns[i].label %}</th>
+ <th style="width: 13">{%= report_columns[0].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>
<tbody>
- {% for (let j=13; j<data.length; j++) { %}
+ {% for (let j=14; j<data.length; j++) { %}
{%
var row = data[j];
%}
diff --git a/erpnext/regional/report/uae_vat_21/uae_vat_21.js b/erpnext/regional/report/uae_vat_21/uae_vat_21.js
index 3e6cdd8..5fc5449 100644
--- a/erpnext/regional/report/uae_vat_21/uae_vat_21.js
+++ b/erpnext/regional/report/uae_vat_21/uae_vat_21.js
@@ -18,7 +18,6 @@
"fieldtype": "Date",
"reqd": 1,
"default": frappe.datetime.add_months(frappe.datetime.get_today(), -3),
- "width": "80"
},
{
"fieldname": "to_date",
diff --git a/erpnext/regional/report/uae_vat_21/uae_vat_21.py b/erpnext/regional/report/uae_vat_21/uae_vat_21.py
index d400732..211bf16 100644
--- a/erpnext/regional/report/uae_vat_21/uae_vat_21.py
+++ b/erpnext/regional/report/uae_vat_21/uae_vat_21.py
@@ -17,27 +17,29 @@
return [
{
"fieldname": "no",
- "label": "No",
+ "label": _("No"),
"fieldtype": "Data",
"width": 50
},
{
"fieldname": "legend",
- "label": "Legend",
+ "label": _("Legend"),
"fieldtype": "Data",
"width": 300
},
{
"fieldname": "amount",
- "label": "Amount (AED)",
+ "label": _("Amount (AED)"),
"fieldtype": "Currency",
- "width": 100
+ "width": 125,
+ "options": "currency"
},
{
"fieldname": "vat_amount",
- "label": "VAT Amount (AED)",
+ "label": _("VAT Amount (AED)"),
"fieldtype": "Currency",
- "width": 100
+ "width": 150,
+ "options": "currency"
}
]
@@ -46,7 +48,7 @@
data = []
data.append({
"no": '',
- "legend": 'VAT on Sales and All Other Outputs',
+ "legend": _('VAT on Sales and All Other Outputs'),
"amount": '',
"vat_amount": ''
})
@@ -64,14 +66,14 @@
for d, emirate in enumerate(emirates, 97):
if emirate in amounts_by_emirate:
- amounts_by_emirate[emirate]["no"] = f'1{chr(d)}'
- amounts_by_emirate[emirate]["legend"] = f'Standard rated supplies in {emirate}'
+ amounts_by_emirate[emirate]["no"] = _(f'1{chr(d)}')
+ amounts_by_emirate[emirate]["legend"] = _(f'Standard rated supplies in {emirate}')
data.append(amounts_by_emirate[emirate])
else:
data.append(
{
- "no": f'1{chr(d)}',
- "legend": f'Standard rated supplies in {emirate}',
+ "no": _(f'1{chr(d)}'),
+ "legend": _(f'Standard rated supplies in {emirate}'),
"amount": 0,
"vat_amount": 0
}
@@ -79,8 +81,8 @@
data.append(
{
- "no": '2',
- "legend": 'Tax Refunds provided to Tourists under the Tax Refunds for Tourists Scheme',
+ "no": _('2'),
+ "legend": _('Tax Refunds provided to Tourists under the Tax Refunds for Tourists Scheme'),
"amount": (-1) * get_tourist_tax_return_total(filters),
"vat_amount": (-1) * get_tourist_tax_return_tax(filters)
}
@@ -88,8 +90,8 @@
data.append(
{
- "no": '3',
- "legend": 'Supplies subject to the reverse charge provision',
+ "no": _('3'),
+ "legend": _('Supplies subject to the reverse charge provision'),
"amount": get_reverse_charge_total(filters),
"vat_amount": get_reverse_charge_tax(filters)
}
@@ -97,8 +99,8 @@
data.append(
{
- "no": '4',
- "legend": 'Zero Rated',
+ "no": _('4'),
+ "legend": _('Zero Rated'),
"amount": get_zero_rated_total(filters),
"vat_amount": "-"
}
@@ -106,16 +108,23 @@
data.append(
{
- "no": '5',
- "legend": 'Exempt Supplies',
+ "no": _('5'),
+ "legend": _('Exempt Supplies'),
"amount": get_exempt_total(filters),
"vat_amount": "-"
}
)
data.append({
- "no": '',
- "legend": 'VAT on Expenses and All Other Inputs',
+ "no": _(''),
+ "legend": _(''),
+ "amount": '',
+ "vat_amount": ''
+ })
+
+ data.append({
+ "no": _(''),
+ "legend": _('VAT on Expenses and All Other Inputs'),
"amount": '',
"vat_amount": ''
})
@@ -123,7 +132,7 @@
data.append(
{
"no": '9',
- "legend": 'Standard Rated Expenses',
+ "legend": _('Standard Rated Expenses'),
"amount": get_standard_rated_expenses_total(filters),
"vat_amount": get_standard_rated_expenses_tax(filters)
}
@@ -131,8 +140,8 @@
data.append(
{
- "no": '10',
- "legend": 'Supplies subject to the reverse charge provision',
+ "no": _('10'),
+ "legend": _('Supplies subject to the reverse charge provision'),
"amount": get_reverse_charge_recoverable_total(filters),
"vat_amount": get_reverse_charge_recoverable_tax(filters)
}