{{-- {{dd($orders)}} --}} @foreach ($orders as $order)

{{ $order->distributor_name }}

SALES INVOICE

Address: {{ $order->distributor_address }}
Phone: {{ $order->distributor_phone }}
Bill No: {{ $order->bill_no }}
Date: {{ $order->bill_date }}
Booker: {{ $order->booker_name }}
Party Name: {{ $order->retailer_name }} / Code: {{ !empty($order->shop_code) ? $order->shop_code : 'N/A' }}
Address: {{ !empty($order->retailer_address) ? $order->retailer_address : 'N/A' }} / Ph: {{ !empty($order->retailer_phone) ? $order->retailer_phone : 'N/A' }}
CNIC/NTN: {{ $order->retailer_cnic ? substr($order->retailer_cnic,-9) : 'NA' }}/{{ $order->retailer_ntn ? substr($order->retailer_ntn,-9) : 'NA' }}
Channel: {{ !empty($order->retailer_channel) ? $order->retailer_channel : 'N/A'}}
@php $md = 0; $md_sum = 0; $md_count = 0; $total_trade_amount = 0; @endphp @if($format == 1) @if($showTax == 1) @endif @else @if( $showTax == 1) @endif @endif @foreach ($order->detail as $d) @if($format == 1) @if( $showTax == 1) @endif @else @if( $showTax == 1) @endif @endif @endforeach @if($format == 1) @else @endif @if($format == 1) @if( $showTax == 1) @endif @else @if( $showTax == 1) @endif @endif
Code Product Name CTN BOX/PCS FOC T.P. Gr AMT. T.O. T.DISC S. DISCTAXNet AMT.
Code Product Name C.P. T.P. CTN BOX/PCS FOC Gr AMT. T.O. T.D. E.D.TAXNet AMT.
{{ !empty($d->sku) ? $d->sku : '-' }} {{ !empty($d->item_name) ? $d->item_name : '-' }} {{ !empty($d->primary) ? $d->primary : '-' }} {{ !empty($d->secondary) ? $d->secondary : '-' }} {{ !empty($d->free_qty) ? $d->free_qty : '-' }} {{ $d->trade_price != '-' ? number_format($d->trade_price, 2) : '-' }} {{ $d->gross_amount != '-' ? number_format($d->gross_amount, 2) : '-' }} {{ $d->trade_offer_value != '-' ? number_format($d->trade_offer_value, 2) : '-' }} {{ $d->merchant_discount_pkr != '-' ?(number_format($d->merchant_discount, 2).($d->slab_discount_type=='percentage'?'%':'')):'-'}} {{ $d->extra_discount != '-' ? number_format($d->extra_discount, 2) : '-' }}{{ $d->tax != '-' ? number_format($d->tax, 2) : '-' }}{{ $d->net_price != '-' ? number_format($d->net_price, 2) : '-' }}
{{ !empty($d->sku) ? $d->sku : '-' }} {{ !empty($d->item_name) ? $d->item_name : '-' }} {{ $d->retail_price != '-' ? number_format($d->retail_price, 2) : '-' }} {{ $d->trade_price != '-' ? number_format($d->trade_price, 2) : '-' }} {{ !empty($d->primary) ? $d->primary : '-' }} {{ !empty($d->secondary) ? $d->secondary : '-' }} {{ !empty($d->free_qty) ? $d->free_qty : '-' }} {{ $d->gross_amount != '-' ? number_format($d->gross_amount, 2) : '-' }} {{ $d->trade_offer_value != '-' ? number_format($d->trade_offer_value, 2) : '-' }} {{ $d->trade_discount != '-' ? number_format($d->trade_discount, 2) : '-' }} {{ $d->extra_discount != '-' ? number_format($d->extra_discount, 2) : '-' }}{{ $d->tax != '-' ? number_format($d->tax, 2) : '-' }}{{ $d->net_price != '-' ? number_format($d->net_price, 2) : '-' }}
Total {{ !empty($order->total[0]['primary']) ? $order->total[0]['primary'] :0 }} {{ !empty($order->total[0]['secondary']) ? $order->total[0]['secondary'] :0 }} {{ !empty($order->total[0]['free_qty']) ? $order->total[0]['free_qty'] :0 }} - {{ isset($order->total[0]['gross_amount'])? number_format($order->total[0]['gross_amount'], 2) :0 }} {{ isset($order->total[0]['trade_offer'])? number_format($order->total[0]['trade_offer'], 2) :0 }} - {{ isset($order->total[0]['extra_discount'])? number_format($order->total[0]['extra_discount'], 2) :0 }}{{ isset($order->total[0]['tax'])? number_format($order->total[0]['tax'], 2) :0 }} {{ isset($order->total[0]['net_price'])? number_format($order->total[0]['net_price'], 2) :0 }}
Total {{ !empty($order->total[0]['primary']) ? $order->total[0]['primary'] :0 }} {{ !empty($order->total[0]['secondary']) ? $order->total[0]['secondary'] :0 }} {{ !empty($order->total[0]['free_qty']) ? $order->total[0]['free_qty'] :0 }} {{ isset($order->total[0]['gross_amount'])? number_format($order->total[0]['gross_amount'], 2) :0 }} {{ isset($order->total[0]['trade_offer'])? number_format($order->total[0]['trade_offer'], 2) :0 }} {{ isset($order->total[0]['trade_discount'])? number_format($order->total[0]['trade_discount'], 2) :0 }} {{ isset($order->total[0]['extra_discount'])? number_format($order->total[0]['extra_discount'], 2) :0 }}{{ isset($order->total[0]['tax'])? number_format($order->total[0]['tax'], 2) :0 }} {{ isset($order->total[0]['net_price'])? number_format($order->total[0]['net_price'], 2) :0 }}
@if( $showTax == 1) @endif
    Gross Amount : {{ isset($order->total[0]['gross_amount'])? number_format($order->total[0]['gross_amount'], 2) :0 }}
    Trade Discount: {{ number_format($order->total[0]['merchant_discount_pkr'],2)}}
    T.O & Extra DISC : {{number_format($order->total[0]['trade_offer']+$order->total[0]['loyalty_offer_discount_pkr']+$order->total[0]['special_discount']+$order->total[0]['booker_discount'], 2) }}
    Total Tax : {{ isset($order->total[0]['tax'])? number_format($order->total[0]['tax'], 2) :0 }}
    Previous Balance : {{ (isset($order->pre_amt))? number_format($order->pre_amt, 2):0 }}
Salesman Signature Receiver Signature Net AMT: {{ (isset($order->total_net_price))? number_format(ROUND($order->total_net_price)):0 }}
@if( !in_array(env('APP_NAME'),['Sell3601']))
@endif

@endforeach