@include('inventory.print.dynamic.head')
{!! $head !!}
@php $fs = explode(',',$setting->field_show); $fn = explode(',',$setting->field_name); $comission = $printData['invoice']->dp_commission; $trans = $printData['invoice']->use_status != 4 ? $printData['invoice']->transaction : $printData['invoice']->damageTransactions; if ($setting->show_zero_qty != 1) $trans = $trans->where('quantity', '>', 0); $transactions[0] = $trans->where('is_free_or_gift', '!=', 2)->groupBy('dr_cr'); $transactions[1] = $trans->where('is_free_or_gift', 2)->groupBy('dr_cr'); //For gift Item if (($printData['invoice']->transaction_type == 3 || $printData['invoice']->transaction_type == 4) && $is_dp == 1 && $printData['invoice']->party->depot_id) { $comission = request()->pd ? $printData['invoice']->dp_commission : ($printData['invoice']->party->depot_id ? $printData['invoice']->party->commission : $printData['invoice']->dc_percentage); } // if (($printData['invoice']->transaction_type == 3 || $printData['invoice']->transaction_type == 4) && $is_dp == 1 && $printData['invoice']->party->depot_id) { // $comission = request()->pd ? $printData['invoice']->party->parentDepot->commission // : ($printData['invoice']->party->depot_id ? // $printData['invoice']->party->commission // : $printData['invoice']->dc_percentage); // } // dd($comission); $new_total=[]; $new_net=[]; $deport_id=$printData['invoice']->party->depot_id; @endphp @for ($x = 0; $x<2; $x++) @foreach ($transactions[$x] as $key=>$data) @php $span = 0; $tspan=0; $tot_dc = 0; @endphp @if($transactions[$x]->count() > 1) @endif @if (in_array(1, $fs)) @php $span++; $tspan++; @endphp @endif @if (in_array(2, $fs)) @php $span++; $tspan++; @endphp @endif @if (in_array(3, $fs)) @php $span++; $tspan++; @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 ($is_dp == 1) @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 $tot_qty = 0; $total = 0; @endphp @php $i = 0; @endphp @foreach($data as $k=>$item) @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 ($chalan != 1) @if (in_array(5, $fs)) @endif @if ($is_dp == 1) @endif @php $t = ($price * $item->quantity); // dd($t); @endphp @if (in_array(13, $fs)) @endif @if (in_array(6, $fs)) @php $dc = $t * ($item->dc_price/100); @endphp @endif @if (in_array(7, $fs)) @php $n = $t - ($t * ($item->dc_price/100)); @endphp @endif @endif @php $total += $price * $item->quantity; @endphp @endforeach @php $discount_total=($printData['invoice']->dc_percentage/100)*$total; $tot_dc += $discount_total; @endphp @if($transactions[$x]->count() > 1) @if ($chalan != 1) @endif @endif