<script type="text/javascript" src="<?php echo base_url();?>assets/js/inventory_purchase.js"></script>
<style>
.form-horizontal .nopadding {
	padding: 0px;
}
.form-horizontal .form-control {
	width: 100%;
	min-width: 100%;
	max-width: 100%;
}
.form-horizontal .input-group {
	max-width: 100%;
	min-width: 100%;
}
</style>
<aside class="right-side">
  <section class="content-header">
    <div class="title_bar">
      <h1 class="major_txt_color">Inventory – Purchase Management Add</h1>
      <div class="breadcrumb_container"><?php echo breadcrumb_links();?></div>
    </div>
  </section>
  <section class="content">
    <div class="row">
      <div class="col-xs-12">
        <form action="<?php echo $form_action;?>" method="post" name="purchase_form" class="form-horizontal add_form" enctype="multipart/form-data" method="post">
        <input type="hidden" name="hidden_id" value="" />
        <div class="box box-danger">
          <div class="box-body">
            <div class="box-body table-responsive" style="display: none;">
              <div class="alert alert-danger alert-dismissable"> <i class="fa fa-thumbs-o-down"></i>
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                <h4></h4>
              </div>
            </div>
            <ul class="error_container">
            </ul>
            <div class="col-md-12">
              <div class="form-group">
                <div class="col-md-4">
                  <select name="supplier_id" class="form-control select2">
                    <option value="">Select Supplier Name</option>
                    <?php foreach($suppliers as $key=>$supplier) {?>
                    <option value="<?php echo $supplier->id;?>"><?php echo $supplier->ven_company;?></option>
                    <?php } ?>
                  </select>
                </div>
                <div class="col-md-4">
                	<input type="text" class="form-control" name="purchase_ref_no" placeholder="Purchase Ref No" title="Purchase Ref No" alt="Purchase Ref No" value="<?php echo $purchase_ref_no; ?>" />
                </div>
              </div>
              <div class="form-group">
                <div class="col-md-4">
                  <input type="text" class="form-control" name="invoice_no" placeholder="Invoice No" value="<?php echo $inv_no; ?>" />
                </div>
                <div class="col-md-4">
                  <div class="input-group">
                    <input type="text" class="form-control datepicker" name="invoice_date" placeholder="Invoice Date" />
                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                  </div>
                </div>
              </div>
              <div class="form-group">
                <div class="col-md-4">
                  <input type="text" class="form-control" name="purchase_for" placeholder="Purchase for" />
                </div>
                <div class="col-md-4">
                  <div class="input-group">
                    <input type="text" class="form-control datepicker" name="received_date" placeholder="Receivable Date"/>
                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                  </div>
                </div>
              </div>
            </div>
            <div class="col-xs-12">
              <div class="col-md-6">
                <h4 class="major_txt_color">Item Details<span class="required">*</span></h4>
              </div>
            </div>
            <div class="col-xs-12 item_container">
              <div class="item float-clear">
                <div class="item_details">
                  <input type="hidden" name="poi_id[0]" class="poi_id" value="" />
                  <div class="col-md-3">
                    <div class="form-group">
                      <select name="category_id[0]" class="form-control select2 category_id" onchange="get_item_by_cat_id(this);">
                        <option value="">Select Category Name</option>
                        <?php foreach($categories as $key=>$category) {?>
                        <option value="<?php echo $category->id;?>"><?php echo $category->name;?></option>
                        <?php } ?>
                      </select>
                    </div>
                  </div>
                  <div class="col-md-3">
                    <div class="form-group">
                      <select name="item_id[0]" class="form-control select2 item_id" onchange="get_unit_by_item_id(this);">
                        <option value="">Select Item Name</option>
                      </select>
                    </div>
                  </div>
                  <div class="col-md-1">
                    <div class="form-group">
                      <input type="text" class="form-control cls-w-70 qty integer_value" name="qty[0]" placeholder="Qty" onkeyup="calculate_amount_by_qty(this)" />
                      <span class="uom" style="color:#0B45B3;"></span>
                      <input type="hidden" class="form-control hidden_uom" name="hidden_uom[]" />
                    </div>
                  </div>
                  <div class="col-md-2">
                    <div class="form-group">
                      <div class="input-group cls-w-100">
                        <div class="input-group-addon">$</div>
                        <input type="text" class="form-control float_value cls-w-100 price" name="price[0]" placeholder="Price" onkeyup="calculate_amount_by_price(this);" />
                      </div>
                    </div>
                  </div>
                  <div class="col-md-2">
                    <div class="form-group">
                      <div class="input-group cls-w-100">
                        <div class="input-group-addon">$</div>
                        <input type="text" class="form-control cls-w-100 amount sub_total" name="amount[0]" placeholder="Amount" readonly />
                      </div>
                    </div>
                  </div>
                </div>
                <div class="add_row_action">
                  <label class=""> <i class="fa fa-2x fa-plus-circle addButton add-row addRow_color"></i> </label>
                </div>
              </div>
            </div>
            <br/>
            <div class="col-md-12" style="margin-top:2%;">
            
              
              <div class="col-md-4">
              
                <div class="form-group">
                  <div class="input-group cls-w-100">
                    <div class="input-group-addon">$</div>
                    <input type="text" class="form-control" name="total" placeholder="Total Amount" readonly />
                  </div>
                </div>
                <div class="form-group">
                  <select name="payment" class="form-control select2">
                    <option value="">Select Payment Status</option>
                    <option value="1">Unpaid</option>
                    <option value="2">Paid</option>
                  </select>
                </div>
              </div>
              <div class="col-md-6">
                <div class="form-group">
                  <textarea class="form-control" name="desc" style="min-width: 100%; height:85px;" placeholder="Description"></textarea>
                </div>
              </div>
            </div>
          </div>
          <div class="box-footer form-actions">
            <input type="submit" name="submit" value="Submit" class="btn btn-primary" style="padding: 5px 50px;"/>
            <input class="btn btn-primary reset" type="reset" value="Reset" style="padding: 5px 50px;"/>
          </div>
        </div>
        <!-- /.box -->
        </form>
      </div>
      <!-- /.col-xs-12 --> 
    </div>
    <!-- /.row --> 
    
  </section>
  <!-- /.content --> 
</aside>
