<!---- 
    Author 	: Ladur
    Tanggal : 12-08-2014	
    Revisi 	:
-->
<div class="easyui-layout" data-options="fit:true,border:false">
	<!-- top view-->
	<div id="form-header" data-options="region:'north',border:false" >
		<div id="form-header-wrapper">
			<table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
				<tr>
					<td align="left" valign="middle">
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-document" plain="true" onclick="location.reload()">New</a>
						<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-journal" plain="true"  id="btn_journal" 
							onclick="show_journal()" disabled="disabled">Journal
						</a>
						<input type="hidden" id="id_tojournal" name="id_tojournal" />
					</td>							
					<td height="25" align="right" valign="middle">								
						<span class="form-title"><?=$menu_label?></span>
					</td>
				</tr>
			</table>		     	
		</div>			
	</div>
	<!-- end top view -->	
	<!-- center view -->
	<div id="form-body" data-options="region:'center',border:false">
		<div id="form-wrapper" class="easyui-panel"  style="width:1180%;height:548px;padding:5px;">
			<form id="fm_payment" name="fm_payment" method="post">
				<input type="hidden" name="detail" id="detail"/>
				<table cellpadding="0" cellspacing="3" width="100%" height="100%" border="0">
					<tr>
						<td valign="middle" height="" align="left">
							<label>Paid From</label>
						</td>
						<td align="left" valign="middle">							
							<select name="cmb_bank_account" class="easyui-combogrid" id="cmb_bank_account" required="required" style="width:259px; height:18px;" data-options="
							panelWidth: 300,
							idField: 'AccountNumber',
							textField: 'AccountName',
							url: '<?php echo base_url(); ?><?php echo"list/payment_lebih"; ?>/get_petty_cash',               
							columns: [[
							{field:'AccountName',title:'Account Name',width:190}
							]],
							fitColumns: true
							">
							</select>
						</td>
						<td align="left" valign="middle">&nbsp;</td>
						<td rowspan="6" align="left" valign="top">
							<table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
								<tr>
									<td align="right" valign="top">
										<table cellpadding="0" cellspacing="1" width="100%" border="0">
											<tr>
												<td height="20">&nbsp;</td>
												<td width="100" align="center" valign="middle" bgcolor="#333399"><span style="color: #fff">Cash Payment No.</span></td>
												<td width="100" align="center" valign="middle" bgcolor="#333399"><span style="color:#fff;">Cash Payment. Date</span></td>
											</tr>
											<tr>
												<td>&nbsp;</td>
												<td height="20" align="left" valign="top">
													<input type="text" name="txt_payment_no" id="txt_payment_no" class="easyui-validatebox" style="width:140px;"  required="required"
														value="<?php echo $pay_number; ?>" />
												</td>
												<td align="right" valign="top"><input name="txt_payment_date" id="txt_payment_date" type="text" class="easyui-datebox" style="width:120px;height:20px" required="required" /></td>
											</tr>
										</table><br/><br/><br/>
										<span class="blink">PERINGATAN :</span>
										<p>Form ini hanya dapat digunakan untuk melakukan transaksi dengan </p>
										<p>total invoice sama dengan total faktur yang lebih besar atau sama dengan Rp.250.000,00</p>
									</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr>
						<td valign="middle" height="" align="left" width="100">
							<label>Memo</label>
						</td>
						<td valign="middle" align="left">
							<textarea class="textbox" style="resize:none;" name="txa_memo" id="txa_memo" cols="40" rows="3" onclick=""></textarea>
						</td>
						<td width="50" align="left" valign="middle">&nbsp;</td>
					</tr>
					<tr>
						<td valign="middle" height="" align="left"><label>Amount</label></td>
						<td align="left" valign="middle">
							<input name="txt_amount" id="txt_amount" type="text" class="easyui-numberbox" style="width:300px;height:20px" required="required" 
									data-options="
										min:0,
										precision:2,
										decimalSeparator:',',
										groupSeparator:'.',
										onChange:function(value){
											amount_value(value);
										}
									">
							<a href="#" id="btn_calculate" class="easyui-linkbutton" data-options="iconCls:'icon-calculator',size:'small'" onclick="count_amount()"></a>
						</td>
						<td rowspan="4" align="left" valign="middle">&nbsp;</td>
					</tr>
					<tr>
						<td valign="middle" height="" align="left">&nbsp;</td>
						<td align="left" valign="middle">&nbsp;</td>
					</tr>						
				</table>
				<!-- // ================== Datagrid ================= //-->
				<table id="dtg_payment" class="easyui-edatagrid"
					 toolbar="#tb_dtg_payment" idField="id"
					 rownumbers="true" fitColumns="true" singleSelect="true" style="height:340px;">
					<thead>
						<tr>
							<th align="center" valign="middle" data-options="field:'AccountName',width:400,align:'left'" editor="{type:'PaymentAccountName',options:{required:true}}">
								Account Name
							</th>
							<th align="center" valign="middle" data-options="
								minValue:0,
								field:'Amount',
								width:120,
								align:'center',
								editor:{
									type:'numberbox',
									options:{precision:2,decimalSeparator:',',groupSeparator:'.',required:true}
								}">
								Amount
							</th>
							<th align="center" valign="middle" data-options="field:'Memo',width:400,align:'left',editor:'text'">Memo</th>
							<th align="center" valign="middle" data-options="field:'DepartmentName',width:150,align:'left'" editor="{type:'DepartmentAccountName',options:{required:true}}">
								Department
							</th>
						</tr>
					</thead>
				</table>
				<div id="tb_dtg_payment">
					<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="javascript:$('#dtg_payment').edatagrid('addRow')">New</a>
					<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="javascript:$('#dtg_payment').edatagrid('destroyRow')">Delete</a>
					<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" onclick="javascript:$('#dtg_payment').edatagrid('cancelRow')">Cancel</a>
				</div>
				<table cellpadding="0" cellspacing="0" width="100%" border="0">
					<tr>
						<td align="right" height="20" valign="bottom">
							<span>Total Payment ::<span id="total_amount"></span></span>
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div id="form-footer">
			 <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-help" onclick="" plain="true">Help</a>
			 <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-ok" onclick="" id="btn_appdir" disabled="disabled">
				App. Dir
			</a>
			 <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-ok" onclick="" id="btn_appmgrspv" disabled="disabled">
				App. Mgr
			</a>
			 <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-save" onclick="save_me()">Save</a> 								
			 <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-print" onclick="" disabled="disabled">Preview & Print</a>   
			 <a href="javascript:void(0)" class="easyui-linkbutton form-button" iconCls="icon-cancel" onclick="parent.tab_close('tt')">Cancel</a>	
		</div>		
	</div>
</div>

<?php $this->load->view('v_popup_item'); ?>

<script type="text/javascript">
	
</script>