{{--{{dd($data)}}--}}

Perpetual Inventory Report Start Date: {{$_GET['dateFrom']}}End Date: {{$_GET['dateTo']}}Generated On: {{Date('d-M-Y')}}

Distributor Name: {{(isset($data['gen_data']['distributor_name']))? $data['gen_data']['distributor_name']:'N/A'}} Cost Price Rs. {{number_format($data['gen_data']['stock_in_value'],2)}}
Distributor Code: {{(isset($data['gen_data']['distributor_code']))? $data['gen_data']['distributor_code']:'N/A'}} G.Sales Value Rs. {{number_format($data['gen_data']['total_cost_price'],2)}}
TSM: {{(isset($data['gen_data']['tsm']))? $data['gen_data']['tsm']:'N/A'}} In Stock Units {{number_format($data['gen_data']['stock_in_unit'])}}
@if (collect($data['brands'])->count()>0) @php $g_open_blnc = 0; $g_purchased = 0; $g_return = 0; $g_companyreturn = 0; $g_avl_blnc = 0; $g_sold = 0; $g_SIH = 0; $g_demaged = 0; $g_adjustmentIn = 0; $g_adjustmentOut = 0; $g_cost_price = 0; $g_value = 0; @endphp @foreach (collect($data['brands']) as $brand) @php $t_open_blnc = 0; $t_purchased = 0; $t_return = 0; $t_companyreturn = 0; $t_avl_blnc = 0; $t_sold = 0; $t_demaged = 0; $t_adjustmentIn= 0; $t_adjustmentOut= 0; $t_SIH = 0; $t_cost_price = 0; $t_value = 0; @endphp @foreach (collect($brand->items) as $item) @php $purchaseds = array_values(array_filter(@$data['purchased'], fn ($x) => $x->item_id == $item->item_id)); $returns = array_values(array_filter(@$data['return'], fn ($x) => $x->item_id == $item->item_id)); $companyreturns = array_values(array_filter(@$data['companyreturn'], fn ($x) => $x->item_id == $item->item_id)); $solds = array_values(array_filter(@$data['sold'], fn ($x) => $x->item_id == $item->item_id)); $demageds = array_values(array_filter(@$data['demaged'], fn ($x) => $x->item_id == $item->item_id)); $adjustments = array_values(array_filter(@$data['adjustment'], fn ($x) => $x->item_id == $item->item_id)); $purchased = (float)@$purchaseds[0]->qty; $return = abs((float)$returns[0]->qty); // nida na kha hae kh plus m show karana hae $companyreturn = (float)@$companyreturns[0]->qty; $sold = (float)@$solds[0]->qty; $demaged = (float)@$demageds[0]->qty; $adjustmentIn = (float)@$adjustments[0]->qty_in; $adjustmentOut = (float)@$adjustments[0]->qty_out; $avl_balance = $purchased + (float)@$item->opening_balance + $return+$adjustmentIn; $value = ($avl_balance -($sold+$companyreturn+$adjustmentOut)) * $item->item_trade_price ; $cost_price = $value; $value = $value - ( $value * $item->discount / 100 ); $SIH = $avl_balance-($sold+$companyreturn+$adjustmentOut); $t_open_blnc += (float)@$item->opening_balance; $t_purchased += $purchased; $t_return += $return; $t_companyreturn += $companyreturn; $t_avl_blnc += $avl_balance; $t_sold += $sold; $t_demaged += $demaged; $t_adjustmentIn += $adjustmentIn; $t_adjustmentOut+= $adjustmentOut; $t_value += $value; $t_cost_price += $cost_price; $t_SIH += $avl_balance-($sold+$companyreturn+$adjustmentOut); @endphp @endforeach @php $g_open_blnc += $t_open_blnc; $g_purchased += $t_purchased; $g_return += $t_return; $g_companyreturn += $t_companyreturn; $g_avl_blnc += $t_avl_blnc; $g_sold += $t_sold; $g_demaged += $t_demaged; $g_adjustmentIn += $t_adjustmentIn; $g_adjustmentOut += $t_adjustmentOut; $g_SIH += $t_SIH; $g_cost_price += $t_cost_price; $g_value += $t_value; @endphp @endforeach @else @endif
SKU Product Packing
Unit
Trade
Price
Opening
Stock
Company
Purchase
Market
Return
Adjustment
In
Available
Stock
Company
Return
Sold Damage Adjustment
Out
Stock
In Hand
Cost
Price
G.Sales
Value
{{$item->item_sku}} {{$item->item_name}} {{$item->unit_name}} {{number_format($item->item_trade_price,2)}} {{number_format($item->opening_balance)}} {{number_format($purchased)}} {{number_format($return)}} {{number_format($adjustmentIn)}} {{number_format($avl_balance)}} {{number_format($companyreturn)}} {{number_format($sold)}} {{number_format($demaged)}} {{number_format($adjustmentOut)}} {{number_format($SIH)}} {{number_format($value,2)}} {{number_format($cost_price,2)}}
{{$brand->brand_name}} Total {{number_format($t_open_blnc)}} {{number_format($t_purchased)}} {{number_format($t_return)}} {{number_format($t_adjustmentIn)}} {{number_format($t_avl_blnc)}} {{number_format($t_companyreturn)}} {{number_format($t_sold)}} {{number_format($t_demaged)}} {{number_format($t_adjustmentOut)}} {{number_format($t_SIH)}} {{number_format($t_value,2)}} {{number_format($t_cost_price,2)}}
GRAND TOTAL {{number_format($g_open_blnc)}} {{number_format($g_purchased)}} {{number_format($g_return)}} {{number_format($g_adjustmentIn)}} {{number_format($g_avl_blnc)}} {{number_format($g_companyreturn)}} {{number_format($g_sold)}} {{number_format($g_demaged)}} {{number_format($g_adjustmentOut)}} {{number_format($g_SIH)}} {{number_format($g_value,2)}} {{number_format($g_cost_price,2)}}
No data found.