@extends('Reports.template') @section('title') @if($trnType == "I") @php $title= "Sales Bill"; @endphp @elseif($trnType == "IR") @php $title= "Sales Return Bill"; @endphp @elseif($trnType == "DC") @php $title= "Delivery Challan"; @endphp @else @php $title= "Delivery Challan Return"; @endphp @endif {{$title}} @endsection @section('ExternalCss') @parent @endsection @section('Content') @php $doctorName = ''; if ($productHeader[0]->doctor_name != '') { $doctorName = $productHeader[0]->doctor_name; } if($paraDoctor != 'false'){ $doctorName = $paraDoctor; } $patientAdress = ''; if ($productHeader[0]->patient_village != '') { $patientAdress = $productHeader[0]->patient_village; } $trnDate = date("d/m/Y", strtotime(str_replace("-", "/", $productHeader[0]->trn_date))); // if($trnType == 'I' || $trnType == 'IR') // { // if($salesGstExempt == "N") // { // $invvoice_type='- TAX INVOICE'; // } // else // { // $invvoice_type='- BILL OF SUPPLY'; // } // } if($trnType == 'I'){ if($productHeader[0]->is_credit_bill == 'Y'){ $reportTitle = 'PHARMACY BILL '; }else{ $reportTitle = 'PHARMACY BILL '; } $no = "Bill No : "; $date = "Bill Date : "; }else if ($trnType == 'IR'){ if($productHeader[0]->is_credit_bill == 'Y'){ $reportTitle = 'MEDICINE RETURN NOTE '; }else{ $reportTitle = 'MEDICINE RETURN NOTE '; } $no = 'MR No : '; $date = 'MR Date : '; }else if ($trnType == "DC"){ $reportTitle = "DELIVERY CHALLAN"; $no = "DC No : "; $date = "DC Date : "; }else if ($trnType == "DCR"){ $reportTitle = "DELIVERY CHALLAN RETURN"; $no = "DCR No : "; $date = "DCR Date : "; } @endphp @if($salesGstExempt == "N" && ($trnType == "I" || $trnType == "IR")) @if($show_discount == "Y") @endif @if($show_discount == "Y") @endif @else @if($show_discount == "Y") @endif @if($show_discount == "Y") @endif @endif @php $i = 1; $mrp = 0; $totalGstAmount = 0; $netTotal = 0; $mrpValue = 0; $totalQty = 0; $totalmrpValue = 0; $oldRefTrnType = ''; $oldRefTrnId = 0; $grand_discount_amt=0; @endphp @foreach ($productTransactionData as $key =>$productTransaction) @php $time = strtotime($productTransaction->batch_exp); $month = date("m",$time); $year = date("y",$time); $batchExp = $month."/".$year; if($year == "70"){ $batchExp = ""; } $gstPercentage = (float)$productTransaction->sgst_percentage + (float)$productTransaction->cgst_percentage; $gstAmount = (float)$productTransaction->sgst_value + (float)$productTransaction->cgst_value; $totalGstAmount += $gstAmount; $totalQty += $productTransaction->quantity; $netTotal = $productTransaction->total - $productTransaction->discount_amt; // Calculate rate on original MRP $orgi_mrp_per_unit=$productTransaction->original_mrp/$productTransaction->conversion_factor; $mrpValue = round($productTransaction->quantity*$orgi_mrp_per_unit,2); $discount_amt=$productTransaction->discount_amt+($orgi_mrp_per_unit-$productTransaction->mrp)*$productTransaction->quantity; $grand_discount_amt+=$discount_amt; $mrpValue = round($productTransaction->quantity*$productTransaction->mrp,2); $totalmrpValue += $mrpValue; $discountPercentage = ($productTransaction->discount_type == 'P' || $productTransaction->discount_type == NULL ) ? number_format($productTransaction->discount,1) : '' ; @endphp @if($trnType == "I" && ($refTrnType == "DC" || $refTrnType == "DCR") && ($oldRefTrnType != $productTransaction->ref_trn_type || $oldRefTrnId != $productTransaction->ref_trn_id)) @endif @if($productTransaction->product_hsn_code!='0' && $productTransaction->product_hsn_code!=NULL && $hsncode->value == 'Y') @php $productHsnCode = " --- (".$productTransaction->product_hsn_code.")"; @endphp @else @php $productHsnCode = ''; @endphp @endif @if($salesGstExempt == "N" && ($trnType == "I" || $trnType == "IR")) {{-- --}} {{-- --}} @if($show_discount == "Y") @endif {{-- --}} @if($show_discount == "Y") @endif @else @if($show_discount == "Y") @endif @endif @php $mrp += $productTransaction->mrp; $oldRefTrnType = $productTransaction->ref_trn_type; $oldRefTrnId = $productTransaction->ref_trn_id; @endphp @endforeach @php $totalGstValue = (float)$productTransaction->sgst_value + (float)$productTransaction->cgst_value @endphp @if($salesGstExempt == "N" && ($trnType == "I" || $trnType == "IR")) @if($show_discount == "Y") {{-- --}} @endif @else @if($show_discount == "Y") @endif @endif @if($productHeader[0]->discount_amt > 0 && $show_discount == "Y") @else @endif @if($printRoomDetailsInPharmacyBillParameter->value == 'Y') @endif @endif @if(isset($businessEntityMasterData[0]->name) ) @if(!empty($businessEntityMasterData[0]->remarks)) @endif @endif @php $currentTime = \Carbon\Carbon::now(); @endphp @if($printRemarkParameter != "") @else @endif
@if(isset($businessEntityMasterData[0]->logo) ) Pharmacy Logologo )}}"/> @endif @if(isset($businessEntityMasterData[0]->name) )
{{ $businessEntityMasterData[0]->name }}
@endif @if(isset($businessEntityMasterData[0]->add1) && isset($businessEntityMasterData[0]->add2) && isset($businessEntityMasterData[0]->city) && isset($businessEntityMasterData[0]->pincode))
{{$businessEntityMasterData[0]->add1. " " .$businessEntityMasterData[0]->add2 ." ".$businessEntityMasterData[0]->city." : " .$businessEntityMasterData[0]->pincode }}
@endif @if(isset($businessEntityMasterData[0]->tel1) )
{{"Phone : ".$businessEntityMasterData[0]->tel1}}
@endif
@if($trnType == 'I' || $trnType == 'IR') @if($salesGstExempt == "N")

{{'TAX INVOICE'}} @else

{{'BILL OF SUPPLY'}} @endif @endif
@php if($productHeader[0]->patient_id == NULL || $productHeader[0]->patient_id == '0'){ $patOrCustDetail = "Customer : " . $productHeader[0]->ph_cust_id." / ".$productHeader[0]->ph_cust_name. ($productHeader[0]->ph_cust_contact_no ? " / " : "").$productHeader[0]->ph_cust_contact_no; if($productHeader[0]->gst_number) { $patOrCustDetail .= " / GST No : " .$productHeader[0]->gst_number; } }else{ if($productHeader[0]->is_ptr_applicable == "Y" || $productHeader[0]->hosp_name_on_ph_bill == "Y"){ $patOrCustDetail = "Patient : " . $productHeader[0]->patient_id." / ".$productHeader[0]->patient_name." / ".$productHeader[0]->patient_contact1." (C/o $companyName)"; }else{ $patOrCustDetail = "Patient : " . $productHeader[0]->patient_id." / ".$productHeader[0]->patient_name." / ".$productHeader[0]->patient_contact1; } } @endphp {{$patOrCustDetail}}
Address : {{$patientAdress}}
{{$reportTitle }}
Prescribed By : {{$doctorName}}
{{$no.$productHeader[0]->trn_type." / ".$productHeader[0]->trn_fyear." / ".$productHeader[0]->trn_id}}
{{$date.$trnDate}}
Sale Total DiscountTaxable SGST CGST
Sr.   Item Name Pkg  Batch Exp MRP Rate QtyAmount Rate ValueValue Rate Value Rate Value Amount
Sale Total Discount
Sr.   Item Name Pkg  Batch Exp MRP Rate QtyAmount Rate ValueAmount
 {{$productTransaction->ref_trn_type}}{{$productTransaction->ref_trn_id}}  {{\Helper::getDisplayDate($productTransaction->ref_trn_date)}}
{{ $i++ }} {{ $productTransaction->product_name.$productHsnCode }} {{$productTransaction->conversion_factor }} {{ $productTransaction->batch_no }} {{$batchExp}} {{ number_format($productTransaction->original_mrp,2) }}{{ number_format($productTransaction->mrp,2) }}{{ number_format($orgi_mrp_per_unit,2) }} {{ $productTransaction->quantity }}{{ $discountPercentage }} {{ number_format($mrpValue,2) }} {{ number_format((($discount_amt*100)/$mrpValue),2) }}{{ number_format($productTransaction->discount_amt,2) }} {{ number_format($discount_amt,2) }}{{ number_format($productTransaction->taxable_amt,2) }} {{ number_format($productTransaction->cgst_percentage,1) }} {{ number_format($productTransaction->cgst_value,2) }} {{ number_format($productTransaction->sgst_percentage,1) }} {{ number_format($productTransaction->sgst_value,2) }} {{ number_format($netTotal,2) }}
{{ $i++ }}   {{ substr($productTransaction->product_name, 0, 35).$productHsnCode }} {{$productTransaction->conversion_factor }} {{ $productTransaction->batch_no }} {{$batchExp}} {{ number_format($productTransaction->original_mrp,2) }} {{ number_format($productTransaction->mrp,2) }} {{ $productTransaction->quantity }}{{ number_format($mrpValue,2) }} {{ $discountPercentage }} {{ number_format($productTransaction->discount_amt,2) }}{{ number_format($netTotal,2) }}
@if($productHeader[0]->rate_card != "") {{"Patient Type : ".$productHeader[0]->rate_card}} @endif {{$totalQty }}{{\Helper::zeroValueToNbspSpace(number_format($totalmrpValue,2)) }} {{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->discount_amt,2)) }}{{\Helper::zeroValueToNbspSpace(number_format($grand_discount_amt,2)) }}{{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->net_taxable_amt,2)) }} {{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->sgst_amt,2)) }} {{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->cgst_amt,2)) }} {{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->invoice_amt,2)) }}
@if($productHeader[0]->rate_card != "") {{"Patient Type : ".$productHeader[0]->rate_card}} @endif {{$totalQty }}{{\Helper::zeroValueToNbspSpace(number_format($totalmrpValue,2)) }} {{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->discount_amt,2)) }}{{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->invoice_amt,2)) }}
REMARK : {{strtoupper($productHeader[0]->remarks)}} ROUND OFF : @if($productHeader[0]->round_off == 0) 0.00 @else {{ \Helper::zeroValueToNbspSpace(number_format($productHeader[0]->round_off, 2)) }} @endif
@if($productHeader[0]->total >= 0) RUPEES {{ strtoupper(\Helper::convertNumber($productHeader[0]->total) . " only") }} @if($productHeader[0]->is_credit_bill == 'N') {{"By ".strtoupper($productHeader[0]->gm_description) }} @endif @if(strtoupper($productHeader[0]->payment_agency != '')) {{", ".strtoupper($productHeader[0]->payment_agency) }} {{", ".strtoupper($productHeader[0]->payment_number) }} @endif @endif YOU SAVED RUPEES : {{number_format($productHeader[0]->discount_amt,2)}}NET TOTAL : @if($productHeader[0]->total == 0) 0.00 @else {{\Helper::zeroValueToNbspSpace(number_format($productHeader[0]->total,2)) }} @endif
{{-- @if($productHeader[0]->rate_card != "") {{"Patient Type : ".$productHeader[0]->rate_card}} @endif --}} @if($RemarkParameter != "" || $RemarkParameter != " ") Note: {{$RemarkParameter}} @endif @if($productHeader[0]->room_id != "" && $productHeader[0]->discharge_date == "0000-00-00" ) {{"Room : ". $productHeader[0]->room_id ." / ".$productHeader[0]->room_cat_dis." / Floor : ".$productHeader[0]->floor}} @endif @if($indentId != "") Indent No : {{$indentId}}
Indent By: {{strtoupper($indentBy.' # '.\Helper::getDisplayDateTime($indentDate))}} @endif
@if(isset($businessEntityMasterData[0]->dl_no) ) D.L NO : {{$businessEntityMasterData[0]->dl_no}} @endif
@if(isset($businessEntityMasterData[0]->dl_no) ) GST NO : {{$businessEntityMasterData[0]->gsttin_no}} @endif {{-- @if($RemarkParameter != "" || $RemarkParameter != " ") Note: {{$RemarkParameter}} @endif --}}

@if(isset($businessEntityMasterData[0]->name) ) E. & O.E.    For, {{ strtoupper(($businessEntityMasterData[0]->name)) }}
{!! $businessEntityMasterData[0]->remarks !!}
Print By : {{ strtoupper($userId)." # ".$currentTime->format('d/m/Y H:i:s ')}}Special Instruction: {{$printRemarkParameter}} Created By : {{strtoupper($productHeader[0]->ph_created_by.' # '.\Helper::getDisplayDateTime($productHeader[0]->ph_created_date))}}
@if($trnType == "I" || $trnType == "IR") Back {{-- Back --}} {{-- @if($productHeader[0]->bill_amendment > 0) Back @else Back @endif --}} @else @if($productHeader[0]->ph_is_consignment_dc == "Y") Back @else Back @endif @endif
@endsection @section('BootstrapModals') @endsection @section('ExternalJs') @endsection