{%
	if (report.columns.length > 8) {
		frappe.throw(__("Too many columns. Export the report and print it using a spreadsheet application."));
	}
%}

<style>
	.financial-statements-important td {
		font-weight: bold;
	}

	.financial-statements-blank-row td {
		height: 37px;
	}
</style>

<h2 class="text-center">{%= __(report.report_name) %}</h2>
<h4 class="text-center">{%= filters.company %}</h3>
<h4 class="text-center">{%= filters.fiscal_year %}</h3>
{% if (filters.from_date) { %}
	<h4 class="text-center">{%= dateutil.str_to_user(filters.from_date) %} - {%= dateutil.str_to_user(filters.to_date) %}</h3>
{% } %}
<hr>
<table class="table table-bordered">
	<thead>
		<tr>
			<th style="width: {%= 100 - (report.columns.length - 2) * 13 %}%"></th>
			{% for(var i=2, l=report.columns.length; i<l; i++) { %}
				<th class="text-right">{%= report.columns[i].label %}</th>
			{% } %}
		</tr>
	</thead>
	<tbody>
		{% for(var j=0, k=data.length; j<k; j++) { %}
			{%
				var row = data[j];
				var row_class = data[j].parent_account ? "" : "financial-statements-important";
				row_class += data[j].account_name ? "" : " financial-statements-blank-row";
			%}
			<tr class="{%= row_class %}">
				<td>
					<span style="padding-left: {%= cint(data[j].indent) * 2 %}em">{%= row.account_name %}</span>
				</td>
				{% for(var i=2, l=report.columns.length; i<l; i++) { %}
					<td class="text-right">
						{% var fieldname = report.columns[i].field; %}
						{% if (!is_null(row[fieldname])) { %}
							{%= format_currency(row[fieldname]) %}
						{% } %}
					</td>
				{% } %}
			</tr>
		{% } %}
	</tbody>
</table>
<p class="text-right text-muted">Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>
