fadlyshafa

Untitled

May 5th, 2020
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 16.27 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. $p = array('1','31','32','51','52');
  4. if(!(in_array($this->session->userdata('type'),$p))){
  5.     redirect('auth/dashboard');
  6. }
  7. $this->load->view('layout/header');
  8.  
  9. ?>
  10. <div class="content-wrapper">
  11.     <section class="content-header">
  12.         <h5>
  13.             <ol class="breadcrumb">
  14.                 <li><a href="<?php echo base_url('auth/dashboard'); ?>"><i class="fa fa-dashboard"></i> <?php echo $this->lang->line('header_dashboard'); ?></a></li>
  15.                 <li><a href="<?php echo base_url('purchase'); ?>"><?php echo $this->lang->line('header_purchase'); ?></a></li>
  16.                 <li class="active"><?php echo $this->lang->line('purchase_add_purchase'); ?></li>
  17.             </ol>
  18.         </h5>    
  19.     </section>
  20.  
  21.     <section class="content">
  22.         <div class="row">
  23.             <div class="col-sm-12">
  24.                 <div class="box">
  25.                     <div class="box-header with-border">
  26.                         <h3 class="box-title"><?php echo $this->lang->line('purchase_add_new_purchase'); ?></h3>
  27.                     </div>
  28.                     <div class="box-body">
  29.                         <div class="row">
  30.                             <form role="form" id="form" method="post" action="<?php echo base_url('index.php/purchase/addPurchase');?>" enctype="multipart/form-data">
  31.                                 <div class="col-sm-6">
  32.                                     <div class="form-group">
  33.                                         <label for="reference_no">Nomor PO : </label>
  34.                                         <input type="text" class="form-control" id="reference_no" name="reference_no" value="<?php echo set_value('reference_no', $reference_no); ?>">
  35.                                     </div>
  36.  
  37.                                     <div class="form-group">
  38.                                         <label for="date">Created Date : <span class="validation-color">*</span></label>
  39.                                         <input type="text" class="form-control" id="date" name="date" value="<?php echo date("Y-m-d h:i:s");  ?>" readonly>
  40.                                         <span class="validation-color" ><?php echo form_error('date'); ?></span>
  41.                                     </div>
  42.  
  43.                                     <div class="form-group">
  44.                                         <label for="po_date">PO Date : <span class="validation-color">*</span></label>
  45.                                         <input type="text" class="form-control datepicker" id="po_date" name="po_date" value="<?php echo date("Y-m-d");  ?>">
  46.                                         <span class="validation-color" ><?php echo form_error('date'); ?></span>
  47.                                     </div>
  48.  
  49.                                     <div class="form-group">
  50.                                         <label for="supplier">Supplier : <span class="validation-color">*</span></label>
  51.                                         <select class="form-control select2" id="supplier" name="supplier" style="width: 100%;">
  52.                                             <option value=""><?php echo $this->lang->line('product_select'); ?></option>
  53.                                             <?php
  54.  
  55.                                             foreach ($supplier as $row) {
  56.                                                 echo "<option value='$row->supplier_id'".set_select('supplier_id',$row->supplier_id).">$row->cf1". ' - ' ." $row->supplier_name</option>";
  57.                                             }
  58.                                             ?>
  59.                                         </select>
  60.                                         <span class="validation-color" id="err_supplier"><?php echo form_error('supplier'); ?></span>
  61.                                     </div>
  62.  
  63.                                     <div class="form-group">
  64.                                         <label for="tax">Tax : </label>
  65.                                         <select name="tax"  class="form-control">
  66.                                             <option value='1'>Tax Include</option>
  67.                                             <option value='2'>Tax Exclude</option>
  68.                                             <option value='0'>No-Tax</option>
  69.                                         </select>
  70.                                     </div>
  71.  
  72.                                     <div class="form-group">
  73.                                         <label for="kursdata">Currency : <span class="validation-color">*</span></label>
  74.                                         <select class="form-control" id="kursdata" name="kursdata">
  75.                                             <?php
  76.                                             foreach($kursdata as $kursd)
  77.                                             {  
  78.                                                 echo "<option value='".$kursd->kurs_id."'>".$kursd->kurs."</option>";
  79.                                             }
  80.                                             ?>
  81.                                         </select>
  82.                                     </div>
  83.  
  84.                                     <div class="form-group" id="currency" style="display: none;">
  85.                                         <label for="ckurs">Currency Exchange : </label>
  86.                                         <input type="text" class="form-control" id="ckurs" name="ckurs" value="">
  87.                                         <input type="hidden" class="form-control" id="symbol" value="">
  88.                                     </div>                                 
  89.                                 </div>
  90.  
  91.                                 <div class="col-sm-6">
  92.                                    
  93.                                     <div class="form-group">
  94.                                         <label for="principal">Item Request No : </label>
  95.                                         <select class="form-control" id="itemrequest" name="itemrequest">
  96.                                             <option value="">Select Item Request</option>
  97.                                             <?php
  98.                                             foreach($itemrequest as $value)
  99.                                             {   ?>
  100.                                                 <option value="<?= $value->product_id ?>"><?= $value->po_new ? :$value->po; ?> -  <?= $value->code ?> <b style="color: green">(<?= $value->qty ?>)</b></option>;
  101.                                             <?php } ?>
  102.                                         </select>
  103.                                     </div>
  104.  
  105.                                     <div class="form-group">
  106.                                         <label for="principal">Reference No : </label>
  107.                                         <input type="text" class="form-control" id="refer_no" name="refer_no">
  108.                                     </div>
  109.  
  110.                                     <div class="form-group">
  111.                                         <label for="quotaattn">Purchase ATTN to :</label>
  112.                                         <div class="row">
  113.                                             <div class="col-md-6">
  114.                                                 <label for="main">Main</label>
  115.                                                 <input type="text" class="form-control" name="main" id="main">
  116.                                             </div>
  117.                                             <div class="col-md-6">
  118.                                                 <label for="cc">CC</label>
  119.                                                 <input type="text" class="form-control" name="cc" id="cc">
  120.                                             </div>
  121.                                         </div>
  122.                                     </div>
  123.  
  124.                                     <div class="form-group">
  125.                                         <label for="paymenterms">Payment Terms : <span class="validation-color">*</span></label>
  126.                                         <div class="row">
  127.                                             <div class="col-md-12">
  128.                                                 <label class="radio-inline">
  129.                                                     <input type="radio" name="paymenterms" value="advance" onclick="showo1()" checked> Advance
  130.                                                 </label>
  131.                                                 <label class="radio-inline">
  132.                                                     <input type="radio" name="paymenterms" value="termin" onclick="showo2()"> Termin
  133.                                                 </label>
  134.                                                 <label class="radio-inline">
  135.                                                     <input type="radio" name="paymenterms" value="others" onclick="showo3()"> Others
  136.                                                 </label>
  137.  
  138.                                             </div>
  139.                                         </div>
  140.                                         <div id="divo1" style="display: none;">
  141.                                         </div>
  142.                                         <div id="divo3" style="display: none;">
  143.                                             <input type="text" class="form-control" id="others" name="others" value="">
  144.                                         </div>
  145.                                         <div id="divo2" style="display: none;position: relative;top: 7px">
  146.                                             <label class="control-label nopadding">Jumlah Termin Kredit</label>
  147.                                             <div class="input-group">
  148.                                                 <select id="terminnumber" name="terminnumber" onclick="addFields()" class="form-control" >
  149.                                                     <?php
  150.                                                     for ($i = 1; $i <= 100; $i++) {
  151.                                                         echo "<option value='" . $i . "'>" . $i . "</option>";
  152.                                                     }
  153.                                                     ?>
  154.                                                 </select>
  155.                                             </div>
  156.                                         </div>
  157.                                         <div id="termincontainer">
  158.                                         </div>
  159.                                     </div>
  160.  
  161.                                     <div class="form-group">
  162.                                         <label for="shipping_address">Ship To : <span class="validation-color">*</span></label>
  163.                                         <select class="form-control select2" name="shipping_address" >
  164.                                             <?php
  165.                                             $shipping_address = explode(';', $company[0]->shipping_address);
  166.                                             foreach($shipping_address as $address){
  167.                                                 echo '<option value="' . $address . '">' . $address . '</option>';                                 
  168.                                             }
  169.                                             ?>                 
  170.                                         </select>
  171.                                     </div>
  172.  
  173.                                     <div class="form-group">
  174.                                         <label for="billing_address">Bill To : <span class="validation-color">*</span></label>
  175.                                         <select class="form-control select2" name="billing_address">
  176.                                             <?php
  177.                                             $billing_address = explode(';', $company[0]->billing_address);
  178.                                             foreach($billing_address as $address){
  179.                                                 echo '<option value="' . $address . '">' . $address . '</option>';
  180.                                             }
  181.                                             ?>
  182.                                         </select>
  183.                                     </div>
  184.                                     <div class="form-group">
  185.                                         <label for="dateestimate">Estimated Delivery Date<span class="validation-color"></span></label>
  186.                                         <input type="text" name="dateestimate" class="form-control datepicker">
  187.                                     </div>
  188.                                 </div>
  189.  
  190.                                 <div class="col-sm-12">
  191.                                     <div class="col-sm-12">
  192.                                         <br>
  193.                                         <h3>Produk Data</h3>
  194.                                         <div class="col-sm-3">
  195.                                             <div class="form-group">
  196.                                                 <select class="form-control select2" id="brand" name="brand" style="width: 100%;">
  197.                                                     <option value="">Select Brand</option>
  198.                                                     <?php foreach ($brands as $brand) { ?>
  199.                                                         <option value='<?= $brand->id ?>'><?= $brand->brand_name ?></option>
  200.                                                         <?php } ?>
  201.                                                     </select>
  202.                                                     <span class="validation-color" id="err_warehouse"><?php echo form_error('warehouse'); ?></span>
  203.                                                 </div>
  204.                                             </div>
  205.                                             <div class="col-sm-3">
  206.                                                 <div class="form-group">
  207.                                                     <select class="form-control select2" id="code_item" name="code_item" style="width: 100%;">
  208.                                                         <option value="">Select Part Number</option>
  209.                                                     </select>
  210.                                                 </div>
  211.                                             </div>
  212.                                             <div class="col-sm-3">
  213.                                                 <div class="form-group">
  214.                                                     <select class="form-control" id="product" name="product" style="width: 100%;">
  215.                                                         <option value=""><?php echo $this->lang->line('purchase_select_product'); ?></option>
  216.                                                     </select>
  217.                                                 </div>
  218.                                             </div>
  219.                                             <div class="col-sm-3">
  220.                                                 <a href="<?php echo base_url('product/add'); ?>" target="_blank" class="btn btn-info"><?php echo $this->lang->line('header_add'); ?> New Products</a>
  221.                                                 <span class="validation-color" id="err_product"></span>
  222.                                             </div>
  223.                                         </div>
  224.  
  225.  
  226.                                         <div class="col-sm-12">
  227.                                             <div class="form-group">
  228.                                                 <label><?php echo $this->lang->line('purchase_inventory_items'); ?></label>
  229.                                                 <div style="overflow-y: auto;">
  230.                                                     <table class="table items table-striped table-bordered table-condensed table-hover product_table" name="product_data" id="product_data">
  231.                                                         <thead>
  232.                                                             <tr>
  233.                                                                 <th width="3%"><img src="<?php echo base_url(); ?>assets/images/bin1.png" /></th>
  234.                                                                 <th class="span2" width="5%">Part Number</th>
  235.                                                                 <th class="span2" width="8%">Item Name</th>
  236.                                                                 <th class="span2" width="10%">Vendor or Item Name</th>
  237.                                                                 <th class="span2" width="8%">Description</th>
  238.                                                                 <th class="span2" width="8%">Qty</th>
  239.                                                                 <th class="span2" width="5%">Stock</th>
  240.                                                                 <th class="span2" width="5%">UOM</th>
  241.                                                                 <th class="span2" width="8%">Price</th>
  242.                                                                 <th class="span2" width="8%">Purchase Total</th>
  243.                                                                 <th class="span2" width="8%">Discount</th>
  244.                                                                 <th class="span2" width="8%">Total</th>
  245.                                                             </tr>
  246.                                                         </thead>
  247.                                                         <tbody>
  248.  
  249.                                                         </tbody>
  250.                                                     </table>
  251.                                                 </div>
  252.                                             </div>
  253.                                         </div>
  254.                                         <input type="hidden" name="total_value" id="total_value">
  255.                                         <input type="hidden" name="total_discount" id="total_discount">
  256.                                         <input type="hidden" name="total_tax" id="total_tax">
  257.                                         <input type="hidden" name="grand_total" id="grand_total">
  258.                                         <input type="hidden" name="grand_currency" id="grand_currency">
  259.                                         <input type="hidden" name="table_data" id="table_data">
  260.  
  261.                                         <table class="table table-striped table-bordered table-condensed table-hover">
  262.                                             <tr>
  263.                                                 <td align="right" width="80%"><?php echo $this->lang->line('purchase_total_value').'/Total Harga'; ?></td>
  264.                                                 <td align='right'><span id="kurs_symbol"></span><span id="totalValue">&nbsp;0.00</span></td>
  265.                                             </tr>
  266.                                             <tr>
  267.                                                 <td align="right"><?php echo $this->lang->line('purchase_total_discount'); ?></td>
  268.                                                 <td align='right'><span id="kurs_symbol1"></span>
  269.                                                 <span id="totalDiscount">&nbsp;0.00</span>
  270.                                             </td>
  271.                                         </tr>
  272.  
  273.                                        
  274.                                     <tr>
  275.                                         <td align="right"><?php echo "Diskon %"; ?></td>
  276.                                         <td align='right'>
  277.                                             <input type="number" class="text-right" onkeypress="return isNumber(event)"  id="diskonpersen_text" step="0.01" name="diskonpersen_text">
  278.                                         </td>
  279.                                     </tr>
  280.  
  281.                                     <tr style="display:none;">
  282.                                         <td align="right"><?php echo 'Jumlah Diskon %'; ?></td>
  283.                                         <td align='right'><span id="kurs_symbol2"></span>
  284.                                         <span id="JumlahDiskonPersen">&nbsp;0.00</span>
  285.                                     </td>
  286.                                 </tr>
  287.  
  288.                                 <tr>
  289.                                     <td align="right"><?php echo "Diskon Fix"; ?></td>
  290.                                     <td align='right'><span id="kurs_symbol3"></span>
  291.                                     <input type="number" step='0.01' class="text-right" onkeypress="return isNumber(event)"  id="diskon_text" name="diskon_text">
  292.                                 </td>
  293.                             </tr>
  294.  
  295.                             <tr>
  296.                                 <td align="right"><?php echo $this->lang->line('purchase_total_discount'); ?></td>
  297.                                 <td align='right'><span id="kurs_symbol4"></span>
  298.                                     <span id="totalDiskon">&nbsp;0.00</span>
  299.                                 </td>
  300.                             </tr>
  301.  
  302.                             <tr>
  303.                                 <td align="right">Tax</td>
  304.                                 <td align='right'>
  305.                                   <select class="form-control" name="taxx" id="taxx">
  306.                                       <option value="">Select Tax</option>
  307.                                     <?php foreach ($tax as $value) { ?>
  308.                                       <option value="<?= $value->tax_value ?>"><?= $value->tax_name ?></option>
  309.                                     <?php } ?>
  310.                                   </select>
  311.                                 </td>
  312.                              </tr>
  313.  
  314.                              <tr>
  315.                                             <td align="right"><?php echo $this->lang->line('purchase_total_tax').'/Pajak'; ?></td>
  316.                                             <td align='right'><span id="kurs_symbol5"></span>
  317.                                             <span id="totalTax">&nbsp;0.00</span>
  318.                                         </td>
  319.                                     </tr>
  320.  
  321.  
  322.  
  323.                         <tr>
  324.                             <td align="right"><?php echo $this->lang->line('purchase_total').'/Total Harga'; ?></td>
  325.                             <td align='right'><span id="kurs_symbol6"></span><span id="grandTotal">&nbsp;0.00</span></td>
  326.                         </tr>
  327.  
  328.                         <tr>
  329.                             <td align="right"><?php echo 'Currency Total :'; ?> </td>
  330.                             <td align='right'><span id="grandCurrency"></span></td>
  331.                         </tr>
  332.  
  333.                     </table>
  334.                     <hr>
  335.                     <a id="add-biaya" class="btn btn-success">Add Biaya</a>
  336.                     <hr>
  337.                     <table class="table table-bordered" border="1" id="tbl_biaya">
  338.                         <thead>
  339.                             <tr>
  340.                                 <td>Jenis Biaya</td>
  341.                                 <td>Keterangan</td>
  342.                                 <td>Add To Doc</td>
  343.                                 <td>File Upload</td>
  344.                                 <td>Nominal</td>
  345.                                 <td></td>
  346.                             </tr>
  347.                         </thead>
  348.                         <tbody>
  349.  
  350.                         </tbody>
  351.                         <tfoot>
  352.                             <tr>
  353.                                 <td colspan="3" align="right">Total Biaya</td>
  354.                                 <td colspan="2">
  355.                                     <span id="totalBiaya"></span>
  356.                                 </td>
  357.                             </tr>
  358.                         </tfoot>
  359.                     </table>
  360.                 </div>                           
  361.             </div>
  362.             <div class="col-sm-12">
  363.                 <div class="form-group">
  364.                     <label for="note"><?php echo $this->lang->line('purchase_note'); ?></label>
  365.                     <textarea class="form-control" id="note" name="note">
  366.                         - Pengiriman barang harus disertai dengan Faktur dan Surat Jalan <br>
  367.                         - Barang akan dikembalikan apabila tidak sesuai dengan pesanan <br>
  368.                         - No. PO harus dicantumkan di Faktur <br>
  369.                         - Apabila pengiriman barang dilakukan secara bertahap, setiap pengiriman harus disertakan fotocopy PO <br>
  370.                         - Cara pembayaran dengan transfer, 30 hari setelah barang diterima<?php echo set_value('details'); ?></textarea>
  371.                     <span class="validation-color" id="err_details"><?php echo form_error('details'); ?></span>
  372.                 </div>
  373.             </div>
  374.             <div class="col-sm-12">
  375.                 <div class="box-footer">
  376.                     <input type="submit" name="submit" id="submit" class="btn btn-info" value="Publish">
  377.                     <input type="submit" name="submit" id="submit" value="Save As Draft" class="btn btn-warning">
  378.                     <a href="#" data-toggle="modal" data-target="#previewmodal" id="preview" class="btn btn-default">Preview</a>
  379.                     <span class="btn btn-default" id="cancel" style="margin-left: 2%" onclick="cancel('purchase')"><?php echo $this->lang->line('product_cancel'); ?></span>
  380.                 </div>
  381.             </div>
  382.         </form>
  383.     </div>
  384. </div>
  385. </div>
  386. </div>
  387. </div>
  388. </section>
  389. </div>
  390.  
  391. <?php
  392. $this->load->view('layout/product_footer');
  393. $this->load->view('purchase/script/add');
  394. $this->load->view('purchase/modal/preview');
  395. ?>
Add Comment
Please, Sign In to add comment