<div id="tb">
    <div title="Transaction" data-options="closable:false" style="padding:10px">
        <div style="height:50%;padding-bottom:10px">
        <table id="dg_hdr"></table> 
        
        <div id="toolbar_hdr"> 
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t41') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnTbh" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="addForm()">Add</a>  
          <?php }?>
          <?php if ($this->session->userdata('u12') == 1 && $this->session->userdata('u41') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnUbh" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editForm()">Edit</a> 
          <?php }?>
          <?php if ($this->session->userdata('h12') == 1 && $this->session->userdata('h41') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnHps" class="easyui-linkbutton" iconCls="icon-remove" plain="true">Delete</a>  
          <?php }?> 
          <!-- <a href="javascript:void(0)" id="btnPrint" class="easyui-linkbutton" iconCls="icon-print" plain="true" title="Print">Print Slip</a> -->
          <?php if ($this->session->userdata('t12') == 1 && $this->session->userdata('t41') == 1 ){ ?>
          <a href="javascript:void(0)" id="btnJournal" class="easyui-linkbutton" iconCls="icon-ok" plain="true" style="width:120px">Create Journal</a>
          <a href="javascript:void(0)" id="btnresetJ" class="easyui-linkbutton" iconCls="icon-remove" plain="true" style="width:120px">Reset Journal</a>
         <?php } ?>
          <span style="display:inline-block;">
          &nbsp; &nbsp; &nbsp;
          <input id="q">
          </span>
        </div>
        
        <div id="dlg" class="easyui-dialog" style="width:70%; top:25%" inline="false" closed="true" buttons="#dlg-buttons">
        <form id="fm" class="form-horizontal" role="form" method="post" style="padding:10px;">
            <input type="submit" id="btnSubmit" name="btnSubmit" style="display:none">
            <input type="hidden" id="id" name="id">
            <div class="form-group">
                <!--<label class="control-label col-md-2">AP No.</label>
                <div class="col-md-2">
                <input class="form-control easyui-textbox" id="no" name="no" style="width:90%" required>
              </div>-->
              <label class="control-label col-md-2">AP Date</label>            
              <div class="col-md-2">          
                <input class="form-control easyui-datebox" id="date" name="date" maxlength="10" style="width:90%" required>
              </div>
              <label class="control-label col-md-2">Incoming No.</label>
              <div class="col-md-2">
                <input class="form-control" name="ref_id" id="ref_id" style="width:90%" required>
              </div>
            </div>
            <div class="form-group">            
              <label class="control-label col-md-2">Supplier</label>
              <div class="col-md-2">          
                <input class="form-control" name="partner_id" id="partner_id" style="width:90%">
              </div>
              <label class="control-label col-md-2">Currency</label>
              <div class="col-md-2">          
                <input class="form-control" name="currency" id="currency" style="width:90%">
              </div>
              <label class="control-label col-md-2">Rate</label>
              <div class="col-md-2">          
                <input class="form-control easyui-textbox" id="rate" name="rate" style="width:90%">
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-md-2">Description</label>
              <div class="col-md-2">          
                <input class="form-control easyui-textbox" name="description" id="description" style="width:90%">
              </div>
              <label class="control-label col-md-2">Date Inv.</label>
              <div class="col-md-2">          
                <input class="form-control easyui-datebox" name="dateInv" id="dateInv" style="width:90%">
              </div>
            </div>
            <div class="form-group">
              <label class="control-label col-md-2">Debit</label>
              <div class="col-md-2">          
                <input class="form-control" name="accountd_id" id="accountd_id" style="width:90%" require>
              </div>
              <div class="col-md-4">          
                <input class="form-control easyui-textbox" name="acctnamed" id="acctnamed" style="width:90%" readonly>
              </div>
            </div>
            <div class="form-group">            
              <label class="control-label col-md-2">Credit</label>
              <div class="col-md-2">          
                <input class="form-control" name="accountc_id" id="accountc_id" style="width:90%">
              </div>
              <div class="col-md-4">          
                <input class="form-control easyui-textbox" name="acctnamec" id="acctnamec" style="width:90%" readonly>
              </div>
            </div>
            <div class="form-group">            
              <label class="control-label col-md-2">Tot. Amount</label>
              <div class="col-md-2">          
                <input class="form-control" name="tot_amount" id="tot_amount" style="width:90%" readonly>
              </div>
              <div class="col-md-8">          
              <input type="radio" name="tax" id="tax1" onchange="calculatetax()" value="none" checked="checked">None &nbsp&nbsp&nbsp&nbsp
                <input type="radio" name="tax" id="tax2" onchange="calculatetax()" value="ppn" >Ppn &nbsp&nbsp&nbsp&nbsp
                <input type="radio" name="tax" id="tax3" onchange="calculatetax()" value="pph21" >Pph 21 &nbsp&nbsp&nbsp&nbsp
                <input type="radio" name="tax" id="tax4" onchange="calculatetax()" value="pph23" >Pph 23 &nbsp&nbsp&nbsp&nbsp
                <input type="radio" name="tax" id="tax5" onchange="calculatetax()" value="ppn+pph23" >Ppn + Pph 23 &nbsp&nbsp&nbsp&nbsp
                <input type="radio" name="tax" id="tax6" onchange="calculatetax()" value="pph22_Oil" >Pph22_Oil &nbsp&nbsp&nbsp&nbsp
                <input type="radio" name="tax" id="tax7" onchange="calculatetax()" value="pph22_Import" >Pph22_Import 
              </div>
            </div>
            <div class="form-group">            
              <label class="control-label col-md-2">Tax. Amount</label>
              <div class="col-md-2">          
                <input class="form-control" name="tax_amount" id="tax_amount" style="width:90%" required>
              </div>
            </div>            
            <div class="form-group">            
              <label class="control-label col-md-2">After Tax</label>
              <div class="col-md-2">          
                <input class="form-control" name="after_tax" id="aftertax_amount" style="width:90%" readonly>
              </div>
            </div>             
              
        </form>
        </div>
        <div id="dlg-buttons">
            <a href="#" id="btnSim" onclick="javascript:alert('data header tersimpan! (klik ok)')" class="easyui-linkbutton c6" iconCls="icon-ok">Simpan</a>
            <a href="javascript:void(0)" id="btnReset" class="easyui-linkbutton" iconCls="icon-cancel">Kosongkan</a>
        </div>

        </div>
        <div style="height:50%">
            <table id="dg_det"></table>
            <div id="toolbar_det">  
              <span style="display:inline-block;">
                &nbsp; &nbsp; &nbsp;
                <input id="q_det">
              </span>
            </div>
            <div id="dlg2" class="easyui-dialog" style="width:40%;" closed="true" buttons="#dlg2-buttons">
            <form id="fm2"class="form-horizontal" role="form" method="post" style="padding:10px;">
                <input type="submit" id="btnSubmit2" name="btnSubmit2" style="display:none">
                <input type="hidden" id="id_det" name="id">
                <div class="form-group">
                    <label class="control-label col-md-3">Item Code</label>
                  <div class="col-md-2">
                    <input class="form-control" id="item_id" name="item_id" style="width:90%" required>
                  </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3">Item Description</label>
                  <div class="col-md-9">
                    <input class="form-control easyui-textbox" id="NmBarang" name="NmBarang" style="width:100%" readonly>
                  </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3">UOM</label>
                  <div class="col-md-2">
                    <input class="form-control" id="Sat" name="Sat" style="width:90%" readonly>
                  </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3">Qty.</label>
                  <div class="col-md-3">
                    <input class="form-control" id="qty" name="qty" style="width:100%">
                  </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3">Price</label>
                  <div class="col-md-3">
                    <input class="form-control" id="price" name="price" style="width:100%">
                  </div>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3">Amount</label>
                  <div class="col-md-3">
                    <input class="form-control" id="amount" name="amount" style="width:100%" readonly>
                  </div>
                </div>
                
            </form>
            </div>
            <div id="dlg2-buttons">
                <a href="#" id="btnSim2" class="easyui-linkbutton c6" iconCls="icon-ok">Simpan</a>
                <a href="javascript:void(0)" id="btnReset2" class="easyui-linkbutton" iconCls="icon-cancel">Kosongkan</a>
            </div>
            
            <div id="dlg3" class="easyui-dialog" style="width:40%;" closed="true" buttons="#dlg3-buttons">
            <form id="fm3"class="form-horizontal" role="form" method="post" style="padding:10px;">
                <input type="submit" id="btnSubmit3" name="btnSubmit3" style="display:none">
                <div class="form-group">
                    <label class="control-label col-md-3">Barcode Item</label>
                  <div class="col-md-8">
                    <input class="form-control" id="barcode" name="barcode" style="width:90%" required><label class="checkbox-inline"><input type="checkbox" id="fifo" name="fifo" value="1">FIFO</label>
                  </div>
                </div>                  
            </form>
            </div>
            <div id="dlg3-buttons">
                <a href="#" id="btnSim3" class="easyui-linkbutton c6" iconCls="icon-ok">Simpan</a>
                <a href="javascript:void(0)" id="btnReset3" class="easyui-linkbutton" iconCls="icon-cancel">Kosongkan</a>
            </div>
        </div>
    </div>
    <div title="List View" data-options="closable:false" style="padding:10px">
        <table id="dg_hdrdet"></table>
        <div id="toolbar_hdrdet">  
            <a href="javascript:void(0)" id="btnPrint2" class="easyui-linkbutton" iconCls="icon-print" plain="true" title="Print">Print</a> 
            <a href="javascript:void(0)" id="btnExcel" class="easyui-linkbutton" iconCls="icon-xls" plain="true" title="Excel">Excel</a>
            <span style="display:inline-block;">
            &nbsp; &nbsp; &nbsp;
            <input id="q2">
            </span>
        </div> 
    </div>    
</div>