@extends('Reports.template') @section('title') @if($reportType == "D") @php $reportTitle = "Doctor Wise Sales Report (Day Wise)"; @endphp @else @php $reportTitle = "Doctor Wise Sales Report (Summary)"; @endphp @endif {{$reportTitle}} @endsection @section('ExternalCss') @parent @endsection @section('Content') @php $currentTime = \Carbon\Carbon::now(); @endphp @if($reportType == "D") @else @endif @if($patientFilter != '') @else @endif @php $oldDoctorID = ''; $totalSalesAmt = 0; $totalPtrAsPerStock = 0; $finalTotalAsPerStock = 0; $totalPtrPerQty = 0; $finalTotalPtrPerQty = 0; $totalDiffAmt = 0; $finalTotalDiffAmt = 0; $finalTotalSalesAmt = 0; @endphp @foreach($salesData as $sales) @if($sales->total_quantity != 0) @php $doctorID = $sales->doctor_id; @endphp @if($doctorID != $oldDoctorID) @if($totalSalesAmt != 0 && $oldDoctorID != '') @endif @php $trnDate = ''; $totalSalesAmt = $sales->total_amt; $finalTotalSalesAmt += $sales->total_amt; $ptrAmount = $sales->ptr; $totalPtrAmount = $sales->ptr * $sales->total_quantity; $diffAmt = $sales->total_amt - $totalPtrAmount; $totalPtrAsPerStock = $ptrAmount; $finalTotalAsPerStock += $ptrAmount; $totalPtrPerQty = $totalPtrAmount; $finalTotalPtrPerQty += $totalPtrAmount; $totalDiffAmt = $diffAmt; $finalTotalDiffAmt += $diffAmt; if($sales->patient_id != NULL){ $patientDetail = $sales->patient_id . ' / '. $sales->patient_name; } else { $patientDetail = $sales->ph_cust_id . ' / '. $sales->ph_cust_name; } if($patientFilter == ''){ $patientDetail = ''; } @endphp @if($reportType == "D") @else @else @php $ptrAmount = $sales->ptr; $totalPtrAmount = $sales->ptr * $sales->total_quantity; $diffAmt = $sales->total_amt - $totalPtrAmount; $totalSalesAmt += $sales->total_amt; $finalTotalSalesAmt += $sales->total_amt; $totalPtrAsPerStock += $ptrAmount; $finalTotalAsPerStock += $ptrAmount; $totalPtrPerQty += $totalPtrAmount; $finalTotalPtrPerQty += $totalPtrAmount; $totalDiffAmt += $diffAmt; $finalTotalDiffAmt += $diffAmt; @endphp @if($reportType == "D") @if(\Helper::getDisplayDate($sales->trn_date) != $trnDate) @else @endif @else @endif @endif @php $oldDoctorID = $doctorID; $trnDate = \Helper::getDisplayDate($sales->trn_date); @endphp @endif @endforeach @if($totalSalesAmt != 0) @endif
@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)}}
Doctor Name Bill DateDoctor NamePatientProduct Name Mfg Category SUOM Sales Qty PTR as per Stock Unit Total as per PTR Sales Amt Diff Amt
Total : {{\Helper::customAmountFormat($totalPtrPerQty)}} {{\Helper::customAmountFormat($totalSalesAmt)}} {{\Helper::customAmountFormat($totalDiffAmt)}}
{{$sales->doctor_name}} {{\Helper::getDisplayDate($sales->trn_date)}}{{$sales->doctor_name}} @endif {{$patientDetail}} {{$sales->product_name}} {{$sales->manufacturer_name}} {{ $sales->category_abbrev }} {{ $sales->SUOM }} {{ $sales->total_quantity }} {{ \Helper::customAmountFormat($ptrAmount) }} {{ \Helper::customAmountFormat($totalPtrAmount) }} {{\Helper::customAmountFormat($sales->total_amt)}} {{ \Helper::customAmountFormat($diffAmt) }}
{{\Helper::getDisplayDate($sales->trn_date)}} @endif @if(\Helper::getDisplayDate($sales->trn_date) != $trnDate) {{ $patientDetail }} @else {{$sales->product_name}} {{$sales->manufacturer_name}} {{$sales->category_abbrev}} {{$sales->SUOM}} {{$sales->total_quantity}} {{\Helper::customAmountFormat($ptrAmount)}} {{\Helper::customAmountFormat($totalPtrAmount)}} {{\Helper::customAmountFormat($sales->total_amt)}} {{\Helper::customAmountFormat($diffAmt)}}
Total : {{\Helper::customAmountFormat($totalPtrPerQty)}} {{\Helper::customAmountFormat($totalSalesAmt)}} {{\Helper::customAmountFormat($totalDiffAmt)}}
Total Sales : {{\Helper::customAmountFormat($finalTotalPtrPerQty)}} {{\Helper::customAmountFormat($finalTotalSalesAmt)}} {{\Helper::customAmountFormat($finalTotalDiffAmt)}}
{{ strtoupper(Session::get('userId'))." # ".$currentTime->format('d/m/Y H:i:s ')}}

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