@extends('layouts/inventory_layout') @section('title', '| ' . $pageTitle) @section('content')
{{ $pageTitle }}
{!! Form::open(array('url' => '', 'role' => 'form', 'class'=>'form-horizontal form-groups', 'id' => 'editPurchaseForm')) !!} {!! Form::hidden('purchase_id', $purchase->id, ['class' => 'form-control input-sm', 'id' => 'purchase_id']) !!}
{!! Form::label('billNo', 'Bill No:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('purchase_no', 'P'.$value = $purchase->purchase_no, ['class' => 'form-control', 'id' => 'purchase_no', 'type' => 'text','readonly','autocomplete'=>'off']) !!}

{!! Form::label('branch_id', 'Branch Name:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::select('branch_id', $branches, $purchase->branch_id, ['class' => 'form-control custom-select2', 'id' => 'branch_id','placeholder' => 'Select Branch','required'=>'required','autocomplete'=>'off']) !!}

{!! Form::label('purchase_date', 'Purchase Date:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('purchase_date',date('d-m-Y', strtotime($purchase->purchase_date)), ['class' => 'form-control', 'id' => 'purchase_date','readonly','autocomplete'=>'off']) !!}

@if(isset($purchase_orders) && count($purchase_orders) > 0)
{!! Form::label('order_id', 'Order No:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::select('order_id', $purchase_orders, $purchase->order_id, ['class' => 'form-control custom-select2', 'id' => 'order_id','placeholder' => 'Select Order No','autocomplete'=>'off']) !!}

{!! Form::label('order_date', 'Order Date:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('order_date', date('d-m-Y',strtotime($purchase->order_date)), ['class' => 'form-control', 'id' => 'order_date','readonly','autocomplete'=>'off']) !!}

@endif
{!! Form::label('chalan_no', 'Chalan No:', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('chalan_no', $purchase->chalan_no, array('class'=>'form-control', 'id' => 'chalan_no','placeholder' => 'Enter Chalan No','autocomplete'=>'off')) !!}

{!! Form::label('chalan_date', 'Chalan Date:', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('chalan_date', date('d-m-Y',strtotime($purchase->chalan_date)), ['class' => 'form-control', 'id' => 'chalan_date','readonly','autocomplete'=>'off']) !!}

{!! Form::label('supplier_id', 'Supplier:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::select('supplier_id', $suppliers, $purchase->supplier_id, ['class' => 'form-control custom-select2', 'id' => 'supplier_id','placeholder' => 'Select Supplier','required'=>'required','autocomplete'=>'off']) !!}

{!! Form::label('contact_person', 'Contact Person*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('contact_person', $value = $purchase->inv_supplier->name, ['class' => 'form-control', 'id' => 'contact_person', 'type' => 'text', 'readonly','placeholder' => 'Enter Contect Person','autocomplete'=>'off']) !!}

{!! Form::label('remarks', 'Remarks:', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::textarea('remarks', $purchase->remarks, array('class'=>'form-control','rows'=>2, 'id' => 'remarks','placeholder' => 'Enter Remarks','autocomplete'=>'off')) !!}

{!! Form::label('total_quantity', 'Total Quantity:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('total_quantity', $purchase->total_quantity, ['class' => 'form-control numeric', 'id' => 'total_quantity', 'readonly','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('total_amount', 'Total Amount:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('total_amount', round($purchase->total_amount, 2), ['class' => 'form-control numeric', 'id' => 'total_amount', 'readonly','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('discount', 'Discount:', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('discount_percent', $purchase->discount_percent, ['class' => 'form-control numeric col-sm-5', 'id' => 'discount_percent', 'placeholder'=>'%','min'=>'0','autocomplete'=>'off']) !!}
{!! Form::text('discount_amount', round($purchase->discount_amount,2), ['class' => 'form-control col-sm-7 numeric', 'id' => 'discount_amount','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('total_amount_after_discount', 'T/A After Discount:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('total_amount_after_discount', round($purchase->total_amount_after_discount,2), ['class' => 'form-control', 'id' => 'total_amount_after_discount', 'readonly','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('vat', 'VAT:', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('vat_percent', $purchase->vat_percent, ['class' => 'form-control numeric col-sm-5', 'id' => 'vat_percent', 'placeholder'=>'%','min'=>'0','autocomplete'=>'off']) !!}
{!! Form::text('vat_amount', round($purchase->vat_amount,2), ['class' => 'form-control col-sm-7 numeric', 'id' => 'vat_amount', 'readonly','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('gross_total', 'Gross Total:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('gross_total', round($purchase->gross_total,2), ['class' => 'form-control', 'id' => 'gross_total', 'readonly','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('pay_amount', 'Pay Amount:*', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('pay_amount', round($purchase->pay_amount,2), ['class' => 'form-control numeric', 'id' => 'pay_amount','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('purchase_due', 'Purchase Due:', ['class' => 'col-sm-4 control-label'],false) !!}
{!! Form::text('purchase_due', round($purchase->due_amount,2), ['class' => 'form-control numeric', 'id' => 'purchase_due','min'=>'0','autocomplete'=>'off']) !!}

{!! Form::label('group_id', 'Group:', ['class' => 'control-label col-sm-12']) !!}
{!! Form::label('category_id', 'Category:', ['class' => 'control-label col-sm-12']) !!}
{!! Form::label('sub_category_id', 'Subcatagory:', ['class' => 'control-label col-sm-12']) !!}
{!! Form::label('model_id', 'Model:', ['class' => 'control-label col-sm-12']) !!}
{{-- --}} {{-- --}} {{-- --}} @php $t_qty = 0; $t_price = 0; @endphp @foreach($purchase_details as $details) {{-- --}} @php $t_qty += $details->quantity; $t_price += $details->total_price; @endphp @endforeach
BarcodeProduct Name* Model Name* Qty* Price* Total* Remove
{{-- --}} {{$details->inv_product->name}}{{$details->inv_product->inv_model->name}}
Total Quantity {{$t_qty}} Total Amount {{$t_price}}
{!! Form::label('submit', ' ', ['class' => 'col-sm-4 control-label']) !!}
{!! Form::submit('Update', ['id' => 'add', 'class' => 'btn btn-info']); !!} Close
{!! Form::close() !!}