@if(isset($item_movements[0])) @if($print)
Date: {{ date('d/m/Y') }}

{{strtoupper($item->name)}} MOVEMENTS @if($from != "" && $to != "") FROM {{\Carbon\Carbon::parse($from)->toFormattedDateString()}} TO {{\Carbon\Carbon::parse($to)->toFormattedDateString()}} @elseif($from != "" && $to == "") FROM {{\Carbon\Carbon::parse($from)->toFormattedDateString()}} TO {{\Carbon\Carbon::parse(date("Y/m/d"))->toFormattedDateString()}} @elseif($from == "" && $to != "") AS OF {{\Carbon\Carbon::parse($to)->toFormattedDateString()}} @else AS OF {{\Carbon\Carbon::parse(date('Y-m-d'))->toFormattedDateString()}} @endif

{{--*/ $in_quantity_total = 0 /*--}} {{--*/ $out_quantity_total = 0 /*--}} {{--*/ $avarage_price = 0 /*--}} {{--*/ $balance_quantity = 0 /*--}} @foreach($item_movements as $item_movement) {{--*/ $in_quantity = 0 /*--}} {{--*/ $in_price = 0 /*--}} {{--*/ $in_amount = 0 /*--}} {{--*/ $out_quantity = 0 /*--}} {{--*/ $out_price = 0 /*--}} {{--*/ $out_amount = 0 /*--}} @if($item_movement->document == "GRN") {{--*/ $in_quantity = $item_movement->quantity /*--}} {{--*/ $in_price = $item_movement->price_per_item /*--}} {{--*/ $in_amount = $in_quantity*$in_price /*--}} {{--*/ $in_quantity_total += $in_quantity/*--}} {{--*/ $balance_quantity += $in_quantity /*--}} @endif @if($item_movement->document == "GIN") {{--*/ $out_quantity = $item_movement->quantity /*--}} {{--*/ $out_price = $item_movement->price_per_item /*--}} {{--*/ $out_amount = $out_quantity*$in_amount /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif {{--*/ $avarage_price = 0 /*--}} @if($item_movement->in_price>0) @endif @endforeach
  Inward Outward Balance
Date Description Qnty Price Amount Qnty Price Amount Qnty Price Amount
OPEN BALANCE
{{ \Carbon\Carbon::parse($item_movement->date)->toFormattedDateString()}} {{ $item_movement->reference_number}} {{number_format($in_quantity)}} {{number_format($in_price)}} {{number_format($in_amount)}} {{number_format($out_quantity)}} {{number_format($out_price)}} {{number_format($out_amount)}}{{number_format($balance_quantity)}} {{number_format($item_movement->average_price)}} {{number_format(0)}}
TOTAL INWARD {{number_format($in_quantity_total)}} TOTAL OUTWARD {{number_format($out_quantity_total)}} CLOSED BALANCE {{number_format($balance_quantity)}} {{$avarage_price}} {{number_format($avarage_price*$balance_quantity,2)}}
@else {{--*/ $in_quantity_total = 0 /*--}} {{--*/ $out_quantity_total = 0 /*--}} {{--*/ $avarage_price = 0 /*--}} {{--*/ $balance_quantity = 0 /*--}} @foreach($item_movements as $item_movement) {{--*/ $in_quantity = 0 /*--}} {{--*/ $in_price = 0 /*--}} {{--*/ $in_amount = 0 /*--}} {{--*/ $out_quantity = 0 /*--}} {{--*/ $out_price = 0 /*--}} {{--*/ $out_amount = 0 /*--}} @if($item_movement->document == "GRN") {{--*/ $in_quantity = $item_movement->quantity /*--}} {{--*/ $in_price = $item_movement->price_per_item /*--}} {{--*/ $in_amount = $in_quantity*$in_price /*--}} {{--*/ $in_quantity_total += $in_quantity/*--}} {{--*/ $balance_quantity += $in_quantity /*--}} @endif @if($item_movement->document == "GIN") {{--*/ $out_quantity = $item_movement->quantity /*--}} {{--*/ $out_price = $item_movement->price_per_item /*--}} {{--*/ $out_amount = $out_quantity*$in_amount /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif {{--*/ $avarage_price = 0 /*--}} {{-- --}} @if($item_movement->document == "GRN") @elseif($item_movement->document == "GIN") @endif @if($item_movement->in_price>0) @endif @endforeach
  Inward Outward Balance
Date Description Qnty Price Amount Qnty Price Amount Qnty Price Amount
OPEN BALANCE
{{ \Carbon\Carbon::parse($item_movement->date)->toFormattedDateString()}}{{ $item_movement->reference_number}}{{ $item_movement->reference_number }} | id)}}'> GRN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->id)}} {{ $item_movement->reference_number }} | GIN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->id)}} {{number_format($in_quantity)}} {{number_format($in_price)}} {{number_format($in_amount)}} {{number_format($out_quantity)}} {{number_format($out_price)}} {{number_format($out_amount)}}{{number_format($balance_quantity)}} {{number_format($item_movement->average_price)}} {{number_format(0)}}
TOTAL INWARD {{number_format($in_quantity_total)}} TOTAL OUTWARD {{number_format($out_quantity_total)}} CLOSED BALANCE {{number_format($balance_quantity)}} {{$avarage_price}} {{number_format($avarage_price*$balance_quantity,2)}}
@endif @else









Information Not Available..!!

@endif