@include('inventory.print.dynamic.head')
{!! $head !!} @if($html) {!!$html!!} @else @php $tot_dc = 0; $g_tot = 0; @endphp
@php $k = 0; @endphp @foreach($groups as $group_id=>$productGroup) {{--

{{ ($groupNames->where('id',$group_id)->first() ? $groupNames->where('id',$group_id)->first()->name : '') }}

--}} {{--
--}} @php // $digit = new NumberFormatter("en", NumberFormatter::SPELLOUT); $fs = explode(',',$setting->field_show); $fn = explode(',',$setting->field_name); $span = 0; @endphp @if (in_array(1, $fs)) @php $span++; @endphp @endif @if (in_array(2, $fs)) @php $span++; @endphp @endif @if (in_array(3, $fs)) @php $span++; @endphp @endif @if (in_array(4, $fs)) @php $span++; @endphp @endif @if (in_array(10, $fs)) @php $span++; @endphp @endif @if ($chalan != 1) @if (in_array(5, $fs)) @php $span++; @endphp @endif @if (in_array(13, $fs)) @php $span++; @endphp @endif @if (in_array(6, $fs)) @php $span++; @endphp @endif @if (in_array(7, $fs)) @php $span++; @endphp @endif @endif @php $total=0; $discount_total=0; if ($productGroup->first()->transaction_type == 4) { $transaction = $productGroup->unique('product_id'); } else { $transaction = $productGroup; } if ($setting->show_zero_qty != 1) $transaction = $transaction->where('quantity', '>', 0); @endphp @foreach($transaction as $item) @php $unit_qty = (in_array(14, $fs) ? $item->unit_qty : 1); $item_qty = $item->quantity; $item_price = $item->avg_price; if ($productGroup->first()->transaction_type == 4) { $item_qty = $productGroup->where('product_id', $item->product_id)->sum('quantity'); if (get_class($item) == 'App\Models\Inventory\DamageTransaction') { $item_price = $item->price; } } @endphp @if (in_array(1, $fs)) @endif @if (in_array(2, $fs)) @endif @if (in_array(3, $fs)) @endif @if (in_array(4, $fs)) @endif {{-- @if (in_array(10, $fs)) @endif --}} @if (in_array(10, $fs)) @endif @if ($chalan != 1) @if (in_array(5, $fs)) @endif @if (in_array(13, $fs)) @php $t = $item_price * $item_qty; @endphp @endif @php $dc = ($item_price * $item_qty) * ($item->dc_price/100); @endphp @if (in_array(6, $fs)) @endif @if (in_array(7, $fs)) @php $net = ($item_price * $item_qty) - $dc; @endphp @endif @endif @php $total += ($item_price * $item_qty); @endphp @endforeach {{-- --}} @php $g_tot += $total; $discount_total=($invoice->dc_percentage/100)*$total; $tot_dc += $discount_total; $netBillArray[$group_id]=($total-$discount_total); @endphp @if ($chalan != 1 && in_array(8, $fs)) @endif {{-- @if ((count($groups) > 0 && count($groups) != $cnt_grp) || ($chalan != 1 && in_array(12, $fs)))
@endif --}} {{--
--}} @endforeach
@if ($chalan != 1 && in_array(12, $fs))
@if (in_array(11, $fs) && $printData['invoice']->other_charge != 0) @endif @if ($printData['invoice']->other_dc_percentage != 0) @endif @php $net = array_sum($netBillArray); $nt = $printData['invoice']->other_dc_amount + ($setting->fraction_type == 1 ? ($net+$invoice->other_charge) : (round($net+$invoice->other_charge))); @endphp @if ($printData['invoice']->cash_amount > 0) @endif @if ($setting->show_balance == 1) @endif {{-- @if (in_array(9, $fs)) @endif --}}
@if (in_array(9, $fs))
   {{ ucwords(getNumberInWords(number_format($nt, 2, '.', '') )) }} {{ ($currency ? $currency->name : '') }} only.
@endif
@endif @endif
{!! $foot !!}
@include('inventory.print.dynamic.foot')