{extends file="layout.html"}
{block name=title}LMS: {$layout.pagetitle|striphtml}{/block}
{block name=module_content}
<!--// $Id$ //-->
<h1>{$layout.pagetitle}</h1>

<form method="post" name="invoicereport" id="invoicereport" action="?m=export&type=invoices">
	<input type="submit" class="hiddenbtn">
</form>

<table class="lmsbox">
	<colgroup>
		<col style="width: 1%;">
		<col style="width: 99%;">
	</colgroup>
	<thead>
		<tr>
			<td>
				{icon name="money"}
			</td>
			<td>
				<strong>{trans("Sale Registry")}</strong>
			</td>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td colspan="2">
				<table style="width: 100%;">
					<colgroup>
						<col style="width: 1%;">
						<col style="width: 1%;">
						<col style="width: 1%;">
						<col style="width: 97%;">
					</colgroup>
					<tr>
						<td>
							{icon name="calendar"}
						</td>
						<td>
							<strong>{trans("Period")}</strong>
						</td>
						<td>
							<span class="lms-ui-date-period-container">
								{date_period_preset from="[form=\"invoicereport\"][name=\"from\"]" to="[form=\"invoicereport\"][name=\"to\"]"}
								<span>{trans("From")}</span>
								<input type="text" name="from" form="invoicereport" size="10" maxlength="10"
									placeholder="{trans("yyyy/mm/dd")}"
									{tip class="lms-ui-date" text="Enter date in 'yyyy/mm/dd' format (empty field means current date) or click to choose it from calendar"}>
							</span>
						</td>
						<td>
							<span class="lms-ui-date-period-container">
								<span>{trans("To")}</span>
								<input type="text" name="to" form="invoicereport" size="10" maxlength="10"
									placeholder="{trans("yyyy/mm/dd")}"
									{tip class="lms-ui-date" text="Enter date in 'yyyy/mm/dd' format (empty field means current date) or click to choose it from calendar"}>
							</span>
						</td>
					</tr>
					<tr>
						<td>
							{icon name="division"}
						</td>
						<td>
							<strong>{trans("Division")}</strong>
						</td>
						<td colspan="2">
							<select size="1" name="division" form="invoicereport" {tip text="Select division"}>
								<option value="0">{trans("— all —")}</option>
								{foreach $divisions as $division}
									<option value="{$division.id}">{$division.label|escape}</option>
								{/foreach}
							</select>
						</td>
					</tr>
					<tr>
						<td>
							{icon name="customergroup"}
						</td>
						<td class="nobr">
							<strong>{trans("Group")}</strong>
						</td>
						<td colspan="2">
							<select size="4" name="customergroups[]" form="invoicereport" class="lms-ui-multiselect"
								multiple {tip text="Select groups"}
								data-default-value="{trans("— all groups —")}">
								{foreach $customergroups as $customergroup}
									<option value="{$customergroup.id}">{$customergroup.name|trunescape:30}</option>
								{/foreach}
							</select>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan="2" class="lms-ui-box-buttons">
				{button type="submit" label="Save" icon="save" form="invoicereport"}
			</td>
		</tr>
	</tbody>
</table>

<script>

	$(function() {
		$('#invoicereport').submit(function() {
			$('[form="invoicereport"][type="submit"]').prop('disabled', false);
		});
	});

</script>

<FORM method="post" name="receiptlist" id="receiptlist" action="?m=export&amp;type=cash">
<INPUT type="submit" class="hiddenbtn">
<TABLE class="lmsbox">
    <THEAD>
	<TR>
		<TD width="1%">
			<IMG src="img/money.gif" alt="">
		</TD>
		<TD width="99%">
			<B>{trans("Cash Report")}</B>
		</TD>
	</TR>
    </THEAD>
    <TBODY>
	<TR>
		<TD width="100%" colspan="2">
			<TABLE width="100%">
				<TR>
					<TD width="1%">
						<IMG src="img/queue.gif" alt="">
					</TD>
					<TD width="1%" nowrap>
						<B>{trans("Registry:")}</B>
					</TD>
					<TD width="1%">
						<SELECT SIZE="1" NAME="registry" {tip text="Select cash registry"}>
					    		<OPTION VALUE="0">{trans("— select registry —")}</OPTION>
						        {foreach from=$cashreglist item=c}
							<OPTION VALUE="{$c.id}">{$c.name|truncate:40:"&hellip;":true} ({$c.id|string_format:"%04d"})</OPTION>
						        {/foreach}
						</SELECT>
					</TD>
					<TD width="1%">
						<IMG src="img/calendar.gif" alt="">
					</TD>
					<TD width="1%">
						<span class="lms-ui-date-period-container">
							<strong>{trans("Period:")}</strong>
							{date_period_preset from="#receiptlist [name=\"from\"]" to="#receiptlist [name=\"to\"]"}
							<span>{trans("From")}</span>
							<input type="text" name="from" size="10" maxlength="10"
								placeholder="{trans("yyyy/mm/dd")}"
								{tip class="lms-ui-date" text="Enter date in 'yyyy/mm/dd' format (empty field means current date) or click to choose it from calendar"}>
							<span>{trans("To")}</span>
							<input type="text" name="to" size="10" maxlength="10"
								placeholder="{trans("yyyy/mm/dd")}"
								{tip class="lms-ui-date" text="Enter date in 'yyyy/mm/dd' format (empty field means current date) or click to choose it from calendar"}>
						</span>
					</TD>
					<TD width="1%">
						<IMG src="img/users.gif" alt="">
					</TD>
					<TD width="1%" nowrap>
						<B>{trans("User:")}</B>
					</TD>
					<TD width="93%">
						<SELECT size="1" name="user" {tip text="You can select user to limit results"}>
							<OPTION value="">{trans("— all users —")}</OPTION>
							{section name="users" loop=$users}
							<OPTION value="{$users[users].id}">{$users[users].name|truncate:40:"&hellip;":true}</OPTION>
							{/section}
						</SELECT>
					</TD>
				</TR>
			</TABLE>
		</TD>
	</TR>
	<TR>
		<TD width="100%" colspan="2" align="right">
			<A href="javascript:document.receiptlist.submit();">{trans("Save")} <IMG src="img/save.gif" alt="" hspace="2"></A>
		</TD>
	</TR>
    </TBODY>
</TABLE>
</FORM>
{/block}
