@extends('layouts.app')
@section('title', __('lang_v1.add_purchase_order'))
@section('content')
@include('layouts.partials.error')
{!! Form::open(['url' => action([\App\Http\Controllers\PurchaseOrderController::class, 'store']), 'method' => 'post', 'id' => 'add_purchase_form', 'files' => true ]) !!}
@component('components.widget', ['class' => 'box-solid'])
@lang('business.address'):
{!! Form::label('ref_no', __('purchase.ref_no').':') !!}
{!! Form::text('ref_no', null, ['class' => 'form-control']); !!}
@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); !!}
@if(!empty($common_settings['enable_purchase_requisition']))
{!! Form::label('purchase_requisition_ids', __('lang_v1.purchase_requisition').':') !!}
{!! Form::select('purchase_requisition_ids[]', [], null, ['class' => 'form-control select2', 'multiple', 'id' => 'purchase_requisition_ids']); !!}
@endif
@endcomponent
@component('components.widget', ['class' => 'box-solid'])
@php
$hide_tax = '';
if( session()->get('business.enable_inline_tax') == 0){
$hide_tax = 'hide';
}
@endphp
# |
@lang( 'product.product_name' ) |
@lang( 'lang_v1.order_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( 'lang_v1.total_items' ): |
|
@lang( 'purchase.total_before_tax' ): |
|
@lang( 'purchase.net_total_amount' ): |
|
@endcomponent
@component('components.widget', ['class' => 'box-solid'])
{!! Form::label('shipping_details', __('sale.shipping_details')) !!}
{!! Form::textarea('shipping_details',null, ['class' => 'form-control','placeholder' => __('sale.shipping_details') ,'rows' => '3', 'cols'=>'30']); !!}
{!! Form::label('shipping_address', __('lang_v1.shipping_address')) !!}
{!! Form::textarea('shipping_address',null, ['class' => 'form-control','placeholder' => __('lang_v1.shipping_address') ,'rows' => '3', 'cols'=>'30']); !!}
{!! Form::label('shipping_status', __('lang_v1.shipping_status')) !!}
{!! Form::select('shipping_status',$shipping_statuses, null, ['class' => 'form-control','placeholder' => __('messages.please_select')]); !!}
{!! Form::label('delivered_to', __('lang_v1.delivered_to') . ':' ) !!}
{!! Form::text('delivered_to', null, ['class' => 'form-control','placeholder' => __('lang_v1.delivered_to')]); !!}
@php
$custom_labels = json_decode(session('business.custom_labels'), true);
$shipping_custom_label_1 = !empty($custom_labels['shipping']['custom_field_1']) ? $custom_labels['shipping']['custom_field_1'] : '';
$is_shipping_custom_field_1_required = !empty($custom_labels['shipping']['is_custom_field_1_required']) && $custom_labels['shipping']['is_custom_field_1_required'] == 1 ? true : false;
$shipping_custom_label_2 = !empty($custom_labels['shipping']['custom_field_2']) ? $custom_labels['shipping']['custom_field_2'] : '';
$is_shipping_custom_field_2_required = !empty($custom_labels['shipping']['is_custom_field_2_required']) && $custom_labels['shipping']['is_custom_field_2_required'] == 1 ? true : false;
$shipping_custom_label_3 = !empty($custom_labels['shipping']['custom_field_3']) ? $custom_labels['shipping']['custom_field_3'] : '';
$is_shipping_custom_field_3_required = !empty($custom_labels['shipping']['is_custom_field_3_required']) && $custom_labels['shipping']['is_custom_field_3_required'] == 1 ? true : false;
$shipping_custom_label_4 = !empty($custom_labels['shipping']['custom_field_4']) ? $custom_labels['shipping']['custom_field_4'] : '';
$is_shipping_custom_field_4_required = !empty($custom_labels['shipping']['is_custom_field_4_required']) && $custom_labels['shipping']['is_custom_field_4_required'] == 1 ? true : false;
$shipping_custom_label_5 = !empty($custom_labels['shipping']['custom_field_5']) ? $custom_labels['shipping']['custom_field_5'] : '';
$is_shipping_custom_field_5_required = !empty($custom_labels['shipping']['is_custom_field_5_required']) && $custom_labels['shipping']['is_custom_field_5_required'] == 1 ? true : false;
@endphp
@if(!empty($shipping_custom_label_1))
@php
$label_1 = $shipping_custom_label_1 . ':';
if($is_shipping_custom_field_1_required) {
$label_1 .= '*';
}
@endphp
{!! Form::label('shipping_custom_field_1', $label_1 ) !!}
{!! Form::text('shipping_custom_field_1', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_1, 'required' => $is_shipping_custom_field_1_required]); !!}
@endif
@if(!empty($shipping_custom_label_2))
@php
$label_2 = $shipping_custom_label_2 . ':';
if($is_shipping_custom_field_2_required) {
$label_2 .= '*';
}
@endphp
{!! Form::label('shipping_custom_field_2', $label_2 ) !!}
{!! Form::text('shipping_custom_field_2', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_2, 'required' => $is_shipping_custom_field_2_required]); !!}
@endif
@if(!empty($shipping_custom_label_3))
@php
$label_3 = $shipping_custom_label_3 . ':';
if($is_shipping_custom_field_3_required) {
$label_3 .= '*';
}
@endphp
{!! Form::label('shipping_custom_field_3', $label_3 ) !!}
{!! Form::text('shipping_custom_field_3', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_3, 'required' => $is_shipping_custom_field_3_required]); !!}
@endif
@if(!empty($shipping_custom_label_4))
@php
$label_4 = $shipping_custom_label_4 . ':';
if($is_shipping_custom_field_4_required) {
$label_4 .= '*';
}
@endphp
{!! Form::label('shipping_custom_field_4', $label_4 ) !!}
{!! Form::text('shipping_custom_field_4', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_4, 'required' => $is_shipping_custom_field_4_required]); !!}
@endif
@if(!empty($shipping_custom_label_5))
@php
$label_5 = $shipping_custom_label_5 . ':';
if($is_shipping_custom_field_5_required) {
$label_5 .= '*';
}
@endphp
{!! Form::label('shipping_custom_field_5', $label_5 ) !!}
{!! Form::text('shipping_custom_field_5', null, ['class' => 'form-control','placeholder' => $shipping_custom_label_5, 'required' => $is_shipping_custom_field_5_required]); !!}
@endif
@lang('lang_v1.additional_expense_name') |
@lang('sale.amount') |
{!! Form::text('additional_expense_key_1', null, ['class' => 'form-control']); !!}
|
{!! Form::text('additional_expense_value_1', 0, ['class' => 'form-control input_number', 'id' => 'additional_expense_value_1']); !!}
|
{!! Form::text('additional_expense_key_2', null, ['class' => 'form-control']); !!}
|
{!! Form::text('additional_expense_value_2', 0, ['class' => 'form-control input_number', 'id' => 'additional_expense_value_2']); !!}
|
{!! Form::text('additional_expense_key_3', null, ['class' => 'form-control']); !!}
|
{!! Form::text('additional_expense_value_3', 0, ['class' => 'form-control input_number', 'id' => 'additional_expense_value_3']); !!}
|
{!! Form::text('additional_expense_key_4', null, ['class' => 'form-control']); !!}
|
{!! Form::text('additional_expense_value_4', 0, ['class' => 'form-control input_number', 'id' => 'additional_expense_value_4']); !!}
|
{!! Form::hidden('final_total', 0 , ['id' => 'grand_total_hidden']); !!}
@lang('lang_v1.order_total'): 0
@endcomponent
@component('components.widget', ['class' => 'box-solid'])
{!! 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('additional_notes',__('purchase.additional_notes')) !!}
{!! Form::textarea('additional_notes', null, ['class' => 'form-control', 'rows' => 3]); !!}
|
@endcomponent
{!! Form::close() !!}
@include('contact.create', ['quick_add' => true])
@endsection
@section('javascript')
@include('purchase.partials.keyboard_shortcuts')
@endsection