@php $discount = isset($sale_return_invoice->getSaleInvoiceDiscounts) && $sale_return_invoice->getSaleInvoiceDiscounts!=''?$sale_return_invoice->getSaleInvoiceDiscounts->discount_amount:''; $patient = $sale_return_invoice->getPatient ?? null; $patientAddress = $patient->first_account_address ?? null; $patientState = $patientAddress->state->name ?? ''; $company = @$sale_return_invoice->getCompany; $comapnyState = $company->getCompanyAddress->getComapnyState->name ?? ''; if($discount>0 || $voucher_type->tax_applicable == '1') { $rowspan = 2; }else{ $rowspan = 1; } @endphp
@if($voucher_type && $voucher_type->tax_applicable == '1') @endif @if($discount>0) @endif @if($voucher_type && $voucher_type->tax_applicable == '1') @if($patientState == $comapnyState) @else @endif @endif @if($discount>0) @endif @if($voucher_type && $voucher_type->tax_applicable == '1') @if($patientState == $comapnyState) @else @endif @endif @php $total_gst_amount = 0; $IGST = $CGST = $SGST = $CESS = 0; $totalMrp = 0; $totalQnt = 0; $totalValue = 0; $totalValueAmount = 0; $totalDiscountAmount = 0; $discountAmount = 0; $totalAmount = 0; $productPriceAfterDiscount = 0; $mrp = 0; $IgstAmount = $CgstAmount = $SgstAmount = $CessAmount = 0; $totalIgstAmount = $totalCgstAmount = $totalSgstAmount = $totalCessAmount = 0; @endphp @foreach ($sale_return_invoice->getSaleInvoiceDetails as $key => $value) @php $discountAmount = $value->price * ($value->discount_percentage / 100); $totalMrp +=$value->price; $productPriceAfterDiscount = $value->price - $discountAmount; $totalQnt+=$value->main_qty; $totalValue+=$productPriceAfterDiscount*$value->main_qty; $totalValueAmount = $productPriceAfterDiscount*$value->main_qty; $totalDiscountAmount+=$value->discount_amount; $mrp = ($value->main_qty>0)?$value->customer_amount/$value->main_qty:0; @endphp @if($voucher_type && $voucher_type->tax_applicable == '1') @endif @if($discount>0) @endif @php $gst = $value->getProduct->getTaxMaster ->total_percentage ?? 0; $gst_amount = taxAmountCalculate($gst,$totalValueAmount); $total_gst_amount += $gst_amount; @endphp @if($voucher_type && $voucher_type->tax_applicable == '1') @php if ( isset( $value->getProduct ->getTaxMaster ->getTaxMasterSub, ) ) { foreach ($value->getProduct->getTaxMaster->getTaxMasterSub as $tax) { if ($tax->name == 'IGST') { $IGST = $tax->percentage ??0; $IgstAmount = taxAmountCalculate($tax->percentage,$totalValueAmount); $totalIgstAmount+=$IgstAmount; } elseif ( $tax->name == 'CGST' ) { $CGST = $tax->percentage ??0; $CgstAmount = taxAmountCalculate($tax->percentage,$totalValueAmount); $totalCgstAmount+=$CgstAmount; } elseif ( $tax->name == 'SGST' ) { $SGST = $tax->percentage ?? 0; $SgstAmount = taxAmountCalculate($tax->percentage,$totalValueAmount); $totalSgstAmount+=$SgstAmount; }elseif($tax->name == 'CESS') { $CESS = $tax->percentage ??0; $CessAmount = taxAmountCalculate($tax->percentage,$totalValueAmount); $totalCessAmount+=$CessAmount; } } } @endphp @if($patientState == $comapnyState) @else @endif @endif @endforeach @if($voucher_type && $voucher_type->tax_applicable == '1') @endif @if($discount>0) @endif @if($voucher_type && $voucher_type->tax_applicable == '1') @if($patientState == $comapnyState) @else @endif @endif
Sl.No Item Name & DetailsHSN/SACMRP Qty UOM RateDiscountTaxable AmtCGST SGSTIGSTCESSTotal
% Amt% Amt % Amt% Amt% Amt
{!! $key + 1 !!} {!! $value->getProduct->name ?? '' !!} {!! isset($value->item_batch) && $value->item_batch!='N/A' ? '
'.$value->item_batch : '' !!}
{!! $value->getProduct->hsncode ?? '' !!} {!! isset($mrp)? convertDecimelPoint($mrp): '' !!} {!! isset($value->main_qty) ? convertDecimelPoint($value->main_qty) : '' !!} {!! isset($value->getProduct->getProductPrimaryUnit->name)? $value->getProduct->getProductPrimaryUnit->name: '' !!} {!! isset($value->price)? convertDecimelPoint($value->price): '' !!} {!! $value->discount_percentage ?? '' !!} {!! isset($value->discount_amount) ? convertDecimelPoint($value->discount_amount) : '' !!}{!! convertDecimelPoint($totalValueAmount-$value->discount_amount) !!}{!! $CGST !!} {!! $CgstAmount?convertDecimelPoint($CgstAmount):0.00 !!} {!! $SGST !!} {!! $SgstAmount?convertDecimelPoint($SgstAmount):0.00 !!}{!! $IGST !!} {!! $IgstAmount?convertDecimelPoint($IgstAmount):0.00 !!}{!! $CESS !!} {!! $CessAmount?convertDecimelPoint($CessAmount):0.00 !!} {!! convertDecimelPoint($value->customer_amount) ?? '' !!} @php $newAmount = $value->customer_amount; $totalAmount+=$newAmount; @endphp
TOTAL {{-- {!! $totalMrp?convertDecimelPoint($totalMrp):'' !!} --}} {!! $totalQnt?convertDecimelPoint($totalQnt):'' !!} {!! $totalDiscountAmount?convertDecimelPoint($totalDiscountAmount):'' !!}{{-- {!! $total_gst_amount?convertDecimelPoint($total_gst_amount):'' !!} --}} {!! $totalCgstAmount?convertDecimelPoint($totalCgstAmount):0.00 !!} {!! $totalSgstAmount?convertDecimelPoint($totalSgstAmount):0.00 !!} {!! $totalIgstAmount?convertDecimelPoint($totalIgstAmount):0.00 !!} {!! $totalCessAmount?convertDecimelPoint($totalCessAmount):0.00 !!}{!! $totalAmount?convertDecimelPoint($totalAmount):0.00 !!}