@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) {{--*/ $item = App\Model\Item::find($item_movement->item_id) /*--}} {{--*/ $item_price = $item->itemPriceOnStore($store_id) /*--}} {{--*/ $currency = App\Model\Currency::find($item_movement->currency_id ? $item_movement->currency_id : 2)/*--}} {{--*/ $in_quantity = 0 /*--}} {{--*/ $in_price = 0 /*--}} {{--*/ $in_amount = 0 /*--}} {{--*/ $out_quantity = 0 /*--}} {{--*/ $out_price = 0 /*--}} {{--*/ $out_amount = 0 /*--}} {{--*/ $other_quantity = 0 /*--}} @if($item_movement->transaction_type == "LPO") {{--*/ $other_quantity = $item_movement->purchased_quantity /*--}} @endif @if($item_movement->transaction_type == "LPO_OPEN") {{--*/ $other_quantity = $item_movement->opening_purchased_quantity /*--}} @endif @if($item_movement->transaction_type == "GRN") {{--*/ $in_quantity = $item_movement->received_quantity /*--}} {{--*/ $in_price = $item_price /*--}} {{--*/ $in_amount = $in_quantity*$in_price /*--}} {{--*/ $in_quantity_total += $in_quantity/*--}} {{--*/ $balance_quantity += $in_quantity /*--}} @endif @if($item_movement->transaction_type == "ASSET") {{--*/ $in_quantity = $item_movement->asset_quantity /*--}} {{--*/ $in_price = $item_price /*--}} {{--*/ $in_amount = $in_quantity*$in_price /*--}} {{--*/ $in_quantity_total += $in_quantity/*--}} {{--*/ $balance_quantity += $in_quantity /*--}} @endif @if($item_movement->transaction_type == "GIN") {{--*/ $out_quantity = $item_movement->issued_quantity /*--}} {{--*/ $out_price = 0 /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif @if($item_movement->transaction_type == "ASSET_ASSIGN") {{--*/ $out_quantity = $item_movement->asset_issued_quantity /*--}} {{--*/ $out_price = $item_price /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif @if($item_movement->transaction_type == "RETURN") {{--*/ $out_quantity = $item_movement->returned_quantity /*--}} {{--*/ $out_price = $item_price /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif @if($item_movement->transaction_type == "TRANSFER") {{--*/ $out_quantity = $item_movement->transferred_quantity /*--}} {{--*/ $out_price = $item_price /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif {{--*/ $avarage_price = 0 /*--}} {{-- --}} @if($item_movement->transaction_type == "GRN") @elseif($item_movement->transaction_type == "GIN") @elseif($item_movement->transaction_type == "LPO") @elseif($item_movement->transaction_type == "LPO_OPEN") @elseif($item_movement->transaction_type == "ASSET") @elseif($item_movement->transaction_type == "ASSET_ASSIGN") @elseif($item_movement->transaction_type == "RETURN") @elseif($item_movement->transaction_type == "TRANSFER") @else @endif @if($item_movement->transaction_type == 'LPO' OR $item_movement->transaction_type == 'LPO_OPEN') @else @endif @endforeach
  Inward Outward Balance
Date Transaction Other Qnty Price Amount Qnty Price Amount Qnty Price Amount
OPEN BALANCE
{{ \Carbon\Carbon::parse($item_movement->transaction_date)->toFormattedDateString()}}{{ $item_movement->reference_number}}Received | GRN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}}Issued | GIN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Purchased | LPO/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Purchased | LPO/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Registred Asset | ASSET/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Assigned Asset | ASSET/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Returned | RETURN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Transferred | TRANSFER/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} {{$other_quantity > 0 ? number_format($other_quantity) : ''}} {{$balance_quantity > 0 ? number_format($balance_quantity) : ''}} {{$in_quantity > 0 ? number_format($in_quantity) : ''}} {{$in_price > 0 ? number_format($in_price) : ''}} {{$in_amount > 0 ? number_format($in_amount) : ''}} {{$out_quantity > 0 ? number_format($out_quantity) : ''}} {{$out_price > 0 ? number_format($out_price) : ''}} {{$out_amount > 0 ? number_format($out_amount) : ''}} {{$balance_quantity > 0 ? number_format($balance_quantity) : ''}} {{$item_price > 0 ? number_format($item_price) : ''}} {{($balance_quantity * $item_price) > 0 ? number_format($balance_quantity * $item_price) : ''}}
TOTAL INWARD {{$in_quantity_total > 0 ? number_format($in_quantity_total) : ''}} TOTAL OUTWARD {{$out_quantity_total > 0 ? number_format($out_quantity_total) : ''}} CLOSED BALANCE {{$balance_quantity > 0 ? number_format($balance_quantity) : ''}} {{($item_price*$balance_quantity) > 0 ? number_format($item_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) {{--*/ $item = App\Model\Item::find($item_movement->item_id) /*--}} {{--*/ $item_price = $item->itemPriceOnStore($store_id) /*--}} {{--*/ $in_quantity = 0 /*--}} {{--*/ $in_price = 0 /*--}} {{--*/ $in_amount = 0 /*--}} {{--*/ $out_quantity = 0 /*--}} {{--*/ $out_price = 0 /*--}} {{--*/ $out_amount = 0 /*--}} {{--*/ $other_quantity = 0 /*--}} @if($item_movement->transaction_type == "LPO") {{--*/ $other_quantity = $item_movement->purchased_quantity /*--}} @endif @if($item_movement->transaction_type == "LPO_OPEN") {{--*/ $other_quantity = $item_movement->opening_purchased_quantity /*--}} @endif @if($item_movement->transaction_type == "GRN") {{--*/ $in_quantity = $item_movement->received_quantity /*--}} {{--*/ $in_price = $item_price /*--}} {{--*/ $in_amount = $in_quantity*$in_price /*--}} {{--*/ $in_quantity_total += $in_quantity/*--}} {{--*/ $balance_quantity += $in_quantity /*--}} @endif @if($item_movement->transaction_type == "ASSET") {{--*/ $in_quantity = $item_movement->asset_quantity /*--}} {{--*/ $in_price = $item_price /*--}} {{--*/ $in_amount = $in_quantity*$in_price /*--}} {{--*/ $in_quantity_total += $in_quantity/*--}} {{--*/ $balance_quantity += $in_quantity /*--}} @endif @if($item_movement->transaction_type == "GIN") {{--*/ $out_quantity = $item_movement->issued_quantity /*--}} {{--*/ $out_price = 0 /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif @if($item_movement->transaction_type == "ASSET_ASSIGN") {{--*/ $out_quantity = $item_movement->asset_issued_quantity /*--}} {{--*/ $out_price = $item_price /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif @if($item_movement->transaction_type == "RETURN") {{--*/ $out_quantity = $item_movement->returned_quantity /*--}} {{--*/ $out_price = $item_price /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif @if($item_movement->transaction_type == "TRANSFER") {{--*/ $out_quantity = $item_movement->transferred_quantity /*--}} {{--*/ $out_price = $item_price /*--}} {{--*/ $out_amount = $out_quantity*$out_price /*--}} {{--*/ $out_quantity_total += $out_quantity /*--}} {{--*/ $balance_quantity -= $out_quantity /*--}} @endif {{--*/ $avarage_price = 0 /*--}} {{-- --}} @if($item_movement->transaction_type == "GRN") @elseif($item_movement->transaction_type == "GIN") @elseif($item_movement->transaction_type == "LPO") @elseif($item_movement->transaction_type == "LPO_OPEN") @elseif($item_movement->transaction_type == "ASSET") @elseif($item_movement->transaction_type == "ASSET_ASSIGN") @elseif($item_movement->transaction_type == "RETURN") @elseif($item_movement->transaction_type == "TRANSFER") @else @endif @if($item_movement->transaction_type == 'LPO' OR $item_movement->transaction_type == 'LPO_OPEN') @else @endif @endforeach
  Inward Outward Balance
Date Transaction Other Qnty Price Amount Qnty Price Amount Qnty Price Amount
OPEN BALANCE
{{ \Carbon\Carbon::parse($item_movement->transaction_date)->toFormattedDateString()}}{{ $item_movement->reference_number}}Received | trasaction_id)}}'> GRN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Issued | GIN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Purchased | LPO/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Purchased | LPO/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Registred Asset | ASSET/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Assigned Asset | ASSET/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Returned | RETURN/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} Transferred | TRANSFER/ {{\App\Logistics\Facades\Logistics::add_leading_zeros($item_movement->trasaction_id)}} {{$other_quantity > 0 ? number_format($other_quantity) : ''}} {{$balance_quantity > 0 ? number_format($balance_quantity) : ''}} {{$in_quantity > 0 ? number_format($in_quantity) : ''}} {{$in_price > 0 ? number_format($in_price) : ''}} {{$in_amount > 0 ? number_format($in_amount) : ''}} {{$out_quantity > 0 ? number_format($out_quantity) : ''}} {{$out_price > 0 ? number_format($out_price) : ''}} {{$out_amount > 0 ? number_format($out_amount) : ''}} {{$balance_quantity > 0 ? number_format($balance_quantity) : ''}} {{$item_price > 0 ? number_format($item_price) : ''}} {{($balance_quantity * $item_price) > 0 ? number_format($balance_quantity * $item_price) : ''}}
TOTAL INWARD {{$in_quantity_total > 0 ? number_format($in_quantity_total) : ''}} TOTAL OUTWARD {{$out_quantity_total > 0 ? number_format($out_quantity_total) : ''}} CLOSED BALANCE {{$balance_quantity > 0 ? number_format($balance_quantity) : ''}} {{($item_price*$balance_quantity) > 0 ? number_format($item_price*$balance_quantity,2) : ''}}
@endif @else









Information Not Available..!!

@endif