@extends('Reports.template') @section('title') @php $reportTitle = "Sales Summary With GST Details"; if($billType=='B'){ $billType = "Credit and Cash"; $reportTitle = $reportTitle." / ".$billType; }else if($billType=='C'){ $billType = "Cash"; $reportTitle = $reportTitle." / ".$billType; }else if($billType=='CR'){ $billType = "Credit"; $reportTitle = $reportTitle." / ".$billType; } @endphp {{$reportTitle}} @endsection @section('ExternalCss') @parent @endsection @section('Content') @if($reportType == "D") @php $currentTime = \Carbon\Carbon::now(); @endphp @php $totalTaxableAmt = 0; $totalCashTaxableSaleAmt = 0; $totalCreditTaxableSaleAmt = 0; $totalTaxableSaleAmt = 0; $totalCashTaxableReturnAmt = 0; $totalCreditTaxableReturnAmt = 0; $totalTaxableReturnAmt = 0; $totalTaxable = 0; $netTaxableAmt = 0; $totalSgstAmt = 0; $totalCashSaleSgstAmt = 0; $totalCreditSaleSgstAmt = 0; $totalSaleSgstAmt = 0; $totalCashReturnSgst = 0; $totalCreditReturnSgst = 0; $totalReturnSgst = 0; $netSgstAmt = 0; $totalCgstAmt = 0; $totalCashSaleCgstAmt = 0; $totalCreditSaleCgstAmt = 0; $totalSaleCgstAmt = 0; $totalCashReturnCgst = 0; $totalCreditReturnCgst = 0; $totalReturnCgst = 0; $netCgstAmt = 0; $totalRoundoffAmt = 0; $totalCashRoundoffSaleAmt = 0; $totalCreditRoundoffSaleAmt = 0; $totalRoundoffSaleAmt = 0; $totalCashRoundoffReturnAmt = 0; $totalCreditRoundoffReturnAmt = 0; $totalRoundoffReturnAmt = 0; $netRoundoff = 0; $patientsale = ''; $patOrCustName = 0; $tempPatientName =''; $sr = 1; $totalsale = 0; $totalCashSaleAmt = 0; $totalCreditSaleAmt = 0; $totalSaleAmt = 0; $totalCashSaleReturnAmt = 0; $totalCreditSaleReturnAmt = 0; $totalSaleReturnAmt = 0; $netSaleAmt = 0; @endphp @foreach ($patientdata as $key=>$patient) @if($patient->trn_date != $patientsale) @if($totalsale != 0) @php $patientsale =''; $totalsale = 0; $totalTaxableAmt = 0; $totalCgstAmt = 0; $totalSgstAmt = 0; $totalRoundoffAmt = 0; $totalTaxable = 0; @endphp @endif @endif @if($patient->trn_type == 'IR' || $patient->trn_type == 'GCR') @php $totalTaxableAmt -= $patient->net_taxable_amt; $totalSgstAmt -=$patient->sgst_amt; $totalCgstAmt -=$patient->cgst_amt; $totalRoundoffAmt -=$patient->round_off; $totalTaxable = $patient->net_taxable_amt *(-1); $totalCgst = $patient->cgst_amt *(-1); $totalSgst = $patient->sgst_amt *(-1); $totalRoundoff = $patient->round_off *(-1); $totalsale -= $patient->total; $patientsale =$patient->total * (-1); if($patient->is_credit_bill == "Y"){ $totalCreditTaxableReturnAmt += $patient->net_taxable_amt; $totalCreditRoundoffReturnAmt += $patient->round_off; $totalCreditSaleReturnAmt+=$patient->total; $totalCreditReturnCgst +=$patient->cgst_amt; $totalCreditReturnSgst +=$patient->sgst_amt; }else{ $totalCashTaxableReturnAmt += $patient->net_taxable_amt; $totalCashRoundoffReturnAmt += $patient->round_off; $totalCashSaleReturnAmt+=$patient->total; $totalCashReturnCgst +=$patient->cgst_amt; $totalCashReturnSgst +=$patient->sgst_amt; } $totalTaxableReturnAmt += $patient->net_taxable_amt; $totalRoundoffReturnAmt += $patient->round_off; $totalSaleReturnAmt+=$patient->total; $totalReturnCgst +=$patient->cgst_amt; $totalReturnSgst +=$patient->sgst_amt; @endphp @else @php $totalTaxableAmt += $patient->net_taxable_amt; $totalsale += $patient->total; $patientsale = $patient->total; $totalTaxable = $patient->net_taxable_amt; $totalSgst = $patient->sgst_amt; $totalCgst = $patient->cgst_amt; $totalRoundoff = $patient->round_off; $totalSgstAmt +=$patient->sgst_amt; $totalCgstAmt +=$patient->cgst_amt; $totalRoundoffAmt +=$patient->round_off; if($patient->is_credit_bill == "Y"){ $totalCreditSaleAmt +=$patient->total; $totalCreditTaxableSaleAmt +=$patient->net_taxable_amt; $totalCreditRoundoffSaleAmt += $patient->round_off; $totalCreditSaleCgstAmt +=$patient->cgst_amt; $totalCreditSaleSgstAmt +=$patient->sgst_amt; }else{ $totalCashSaleAmt +=$patient->total; $totalCashTaxableSaleAmt +=$patient->net_taxable_amt; $totalCashRoundoffSaleAmt += $patient->round_off; $totalCashSaleCgstAmt +=$patient->cgst_amt; $totalCashSaleSgstAmt +=$patient->sgst_amt; } $totalSaleAmt +=$patient->total; $totalTaxableSaleAmt +=$patient->net_taxable_amt; $totalRoundoffSaleAmt += $patient->round_off; $totalSaleCgstAmt +=$patient->cgst_amt; $totalSaleSgstAmt +=$patient->sgst_amt; @endphp @endif @php $netTaxableAmt =$totalTaxableSaleAmt-$totalTaxableReturnAmt; $netSaleAmt =$totalSaleAmt-$totalSaleReturnAmt; $netCgstAmt =$totalSaleCgstAmt-$totalReturnCgst; $netSgstAmt =$totalSaleSgstAmt-$totalReturnSgst; $netRoundoff = $totalRoundoffSaleAmt - $totalRoundoffReturnAmt; @endphp @php if($patient->patient_name != ''){ $patOrCustName = $patient->patient_name; }else{ $patOrCustName = '*'.$patient->ph_cust_name; } if($patient->is_credit_bill == "Y"){ $bill = "Credit"; }else{ $bill = "Cash"; } @endphp @if($patient->trn_date != $tempPatientName) @else @endif @php $patientsale = $patient->trn_date; $tempPatientName = $patient->trn_date; @endphp @endforeach
@if($businessEntityMasterData[0]->logo != null) Pharmacy Logologo )}}" /> @endif
{{ $businessEntityMasterData[0]->name }}
{{$businessEntityMasterData[0]->add1. " " .$businessEntityMasterData[0]->add2 ." ".$businessEntityMasterData[0]->city." : " .$businessEntityMasterData[0]->pincode }}
{{"Phone : ".$businessEntityMasterData[0]->tel1}}
{{$reportTitle}} Store : {{$storeName}} Period : {{\Helper::getDisplayDate($fromDate)}} TO {{\Helper::getDisplayDate($toDate)}}
Sr No Bill Date Bill No Patient Name Bill Type Taxable Amt CGST Amt SGST Amt Round Off Total
Total {{\Helper::customAmountFormat($totalTaxableAmt)}} {{\Helper::customAmountFormat($totalCgstAmt)}} {{\Helper::customAmountFormat($totalSgstAmt)}} {{\Helper::customAmountFormat($totalRoundoffAmt)}} {{\Helper::customAmountFormat($totalsale)}}
{{$sr++}} {{\Helper::getDisplayDate($patient->trn_date)}} {{$patient->trn_type."/".$patient->trn_fyear."/".$patient->trn_id}} {{$patOrCustName}} {{$bill}} {{ $totalTaxable == 0 ? '0.00' : \Helper::customAmountFormat($totalTaxable) }} {{ $totalCgst == 0 ? '0.00' : \Helper::customAmountFormat($totalCgst) }} {{ $totalSgst == 0 ? '0.00' : \Helper::customAmountFormat($totalSgst) }} {{ $totalRoundoff == 0 ? '0.00' : \Helper::customAmountFormat($totalRoundoff) }} {{ $patientsale == 0 ? '0.00' : \Helper::customAmountFormat($patientsale) }}
Total {{\Helper::customAmountFormat($totalTaxableAmt)}} {{\Helper::customAmountFormat($totalCgstAmt)}} {{\Helper::customAmountFormat($totalSgstAmt)}} {{\Helper::customAmountFormat($totalRoundoffAmt)}} {{\Helper::customAmountFormat($totalsale)}}
Total Cash Sales : {{ \Helper::customAmountFormat($totalCashTaxableSaleAmt)}} {{ \Helper::customAmountFormat($totalCashSaleCgstAmt)}} {{ \Helper::customAmountFormat($totalCashSaleSgstAmt)}} {{ \Helper::customAmountFormat($totalCashRoundoffSaleAmt)}} {{ \Helper::customAmountFormat($totalCashSaleAmt)}}
Total Credit Sales : {{ \Helper::customAmountFormat($totalCreditTaxableSaleAmt)}} {{ \Helper::customAmountFormat($totalCreditSaleCgstAmt)}} {{ \Helper::customAmountFormat($totalCreditSaleSgstAmt)}} {{ \Helper::customAmountFormat($totalCreditRoundoffSaleAmt)}} {{ \Helper::customAmountFormat($totalCreditSaleAmt)}}
Total Sales : {{ \Helper::customAmountFormat($totalTaxableSaleAmt)}} {{ \Helper::customAmountFormat($totalSaleCgstAmt)}} {{ \Helper::customAmountFormat($totalSaleSgstAmt)}} {{ \Helper::customAmountFormat($totalRoundoffSaleAmt)}} {{ \Helper::customAmountFormat($totalSaleAmt)}}
Total Cash Sales Return : {{ \Helper::customAmountFormat($totalCashTaxableReturnAmt)}} {{ \Helper::customAmountFormat($totalCashReturnCgst)}} {{ \Helper::customAmountFormat($totalCashReturnSgst)}} {{ \Helper::customAmountFormat($totalCashRoundoffReturnAmt)}} {{ \Helper::customAmountFormat($totalCashSaleReturnAmt)}}
Total Credit Sales Return : {{ \Helper::customAmountFormat($totalCreditTaxableReturnAmt)}} {{ \Helper::customAmountFormat($totalCreditReturnCgst)}} {{ \Helper::customAmountFormat($totalCreditReturnSgst)}} {{ \Helper::customAmountFormat($totalCreditRoundoffReturnAmt)}} {{ \Helper::customAmountFormat($totalCreditSaleReturnAmt)}}
Total Sales Return : {{ \Helper::customAmountFormat($totalTaxableReturnAmt)}} {{ \Helper::customAmountFormat($totalReturnCgst)}} {{ \Helper::customAmountFormat($totalReturnSgst)}} {{ \Helper::customAmountFormat($totalRoundoffReturnAmt)}} {{ \Helper::customAmountFormat($totalSaleReturnAmt)}}
Net Total : {{ \Helper::customAmountFormat($netTaxableAmt)}} {{ \Helper::customAmountFormat($netCgstAmt)}} {{ \Helper::customAmountFormat($netSgstAmt)}} {{ \Helper::customAmountFormat($netRoundoff)}} {{ \Helper::customAmountFormat($netSaleAmt)}}
{{Config::get('constants.asterisk.WALK_CUST')}} {{ strtoupper(Session::get('userId'))." # ".$currentTime->format('d/m/Y H:i:s ')}}
@endif @if($reportType == "S") @php $currentTime = \Carbon\Carbon::now(); @endphp
@if($businessEntityMasterData[0]->logo != null) Pharmacy Logologo )}}" /> @endif
{{ $businessEntityMasterData[0]->name }}
{{$businessEntityMasterData[0]->add1. " " .$businessEntityMasterData[0]->add2 ." ".$businessEntityMasterData[0]->city." : " .$businessEntityMasterData[0]->pincode }}
{{"Phone : ".$businessEntityMasterData[0]->tel1}}
{{$reportTitle}} Store : {{$storeName}} Period : {{\Helper::getDisplayDate($fromDate)}} TO {{\Helper::getDisplayDate($toDate)}}
{{ strtoupper(Session::get('userId'))." # ".$currentTime->format('d/m/Y H:i:s ')}}
@endif

GST Summary - Sales / {{$billType}}

@php $sgstAmt = 0; $cgstAmt = 0; $netTaxableTotal = 0; $netSale = 0; $total = 0; @endphp @foreach ($salegstSummary as $key => $gst) @if($gst->trn_type == "I") @php $gstRange = $gst->sgst_percentage + $gst->cgst_percentage; $sgstAmt += $gst->sgst_amt; $cgstAmt += $gst->cgst_amt; $netTaxableTotal += $gst->net_taxable; $total = $gst->net_taxable + $gst->sgst_amt + $gst->cgst_amt; $netSale += $total; @endphp @endif @endforeach
Taxable CGST SGST Sale
% Amount % Amount % Amount Total Amount
{{$gstRange}} {{\Helper::customAmountFormat($gst->net_taxable)}} {{$gst->cgst_percentage}} {{\Helper::customAmountFormat($gst->cgst_amt)}} {{$gst->sgst_percentage}} {{\Helper::customAmountFormat($gst->sgst_amt)}} {{\Helper::customAmountFormat($total)}}
Total {{\Helper::customAmountFormat($netTaxableTotal)}} {{\Helper::customAmountFormat($cgstAmt)}} {{\Helper::customAmountFormat($sgstAmt)}} {{\Helper::customAmountFormat($netSale)}}

GST Summary - Sales Return / {{$billType}}

@php $sgstAmt = 0; $cgstAmt = 0; $netTaxableTotal = 0; $netSale = 0; $total = 0; @endphp @foreach ($salegstSummary as $key => $gst) @if($gst->trn_type == "IR" || $gst->trn_type == 'GCR') @php $gstRange = $gst->sgst_percentage + $gst->cgst_percentage; $sgstAmt += $gst->sgst_amt; $cgstAmt += $gst->cgst_amt; $netTaxableTotal += $gst->net_taxable; $total = $gst->net_taxable + $gst->sgst_amt + $gst->cgst_amt; $netSale += $total; @endphp @endif @endforeach
Taxable CGST SGST Sale
% Amount % Amount % Amount Total Amount
{{$gstRange}} {{\Helper::customAmountFormat((-1)*$gst->net_taxable)}} {{$gst->cgst_percentage}} {{\Helper::customAmountFormat((-1)*$gst->cgst_amt)}} {{$gst->sgst_percentage}} {{\Helper::customAmountFormat((-1)*$gst->sgst_amt)}} {{\Helper::customAmountFormat((-1)*$total)}}
Total {{\Helper::customAmountFormat((-1)*$netTaxableTotal)}} {{\Helper::customAmountFormat((-1)*$cgstAmt)}} {{\Helper::customAmountFormat((-1)*$sgstAmt)}} {{\Helper::customAmountFormat((-1)*$netSale)}}

GST Summary - Total / {{$billType}}

@php $oldGstRange = 0; $oldGstPercentage = ''; $sgstAmt = 0; $cgstAmt = 0; $netTaxableTotal = 0; $netSale = 0; $total = 0; $totalTaxable = 0; $totalSgstAmt = 0; $totalCgstAmt = 0; $totalAmt = 0; @endphp @foreach ($salegstSummary as $key => $gst) @php $gstRange = $gst->sgst_percentage + $gst->cgst_percentage; @endphp @if($gstRange != $oldGstRange) @php $totalTaxable = 0; $totalSgstAmt = 0; $totalCgstAmt = 0; $totalAmt = 0; @endphp @endif @php $sgstAmt += $gst->sgst_amt; $totalSgstAmt += $gst->sgst_amt; $cgstAmt += $gst->cgst_amt; $totalCgstAmt += $gst->cgst_amt; $netTaxableTotal += $gst->net_taxable; $totalTaxable += $gst->net_taxable; $total = $gst->net_taxable + $gst->sgst_amt + $gst->cgst_amt; $netSale += $total; $totalAmt += $total; @endphp @php $oldGstRange = $gstRange; $oldGstPercentage = $gst->cgst_percentage; @endphp @endforeach
Taxable CGST SGST Sale
% Amount % Amount % Amount Total Amount
{{$oldGstRange}} {{\Helper::customAmountFormat($totalTaxable)}} {{$oldGstPercentage}} {{\Helper::customAmountFormat($totalCgstAmt)}} {{$oldGstPercentage}} {{\Helper::customAmountFormat($totalSgstAmt)}} {{\Helper::customAmountFormat($totalAmt)}}
{{$oldGstRange}} {{\Helper::customAmountFormat($totalTaxable)}} {{$oldGstPercentage}} {{\Helper::customAmountFormat($totalCgstAmt)}} {{$oldGstPercentage}} {{\Helper::customAmountFormat($totalSgstAmt)}} {{\Helper::customAmountFormat($totalAmt)}}
Total {{\Helper::customAmountFormat($netTaxableTotal)}} {{\Helper::customAmountFormat($cgstAmt)}} {{\Helper::customAmountFormat($sgstAmt)}} {{\Helper::customAmountFormat($netSale)}}


Back
@endsection @section('BootstrapModals') @endsection @section('ExternalJs') @endsection