@extends('Reports.template') @if ($trnType == 'I') @php $reportTitle = 'Sale Register Report'; @endphp @elseif($trnType == 'IR') @php $reportTitle = 'Sale Return Register Report'; @endphp @else @php $reportTitle = 'Sale & Sale Return Register Report'; @endphp @endif @section('title') {{ $reportTitle }} @endsection @section('ExternalCss') @parent @endsection @section('Content') @if ($reportType != 'PMS') @php if ($billType === 'P') { $billTypeTitle = 'Cash'; } elseif ($billType === 'C') { $billTypeTitle = 'Credit'; } elseif ($billType === 'B') { $billTypeTitle = 'Both'; } if ($trnStatus === 'P') { $trnStatusMessage = 'Partial'; } elseif ($trnStatus === 'T') { $trnStatusMessage = 'Cancelled'; } elseif ($trnStatus === 'C') { $trnStatusMessage = 'Completed'; } else { $trnStatusMessage = 'ALL'; } @endphp @if(!is_null($rateCard)) @endif @if ($reportType === 'B') @endif @php $oldPhTrnType = ''; $oldPhTrnId = ''; $datetime = 0; $headerSr = 1; $transactionSr = 1; $totalQty = 0; $remark = ''; $totalFreeQty = 0; $totalAmount = 0; $patOrCustName = 0; $createdBy = ''; $strike = 'noStrike'; $summaryBills = 0; $summaryGrossTotal = 0; $summaryDiscount = 0; $summaryNetTaxable = 0; $summaryCgst = 0; $summarySgst = 0; $summaryInvoiceAmt = 0; $summaryRoundOff = 0; $summaryTotal = 0; @endphp @foreach ($productTransactionData as $key => $productTransaction) @if ($productTransaction->ph_trn_id != $oldPhTrnId || $productTransaction->ph_trn_type != $oldPhTrnType) @if ($totalQty != 0) @if ($reportType === 'B') @endif @endif @php $transactionSr = 1; $strike = 'noStrike'; if ($productTransaction->patient_name != '') { $patOrCustName = $productTransaction->patient_id . ' / ' . $productTransaction->patient_name; } else { $patOrCustName = '*' . $productTransaction->ph_cust_id . ' / ' . $productTransaction->ph_cust_name; } $totalQty = 0; $remark = ''; $datetime = 0; $totalAmount = 0; @endphp @if ($productTransaction->ph_trn_status == 'T') @php $strike = 'strike'; @endphp @endif @if ($productTransaction->trn_type == 'I') @php $phGrossTotal = $productTransaction->ph_gross_total; $phDiscountAmt = $productTransaction->ph_discount_amt; $phNetTaxableAmt = $productTransaction->ph_net_taxable_amt; $phCgstAmt = $productTransaction->ph_cgst_amt; $phSgstAmt = $productTransaction->ph_sgst_amt; $phInvoiceAmt = $productTransaction->ph_invoice_amt; $phRoundOff = $productTransaction->ph_round_off; $phTotal = $productTransaction->ph_total; @endphp @else @php $phGrossTotal = -1 * $productTransaction->ph_gross_total; $phDiscountAmt = -1 * $productTransaction->ph_discount_amt; $phNetTaxableAmt = -1 * $productTransaction->ph_net_taxable_amt; $phCgstAmt = -1 * $productTransaction->ph_cgst_amt; $phSgstAmt = -1 * $productTransaction->ph_sgst_amt; $phInvoiceAmt = -1 * $productTransaction->ph_invoice_amt; $phRoundOff = -1 * $productTransaction->ph_round_off; $phTotal = -1 * $productTransaction->ph_total; @endphp @endif @php $paymentMode = ''; @endphp @if ($productTransaction->is_credit_bill == 'N') @php $paymentMode = $productTransaction->paymentMode; @endphp @endif @endif @if ($reportType === 'B') @php $refTrnNo = 0; @endphp @if ($productTransaction->trn_type != 'I' && $productTransaction->ref_trn_id != 0) @php $refTrnNo = 'I' . $productTransaction->ref_trn_id; @endphp @endif @endif @php $totalQty += $productTransaction->quantity; $remark = $productTransaction->ph_remarks; $totalAmount += $productTransaction->total; $datetime = $productTransaction->created_date; $createdBy = strtoupper($productTransaction->ph_created_by); $oldPhTrnType = $productTransaction->ph_trn_type; $oldPhTrnId = $productTransaction->ph_trn_id; @endphp @endforeach @if ($reportType === 'B') @endif @foreach ($saleSummary as $key => $summary) @if ($summary->trn_type == 'I') @php $footerHeading = 'Total Sale Bills : '; @endphp @else @php $footerHeading = 'Total Sale Return Bills : '; @endphp @endif @php $summaryBills += $summary->Bills; $summaryGrossTotal += $summary->gross_total; $summaryDiscount += $summary->discount; $summaryNetTaxable += $summary->netTaxable; $summaryCgst += $summary->cgst; $summarySgst += $summary->sgst; $summaryInvoiceAmt += $summary->invoice_amt; $summaryRoundOff += $summary->round_off; $summaryTotal += $summary->total; @endphp @endforeach @if (!empty($saleSummary)) @endif @php $currentTime = \Carbon\Carbon::now(); @endphp @endif
@if ($businessEntityMasterData[0]->logo != null) Pharmacy Logo @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) }}
Patient Category : @php $cat=""; foreach ($rateCard as $item) $cat.= $item->rate_card .'-'. $item->rate_type .', '; @endphp {{ rtrim($cat,', ') }}
Bill No   Bill Date Payment Received Payment Mode Patient / Customer Name Gross Disc Net Taxable CGST SGST Invoice R.Off Net Amount Created By
Sr   Medicine Name HSN Code Mfg Category P Unit S Unit P Size Ref No.  Batch Exp Qty MRP Disc% Disc Taxable GST% GST Amount
@if ($remark != '')   Remarks : {{ $remark }} @endif Total Qty : {{ \Helper::zeroValueToDash($totalQty) }}
  D.L NO : {{ $businessEntityMasterData[0]->dl_no }} GST NO : {{ $businessEntityMasterData[0]->gsttin_no }} {{ 'Created By : ' }} @if ($createdBy) {{ $createdBy . ' ' . Carbon\Carbon::parse($datetime)->format('d-m-Y h:i:s') }} @endif
@if ($productTransaction->is_credit_bill == 'Y') @endif {{ $productTransaction->trn_type . "/" . $productTransaction->trn_fyear . "/" . $productTransaction->ph_trn_id }}   {{ \Helper::getDisplayDate($productTransaction->trn_date) }} {{ $productTransaction->is_fully_paid == 'Y' ? 'Yes' : 'No' }} {{ $paymentMode }} {{ $patOrCustName }} {{ \Helper::customAmountFormat($phGrossTotal) }} {{ \Helper::customAmountFormat($phDiscountAmt) }} {{ \Helper::customAmountFormat($phNetTaxableAmt) }} {{ \Helper::customAmountFormat($phCgstAmt) }} {{ \Helper::customAmountFormat($phSgstAmt) }} {{ \Helper::customAmountFormat($phInvoiceAmt) }} {{ \Helper::customAmountFormat($phRoundOff) }} {{ \Helper::customAmountFormat($phTotal) }} {{ $productTransaction->ph_created_by }}
{{ $transactionSr++ }}   {{ \Helper::zeroValueToDash($productTransaction->product_name) }} {{ \Helper::zeroValueToDash($productTransaction->product_hsn_code) }} {{ \Helper::zeroValueToDash($productTransaction->manufacturer_name) }} {{ \Helper::zeroValueToDash($productTransaction->category_abbrev) }} {{ \Helper::zeroValueToDash($productTransaction->unit_abbrev) }} {{ \Helper::zeroValueToDash($productTransaction->suom) }} {{ \Helper::zeroValueToDash($productTransaction->conversion_factor) }} {{ \Helper::zeroValueToDash($refTrnNo) }} {{ $productTransaction->batch_no }} {{ \Helper::getMonthYearFromDate($productTransaction->batch_exp) }} {{ $productTransaction->quantity }} {{ \Helper::customAmountFormat($productTransaction->mrp) }} {{ \Helper::customAmountFormat($productTransaction->discount) }} {{ \Helper::customAmountFormat($productTransaction->discount_amt) }} {{ \Helper::customAmountFormat($productTransaction->taxable_amt) }} {{ \Helper::customAmountFormat(floatval($productTransaction->sgst_percentage) + floatval($productTransaction->cgst_percentage)) }} {{ \Helper::customAmountFormat(floatval($productTransaction->sgst_value) + floatval($productTransaction->cgst_value)) }} {{ \Helper::customAmountFormat($productTransaction->total) }}
@if ($remark != '')   Remarks : {{ $remark }} @endif Total Qty : {{ \Helper::zeroValueToDash($totalQty) }}
  D.L NO : {{ $businessEntityMasterData[0]->dl_no }} GST NO : {{ $businessEntityMasterData[0]->gsttin_no }} {{ 'Created By : ' }} @if ($createdBy) {{ $createdBy . ' ' . Carbon\Carbon::parse($datetime)->format('d-m-Y h:i:s') }} @endif
{{ $footerHeading . ' ' . \Helper::zeroValueToNbspSpace($summary->Bills) }} {{ \Helper::customAmountFormat($summary->gross_total) }} {{ \Helper::customAmountFormat($summary->discount) }} {{ \Helper::customAmountFormat($summary->netTaxable) }} {{ \Helper::customAmountFormat($summary->cgst) }} {{ \Helper::customAmountFormat($summary->sgst) }} {{ \Helper::customAmountFormat($summary->invoice_amt) }} {{ \Helper::customAmountFormat($summary->round_off) }} {{ \Helper::customAmountFormat($summary->total) }}
Total Bills : {{ \Helper::zeroValueToNbspSpace($summaryBills) }} {{ \Helper::customAmountFormat($summaryGrossTotal) }} {{ \Helper::customAmountFormat($summaryDiscount) }} {{ \Helper::customAmountFormat($summaryNetTaxable) }} {{ \Helper::customAmountFormat($summaryCgst) }} {{ \Helper::customAmountFormat($summarySgst) }} {{ \Helper::customAmountFormat($summaryInvoiceAmt) }} {{ \Helper::customAmountFormat($summaryRoundOff) }} {{ \Helper::customAmountFormat($summaryTotal) }}
{{ Config::get('constants.asterisk.WALK_CUST') }}, ✱{{ 'Credit Bill' }} {{ strtoupper(Session::get('userId')) . ' # ' . $currentTime->format('d/m/Y H:i:s ') }}

@if ($trnType == 'I') @php $reportType = 'Sale'; @endphp @elseif($trnType == 'IR') @php $reportType = 'Sale Return'; @endphp @else @php $reportType = 'Sale & Sale Return'; @endphp @endif @php $total_sale = 0; $total_sale_return = 0; $total_sale_bill = 0; $total_sale_return_bill = 0; $total_amount = 0; @endphp @foreach ($payment_mode_Summary as $key => $summary) @if ($summary[0]->SaleBill > 0) @php $total = 0; $sale = $summary[0]->Sale; $saleReturn = $summary[0]->SaleReturn; if ($summary[0]->Sale != null) { $total += $sale; $total_sale += $sale; } if ($summary[0]->SaleReturn != null) { $total += $saleReturn; $total_sale_return += $saleReturn; } $total_sale_bill += $summary[0]->SaleBill; $total_sale_return_bill += $summary[0]->SaleReturnBill; $total_amount = $total_sale - $total_sale_return; @endphp @if ($billType != 'C') @else @endif @endif @endforeach @php $total_sale_bill += $summary[0]->CreditSaleBill; $total_sale += $summary[0]->CreditSale; $total_sale_return_bill += $summary[0]->CreditSaleReturnBill; $total_sale_return += $summary[0]->CreditSaleReturn; $total_amount += $summary[0]->CreditSale - $summary[0]->CreditSaleReturn; @endphp @if ($billType != 'C') @else @endif @php $currentTime = \Carbon\Carbon::now(); @endphp
Sales Summery Payment Mode Wise Store : {{ $storeName }} Period : {{ \Helper::getDisplayDate($fromDate) }} TO {{ \Helper::getDisplayDate($toDate) }}
Payment Mode Sales Bill Count Sales Sales Return Bill Count Sales Return Total
{{ $summary[0]->CODE }} {{ $summary[0]->SaleBill }} {{ number_format((float) $sale, 2) }} {{ $summary[0]->SaleReturnBill }} {{ number_format((float) $saleReturn, 2) }} {{ number_format((float) $sale - $saleReturn, 2) }} {{ $summary[0]->CODE }} 0 0.00 0 0.00 0.00
Credit Bill {{ $summary[0]->CreditSaleBill }} {{ number_format((float) $summary[0]->CreditSale, 2) }} {{ $summary[0]->CreditSaleReturnBill }} {{ number_format((float) $summary[0]->CreditSaleReturn, 2) }} {{ number_format((float) $summary[0]->CreditSale - $summary[0]->CreditSaleReturn, 2) }}
Total : {{ $total_sale_bill }} {{ number_format((float) $total_sale, 2) }} {{ $total_sale_return_bill }} {{ number_format((float) $total_sale_return, 2) }} {{ number_format((float) $total_amount, 2) }} Total : 0 0.00 0 0.00 0.00
{{ Config::get('constants.asterisk.WALK_CUST') }}, ✱{{ 'Credit Bill' }} {{ strtoupper(Session::get('userId')) . ' # ' . $currentTime->format('d/m/Y H:i:s ') }}

@if ($patientId != '' && ($billType == 'C' || $billType == 'B')) @if ($trnType == 'I') @php $reportType = 'Sale'; @endphp @elseif($trnType == 'IR') @php $reportType = 'Sale Return'; @endphp @else @php $reportType = 'Sale & Sale Return'; @endphp @endif @php $total_sale = 0; $total_sale_return = 0; $total_sale_bill = 0; $total_sale_return_bill = 0; $total_amount = 0; @endphp @foreach ($payment_receipt_mode as $key => $summary) @php $total = 0; $sale = $summary[0]->Sale; $saleReturn = $summary[0]->SaleReturn; if ($summary[0]->Sale != null) { $total += $sale; $total_sale += $sale; } if ($summary[0]->SaleReturn != null) { $total += $saleReturn; $total_sale_return += $saleReturn; } $total_sale_bill += $summary[0]->SaleBill; $total_sale_return_bill += $summary[0]->SaleReturnBill; $total_amount = $total_sale - $total_sale_return; @endphp @if ($billType != 'P') @else @endif @endforeach @if ($billType != 'P') @else @endif @php $currentTime = \Carbon\Carbon::now(); @endphp
Receipt Payment Mode Wise - Only for Credit Bill Store : {{ $storeName }} Period : {{ \Helper::getDisplayDate($fromDate) }} TO {{ \Helper::getDisplayDate($toDate) }}
Payment Mode Receipt Count Receipt Amount Refund Receipt Count Refund Amount Total
{{ $summary[0]->CODE }} {{ $summary[0]->SaleBill }} {{ number_format((float) $sale, 2) }} {{ $summary[0]->SaleReturnBill }} {{ number_format((float) $saleReturn, 2) }} {{ number_format((float) $sale - $saleReturn, 2) }} {{ $summary[0]->CODE }} 0 0.00 0 0.00 0.00
Total : {{ $total_sale_bill }} {{ number_format((float) $total_sale, 2) }} {{ $total_sale_return_bill }} {{ number_format((float) $total_sale_return, 2) }} {{ number_format((float) $total_amount, 2) }} Total : 0 0.00 0 0.00 0.00
{{ Config::get('constants.asterisk.WALK_CUST') }}, ✱{{ 'Credit Bill' }} {{ strtoupper(Session::get('userId')) . ' # ' . $currentTime->format('d/m/Y H:i:s ') }}
@endif
Back
@endsection @section('BootstrapModals') @endsection @section('ExternalJs') @endsection