@include('layouts.head')
@if (isset( $supplier_list[0]->id) && $supplier_list[0]->id !='')
|
Customer Name : {{ $supplier_list[0]->id }} - {{ $supplier_list[0]->name }}
|
|
Contact Person : {{ $supplier_list[0]->person_name }}
|
|
Address : {{ $supplier_list[0]->address }}
|
|
Mobile No. : {{ $supplier_list[0]->mobile }}
|
@else
Customer Name : {{ isset($_GET['id']) && $_GET['id'] == "All" ? "All" : "Summary" }}
|
@endif
@php
$total = 0;
$g_torder_quantity = 0;
$g_t_quantity = 0;
$g_t_total_price = 0;
@endphp
@if (isset($_GET['id']) && $_GET['id'] == 'All')
@foreach($department_info as $txn_date => $dept)
@php
$sub_grand_qty = 0;
$sub_grand_total = 0;
@endphp
| Date: {!! date('d-F-Y', strtotime($txn_date)) !!} |
@foreach($dept as $sales_id => $catrow)
@php
unset($product_quantity);
$product_id = isset($catrow->product_id) ? explode(',',$catrow->product_id) : [];
$product_qty = isset($catrow->product_qty) ? explode(',',$catrow->product_qty) : [];
$product_information = [];
foreach ($product_id as $k => $v)
{
$product_quantity[$v] = 0;
$product_information[$v] = $product_qty[$k];
}
foreach ($product_id as $k => $v)
{
$product_quantity[$v] += @$product_qty[$k];
}
@endphp
| PI#{{ $sales_id }} {{'- - -'}}Customer Name : {{ $catrow->id }} - {{ $catrow->name }} |
@php
$i = 1;
$torder_quantity = 0;
$t_quantity = 0;
$t_total_price = 0;
foreach($product_info as $row)
{
// print_r($product_information[$row->product_id]);
// print_r($row->product_id);
// exit();
$product_qty = isset($product_information[$row->product_id]) ? $product_information[$row->product_id] : 0;
//$product_qty = $product_information[$row->product_id];
$product_id = $row->product_id;
$product_name = $row->product_name;
$pack_type = $row->pack_type;
$tp_price = $row->tp_price;
$total = $product_qty;
$total_value = $total * $tp_price;
if(isset($product_quantity[$product_id]))
{
$torder_quantity = $product_qty;
$t_quantity += $total;
$t_total_price += $total_value;
echo '';
echo '| '. $i++ .' | ';
echo ''. $product_id .' | ';
echo ''. $product_name .' | ';
echo ''. $pack_type .' | ';
echo ''. $product_qty .' | ';
echo ''. $tp_price .' | ';
echo ''. $total_value .' | ';
echo '
';
}
}
$g_torder_quantity += $torder_quantity;
$g_t_quantity += $t_quantity;
$g_t_total_price += $t_total_price;
$sub_grand_qty += $torder_quantity;
$sub_grand_total += $t_total_price;
@endphp
| Voucher Total = |
|
{!! number_format($torder_quantity) !!} |
|
{!! number_format($t_total_price,2) !!} |
@endforeach
| Sub Total = |
|
{!! number_format($sub_grand_qty) !!} |
|
{!! number_format($sub_grand_total,2) !!} |
@endforeach
@else
@foreach($department_info as $sales_id => $catrow)
@php
unset($product_quantity);
$product_id = isset($catrow->product_id) ? explode(',',$catrow->product_id) : [];
$product_qty = isset($catrow->product_qty) ? explode(',',$catrow->product_qty) : [];
foreach ($product_id as $k => $v)
{
$product_quantity[$v] = 0;
}
foreach ($product_id as $k => $v)
{
$product_quantity[$v] += @$product_qty[$k];
}
@endphp
@if (isset($_GET['id']) && $_GET['id'] != "")
| PI#{{ $catrow->sales_id }} - - - Date: {!! date('d-F-Y', strtotime($catrow->txn_date)) !!} |
@endif
@php
$i = 1;
$torder_quantity = 0;
$t_quantity = 0;
$t_total_price = 0;
foreach($product_info as $row)
{
$product_id = $row->product_id;
$product_name = $row->product_name;
$pack_type = $row->pack_type;
$product_qty = $row->quantity;
$tp_price = $row->tp_price;
$total = $product_qty;
$total_value = $total * $tp_price;
if(isset($product_quantity[$product_id]))
{
$torder_quantity += $product_qty;
$t_quantity += $total;
$t_total_price += $total_value;
echo '';
echo '| '. $i++ .' | ';
echo ''. $product_id .' | ';
echo ''. $product_name .' | ';
echo ''. $pack_type .' | ';
echo ''. $product_qty .' | ';
echo ''. $tp_price .' | ';
echo ''. $total_value .' | ';
echo '
';
}
}
$g_torder_quantity += $torder_quantity;
$g_t_quantity += $t_quantity;
$g_t_total_price += $t_total_price;
@endphp
@if (isset($_GET['id']) && $_GET['id'] != "")
| Sub Total = |
|
{!! number_format($torder_quantity) !!} |
|
{!! number_format($t_total_price,2) !!} |
@endif
@endforeach
@endif
| Grand Total = |
|
{!! number_format($g_torder_quantity) !!} |
|
{{ number_format($g_t_total_price,2) }} |
| IN WORDS : {!! numberTowords($g_t_total_price) !!} |
@endsection