@php
$ItemListIndex = 1;
$totalPrice = 0;
$totalQty = 0;
$totalSubTotal = 0;
$totalAmount = 0;
$totalDiscount = 0;
$totalNet = 0;
@endphp
@foreach($data->list as $index)
@php
$totalAmount += $index->totalSaleAmount;
$totalDiscount += $index->totalDiscountAmount;
$totalNet += ($index->totalSaleAmount - $index->totalDiscountAmount);
@endphp
@if($data->type == 'invoiceDetails')
{
@php
$size = isset($index->billingDetails) ? count($index->billingDetails) : 1;
@endphp
@if($index->billingDetails != null)
{
@foreach($index->billingDetails as $product)
@php
$totalPrice += $product->unitPrice;
$totalQty += $product->quantity;
$totalSubTotal += ($product->netSales);
@endphp
@if($loop->first)
{{$ItemListIndex}} |
{{$index->corporateCustomerName}} |
{{$index->customerName}} |
{{$Controller::dateFormatter($index->billingDate)}} |
{{$index->invoiceNo}} |
@endif
@if(isset($product->productItem->name))
{{$product->productItem->name}}
@else
{{$product->itemName}}
@endif
|
{{number_format($product->unitPrice, 2), 2}} |
{{number_format($product->discountRate, 2), 2}} |
{{$product->quantity}} |
{{number_format($product->netSales, 2), 2}} |
@if($loop->first)
{{number_format($index->totalSaleAmount, 2), 2}}
|
{{number_format($index->totalDiscountPercentage, 2), 2}} |
{{number_format($index->totalDiscountAmount, 2), 2}} |
{{number_format(($index->totalSaleAmount - $index->totalDiscountAmount), 2), 2}} |
@endif
@endforeach
}
@else
{
{{$ItemListIndex}} |
{{$Controller::dateFormatter($index->billingDate)}} |
{{$index->customerName}} |
{{$index->customerRegNo}} |
{{$index->invoiceNo}} |
|
|
|
|
{{number_format($index->totalSaleAmount, 2), 2}} |
{{number_format($index->totalDiscountAmount, 2), 2}} |
{{number_format(($index->totalSaleAmount - $index->totalDiscountAmount), 2), 2}} |
}
@endif
}
@else
{
{{$ItemListIndex}} |
{{$index->corporateCustomerName}} |
{{$index->customerName}} |
{{$Controller::dateFormatter($index->billingDate)}} |
{{$index->invoiceNo}} |
{{number_format($index->totalSaleAmount, 2), 2}} |
{{number_format($index->totalDiscountPercentage, 2), 2}} |
{{number_format($index->totalDiscountAmount, 2), 2}} |
{{number_format($index->totalSaleAmount - $index->totalDiscountAmount, 2), 2}} |
}
@endif
@php $ItemListIndex++ @endphp
@endforeach
@if($data->type == 'invoiceDetails')
Total = |
{{number_format($totalPrice, 2), 2}} |
|
{{($totalQty)}} |
{{number_format($totalSubTotal, 2), 2}} |
{{number_format($totalAmount, 2), 2}} |
|
{{number_format($totalDiscount, 2), 2}} |
{{number_format($totalNet, 2), 2}} |
@else
Total = |
{{number_format($totalAmount, 2), 2}} |
|
{{number_format($totalDiscount, 2), 2}} |
{{number_format($totalNet, 2), 2}} |
@endif