@foreach ($sells as $sell)
@php
$custom_labels = json_decode(session('business.custom_labels'), true);
$export_custom_fields = [];
if (!empty($sell->is_export) && !empty($sell->export_custom_fields_info)) {
$export_custom_fields = $sell->export_custom_fields_info;
}
$line_taxes = [];
foreach ($sell->sell_lines as $key => $value) {
if (!empty($value->sub_unit_id)) {
$formated_sell_line = $transactionUtil->recalculateSellLineTotals($business_id, $value);
$sell->sell_lines[$key] = $formated_sell_line;
}
if (!empty($taxes[$value->tax_id])) {
if (isset($line_taxes[$taxes[$value->tax_id]])) {
$line_taxes[$taxes[$value->tax_id]] += $value->item_tax * $value->quantity;
} else {
$line_taxes[$taxes[$value->tax_id]] = $value->item_tax * $value->quantity;
}
}
}
$payment_types = $transactionUtil->payment_types($sell->location_id, true);
$order_taxes = [];
if (!empty($sell->tax)) {
if ($sell->tax->is_tax_group) {
$order_taxes = $transactionUtil->sumGroupTaxDetails(
$transactionUtil->groupTaxDetails($sell->tax, $sell->tax_amount),
);
} else {
$order_taxes[$sell->tax->name] = $sell->tax_amount;
}
}
@endphp
@component('components.widget', ['class' => 'box-primary'])
@lang('messages.date'):
{{ @format_date($sell->transaction_date) }}
@if ($sell->type == 'sales_order')
{{ __('restaurant.order_no') }}
@else
{{ __('sale.invoice_no') }}
@endif:
#{{ $sell->invoice_no }}
@if (!empty($sell->sale_orders))
{{ __('Sale Order No : ') }}
# {{ $sell->sale_orders->invoice_no }}
@endif
{{ __('sale.status') }}:
@if ($sell->status == 'draft' && $sell->is_quotation == 1)
{{ __('lang_v1.quotation') }}
@else
{{ $statuses[$sell->status] ?? __('sale.' . $sell->status) }}
@endif
@if ($sell->type != 'sales_order')
{{ __('sale.payment_status') }}:
@if (!empty($sell->payment_status))
{{ __('lang_v1.' . $sell->payment_status) }}
@endif
@endif
@if (!empty($custom_labels['sell']['custom_field_1']))
{{ $custom_labels['sell']['custom_field_1'] ?? '' }}:
{{ $sell->custom_field_1 }}
@endif
@if (!empty($custom_labels['sell']['custom_field_2']))
{{ $custom_labels['sell']['custom_field_2'] ?? '' }}:
{{ $sell->custom_field_2 }}
@endif
@if (!empty($custom_labels['sell']['custom_field_3']))
{{ $custom_labels['sell']['custom_field_3'] ?? '' }}:
{{ $sell->custom_field_3 }}
@endif
@if (!empty($custom_labels['sell']['custom_field_4']))
{{ $custom_labels['sell']['custom_field_4'] ?? '' }}:
{{ $sell->custom_field_4 }}
@endif
@if (!empty($sales_orders))
@lang('lang_v1.sales_orders'):
| @lang('lang_v1.sales_order') |
@lang('lang_v1.date') |
@foreach ($sales_orders as $so)
| {{ $so->invoice_no }} |
{{ @format_datetime($so->transaction_date) }} |
@endforeach
@endif
@if ($sell->document_path)
{{ __('purchase.download_document') }}
@endif
@if (!empty($sell->contact->supplier_business_name))
{{ $sell->contact->supplier_business_name }}
@endif
{{ __('sale.customer_name') }}: {{ $sell->contact->name }}
{{ __('business.address') }}:
@if (!empty($sell->billing_address()))
{{ $sell->billing_address() }}
@else
{!! $sell->contact->contact_address !!}
@if ($sell->contact->mobile)
{{ __('contact.mobile') }}: {{ $sell->contact->mobile }}
@endif
@if ($sell->contact->alternate_number)
{{ __('contact.alternate_contact_number') }}:
{{ $sell->contact->alternate_number }}
@endif
@if ($sell->contact->landline)
{{ __('contact.landline') }}: {{ $sell->contact->landline }}
@endif
@endif
@if (in_array('tables', $enabled_modules))
@lang('restaurant.table'):
{{ $sell->table->name ?? '' }}
@endif
@if (in_array('service_staff', $enabled_modules))
@lang('restaurant.service_staff'):
{{ $sell->service_staff->user_full_name ?? '' }}
@endif
@lang('sale.shipping'):
{{ $shipping_statuses[$sell->shipping_status] ?? '' }}
@if (!empty($sell->shipping_address()))
{{ $sell->shipping_address() }}
@else
{{ $sell->shipping_address ?? '--' }}
@endif
@if (!empty($sell->delivered_to))
@lang('lang_v1.delivered_to'): {{ $sell->delivered_to }}
@endif
@if (!empty($sell->shipping_custom_field_1))
{{ $custom_labels['shipping']['custom_field_1'] ?? '' }}:
{{ $sell->shipping_custom_field_1 }}
@endif
@if (!empty($sell->shipping_custom_field_2))
{{ $custom_labels['shipping']['custom_field_2'] ?? '' }}:
{{ $sell->shipping_custom_field_2 }}
@endif
@if (!empty($sell->shipping_custom_field_3))
{{ $custom_labels['shipping']['custom_field_3'] ?? '' }}:
{{ $sell->shipping_custom_field_3 }}
@endif
@if (!empty($sell->shipping_custom_field_4))
{{ $custom_labels['shipping']['custom_field_4'] ?? '' }}:
{{ $sell->shipping_custom_field_4 }}
@endif
@if (!empty($sell->shipping_custom_field_5))
{{ $custom_labels['shipping']['custom_field_5'] ?? '' }}:
{{ $sell->shipping_custom_field_5 }}
@endif
@php
$medias = $sell->media->where('model_media_type', 'shipping_document')->all();
@endphp
@if (count($medias))
@include('sell.partials.media_table', ['medias' => $medias])
@endif
@if (in_array('types_of_service', $enabled_modules))
@if (!empty($sell->types_of_service))
@lang('lang_v1.types_of_service'):
{{ $sell->types_of_service->name }}
@endif
@if (!empty($sell->types_of_service->enable_custom_fields))
{{ $custom_labels['types_of_service']['custom_field_1'] ?? __('lang_v1.service_custom_field_1') }}:
{{ $sell->service_custom_field_1 }}
{{ $custom_labels['types_of_service']['custom_field_2'] ?? __('lang_v1.service_custom_field_2') }}:
{{ $sell->service_custom_field_2 }}
{{ $custom_labels['types_of_service']['custom_field_3'] ?? __('lang_v1.service_custom_field_3') }}:
{{ $sell->service_custom_field_3 }}
{{ $custom_labels['types_of_service']['custom_field_4'] ?? __('lang_v1.service_custom_field_4') }}:
{{ $sell->service_custom_field_4 }}
{{ $custom_labels['types_of_service']['custom_field_5'] ?? __('lang_v1.custom_field', ['number' => 5]) }}:
{{ $sell->service_custom_field_5 }}
{{ $custom_labels['types_of_service']['custom_field_6'] ?? __('lang_v1.custom_field', ['number' => 6]) }}:
{{ $sell->service_custom_field_6 }}
@endif
@endif
@if (!empty($export_custom_fields))
@foreach ($export_custom_fields as $label => $value)
@php
$export_label = __('lang_v1.export_custom_field1');
if ($label == 'export_custom_field_1') {
$export_label = __('lang_v1.export_custom_field1');
} elseif ($label == 'export_custom_field_2') {
$export_label = __('lang_v1.export_custom_field2');
} elseif ($label == 'export_custom_field_3') {
$export_label = __('lang_v1.export_custom_field3');
} elseif ($label == 'export_custom_field_4') {
$export_label = __('lang_v1.export_custom_field4');
} elseif ($label == 'export_custom_field_5') {
$export_label = __('lang_v1.export_custom_field5');
} elseif ($label == 'export_custom_field_6') {
$export_label = __('lang_v1.export_custom_field6');
}
@endphp
{{ $export_label }}
:
{{ $value ?? '' }}
@endforeach
@endif
{{ __('sale.products') }}:
@include('sale_pos.partials.sale_line_details')
@php
$total_paid = 0;
@endphp
@if ($sell->type != 'sales_order')
{{ __('sale.payment_info') }}:
| # |
{{ __('messages.date') }} |
{{ __('purchase.ref_no') }} |
{{ __('sale.amount') }} |
{{ __('sale.payment_mode') }} |
{{ __('sale.payment_note') }} |
@foreach ($sell->payment_lines as $payment_line)
@php
if ($payment_line->is_return == 1) {
$total_paid -= $payment_line->amount;
} else {
$total_paid += $payment_line->amount;
}
@endphp
| {{ $loop->iteration }} |
{{ @format_date($payment_line->paid_on) }} |
{{ $payment_line->payment_ref_no }} |
{{ number_format($payment_line->amount, 2) }}
|
{{ $payment_types[$payment_line->method] ?? $payment_line->method }}
@if ($payment_line->method == 'cheque')
({{ $payment_line->cheque_number }})
@elseif ($payment_line->is_return == 1)
( {{ __('lang_v1.change_return') }} )
@endif
|
@if ($payment_line->note != '')
{{ ucfirst($payment_line->note) }}
@else
--
@endif
|
@endforeach
@endif
| {{ __('sale.total') }}: |
|
{{ number_format($sell->total_before_tax, 2) }}
|
| {{ __('sale.discount') }}: |
(-) |
discount_type == 'fixed') data-currency_symbol="true" @endif>{{ number_format($sell->discount_amount, 2) }}
@if ($sell->discount_type == 'percentage')
{{ '%' }}
@endif
|
@if (in_array('types_of_service', $enabled_modules) && !empty($sell->packing_charge))
| {{ __('lang_v1.packing_charge') }}: |
(+) |
packing_charge_type == 'fixed') data-currency_symbol="true" @endif>{{ number_format($sell->packing_charge, 2) }}
@if ($sell->packing_charge_type == 'percent')
{{ '%' }}
@endif
|
@endif
@if (session('business.enable_rp') == 1 && !empty($sell->rp_redeemed))
| {{ session('business.rp_name') }}: |
(-) |
{{ number_format($sell->rp_redeemed_amount, 2) }}
|
@endif
| {{ __('sale.order_tax') }}: |
(+) |
@if (!empty($order_taxes))
@foreach ($order_taxes as $k => $v)
{{ $k }} - {{ number_format($v, 2) }}
@endforeach
@else
0.00
@endif
|
@if (!empty($line_taxes))
| {{ __('lang_v1.line_taxes') }}: |
|
@if (!empty($line_taxes))
@foreach ($line_taxes as $k => $v)
{{ $k }} - {{ number_format($v, 2) }}
@endforeach
@else
0.00
@endif
|
@endif
| {{ __('sale.shipping') }}: @if ($sell->shipping_details)
({{ $sell->shipping_details }})
@endif
|
(+) |
{{ number_format($sell->shipping_charges, 2) }}
|
@if (!empty($sell->additional_expense_value_1) && !empty($sell->additional_expense_key_1))
| {{ $sell->additional_expense_key_1 }}: |
(+) |
{{ $sell->additional_expense_value_1 }}
|
@endif
@if (!empty($sell->additional_expense_value_2) && !empty($sell->additional_expense_key_2))
| {{ $sell->additional_expense_key_2 }}: |
(+) |
{{ $sell->additional_expense_value_2 }}
|
@endif
@if (!empty($sell->additional_expense_value_3) && !empty($sell->additional_expense_key_3))
| {{ $sell->additional_expense_key_3 }}: |
(+) |
{{ $sell->additional_expense_value_3 }}
|
@endif
@if (!empty($sell->additional_expense_value_4) && !empty($sell->additional_expense_key_4))
| {{ $sell->additional_expense_key_4 }}: |
(+) |
{{ number_format($sell->additional_expense_value_4, 2) }}
|
@endif
| {{ __('lang_v1.round_off') }}: |
|
{{ number_format($sell->round_off_amount, 2) }}
|
| {{ __('sale.total_payable') }}: |
|
{{ number_format($sell->final_total, 2) }}
|
@if ($sell->type != 'sales_order')
| {{ __('sale.total_paid') }}: |
|
{{ number_format($total_paid, 2) }}
|
| {{ __('sale.total_remaining') }}: |
|
@php
$total_paid = (string) $total_paid;
@endphp
{{ number_format($sell->final_total - $total_paid, 2) }}
|
@endif
@endcomponent
@endforeach