@php $total = 0; $total_discount = 0; $total_delivery_charge = 0; function getPaymentMethod($order) { if($order->order_type === App\Enums\OrderType::POS){ return trans('pos_payment_method.' . $order->pos_payment_method, [], 'en') != "pos_payment_method." ? trans('pos_payment_method.' . $order->pos_payment_method, [], 'en') : ""; } return trans( 'payment_gateway.' . $order->payment_method,[],'en' ); } @endphp

{{ App\Libraries\AppLibrary::textShortener($company['company_name'], 60) }}

{{ App\Libraries\AppLibrary::textShortener($company['company_address'],60) }}

{{ trans('all.label.sales_report', [], 'en') }}

@foreach ($orders as $order) @php $total+= $order->total; $total_discount += $order->discount; $total_delivery_charge += $order->delivery_charge; @endphp @endforeach
{{ trans('all.label.order_serial_no', [], 'en') }} {{ trans('all.label.date', [], 'en') }} {{ trans('all.label.payment_type', [], 'en') }} {{ trans('all.label.payment_status', [], 'en') }} {{ trans('all.label.discount', [], 'en') }} {{ trans('all.label.delivery_charge', [], 'en') }} {{ trans('all.label.total', [], 'en') }}
{{$order->order_serial_no}} {{ App\Libraries\AppLibrary::datetime($order->order_datetime) }} {{ $order->transaction ? strtoupper($order->transaction->payment_method) : getPaymentMethod($order)}} {{ trans('payment_status.'. $order->payment_status, [], 'en') }} {{ App\Libraries\AppLibrary::reportCurrencyAmountFormat($order->discount) }} {{ App\Libraries\AppLibrary::reportCurrencyAmountFormat($order->delivery_charge) }} {{ App\Libraries\AppLibrary::reportCurrencyAmountFormat($order->total) }}
{{ trans('all.label.total', [], 'en') }} {{ App\Libraries\AppLibrary::reportCurrencyAmountFormat($total_discount) }} {{ App\Libraries\AppLibrary::reportCurrencyAmountFormat($total_delivery_charge) }} {{ App\Libraries\AppLibrary::reportCurrencyAmountFormat($total) }}