@extends('layouts.app')
@php
if (!empty($status) && $status == 'quotation') {
$title = __('lang_v1.add_quotation');
} else if (!empty($status) && $status == 'draft') {
$title = __('lang_v1.add_draft');
} else {
$title = __('sale.add_sale');
}
if($sale_type == 'sales_order') {
$title = __('lang_v1.sales_order');
}
@endphp
@section('title', $title)
@section('content')
@if(!empty($pos_settings['allow_overselling']))
@endif
@if(session('business.enable_rp') == 1)
@endif
@if(count($business_locations) > 0)
@endif
@php
$custom_labels = json_decode(session('business.custom_labels'), true);
$common_settings = session()->get('business.common_settings');
@endphp
{!! Form::open(['url' => action([\App\Http\Controllers\SellPosController::class, 'store']), 'method' => 'post', 'id' => 'add_sell_form', 'files' => true ]) !!}
@if(!empty($sale_type))
@endif
@component('components.widget', ['class' => 'box-solid','icon' => 'fa fa-download text-primary', 'title' => __('lang_v1.import_export_product_price')])
{!! Form::hidden('location_id', !empty($default_location) ? $default_location->id : null , ['id' => 'location_id', 'data-receipt_printer_type' => !empty($default_location->receipt_printer_type) ? $default_location->receipt_printer_type : 'browser', 'data-default_payment_accounts' => !empty($default_location) ? $default_location->default_payment_accounts : '']); !!}
@if(!empty($price_groups))
@if(count($price_groups) > 1)
@else
@php
reset($price_groups);
@endphp
{!! Form::hidden('price_group', key($price_groups), ['id' => 'price_group']) !!}
@endif
@endif
{!! Form::hidden('default_price_group', null, ['id' => 'default_price_group']) !!}
@if(in_array('types_of_service', $enabled_modules) && !empty($types_of_service))
@endif
@if(in_array('subscription', $enabled_modules))
@show_tooltip(__('lang_v1.recurring_invoice_help'))
@endif
@lang('lang_v1.billing_address'):
{!! $walk_in_customer['contact_address'] ?? '' !!}
@lang('lang_v1.shipping_address'):
{{$walk_in_customer['supplier_business_name'] ?? ''}},
{{$walk_in_customer['name'] ?? ''}},
{{$walk_in_customer['shipping_address'] ?? ''}}
@if(!empty($commission_agent))
@php
$is_commission_agent_required = !empty($pos_settings['is_commission_agent_required']);
@endphp
{!! Form::label('commission_agent', __('lang_v1.commission_agent') . ':') !!}
{!! Form::select('commission_agent',
$commission_agent, null, ['class' => 'form-control select2', 'id' => 'commission_agent', 'required' => $is_commission_agent_required]); !!}
@endif
{!! Form::label('transaction_date', __('sale.sale_date') . ':*') !!}
{!! Form::text('transaction_date', $default_datetime, ['class' => 'form-control bd-rd-7', 'readonly', 'required']); !!}
@if(!empty($status))
@if(in_array($status, ['draft', 'quotation']))
@endif
@else
{!! Form::label('status', __('sale.status') . ':*') !!}
{!! Form::select('status', $statuses, null, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select'), 'required']); !!}
@endif
@if($sale_type != 'sales_order')
{!! Form::label('invoice_scheme_id', __('invoice.invoice_scheme') . ':') !!}
{!! Form::select('invoice_scheme_id', $invoice_schemes, $default_invoice_schemes->id, ['class' => 'form-control select2', 'placeholder' => __('messages.please_select')]); !!}
@endif
@can('edit_invoice_number')
@endcan
@php
$custom_field_1_label = !empty($custom_labels['sell']['custom_field_1']) ? $custom_labels['sell']['custom_field_1'] : '';
$is_custom_field_1_required = !empty($custom_labels['sell']['is_custom_field_1_required']) && $custom_labels['sell']['is_custom_field_1_required'] == 1 ? true : false;
$custom_field_2_label = !empty($custom_labels['sell']['custom_field_2']) ? $custom_labels['sell']['custom_field_2'] : '';
$is_custom_field_2_required = !empty($custom_labels['sell']['is_custom_field_2_required']) && $custom_labels['sell']['is_custom_field_2_required'] == 1 ? true : false;
$custom_field_3_label = !empty($custom_labels['sell']['custom_field_3']) ? $custom_labels['sell']['custom_field_3'] : '';
$is_custom_field_3_required = !empty($custom_labels['sell']['is_custom_field_3_required']) && $custom_labels['sell']['is_custom_field_3_required'] == 1 ? true : false;
$custom_field_4_label = !empty($custom_labels['sell']['custom_field_4']) ? $custom_labels['sell']['custom_field_4'] : '';
$is_custom_field_4_required = !empty($custom_labels['sell']['is_custom_field_4_required']) && $custom_labels['sell']['is_custom_field_4_required'] == 1 ? true : false;
@endphp
@if(!empty($custom_field_1_label))
@php
$label_1 = $custom_field_1_label . ':';
if($is_custom_field_1_required) {
$label_1 .= '*';
}
@endphp
{!! Form::label('custom_field_1', $label_1 ) !!}
{!! Form::text('custom_field_1', null, ['class' => 'form-control bd-rd-7','placeholder' => '', 'required' => $is_custom_field_1_required]); !!}
@endif
@if(!empty($custom_field_2_label))
@php
$label_2 = $custom_field_2_label . ':';
if($is_custom_field_2_required) {
$label_2 .= '*';
}
@endphp
{!! Form::label('custom_field_2', $label_2 ) !!}
{!! Form::text('custom_field_2', null, ['class' => 'form-control bd-rd-7','placeholder' => '', 'required' => $is_custom_field_2_required]); !!}
@endif
@if(!empty($custom_field_3_label))
@php
$label_3 = $custom_field_3_label . ':';
if($is_custom_field_3_required) {
$label_3 .= '*';
}
@endphp
{!! Form::label('custom_field_3', $label_3 ) !!}
{!! Form::text('custom_field_3', null, ['class' => 'form-control bd-rd-7','placeholder' => '', 'required' => $is_custom_field_3_required]); !!}
@endif
@if(!empty($custom_field_4_label))
@php
$label_4 = $custom_field_4_label . ':';
if($is_custom_field_4_required) {
$label_4 .= '*';
}
@endphp
{!! Form::label('custom_field_4', $label_4 ) !!}
{!! Form::text('custom_field_4', null, ['class' => 'form-control bd-rd-7','placeholder' => '', 'required' => $is_custom_field_4_required]); !!}
@endif
@if((!empty($pos_settings['enable_sales_order']) && $sale_type != 'sales_order') || $is_order_request_enabled)
{!! Form::label('sales_order_ids', __('lang_v1.sales_order').':') !!}
{!! Form::select('sales_order_ids[]', [], null, ['class' => 'form-control select2', 'multiple', 'id' => 'sales_order_ids']); !!}
@endif
@if(in_array('tables' ,$enabled_modules) || in_array('service_staff' ,$enabled_modules))
@endif
@endcomponent
@component('components.widget', ['class' => 'box-solid','icon' => 'fa fa-search text-primary', 'title' => __('lang_v1.search_product_placeholder')])
@php
$hide_tax = '';
if( session()->get('business.enable_inline_tax') == 0){
$hide_tax = 'hide';
}
@endphp
@lang('sale.product')
|
@lang('sale.qty')
|
@if(!empty($pos_settings['inline_service_staff']))
@lang('restaurant.service_staff')
|
@endif
@lang('sale.unit_price')
|
@lang('receipt.discount')
|
@lang('sale.tax')
|
@lang('sale.price_inc_tax')
|
@if(!empty($common_settings['enable_product_warranty']))
@lang('lang_v1.warranty') |
@endif
@lang('sale.subtotal')
|
|
@lang('sale.item'):
0
@lang('sale.total'):
0
|
@endcomponent
@component('components.widget', ['class' => 'box-solid','icon' => 'fa fa-percent text-primary', 'title' => __('lang_v1.item_discount')])
{!! Form::label('discount_type', __('sale.discount_type') . ':*' ) !!}
{!! Form::select('discount_type', ['fixed' => __('lang_v1.fixed'), 'percentage' => __('lang_v1.percentage')], 'percentage' , ['class' => 'form-control select2','placeholder' => __('messages.please_select'), 'required', 'data-default' => 'percentage']); !!}
@php
$max_discount = !is_null(auth()->user()->max_sales_discount_percent) ? auth()->user()->max_sales_discount_percent : '';
//if sale discount is more than user max discount change it to max discount
$sales_discount = $business_details->default_sales_discount;
if($max_discount != '' && $sales_discount > $max_discount) $sales_discount = $max_discount;
$default_sales_tax = $business_details->default_sales_tax;
if($sale_type == 'sales_order') {
$sales_discount = 0;
$default_sales_tax = null;
}
@endphp
{!! Form::label('discount_amount', __('sale.discount_amount') . ':*' ) !!}
{!! Form::text('discount_amount', @num_format($sales_discount), ['class' => 'form-control input_number bd-rd-7', 'data-default' => $sales_discount, 'data-max-discount' => $max_discount, 'data-max-discount-error_msg' => __('lang_v1.max_discount_error_msg', ['discount' => $max_discount != '' ? @num_format($max_discount) : '']) ]); !!}
@lang( 'sale.discount_amount' ):(-)
0
{{session('business.rp_name')}}
{!! Form::label('rp_redeemed_modal', __('lang_v1.redeemed') . ':' ) !!}
{!! Form::number('rp_redeemed_modal', 0, ['class' => 'form-control direct_sell_rp_input bd-rd-7', 'data-amount_per_unit_point' => session('business.redeem_amount_per_unit_rp'), 'min' => 0, 'data-max_points' => 0, 'data-min_order_total' => session('business.min_order_total_for_redeem') ]); !!}
@lang('lang_v1.available'): 0
@lang('lang_v1.redeemed_amount'): (-)0
{!! Form::label('tax_rate_id', __('sale.order_tax') . ':*' ) !!}
{!! Form::select('tax_rate_id', $taxes['tax_rates'], $default_sales_tax, ['placeholder' => __('messages.please_select'), 'class' => 'form-control select2', 'data-default'=> $default_sales_tax], $taxes['attributes']); !!}
@lang( 'sale.order_tax' ):(+)
0
{!! Form::label('sell_note',__('sale.sell_note')) !!}
{!! Form::textarea('sale_note', null, ['class' => 'form-control bd-rd-7', 'rows' => 3]); !!}
@endcomponent
@component('components.widget', ['class' => 'box-solid','icon' => 'fa fa-shipping-fast text-primary', 'title' => __('lang_v1.shipping_charges')])
{!! Form::label('shipping_details', __('sale.shipping_details')) !!}
{!! Form::textarea('shipping_details',null, ['class' => 'form-control bd-rd-7','placeholder' => __('sale.shipping_details') ,'rows' => '3', 'cols'=>'30']); !!}
{!! Form::label('shipping_address', __('lang_v1.shipping_address')) !!}
{!! Form::textarea('shipping_address',null, ['class' => 'form-control bd-rd-7','placeholder' => __('lang_v1.shipping_address') ,'rows' => '3', 'cols'=>'30']); !!}
{!!Form::label('shipping_charges', __('sale.shipping_charges'))!!}
{!!Form::text('shipping_charges',@num_format(0.00),['class'=>'form-control input_number bd-rd-7','placeholder'=> __('sale.shipping_charges')]);!!}
{!! Form::label('shipping_status', __('lang_v1.shipping_status')) !!}
{!! Form::select('shipping_status',$shipping_statuses, null, ['class' => 'form-control bd-rd-7','placeholder' => __('messages.please_select')]); !!}
{!! Form::label('delivered_to', __('lang_v1.delivered_to') . ':' ) !!}
{!! Form::text('delivered_to', null, ['class' => 'form-control bd-rd-7','placeholder' => __('lang_v1.delivered_to')]); !!}
{!! Form::label('delivery_person', __('lang_v1.delivery_person') . ':' ) !!}
{!! Form::select('delivery_person', $users, null, ['class' => 'form-control select2','placeholder' => __('messages.please_select')]); !!}
@php
$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', !empty($walk_in_customer['shipping_custom_field_details']['shipping_custom_field_1']) ? $walk_in_customer['shipping_custom_field_details']['shipping_custom_field_1'] : null, ['class' => 'form-control bd-rd-7','placeholder' => '', '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', !empty($walk_in_customer['shipping_custom_field_details']['shipping_custom_field_2']) ? $walk_in_customer['shipping_custom_field_details']['shipping_custom_field_2'] : null, ['class' => 'form-control bd-rd-7','placeholder' => '', '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', !empty($walk_in_customer['shipping_custom_field_details']['shipping_custom_field_3']) ? $walk_in_customer['shipping_custom_field_details']['shipping_custom_field_3'] : null, ['class' => 'form-control bd-rd-7','placeholder' => '', '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', !empty($walk_in_customer['shipping_custom_field_details']['shipping_custom_field_4']) ? $walk_in_customer['shipping_custom_field_details']['shipping_custom_field_4'] : null, ['class' => 'form-control bd-rd-7','placeholder' => '', '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', !empty($walk_in_customer['shipping_custom_field_details']['shipping_custom_field_5']) ? $walk_in_customer['shipping_custom_field_details']['shipping_custom_field_5'] : null, ['class' => 'form-control bd-rd-7','placeholder' => '', '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 bd-rd-7', 'id' => 'additional_expense_key_1']); !!}
|
{!! Form::text('additional_expense_value_1', 0, ['class' => 'form-control input_number bd-rd-7', 'id' => 'additional_expense_value_1']); !!}
|
{!! Form::text('additional_expense_key_2', null, ['class' => 'form-control bd-rd-7', 'id' => 'additional_expense_key_2']); !!}
|
{!! Form::text('additional_expense_value_2', 0, ['class' => 'form-control input_number bd-rd-7', 'id' => 'additional_expense_value_2']); !!}
|
{!! Form::text('additional_expense_key_3', null, ['class' => 'form-control bd-rd-7', 'id' => 'additional_expense_key_3']); !!}
|
{!! Form::text('additional_expense_value_3', 0, ['class' => 'form-control input_number bd-rd-7', 'id' => 'additional_expense_value_3']); !!}
|
{!! Form::text('additional_expense_key_4', null, ['class' => 'form-control bd-rd-7', 'id' => 'additional_expense_key_4']); !!}
|
{!! Form::text('additional_expense_value_4', 0, ['class' => 'form-control input_number bd-rd-7', 'id' => 'additional_expense_value_4']); !!}
|
@if(!empty($pos_settings['amount_rounding_method']) && $pos_settings['amount_rounding_method'] > 0)
(@lang('lang_v1.round_off'): 0)
@endif
@lang('sale.total_payable'):
0
@endcomponent
@if(!empty($common_settings['is_enabled_export']) && $sale_type != 'sales_order')
@component('components.widget', ['class' => 'box-solid','icon' => 'fa fa-file=export text-primary', 'title' => __('lang_v1.export')])
@php
$i = 1;
@endphp
@for($i; $i <= 6 ; $i++)
{!! Form::label('export_custom_field_'.$i, __('lang_v1.export_custom_field'.$i).':') !!}
{!! Form::text('export_custom_fields_info['.'export_custom_field_'.$i.']', !empty($walk_in_customer['export_custom_field_'.$i]) ? $walk_in_customer['export_custom_field_'.$i] : null, ['class' => 'form-control bd-rd-7','placeholder' => '', 'id' => 'export_custom_field_'.$i]); !!}
@endfor
@endcomponent
@endif
@php
$is_enabled_download_pdf = config('constants.enable_download_pdf');
$payment_body_id = 'payment_rows_div';
if ($is_enabled_download_pdf) {
$payment_body_id = '';
}
@endphp
@if((empty($status) || (!in_array($status, ['quotation', 'draft'])) || $is_enabled_download_pdf) && $sale_type != 'sales_order')
@can('sell.payments')
@component('components.widget', ['class' => 'box-solid', 'icon' => 'fa fa-plus text-primary', 'id' => $payment_body_id, 'title' => __('purchase.add_payment')])
@if($is_enabled_download_pdf)
{!! Form::label("prefer_payment_method" , __('lang_v1.prefer_payment_method') . ':') !!}
@show_tooltip(__('lang_v1.this_will_be_shown_in_pdf'))
{!! Form::select("prefer_payment_method", $payment_types, 'cash', ['class' => 'form-control select2','style' => 'width:100%;']); !!}
{!! Form::label("prefer_payment_account" , __('lang_v1.prefer_payment_account') . ':') !!}
@show_tooltip(__('lang_v1.this_will_be_shown_in_pdf'))
{!! Form::select("prefer_payment_account", $accounts, null, ['class' => 'form-control select2','style' => 'width:100%;']); !!}
@endif
@if(empty($status) || !in_array($status, ['quotation', 'draft']))
@lang('lang_v1.advance_balance'):
{!! 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, 'show_denomination' => true])
@lang('lang_v1.change_return'):
0
{!! Form::hidden("change_return", $change_return['amount'], ['class' => 'form-control change_return input_number', 'required', 'id' => "change_return"]); !!}
@if(!empty($change_return['id']))
@endif
{!! Form::label("change_return_method" , __('lang_v1.change_return_payment_method') . ':*') !!}
@php
$_payment_method = empty($change_return['method']) && array_key_exists('cash', $payment_types) ? 'cash' : $change_return['method'];
$_payment_types = $payment_types;
if(isset($_payment_types['advance'])) {
unset($_payment_types['advance']);
}
@endphp
{!! Form::select("payment[change_return][method]", $_payment_types, $_payment_method, ['class' => 'form-control col-md-12 payment_types_dropdown select2', 'id' => 'change_return_method', 'style' => 'width:100%;']); !!}
@if(!empty($accounts))
{!! Form::label("change_return_account" , __('lang_v1.change_return_payment_account') . ':') !!}
{!! Form::select("payment[change_return][account_id]", $accounts, !empty($change_return['account_id']) ? $change_return['account_id'] : '' , ['class' => 'form-control select2', 'id' => 'change_return_account', 'style' => 'width:100%;']); !!}
@endif
@include('sale_pos.partials.payment_type_details', ['payment_line' => $change_return, 'row_index' => 'change_return'])
@lang('lang_v1.balance'): 0.00
@endif
@endcomponent
@endcan
@endif
{!! Form::hidden('is_save_and_print', 0, ['id' => 'is_save_and_print']); !!}
@if(empty($pos_settings['disable_recurring_invoice']))
@include('sale_pos.partials.recurring_invoice_modal')
@endif
{!! Form::close() !!}
@include('contact.create', ['quick_add' => true])
@include('sale_pos.partials.configure_search_modal')
@stop
@section('javascript')
@if(in_array('tables' ,$enabled_modules) || in_array('modifiers' ,$enabled_modules) || in_array('service_staff' ,$enabled_modules))
@endif
@endsection