<div class="content2">
<h1>{{@page_data.title}}</h1>
<check if="{{@lines}}">
<p align="center">
	<input type="button" value="Печать" class="send_ajax" href="/receipts/salesreport?change_id={{@change.id}}&print=1">
</p>
</check>
<table class="work_table">
	<tr>
		<th>
			Наименование
		</th>
		<th width="50">
			Кол-во
		</th>
		<th width="150">
			Сумма
		</th>
	</tr>
	<tr>
		<th colspan="3">
			Продажи
		</th>
	</tr>
	<repeat group="{{@lines['sales']}}" value="{{@line}}">
	<tr>
		<td>
			{{@line.product_title}}
		</td>
		<td align="center">
			{{number_format(@line.total_count, 3, '.', '')}}
		</td>
		<td align="center">
			{{number_format(@line.sum, 2, '.', '')}}
		</td>
	</tr>
	</repeat>
	<tr>
		<th colspan="3">
			Возвраты
		</th>
	</tr>
	<repeat group="{{@lines['returns']}}" value="{{@line}}">
	<tr>
		<td>
			{{@line.product_title}}
		</td>
		<td align="center">
			{{number_format(@line.total_count, 3, '.', '')}}
		</td>
		<td align="center">
			{{number_format(@line.sum, 2, '.', '')}}
		</td>
	</tr>
	</repeat>
	<tr>
		<th colspan="3">
			Итоги
		</th>
	</tr>
	<repeat group="{{@lines['result']}}" value="{{@line}}">
	<tr>
		<td>
			{{@line.product_title}}
		</td>
		<td align="center">
			{{number_format(@line.total_count, 3, '.', '')}}
		</td>
		<td align="center">
			{{number_format(@line.sum, 2, '.', '')}}
			{~@sum+=@line.sum~}
		</td>
	</tr>
	</repeat>
	<tr>
		<td colspan="2" align="right">
			<b>Итого</b>
		</td>
		<td align="center">
			{{number_format(@sum, 2, '.', '')}}
		</td>
	</tr>
</table>
</div>
