<input type="hidden" id="product_selected">
<form class="form-horizontal" id="form_transaction">
	<input type="hidden" id="idtransaction_group" name="idtransaction_group">
	<input type="hidden" id="x_transaction" name="x_transaction">
	<input type="hidden" id="x_transaction_detail" name="x_transaction_detail">
	<input type="hidden" id="hd_idtable" name="hd_idtable">
	<div class="box-field purple">
		<div class="row">
			<div class="col-sm-5">
				<?php
					if (strlen($this->session->userdata('idoutlet')) == 0) {
				?>
				<div class="form-group">
					<label class="control-label col-sm-4"><?php echo azlang('Outlet');?></label>
					<div class="col-sm-8">
						<?php echo az_select_outlet();?>
					</div>
				</div>
				<?php
					}
					else {
				?>
					<input type="hidden" name="idoutlet" id="idoutlet" value="<?php echo $this->session->userdata('idoutlet');?>">
				<?php
					}
				?>
				<div class="form-group">
					<label class="control-label col-sm-4"><?php echo azlang('Customer');?></label>
					<div class="col-sm-6">
						<table width="100%">
							<tr>
								<td>
									<?php echo az_select_customer();?>
								</td>
								<td>&nbsp;</td>
								<td><button class="btn btn-default" id="btn_add_customer" type="button"><i class="fa fa-plus"></i></button></td>
							</tr>
						</table>
						<table id="customer_detail" class="table table-condensed table-stripped" style="margin-top:10px;">
							<!--<tr>
								<td width="150px">Telepon</td>
								<td width="10px">&nbsp;:&nbsp;</td>
								<td class="cd-phone"></td>
							</tr>
						   <tr>
								<td>Nama</td>
								<td>&nbsp;:&nbsp;</td>
								<td class="cd-name"></td>
							</tr>-->
						    <tr>
								<td>Alamat</td>
								<td>&nbsp;:&nbsp;</td>
								<td class="cd-address"></td>
							</tr>
							<tr>
								<td>Kategori Pelanggan</td>
								<td>&nbsp;:&nbsp;</td>
								<td class="cd-category"></td>
							</tr>
						</table>
					</div>
				</div>
			</div>
			<div class="col-sm-4">
				<div class="form-group">
					<label class="control-label col-sm-4">Tgl Selesai</label>
					<div class="col-sm-8">
						<?php echo $duedate;?>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class="box-field green box-sales-transaction">
		<div class="table-responsive">
			<table class="table table-condensed table-transaction">
				<thead>
					<tr>
						<th width="10px"></th>
						<th>Barang</th>
						<th width="290px"></th>
					</tr>
				</thead>
				<tbody>
					
				</tbody>
				<tfoot>
					<tr>
						<td colspan="6">
							<button class="btn btn-warning btn-sm btn-add-product-transaction" type="button"><i class="fa fa-plus"></i> Tambah Transaksi Produk</button>
							<button class="btn btn-primary btn-sm btn-create-item" type="button"><i class="fa fa-plus"></i> Buat Barang Baru</button>
						</td>
					</tr>
				</tfoot>			
			</table>
		</div>

		<div class="row">
			<div class="col-md-6">
				<div class="form-group">
					<label class="control-label col-md-4">Catatan</label>
					<div class="col-md-8">
						<textarea class="form-control" name="info_note" rows="5" id="info_note" placeholder="<?php echo azlang('Note');?>"></textarea>
					</div>
				</div>
			</div>
			<div class="col-md-6">
				<div align="right">
					<table class="table-info">
						<tr class="hide">
							<td width="150px"><?php echo azlang('Grand Total');?></td>
							<td colspan="3"><input readonly type="text" class="form-control txt-right" id="info_totalx" name="info_grand_totalx"></td>
						</tr>
						<tr class="hide">
							<td><?php echo azlang('Discount');?></td>
							<td width="120px">
								<div class="input-group">
										<input type="text" class="form-control txt-right format-number-decimal" value="0,00" id="info_discount_percentx" name="info_discount_percentx">
										<span class="input-group-addon">%</span>
									</div>
								</div>
							</td>
							<td width="130px">
								<input type="text" name="info_discountx" id="info_discountx" value="0,00" class="form-control txt-right format-number-decimal">
							</td>
						</tr>
						<tr class="hide">
							<td><?php echo azlang('Tax');?></td>
							<td width="100px">
								<div class="input-group">
										<input type="text" class="form-control txt-right format-number-decimal" value="0,00" id="info_tax_percent" name="info_tax_percent">
										<span class="input-group-addon">%</span>
									</div>
								</div>
							</td>
							<td width="130px">
								<input type="text" name="info_tax" id="info_tax" value="0,00" class="form-control txt-right format-number-decimal">
							</td>
						</tr>
						<tr class="hide">
							<td><?php echo azlang('Add Cost');?></td>
							<td colspan="3"><input type="text" class="form-control txt-right format-number-decimal" id="info_add_cost" name="info_add_cost" value="0,00"></td>
						</tr>
						<tr>
							<td>Jumlah Tagihan</td>
							<td colspan="3"><input readonly type="text" class="form-control txt-right" id="info_total_final" value="0" name="info_total_final"></td>
						</tr>
						<tr>
							<td colspan="3"><hr></td>
						</tr>
					</table>
				</div>
			</div>
		</div>		
		<hr>
		<div>
			<a href="<?php echo app_url();?>sales_transaction"><button class="btn btn-default" type="button"><?php echo azlang('Back');?></button></a>
			<a href="<?php echo app_url();?>sales_transaction/add"><button class="btn btn-default" type="button"><?php echo azlang('New Transaction');?></button></a>
			<button class="btn btn-info" type="button" id="btn_save_transaction"><?php echo azlang('Save');?></button>
		</div>
	</div>
</form>

<script type="text/template" id="tmp_transaction">
	<?php echo $tmp_transaction;?>
</script>
<script type="text/template" id="tmp_additional_cost">
	<?php echo $tmp_additional_cost;?>
</script>
