@extends('layouts.app') @section('title', __('purchase.add_purchase')) @section('content')

@lang('purchase.add_purchase')

@include('layouts.partials.error') {!! Form::open(['url' => action('PurchaseController@store'), 'method' => 'post', 'id' => 'add_purchase_form', 'files' => true ]) !!} @component('components.widget', ['class' => 'box-primary'])
{!! Form::label('supplier_id', __('purchase.supplier') . ':*') !!}
{!! Form::select('contact_id', [], null, ['class' => 'form-control', 'placeholder' => __('messages.please_select'), 'required', 'id' => 'supplier_id']); !!}
@lang('business.address'):
{!! Form::label('ref_no', __('purchase.ref_no').':') !!} @show_tooltip(__('lang_v1.leave_empty_to_autogenerate')) {!! Form::text('ref_no', null, ['class' => 'form-control']); !!}
{!! Form::label('transaction_date', __('purchase.purchase_date') . ':*') !!}
{!! Form::text('transaction_date', @format_datetime('now'), ['class' => 'form-control', 'readonly', 'required']); !!}
{!! Form::label('status', __('purchase.purchase_status') . ':*') !!} @show_tooltip(__('tooltip.order_status')) {!! Form::select('status', $orderStatuses, $default_purchase_status, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required']); !!}
@if(count($business_locations) == 1) @php $default_location = current(array_keys($business_locations->toArray())); $search_disable = false; @endphp @else @php $default_location = null; $search_disable = true; @endphp @endif
{!! Form::label('location_id', __('purchase.business_location').':*') !!} @show_tooltip(__('tooltip.purchase_location')) {!! Form::select('location_id', $business_locations, $default_location, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required'], $bl_attributes); !!}
{!! Form::label('exchange_rate', __('purchase.p_exchange_rate') . ':*') !!} @show_tooltip(__('tooltip.currency_exchange_factor'))
{!! Form::number('exchange_rate', $currency_details->p_exchange_rate, ['class' => 'form-control', 'required', 'step' => 0.001]); !!}
@lang('purchase.diff_purchase_currency_help', ['currency' => $currency_details->name])
{!! Form::label('pay_term_number', __('contact.pay_term') . ':') !!} @show_tooltip(__('tooltip.pay_term'))
{!! Form::number('pay_term_number', null, ['class' => 'form-control width-40 pull-left', 'placeholder' => __('contact.pay_term')]); !!} {!! Form::select('pay_term_type', ['months' => __('lang_v1.months'), 'days' => __('lang_v1.days')], null, ['class' => 'form-control width-60 pull-left','placeholder' => __('messages.please_select'), 'id' => 'pay_term_type']); !!}
{!! Form::label('document', __('purchase.attach_document') . ':') !!} {!! Form::file('document', ['id' => 'upload_document', 'accept' => implode(',', array_keys(config('constants.document_upload_mimes_types')))]); !!}

@lang('purchase.max_file_size', ['size' => (config('constants.document_size_limit') / 1000000)]) @includeIf('components.document_help_text')

@endcomponent @component('components.widget', ['class' => 'box-primary'])
{!! Form::text('search_product', null, ['class' => 'form-control mousetrap', 'id' => 'search_product', 'placeholder' => __('lang_v1.search_product_placeholder'), 'disabled' => $search_disable]); !!}
@php $hide_tax = ''; if( session()->get('business.enable_inline_tax') == 0){ $hide_tax = 'hide'; } @endphp
@if(session('business.enable_lot_number')) @endif @if(session('business.enable_product_expiry')) @endif
# @lang( 'product.product_name' ) @lang( 'purchase.purchase_quantity' ) @lang( 'lang_v1.unit_cost_before_discount' ) @lang( 'lang_v1.discount_percent' ) @lang( 'purchase.unit_cost_before_tax' ) @lang( 'purchase.subtotal_before_tax' ) @lang( 'purchase.product_tax' ) @lang( 'purchase.net_cost' ) @lang( 'purchase.line_total' ) @lang( 'lang_v1.profit_margin' ) @lang( 'purchase.unit_selling_price' ) (@lang('product.inc_of_tax')) @lang('lang_v1.lot_number') @lang('product.mfg_date') / @lang('product.exp_date')

@lang( 'lang_v1.total_items' ):
@lang( 'purchase.total_before_tax' ):
@lang( 'purchase.net_total_amount' ):
@endcomponent @component('components.widget', ['class' => 'box-primary'])
{!! Form::label('discount_type', __( 'purchase.discount_type' ) . ':') !!} {!! Form::select('discount_type', [ '' => __('lang_v1.none'), 'fixed' => __( 'lang_v1.fixed' ), 'percentage' => __( 'lang_v1.percentage' )], '', ['class' => 'form-control select2']); !!}
{!! Form::label('discount_amount', __( 'purchase.discount_amount' ) . ':') !!} {!! Form::text('discount_amount', 0, ['class' => 'form-control input_number', 'required']); !!}
  @lang( 'purchase.discount' ):(-) 0
{!! Form::label('tax_id', __('purchase.purchase_tax') . ':') !!} {!! Form::hidden('tax_amount', 0, ['id' => 'tax_amount']); !!}
    @lang( 'purchase.purchase_tax' ):(+) 0
{!! Form::label('shipping_details', __( 'purchase.shipping_details' ) . ':') !!} {!! Form::text('shipping_details', null, ['class' => 'form-control']); !!}
   
{!! Form::label('shipping_charges','(+) ' . __( 'purchase.additional_shipping_charges' ) . ':') !!} {!! Form::text('shipping_charges', 0, ['class' => 'form-control input_number', 'required']); !!}
      {!! Form::hidden('final_total', 0 , ['id' => 'grand_total_hidden']); !!} @lang('purchase.purchase_total'): 0
{!! Form::label('additional_notes',__('purchase.additional_notes')) !!} {!! Form::textarea('additional_notes', null, ['class' => 'form-control', 'rows' => 3]); !!}
@endcomponent @component('components.widget', ['class' => 'box-primary', 'title' => __('purchase.add_payment')])
@lang('lang_v1.advance_balance'): 0 {!! Form::hidden('advance_balance', null, ['id' => 'advance_balance', 'data-error-msg' => __('lang_v1.required_advance_balance_not_available')]); !!}
@include('sale_pos.partials.payment_row_form', ['row_index' => 0, 'show_date' => true])
@lang('purchase.payment_due'): 0.00

@endcomponent {!! Form::close() !!}
@endsection @section('javascript') @include('purchase.partials.keyboard_shortcuts') @endsection