Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- $p = array('1','31','32','51','52');
- if(!(in_array($this->session->userdata('type'),$p))){
- redirect('auth/dashboard');
- }
- $this->load->view('layout/header');
- ?>
- <div class="content-wrapper">
- <section class="content-header">
- <h5>
- <ol class="breadcrumb">
- <li><a href="<?php echo base_url('auth/dashboard'); ?>"><i class="fa fa-dashboard"></i> <?php echo $this->lang->line('header_dashboard'); ?></a></li>
- <li><a href="<?php echo base_url('purchase'); ?>"><?php echo $this->lang->line('header_purchase'); ?></a></li>
- <li class="active"><?php echo $this->lang->line('purchase_add_purchase'); ?></li>
- </ol>
- </h5>
- </section>
- <section class="content">
- <div class="row">
- <div class="col-sm-12">
- <div class="box">
- <div class="box-header with-border">
- <h3 class="box-title"><?php echo $this->lang->line('purchase_add_new_purchase'); ?></h3>
- </div>
- <div class="box-body">
- <div class="row">
- <form role="form" id="form" method="post" action="<?php echo base_url('index.php/purchase/addPurchase');?>" enctype="multipart/form-data">
- <div class="col-sm-6">
- <div class="form-group">
- <label for="reference_no">Nomor PO : </label>
- <input type="text" class="form-control" id="reference_no" name="reference_no" value="<?php echo set_value('reference_no', $reference_no); ?>">
- </div>
- <div class="form-group">
- <label for="date">Created Date : <span class="validation-color">*</span></label>
- <input type="text" class="form-control" id="date" name="date" value="<?php echo date("Y-m-d h:i:s"); ?>" readonly>
- <span class="validation-color" ><?php echo form_error('date'); ?></span>
- </div>
- <div class="form-group">
- <label for="po_date">PO Date : <span class="validation-color">*</span></label>
- <input type="text" class="form-control datepicker" id="po_date" name="po_date" value="<?php echo date("Y-m-d"); ?>">
- <span class="validation-color" ><?php echo form_error('date'); ?></span>
- </div>
- <div class="form-group">
- <label for="supplier">Supplier : <span class="validation-color">*</span></label>
- <select class="form-control select2" id="supplier" name="supplier" style="width: 100%;">
- <option value=""><?php echo $this->lang->line('product_select'); ?></option>
- <?php
- foreach ($supplier as $row) {
- echo "<option value='$row->supplier_id'".set_select('supplier_id',$row->supplier_id).">$row->cf1". ' - ' ." $row->supplier_name</option>";
- }
- ?>
- </select>
- <span class="validation-color" id="err_supplier"><?php echo form_error('supplier'); ?></span>
- </div>
- <div class="form-group">
- <label for="tax">Tax : </label>
- <select name="tax" class="form-control">
- <option value='1'>Tax Include</option>
- <option value='2'>Tax Exclude</option>
- <option value='0'>No-Tax</option>
- </select>
- </div>
- <div class="form-group">
- <label for="kursdata">Currency : <span class="validation-color">*</span></label>
- <select class="form-control" id="kursdata" name="kursdata">
- <?php
- foreach($kursdata as $kursd)
- {
- echo "<option value='".$kursd->kurs_id."'>".$kursd->kurs."</option>";
- }
- ?>
- </select>
- </div>
- <div class="form-group" id="currency" style="display: none;">
- <label for="ckurs">Currency Exchange : </label>
- <input type="text" class="form-control" id="ckurs" name="ckurs" value="">
- <input type="hidden" class="form-control" id="symbol" value="">
- </div>
- </div>
- <div class="col-sm-6">
- <div class="form-group">
- <label for="principal">Item Request No : </label>
- <select class="form-control" id="itemrequest" name="itemrequest">
- <option value="">Select Item Request</option>
- <?php
- foreach($itemrequest as $value)
- { ?>
- <option value="<?= $value->product_id ?>"><?= $value->po_new ? :$value->po; ?> - <?= $value->code ?> <b style="color: green">(<?= $value->qty ?>)</b></option>;
- <?php } ?>
- </select>
- </div>
- <div class="form-group">
- <label for="principal">Reference No : </label>
- <input type="text" class="form-control" id="refer_no" name="refer_no">
- </div>
- <div class="form-group">
- <label for="quotaattn">Purchase ATTN to :</label>
- <div class="row">
- <div class="col-md-6">
- <label for="main">Main</label>
- <input type="text" class="form-control" name="main" id="main">
- </div>
- <div class="col-md-6">
- <label for="cc">CC</label>
- <input type="text" class="form-control" name="cc" id="cc">
- </div>
- </div>
- </div>
- <div class="form-group">
- <label for="paymenterms">Payment Terms : <span class="validation-color">*</span></label>
- <div class="row">
- <div class="col-md-12">
- <label class="radio-inline">
- <input type="radio" name="paymenterms" value="advance" onclick="showo1()" checked> Advance
- </label>
- <label class="radio-inline">
- <input type="radio" name="paymenterms" value="termin" onclick="showo2()"> Termin
- </label>
- <label class="radio-inline">
- <input type="radio" name="paymenterms" value="others" onclick="showo3()"> Others
- </label>
- </div>
- </div>
- <div id="divo1" style="display: none;">
- </div>
- <div id="divo3" style="display: none;">
- <input type="text" class="form-control" id="others" name="others" value="">
- </div>
- <div id="divo2" style="display: none;position: relative;top: 7px">
- <label class="control-label nopadding">Jumlah Termin Kredit</label>
- <div class="input-group">
- <select id="terminnumber" name="terminnumber" onclick="addFields()" class="form-control" >
- <?php
- for ($i = 1; $i <= 100; $i++) {
- echo "<option value='" . $i . "'>" . $i . "</option>";
- }
- ?>
- </select>
- </div>
- </div>
- <div id="termincontainer">
- </div>
- </div>
- <div class="form-group">
- <label for="shipping_address">Ship To : <span class="validation-color">*</span></label>
- <select class="form-control select2" name="shipping_address" >
- <?php
- $shipping_address = explode(';', $company[0]->shipping_address);
- foreach($shipping_address as $address){
- echo '<option value="' . $address . '">' . $address . '</option>';
- }
- ?>
- </select>
- </div>
- <div class="form-group">
- <label for="billing_address">Bill To : <span class="validation-color">*</span></label>
- <select class="form-control select2" name="billing_address">
- <?php
- $billing_address = explode(';', $company[0]->billing_address);
- foreach($billing_address as $address){
- echo '<option value="' . $address . '">' . $address . '</option>';
- }
- ?>
- </select>
- </div>
- <div class="form-group">
- <label for="dateestimate">Estimated Delivery Date<span class="validation-color"></span></label>
- <input type="text" name="dateestimate" class="form-control datepicker">
- </div>
- </div>
- <div class="col-sm-12">
- <div class="col-sm-12">
- <br>
- <h3>Produk Data</h3>
- <div class="col-sm-3">
- <div class="form-group">
- <select class="form-control select2" id="brand" name="brand" style="width: 100%;">
- <option value="">Select Brand</option>
- <?php foreach ($brands as $brand) { ?>
- <option value='<?= $brand->id ?>'><?= $brand->brand_name ?></option>
- <?php } ?>
- </select>
- <span class="validation-color" id="err_warehouse"><?php echo form_error('warehouse'); ?></span>
- </div>
- </div>
- <div class="col-sm-3">
- <div class="form-group">
- <select class="form-control select2" id="code_item" name="code_item" style="width: 100%;">
- <option value="">Select Part Number</option>
- </select>
- </div>
- </div>
- <div class="col-sm-3">
- <div class="form-group">
- <select class="form-control" id="product" name="product" style="width: 100%;">
- <option value=""><?php echo $this->lang->line('purchase_select_product'); ?></option>
- </select>
- </div>
- </div>
- <div class="col-sm-3">
- <a href="<?php echo base_url('product/add'); ?>" target="_blank" class="btn btn-info"><?php echo $this->lang->line('header_add'); ?> New Products</a>
- <span class="validation-color" id="err_product"></span>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label><?php echo $this->lang->line('purchase_inventory_items'); ?></label>
- <div style="overflow-y: auto;">
- <table class="table items table-striped table-bordered table-condensed table-hover product_table" name="product_data" id="product_data">
- <thead>
- <tr>
- <th width="3%"><img src="<?php echo base_url(); ?>assets/images/bin1.png" /></th>
- <th class="span2" width="5%">Part Number</th>
- <th class="span2" width="8%">Item Name</th>
- <th class="span2" width="10%">Vendor or Item Name</th>
- <th class="span2" width="8%">Description</th>
- <th class="span2" width="8%">Qty</th>
- <th class="span2" width="5%">Stock</th>
- <th class="span2" width="5%">UOM</th>
- <th class="span2" width="8%">Price</th>
- <th class="span2" width="8%">Purchase Total</th>
- <th class="span2" width="8%">Discount</th>
- <th class="span2" width="8%">Total</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <input type="hidden" name="total_value" id="total_value">
- <input type="hidden" name="total_discount" id="total_discount">
- <input type="hidden" name="total_tax" id="total_tax">
- <input type="hidden" name="grand_total" id="grand_total">
- <input type="hidden" name="grand_currency" id="grand_currency">
- <input type="hidden" name="table_data" id="table_data">
- <table class="table table-striped table-bordered table-condensed table-hover">
- <tr>
- <td align="right" width="80%"><?php echo $this->lang->line('purchase_total_value').'/Total Harga'; ?></td>
- <td align='right'><span id="kurs_symbol"></span><span id="totalValue"> 0.00</span></td>
- </tr>
- <tr>
- <td align="right"><?php echo $this->lang->line('purchase_total_discount'); ?></td>
- <td align='right'><span id="kurs_symbol1"></span>
- <span id="totalDiscount"> 0.00</span>
- </td>
- </tr>
- <tr>
- <td align="right"><?php echo "Diskon %"; ?></td>
- <td align='right'>
- <input type="number" class="text-right" onkeypress="return isNumber(event)" id="diskonpersen_text" step="0.01" name="diskonpersen_text">
- </td>
- </tr>
- <tr style="display:none;">
- <td align="right"><?php echo 'Jumlah Diskon %'; ?></td>
- <td align='right'><span id="kurs_symbol2"></span>
- <span id="JumlahDiskonPersen"> 0.00</span>
- </td>
- </tr>
- <tr>
- <td align="right"><?php echo "Diskon Fix"; ?></td>
- <td align='right'><span id="kurs_symbol3"></span>
- <input type="number" step='0.01' class="text-right" onkeypress="return isNumber(event)" id="diskon_text" name="diskon_text">
- </td>
- </tr>
- <tr>
- <td align="right"><?php echo $this->lang->line('purchase_total_discount'); ?></td>
- <td align='right'><span id="kurs_symbol4"></span>
- <span id="totalDiskon"> 0.00</span>
- </td>
- </tr>
- <tr>
- <td align="right">Tax</td>
- <td align='right'>
- <select class="form-control" name="taxx" id="taxx">
- <option value="">Select Tax</option>
- <?php foreach ($tax as $value) { ?>
- <option value="<?= $value->tax_value ?>"><?= $value->tax_name ?></option>
- <?php } ?>
- </select>
- </td>
- </tr>
- <tr>
- <td align="right"><?php echo $this->lang->line('purchase_total_tax').'/Pajak'; ?></td>
- <td align='right'><span id="kurs_symbol5"></span>
- <span id="totalTax"> 0.00</span>
- </td>
- </tr>
- <tr>
- <td align="right"><?php echo $this->lang->line('purchase_total').'/Total Harga'; ?></td>
- <td align='right'><span id="kurs_symbol6"></span><span id="grandTotal"> 0.00</span></td>
- </tr>
- <tr>
- <td align="right"><?php echo 'Currency Total :'; ?> </td>
- <td align='right'><span id="grandCurrency"></span></td>
- </tr>
- </table>
- <hr>
- <a id="add-biaya" class="btn btn-success">Add Biaya</a>
- <hr>
- <table class="table table-bordered" border="1" id="tbl_biaya">
- <thead>
- <tr>
- <td>Jenis Biaya</td>
- <td>Keterangan</td>
- <td>Add To Doc</td>
- <td>File Upload</td>
- <td>Nominal</td>
- <td></td>
- </tr>
- </thead>
- <tbody>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="3" align="right">Total Biaya</td>
- <td colspan="2">
- <span id="totalBiaya"></span>
- </td>
- </tr>
- </tfoot>
- </table>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="form-group">
- <label for="note"><?php echo $this->lang->line('purchase_note'); ?></label>
- <textarea class="form-control" id="note" name="note">
- - Pengiriman barang harus disertai dengan Faktur dan Surat Jalan <br>
- - Barang akan dikembalikan apabila tidak sesuai dengan pesanan <br>
- - No. PO harus dicantumkan di Faktur <br>
- - Apabila pengiriman barang dilakukan secara bertahap, setiap pengiriman harus disertakan fotocopy PO <br>
- - Cara pembayaran dengan transfer, 30 hari setelah barang diterima<?php echo set_value('details'); ?></textarea>
- <span class="validation-color" id="err_details"><?php echo form_error('details'); ?></span>
- </div>
- </div>
- <div class="col-sm-12">
- <div class="box-footer">
- <input type="submit" name="submit" id="submit" class="btn btn-info" value="Publish">
- <input type="submit" name="submit" id="submit" value="Save As Draft" class="btn btn-warning">
- <a href="#" data-toggle="modal" data-target="#previewmodal" id="preview" class="btn btn-default">Preview</a>
- <span class="btn btn-default" id="cancel" style="margin-left: 2%" onclick="cancel('purchase')"><?php echo $this->lang->line('product_cancel'); ?></span>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- </div>
- <?php
- $this->load->view('layout/product_footer');
- $this->load->view('purchase/script/add');
- $this->load->view('purchase/modal/preview');
- ?>
Add Comment
Please, Sign In to add comment