<vn>
<vn-lot-query id="params">
	<vn-spec name="from" type="Date"/>
</vn-lot-query>
<db-form id="debt">
	<db-model property="model">
		SELECT clientGetDebt() debt
	</db-model>
</db-form>
<h1 id="title">
	_LastOrders
</h1>
<div id="actions">
	<htk-bar-button
		icon="basket"
		tip="_ShoppingBasket"
		show-text="false"
		on-click="onBasketClick"/>
	<htk-bar-button
		id="pay-button"
		icon="pay"
		tip="_MakePayment"
		show-text="false"
		on-click="onPayButtonClick"/>
	<div class="balance">
		<span class="label">
			_Balance:
		</span> 
		<span class="amount" id="balance">
			<htk-text
				lot="debt"
				name="debt"
				format="%.2d€"
				conditional-func="balanceConditionalFunc"/>
		</span>
		<img
			src="image/icon/dark/info.svg"
			title="_PaymentInfo"
			class="info"
			alt="Info"/>
	</div>
</div>
<div id="main" class="orders">
	<div class="card form">
		<div>
			<label>_Show orders from</label>
			<htk-date-chooser lot="params" name="from"/>
		</div>
	</div>
	<div class="card list">
		<htk-repeater form-id="iter">
			<db-model property="model" lot="params">
				CALL clientTicketList (#from, NULL)
			</db-model>
			<custom>
				<a href="#!form=ecomerce/ticket&amp;ticket={{ticket_id}}"
					class="list-row"
					title="_SeeOrder">
					<p class="important total">
						<htk-text lot="iter" name="total" format="%.2d€"/>
					</p>
					<p class="important">
						<htk-text lot="iter" name="date" format="%D"/>
					</p>
					<p>@{{ticket_id}}</p>
					<p>{{consignee}}</p>
					<p>{{type}}</p>
				</a>
			</custom>
		</htk-repeater>
	</div>
</div>
<htk-dialog
	id="error-dialog"
	icon="error"
	message="_An error has been in the payment"
	buttons="ACCEPT_RETRY"
	on-response="onDialogResponse"/>
</vn>
