@extends('Reports.template') @if($trnType === 'GIN') @php $reportTitle = 'Material Issue Note Register Report'; @endphp @else @php $reportTitle = 'Material Issue Note Return Register Report'; @endphp @endif @section('title') {{$reportTitle}} @endsection @section('ExternalCss') @parent @endsection @section('Content') @php if($trnStatus === 'P'){ $trnStatusMessage = "Partial"; }else if($trnStatus === 'T'){ $trnStatusMessage = "Cancelled"; }else if($trnStatus === 'C'){ $trnStatusMessage = "Completed"; }else{ $trnStatusMessage = "ALL"; } @endphp @if($reportType === 'B') @else @endif @if($reportType === 'B') @php $oldPhTrnId = ''; $headerSr = 1; $transactionSr = 1; $totalQty = 0; $mrpTotal = 0; $ptrTotal = 0; $mrpGrandTotal = 0; $ptrGrandTotal = 0; $remark = ''; $createdBy = ''; $datetime = ''; @endphp @foreach ($productTransactionData as $key =>$productTransaction) @if($productTransaction->ph_trn_id != $oldPhTrnId) @if($totalQty != 0) @endif @php $transactionSr = 1; $totalQty = 0; $mrpTotal = 0; $ptrTotal = 0; $remark = ''; if($productTransaction->department_name != null){ $patDepName = $productTransaction->department_name; }else{ $patDepName = $productTransaction->patient_name; } @endphp @endif @php $mrpValue = round($productTransaction->quantity*$productTransaction->mrp,2); $rateValue = round($productTransaction->quantity*$productTransaction->price_per_unit_suom,4); $mrpTotal += $mrpValue; $ptrTotal += $rateValue; $mrpGrandTotal += $mrpValue; $ptrGrandTotal += $rateValue; @endphp @php $totalQty += $productTransaction->quantity; $remark = $productTransaction->ph_remarks; $datetime = $productTransaction->created_date; $createdBy = ($productTransaction->ph_modified_by) ? strtoupper($productTransaction->ph_modified_by) : strtoupper($productTransaction->ph_created_by); $oldPhTrnId = $productTransaction->ph_trn_id; @endphp @endforeach @else @php $oldPhTrnId = ''; $headerSr = 1; $totalQty = 0; $lastTrnId = ''; $lastTrnDate = ''; $lastPatOrDeptName = ''; $ptrTotal = 0; $ptrGrandTotal = 0; @endphp @foreach ($productTransactionData as $key =>$productTransaction) @if($productTransaction->ph_trn_id != $oldPhTrnId) @if($totalQty != 0 && $headerSr >= 1) @endif @php $ptrTotal = 0; if($productTransaction->department_name != null){ $patDepName = $productTransaction->department_name; }else{ $patDepName = $productTransaction->patient_name; } @endphp @endif @php $rateValue = round($productTransaction->quantity*$productTransaction->price_per_unit_suom,4); $ptrTotal += $rateValue; $ptrGrandTotal += $rateValue; $totalQty += $productTransaction->quantity; $oldPhTrnId = $productTransaction->ph_trn_id; $lastTrnId = $productTransaction->trn_type.$productTransaction->ph_trn_id; $lastTrnDate = $productTransaction->trn_date; $lastPatOrDeptName = $patDepName; @endphp @endforeach @endif @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) }}
Bill No  Bill Date Department / Patient Name
Sr   Item Name Mfg Category Unit  Batch Exp Qty MRP MRP Value PTR PTR Value
Bill No  Bill Date Department / Patient Name Total PTR Value
@if($remark != '') Remarks : {{$remark}} @endif {{"Created By : "}} @if($createdBy) {{$createdBy ." ".Carbon\Carbon::parse($datetime)->format('d-m-Y h:i:s')}} @endif Total : {{\Helper::customAmountFormat2($mrpTotal)}} {{\Helper::customAmountFormat4($ptrTotal)}}
{{ $productTransaction->trn_type.$productTransaction->ph_trn_id }}   {{ \Helper::getDisplayDate($productTransaction->trn_date) }} {{$patDepName}}
{{$transactionSr++}}   {{ \Helper::zeroValueToDash($productTransaction->product_name) }} {{ \Helper::zeroValueToDash($productTransaction->manufacturer_name) }} {{ \Helper::zeroValueToDash($productTransaction->category_abbrev) }} {{ \Helper::zeroValueToDash($productTransaction->unit_abbrev) }} {{ $productTransaction->batch_no }} {{ \Helper::getMonthYearFromDate($productTransaction->batch_exp) }} {{ $productTransaction->quantity }} {{ \Helper::customAmountFormat2($productTransaction->mrp) }} {{ \Helper::customAmountFormat2($mrpValue) }} {{ \Helper::customAmountFormat4($productTransaction->price_per_unit_suom) }} {{ \Helper::customAmountFormat4($rateValue) }}
@if($remark != '') Remarks : {{$remark}} @endif {{"Created By : "}} @if($createdBy) {{$createdBy ." ".Carbon\Carbon::parse($datetime)->format('d-m-Y h:i:s')}} @endif Total : {{\Helper::customAmountFormat2($mrpTotal)}} {{\Helper::customAmountFormat4($ptrTotal)}}
Grand Total : {{\Helper::customAmountFormat2($mrpGrandTotal)}} {{\Helper::customAmountFormat4($ptrGrandTotal)}}
{{ $lastTrnId }}   {{ \Helper::getDisplayDate($lastTrnDate) }} {{$lastPatOrDeptName}} {{\Helper::customAmountFormat4($ptrTotal)}}
{{ $lastTrnId }}   {{ \Helper::getDisplayDate($lastTrnDate) }} {{$lastPatOrDeptName}} {{\Helper::customAmountFormat4($ptrTotal)}}
Grand Total : {{\Helper::customAmountFormat4($ptrGrandTotal)}}
{{ strtoupper(Session::get('userId'))." # ".$currentTime->format('d/m/Y H:i:s ')}}
Back
@endsection @section('BootstrapModals') @endsection @section('ExternalJs') @endsection