@php $sno = 1; @endphp @foreach($orders as $key => $row) @foreach($row->orderProducts as $products) @php $voucherVal = 0; $isSpsOrder = $row->isSPSOrder($row['order_id']); if(!empty($products->warehouseProd)){ $mrp = $products->price; $discount = $mrp - $products->price; }else{ $discount = 0 ; } if($isSpsOrder == 1) { $planinfo = $row->getManipulatedMrpForSpsOrder; if(!empty($planinfo)) { $defaultDiscount = $planinfo->discount; $bdayDiscount = $planinfo->bdaydiscount; $annDiscount = $planinfo->anndiscount; $aptDiscount = 5; $bapplied = false; $birthres = $products->orderByBirthday; if($birthres) { $bapplied = true; } $annApplied = false; $annverres = $products->orderByAnn; if($annverres) { $annApplied = true; } $aptApplied = false; $appoinres = $products->orderByAppointment; if($appoinres) { $aptApplied = true; } $vouchRes = $products->orderByVoucher; if($vouchRes) { $voucherVal = $vRow['value']; $totProds = $row->orderProducts->count(); if($voucherVal > 0) { $voucherVal = $voucherVal / $totProds; } } $mrpp = $products->price <= 0 ? 0 : $products->price - ( $products->offer + $products->discount ); if($mrpp == 0) { $smrp = $mrpp; } else { $tempMrp = $mrpp - $voucherVal; $tempMrp = $tempMrp - (($defaultDiscount/100) * $tempMrp); if($bapplied == true) { $tempMrp = $tempMrp - (($bdayDiscount/100) * $tempMrp); } if($annApplied == true) { $tempMrp = $tempMrp - (($annDiscount/100) * $tempMrp); } if($aptApplied == true) { $tempMrp = $tempMrp - (($aptDiscount/100) * $tempMrp); } $smrp = number_format($tempMrp,2,'.',''); } }else { $tax = $products->tax; $mrpp = $products->price <= 0 ? 0 : $products->price; $calMrp1 = ($tax * 100)/5; $calMrp2 = ($tax * 100)/12; $mixMrp1 = abs($mrpp - $calMrp1); $mixMrp2 = abs($mrpp - $calMrp2); if($mixMrp1 < $mixMrp2) { $smrp = abs($calMrp1 + $tax); } else { $smrp = abs($calMrp2 + $tax); } } }else{ $smrp = 0; } if($isSpsOrder == 1) { $gst = $smrp <= 999 ? 5 : 12; }else{ $gst = $mrp <= 999 ? 5 : 12; } if($isSpsOrder){ if($smrp > 0){ $rate = ($smrp/($gst + 100)) * 100; $baseval = ($smrp/($gst + 100)) * 100; $taxamt = $smrp - $rate; //$row['tax']; }else{ $rate = $baseval = $taxamt = 0; } }else{ if($products->price <= 0){ $rate = $baseval = $taxamt = 0; }else{ $rate = ($mrp/($gst + 100)) * 100; $baseval = ($mrp/($gst + 100)) * 100; $taxamt = $products->tax; } } if($taxamt <= 0) { $total =number_format(0,2); }else{ if($isSpsOrder == 1){ $total = number_format(($smrp * $products->quantity),3); }else{ $total = number_format(($mrp * $products->quantity),3); } } @endphp @endforeach @endforeach
From {{ !empty($startdate) ? $startdate : ''}} To {{ !empty($enddate) ? $enddate : ''}}
DSR PRODUCT WISE
S.No. store BILL Date HSN Barcode Section Sub Section Description Size Qty Invoice
Type
Style MRP SPS
MRP
Discount Offer Rate Base
Value
Tax (%) Tax
Amt
CGST (%) CGST
Amt
SGST (%) SGST
Amt
Total (₹)
{{ $sno }} {{ $row->warehouse->name }} {{ $row['invoice_prefix'] }}{{ $row['pos_order_suffix'] }} {{ $row['date_added'] }} {{ !empty($products->fabric) ? $products->fabric : 'N/A' }} {{ !empty($products->barcode) ? $products->barcode : 'N/A' }} {{ !empty($products->warehouseProd) ? $products->warehouseProd->section : 'N/A' }} {{ !empty($products->warehouseProd) ? $products->warehouseProd->subsection : 'N/A' }} {{ $products->model}} {{ $products->name}} {{ $products->size}} {{ $products->quantity}} S {{ !empty($products->warehouseProd) ? $products->warehouseProd->article : 'N/A' }} {{ !empty($products->price) ? $mrp : 'N/A' }} {{ !empty($isSpsOrder) ? number_format($smrp,3) : '0.00' }} {{ $discount}} {{ $products->offer}} {{number_format($rate,3)}} {{number_format($baseval,3)}} {{$gst}} {{number_format($taxamt,3)}} @if($taxamt <= 0) {{ 0 }} @else {{number_format(($gst/2),2)}} @endif @if($taxamt <= 0) {{ 0 }} @else {{number_format(($taxamt/2),2)}} @endif @if($taxamt <= 0) {{ 0 }} @else {{number_format(($gst/2),2)}} @endif @if($taxamt <= 0) {{ 0 }} @else {{number_format(($taxamt/2),2)}} @endif {{$total}}