@php
$balance = $total_units = $total_product_amount = $total_units_sold = $total_product_amount_sold = $total_discount_amount_sold = $total_receivable_amount_sold = $total_received_amount_sold = $total_balance = $total_units_vacant = $total_product_amount_vacant = $total_units_hold = $total_product_amount_hold = $project_balance = $total_project_balance = 0;
@endphp
@if (count($type) > 0)
@foreach ($type as $key => $item)
{{ $item->name }} |
{{ isset($product_total_quantity[$item->id][0]['total_units']) ? $product_total_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_total_quantity[$item->id][0]['size']) ? $product_total_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_total_quantity[$item->id][0]['product_amount']) ? number_format($product_total_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units += isset($product_total_quantity[$item->id][0]['total_units']) ? $product_total_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount += isset($product_total_quantity[$item->id][0]['product_amount']) ? $product_total_quantity[$item->id][0]['product_amount'] : 0;
@endphp
{{ isset($product_sold_quantity[$item->id][0]['total_units']) ? $product_sold_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['size']) ? $product_sold_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_sold_quantity[$item->id][0]['product_amount']) ? number_format($product_sold_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['discount_amount']) ? number_format($product_sold_quantity[$item->id][0]['discount_amount'], 2) : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? number_format($product_sold_quantity[$item->id][0]['receivable_amount'], 2) : 0 }}
|
{{ isset($product_received_amount[$item->id][0]['received_amount']) ? number_format($product_received_amount[$item->id][0]['received_amount'], 2) : 0 }}
|
@php
$balance = (isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? $product_sold_quantity[$item->id][0]['receivable_amount'] : 0) - (isset($product_received_amount[$item->id][0]['received_amount']) ? $product_received_amount[$item->id][0]['received_amount'] : 0);
@endphp
{{ number_format($balance, 2) }} |
@php
$total_units_sold += isset($product_sold_quantity[$item->id][0]['total_units']) ? $product_sold_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_sold += isset($product_sold_quantity[$item->id][0]['product_amount']) ? $product_sold_quantity[$item->id][0]['product_amount'] : 0;
$total_discount_amount_sold += isset($product_sold_quantity[$item->id][0]['discount_amount']) ? $product_sold_quantity[$item->id][0]['discount_amount'] : 0;
$total_receivable_amount_sold += isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? $product_sold_quantity[$item->id][0]['receivable_amount'] : 0;
$total_received_amount_sold += isset($product_received_amount[$item->id][0]['received_amount']) ? $product_received_amount[$item->id][0]['received_amount'] : 0;
$total_balance += $balance;
@endphp
{{ isset($product_available_quantity[$item->id][0]['total_units']) ? $product_available_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_available_quantity[$item->id][0]['size']) ? $product_available_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_available_quantity[$item->id][0]['product_amount']) ? number_format($product_available_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units_vacant += isset($product_available_quantity[$item->id][0]['total_units']) ? $product_available_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_vacant += isset($product_available_quantity[$item->id][0]['product_amount']) ? $product_available_quantity[$item->id][0]['product_amount'] : 0;
@endphp
{{ isset($product_hold_quantity[$item->id][0]['total_units']) ? $product_hold_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_hold_quantity[$item->id][0]['size']) ? $product_hold_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_hold_quantity[$item->id][0]['product_amount']) ? number_format($product_hold_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units_hold += isset($product_hold_quantity[$item->id][0]['total_units']) ? $product_hold_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_hold += isset($product_hold_quantity[$item->id][0]['product_amount']) ? $product_hold_quantity[$item->id][0]['product_amount'] : 0;
$project_balance = (isset($product_available_quantity[$item->id][0]['product_amount']) ? $product_available_quantity[$item->id][0]['product_amount'] : 0) + $balance;
$total_project_balance += $project_balance;
@endphp
{{ number_format($project_balance,2) }} |
@endforeach
@elseif (count($block) > 0)
@foreach ($block as $key => $item)
{{ $item->name }} |
{{ isset($product_total_quantity[$item->id][0]['total_units']) ? $product_total_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_total_quantity[$item->id][0]['size']) ? $product_total_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_total_quantity[$item->id][0]['product_amount']) ? number_format($product_total_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units += isset($product_total_quantity[$item->id][0]['total_units']) ? $product_total_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount += isset($product_total_quantity[$item->id][0]['product_amount']) ? $product_total_quantity[$item->id][0]['product_amount'] : 0;
@endphp
{{ isset($product_sold_quantity[$item->id][0]['total_units']) ? $product_sold_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['size']) ? $product_sold_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_sold_quantity[$item->id][0]['product_amount']) ? number_format($product_sold_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['discount_amount']) ? number_format($product_sold_quantity[$item->id][0]['discount_amount'], 2) : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? number_format($product_sold_quantity[$item->id][0]['receivable_amount'], 2) : 0 }}
|
{{ isset($product_received_amount[$item->id][0]['received_amount']) ? number_format($product_received_amount[$item->id][0]['received_amount'], 2) : 0 }}
|
@php
$balance = (isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? $product_sold_quantity[$item->id][0]['receivable_amount'] : 0) - (isset($product_received_amount[$item->id][0]['received_amount']) ? $product_received_amount[$item->id][0]['received_amount'] : 0);
@endphp
{{ number_format($balance, 2) }} |
@php
$total_units_sold += isset($product_sold_quantity[$item->id][0]['total_units']) ? $product_sold_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_sold += isset($product_sold_quantity[$item->id][0]['product_amount']) ? $product_sold_quantity[$item->id][0]['product_amount'] : 0;
$total_discount_amount_sold += isset($product_sold_quantity[$item->id][0]['discount_amount']) ? $product_sold_quantity[$item->id][0]['discount_amount'] : 0;
$total_receivable_amount_sold += isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? $product_sold_quantity[$item->id][0]['receivable_amount'] : 0;
$total_received_amount_sold += isset($product_received_amount[$item->id][0]['received_amount']) ? $product_received_amount[$item->id][0]['received_amount'] : 0;
$total_balance += $balance;
@endphp
{{ isset($product_available_quantity[$item->id][0]['total_units']) ? $product_available_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_available_quantity[$item->id][0]['size']) ? $product_available_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_available_quantity[$item->id][0]['product_amount']) ? number_format($product_available_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units_vacant += isset($product_available_quantity[$item->id][0]['total_units']) ? $product_available_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_vacant += isset($product_available_quantity[$item->id][0]['product_amount']) ? $product_available_quantity[$item->id][0]['product_amount'] : 0;
@endphp
{{ isset($product_hold_quantity[$item->id][0]['total_units']) ? $product_hold_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_hold_quantity[$item->id][0]['size']) ? $product_hold_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_hold_quantity[$item->id][0]['product_amount']) ? number_format($product_hold_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units_hold += isset($product_hold_quantity[$item->id][0]['total_units']) ? $product_hold_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_hold += isset($product_hold_quantity[$item->id][0]['product_amount']) ? $product_hold_quantity[$item->id][0]['product_amount'] : 0;
$project_balance = (isset($product_available_quantity[$item->id][0]['product_amount']) ? $product_available_quantity[$item->id][0]['product_amount'] : 0) + $balance;
$total_project_balance += $project_balance;
@endphp
{{ number_format($project_balance,2) }} |
@endforeach
@else
@foreach ($category as $key => $item)
{{ $item->name }} |
{{ isset($product_total_quantity[$item->id][0]['total_units']) ? $product_total_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_total_quantity[$item->id][0]['size']) ? $product_total_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_total_quantity[$item->id][0]['product_amount']) ? number_format($product_total_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units += isset($product_total_quantity[$item->id][0]['total_units']) ? $product_total_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount += isset($product_total_quantity[$item->id][0]['product_amount']) ? $product_total_quantity[$item->id][0]['product_amount'] : 0;
@endphp
{{ isset($product_sold_quantity[$item->id][0]['total_units']) ? $product_sold_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['size']) ? $product_sold_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_sold_quantity[$item->id][0]['product_amount']) ? number_format($product_sold_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['discount_amount']) ? number_format($product_sold_quantity[$item->id][0]['discount_amount'], 2) : 0 }}
|
{{ isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? number_format($product_sold_quantity[$item->id][0]['receivable_amount'], 2) : 0 }}
|
{{ isset($product_received_amount[$item->id][0]['received_amount']) ? number_format($product_received_amount[$item->id][0]['received_amount'], 2) : 0 }}
|
@php
$balance = (isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? $product_sold_quantity[$item->id][0]['receivable_amount'] : 0) - (isset($product_received_amount[$item->id][0]['received_amount']) ? $product_received_amount[$item->id][0]['received_amount'] : 0);
@endphp
{{ number_format($balance, 2) }} |
@php
$total_units_sold += isset($product_sold_quantity[$item->id][0]['total_units']) ? $product_sold_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_sold += isset($product_sold_quantity[$item->id][0]['product_amount']) ? $product_sold_quantity[$item->id][0]['product_amount'] : 0;
$total_discount_amount_sold += isset($product_sold_quantity[$item->id][0]['discount_amount']) ? $product_sold_quantity[$item->id][0]['discount_amount'] : 0;
$total_receivable_amount_sold += isset($product_sold_quantity[$item->id][0]['receivable_amount']) ? $product_sold_quantity[$item->id][0]['receivable_amount'] : 0;
$total_received_amount_sold += isset($product_received_amount[$item->id][0]['received_amount']) ? $product_received_amount[$item->id][0]['received_amount'] : 0;
$total_balance += $balance;
@endphp
{{ isset($product_available_quantity[$item->id][0]['total_units']) ? $product_available_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_available_quantity[$item->id][0]['size']) ? $product_available_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_available_quantity[$item->id][0]['product_amount']) ? number_format($product_available_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units_vacant += isset($product_available_quantity[$item->id][0]['total_units']) ? $product_available_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_vacant += isset($product_available_quantity[$item->id][0]['product_amount']) ? $product_available_quantity[$item->id][0]['product_amount'] : 0;
@endphp
{{ isset($product_hold_quantity[$item->id][0]['total_units']) ? $product_hold_quantity[$item->id][0]['total_units'] : 0 }}
|
{{ isset($product_hold_quantity[$item->id][0]['size']) ? $product_hold_quantity[$item->id][0]['size'] : '-' }}
|
{{ isset($product_hold_quantity[$item->id][0]['product_amount']) ? number_format($product_hold_quantity[$item->id][0]['product_amount'], 2) : 0 }}
|
@php
$total_units_hold += isset($product_hold_quantity[$item->id][0]['total_units']) ? $product_hold_quantity[$item->id][0]['total_units'] : 0;
$total_product_amount_hold += isset($product_hold_quantity[$item->id][0]['product_amount']) ? $product_hold_quantity[$item->id][0]['product_amount'] : 0;
$project_balance = (isset($product_available_quantity[$item->id][0]['product_amount']) ? $product_available_quantity[$item->id][0]['product_amount'] : 0) + $balance;
$total_project_balance += $project_balance;
@endphp
{{ number_format($project_balance,2) }} |
@endforeach
@endif
|
{{ number_format($total_units, 2) }} |
|
{{ number_format($total_product_amount, 2) }} |
{{ number_format($total_units_sold, 2) }} |
|
{{ number_format($total_product_amount_sold, 2) }} |
{{ number_format($total_discount_amount_sold, 2) }} |
{{ number_format($total_receivable_amount_sold, 2) }} |
{{ number_format($total_received_amount_sold, 2) }} |
{{ number_format($total_balance, 2) }} |
{{ number_format($total_units_vacant, 2) }} |
|
{{ number_format($total_product_amount_vacant, 2) }} |
{{ number_format($total_units_hold, 2) }} |
|
{{ number_format($total_product_amount_hold, 2) }} |
{{ number_format($total_project_balance,2) }} |