@include('layouts/invoicePIQuotation/header')
| Sr NO. |
Product Name |
HSN |
GST(%) |
Quantity |
Unit Cost |
Total |
@php
$count=1;
$rowtotal=0.0;
$i_show=0;
$cs_show=0;
$gstvalue=0.0;
$rowgst=0.0;
$price=0.0;
$rowttl=0.0;
$subtotal=0.0;
$gsttotal=0.0;
$grandtotalbfround=0.0;
$grandtotal=0.0;
@endphp
@foreach( $product_details as $value )
@php
if($value->c_s_gst=="null")
{
$i_show=1;
$gstvalue=trim($value->i_gst,"%");
$rowgst=($value->unit_cost/100)*($gstvalue)*($value->quantity);
$rowgst=number_format($rowgst,2);
}
elseif($value->i_gst=="null")
{
$cs_show=1;
$gststring=preg_replace('/[^A-Za-z0-9-+-.\-]/', ' ', $value->c_s_gst);
$gstvalue=strtok($gststring, '+');
$display=((float)$gstvalue*2);
$rowgst=($value->unit_cost/100)*(((int)$gstvalue)*2)*($value->quantity);
$rowgst=number_format($rowgst,2);
}
$rowtotal=$value->unit_cost*$value->quantity;
$rowttl=$rowtotal;
$rowtotal=number_format($rowtotal,2);
$subtotal=($subtotal+$rowttl);
$gsttotal=((float)$gsttotal+((float)$rowgst));
$grandtotalbfround=($subtotal)+($gsttotal);
$bfround=round($grandtotalbfround);
$roundvalue=($grandtotalbfround-$bfround);
$roundvalue=number_format($roundvalue,2);
if($roundvalue < 0)
{
$grandtotal=$grandtotalbfround+-($roundvalue);
$grandttl=$grandtotalbfround+-($roundvalue);
$roundvalue=-($roundvalue);
$grandtotal=number_format($grandtotal,2);
}
else if($roundvalue > 0)
{
$grandtotal=$grandtotalbfround-($roundvalue);
$grandttl=$grandtotalbfround-($roundvalue);
$roundvalue=-($roundvalue);
$grandtotal=number_format($grandtotal,2);
}
else
{
$grandtotal=$grandtotalbfround;
$grandttl=$grandtotalbfround;
$grandtotal=number_format($grandtotal,2);
}
$words=getIndianCurrency($grandttl);
$price=number_format($value->unit_cost,2);
@endphp
| {{$count}} |
{{ $value->name }} |
{{ $value->HSN }} |
@if($value->c_s_gst=="null")
{{ $value->i_gst }} |
@elseif($value->i_gst=="null")
{{ $display }}% |
@endif
{{ $value->quantity }} |
₹{{ $price }} |
₹{{ $rowtotal }} |
@php
$count++;
@endphp
@endforeach
| OUR GSTIN: 24AALFT2125L1Z3 |
{{$data->note ? $data->note : ""}}
| Sub Total: |
₹{{ $subtotal }} |
@if($i_show==1)
| IGST: |
₹{{ $gsttotal }} |
@elseif($cs_show==1)
| SGST: |
₹{{ $gsttotal/2 }} |
| CGST: |
₹{{ $gsttotal/2 }} |
@endif
| Round Off: |
₹{{ $roundvalue }} |
| Grand Total: |
₹{{ $grandtotal }} |