@extends('layouts.app')
@section('title', ($sub_type ?? null) === 'downpayment' ? 'New Downpayment ยท POS' : __('sale.pos_sale'))
@section('content')
@if (!empty($pos_settings['allow_overselling']))
@endif
@if (session('business.enable_rp') == 1)
@endif
@php
$is_discount_enabled = $pos_settings['disable_discount'] != 1 ? true : false;
$is_rp_enabled = session('business.enable_rp') == 1 ? true : false;
$show_category_suggestion = session('business.enable_category') == 1 && empty($pos_settings['hide_category_suggestion']) && !empty($categories);
$show_brand_suggestion = session('business.enable_brand') == 1 && empty($pos_settings['hide_brand_suggestion']) && !empty($brands);
$show_pos_suggestions = $show_category_suggestion || $show_brand_suggestion;
$is_pos_downpayment = ($sub_type ?? null) === 'downpayment';
@endphp
@if ($business_details->offlineSalesEnabled() && !$is_pos_downpayment)
@include('sale_pos.partials.offline_sales')
@endif
@if($is_pos_downpayment)
@include('sale_pos.partials.downpayment_pos_guide')
@endif
{!! Form::open([
'url' => action([\App\Http\Controllers\SellPosController::class, 'store']),
'method' => 'post',
'id' => 'add_pos_sell_form',
'files' => true,
]) !!}
@if ($business_details->offlineSalesEnabled() && !$is_pos_downpayment)
@endif
@if(!empty($exchange_sale))
{!! Form::hidden('exchange_parent_id', $exchange_sale->id) !!}
@endif
@php
// Exchange credit (return total) starts at 0 and is computed client-side from selected return items.
// If this page is opened via the legacy exchange redirect, we still show the summary box prefilled.
$exchange_return_total = 0;
if (!empty($exchange_sale)) {
$exchange_return_total = request()->has('exchange_return_total')
? (float) request()->get('exchange_return_total')
: 0;
}
@endphp
Exchange Credit (Return Total):
0
for invoice {{ $exchange_sale->invoice_no ?? '' }}
New Sale Total:
0
Customer Pays:
0
{!! Form::hidden('location_id', $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' => $default_location->default_payment_accounts ?? '',
]) !!}
{!! Form::hidden('sub_type', isset($sub_type) ? $sub_type : null) !!}
@if ($business_details->advancedPromotionsEnabled())
@include('sale_pos.partials.advanced_promotions')
@endif
@include('sale_pos.partials.pos_form')
@include('sale_pos.partials.pos_form_totals')
@include('sale_pos.partials.payment_modal')
@if (empty($pos_settings['disable_suspend']))
@include('sale_pos.partials.suspend_note_modal')
@endif
@if (empty($pos_settings['disable_recurring_invoice']))
@include('sale_pos.partials.recurring_invoice_modal')
@endif
@if ($show_pos_suggestions && !isMobile())
@endif
@include('sale_pos.partials.pos_form_actions')
{!! Form::close() !!}
@include('contact.create', ['quick_add' => true])
@if ($show_pos_suggestions && isMobile())
@include('sale_pos.partials.mobile_product_suggestions')
@endif
@include('sale_pos.partials.configure_search_modal')
@include('sale_pos.partials.product_picker_modal')
@include('sale_pos.partials.recent_transactions_modal')
@include('sale_pos.partials.weighing_scale_modal')
@include('sale_pos.partials.exchange_modal')
@include('sale_pos.partials.sell_return_modal')
@if($business_details->managerPinApprovalsEnabled() && !$is_pos_downpayment)
@include('sale_pos.partials.remote_manager_approval_modal')
@endif
@if(!$is_pos_downpayment && !$business_details->managerPinApprovalsEnabled())
@include('sale_pos.partials.below_cost_price_approval_modal')
@include('sale_pos.partials.discount_approval_modal')
@endif
@stop
@section('css')
@if (!empty($pos_module_data))
@foreach ($pos_module_data as $key => $value)
@if (!empty($value['module_css_path']))
@includeIf($value['module_css_path'])
@endif
@endforeach
@endif
@stop
@section('javascript')
@if ($business_details->offlineSalesEnabled())
@endif
@include('sale_pos.partials.keyboard_shortcuts')
@if (in_array('tables', $enabled_modules) ||
in_array('modifiers', $enabled_modules) ||
in_array('service_staff', $enabled_modules))
@endif
@if (!empty($pos_module_data))
@foreach ($pos_module_data as $key => $value)
@if (!empty($value['module_js_path']))
@includeIf($value['module_js_path'], ['view_data' => $value['view_data']])
@endif
@endforeach
@endif
@include('sale_pos.partials.pos_layout_script', ['form_id' => 'add_pos_sell_form'])
@endsection