update request log pdf

This commit is contained in:
Linksehat Staging Server
2024-01-08 17:13:32 +07:00
parent 88baf6be3d
commit 095a9212e3
4 changed files with 44 additions and 33 deletions

View File

@@ -102,8 +102,8 @@ class RequestLogController extends Controller
$memberValid = false;
if ($member){
if (($member->members_effective_date <= date('Y-m-d')) &&
($member->members_expire_date >= date('Y-m-d')) &&
if (($member->members_effective_date <= date('Y-m-d')) &&
($member->members_expire_date >= date('Y-m-d')) &&
($member->active == 1) &&
($member->suspended == 'N')
){
@@ -120,12 +120,12 @@ class RequestLogController extends Controller
organization_id: $request->organization_id,
source: $request->source
);
DB::commit();
}
catch (\Throwable $th) {
DB::rollBack();
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
}
} else {
@@ -142,18 +142,18 @@ class RequestLogController extends Controller
organization_id: $request->organization_id,
source: $request->source
);
DB::commit();
}
catch (\Throwable $th) {
DB::rollBack();
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
}
// return Helper::responseJson(status: 'failed', statusCode: 500, message: 'Member Not Valid');
}
}
}
return Helper::responseJson(status: 'success', statusCode: 200, message: 'Request LOG berhasil ajukan!', data: $request->toArray());
@@ -179,7 +179,7 @@ class RequestLogController extends Controller
// 'member.current_policy',
'claim',
'organization',
]);
return Helper::responseJson(data: RequestLogShowResource::make($claimRequest));
@@ -214,7 +214,7 @@ class RequestLogController extends Controller
$requestLog->approved_by = auth()->user()->id;
$requestLog->approved_at = Carbon::now();
$requestLog->save();
return response()->json([
'error' => false,
'message' => 'Update succses',
@@ -245,7 +245,7 @@ class RequestLogController extends Controller
'error' => true,
'message' => 'LOG Belum Terverifikasi',
'data' => $requestLog],
200);
200);
}
$member = Member::findOrFail($requestLog->member_id)
@@ -253,15 +253,15 @@ class RequestLogController extends Controller
// 'currentPlan',
'currentPlan' => function ($plan) use ($id, $service_code) {
$plan->where('plans.service_code', $service_code);
},
'currentPolicy',
'currentPlan.corporateBenefits',
},
'currentPolicy',
'currentPlan.corporateBenefits',
'currentPlan.corporateBenefits.benefit'
]);
$pdf = PDF::loadView('pdf.guaranted_leter', compact('member', 'requestLog'));
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
return $requestLog;
}
@@ -275,7 +275,7 @@ class RequestLogController extends Controller
$writer = WriterEntityFactory::createXLSXWriter();
// Membuka penulis untuk menulis ke file
$writer->openToFile(public_path('files/Data Request LOG.xlsx'));
// Sheet 1
$writer->getCurrentSheet()->setName('Data');
$headers_map_to_table_fields = RequestLog::$listing_data_doc_headers;
@@ -293,7 +293,7 @@ class RequestLogController extends Controller
// dd($dataRequestLog);
foreach ($dataRequestLog as $index => $row){
$serviceType = $this->getServiceName($row['service_code']);
$rowData = [
$row['id'], // id
$row['code'], // code
@@ -660,7 +660,7 @@ class RequestLogController extends Controller
->offset($offset)
->limit($limit)
->get();
$data = [];
if(count($memberList)>0){
$temp = [];

View File

@@ -2,9 +2,9 @@
namespace Modules\Internal\Transformers;
use App\Models\Benefit;
use App\Models\Plan;
use App\Models\CorporateBenefit;
use App\Models\ClaimRequest;
use App\Models\MemberPlan;
use App\Models\CorporateService;
use App\Models\RequestLogBenefit;
use App\Models\RequestLogMedicine;
@@ -24,12 +24,23 @@ class RequestLogShowResource extends JsonResource
*/
public function toArray($request)
{
// $requestLog = parent::toArray($request);
// $corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
$requestLog = parent::toArray($request);
$corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $corporateId)->get()->toArray();
$member_id = $requestLog['member_id'];
$planMember = MemberPlan::where('member_id', $member_id)->get('plan_id');
$planId = Plan::whereIn('id', $planMember)->where('service_code', $requestLog['service_code'])->first();
$benefit = CorporateBenefit::with('benefit')->where('plan_id', $planId->id)->get()->toArray();
$benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
$medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
$benefitData = [];
// $benefit = CorporateBenefit::with('benefit')->where('plan_id', $corporateId)->get()->toArray();
// $benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
// $medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
// $benefitData = [];
if (count($benefit)){
foreach($benefit as $data){
array_push($benefitData, $data['benefit']);

View File

@@ -143,7 +143,7 @@
}
.txt-syarat-<?php echo now()->timestamp; ?> {
font-size: {{ $$dynamicVariableName }}px;
text-align: left;
text-align: left;
}
.bottom-left-ttd-<?php echo now()->timestamp; ?> {
color: #000000;
@@ -197,7 +197,7 @@
<body>
<div class="triangle2"></div>
<div class="triangle1"></div>
@php
@php
if(!empty($logoPerusahaan->path)) {
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $logoPerusahaan->path)));
echo '<img class="logo_company-' . now()->timestamp . '" src="' . $imgSrc . '">';
@@ -207,9 +207,9 @@
<div class="corner-text-<?php echo now()->timestamp; ?> top-right-<?php echo now()->timestamp; ?>">
The Future Of Healthcare At Your Fingertips
</div>
<img src="data:image/png;base64,{{ base64_encode(file_get_contents( public_path('images/logo-default.png') )) }}">
<div class="title-container-page-<?php echo now()->timestamp; ?>">
<div class="txt-syarat-<?php echo now()->timestamp; ?>">SYARAT DAN KETENTUAN</div>
<table class="claim-info-<?php echo now()->timestamp; ?>">
@@ -253,7 +253,7 @@
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
@php
if (!empty($logoPerusahaan->code) === 'VALEIND') {
if (!empty($logoPerusahaan->code) == 'VALEIND') {
@endphp
<u><b>Dr. Hery Hermas, M.Kes</b></u>
@php
@@ -277,11 +277,11 @@
(.......................................)
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-right1-ttd-<?php echo now()->timestamp; ?> ">
<b>{{ $dataMember->name }}</b>
<b>{{ $dataMember->name }}</b>
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
@php
if (!empty($logoPerusahaan->code) === 'VALEIND') {
if (!empty($logoPerusahaan->code) == 'VALEIND') {
@endphp
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
@@ -289,7 +289,7 @@
Lt. 1, Jalan Somba Opu 281, Ujung Pandang, Losari, <br> Kec. Makassar, Kota Makassar, Sulawesi Selatan 90113
@php
} else if(!empty($logoPerusahaan->code) === 'PETROLAB') {
} else if(!empty($logoPerusahaan->code) == 'PETROLAB') {
@endphp
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
@@ -302,7 +302,7 @@
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
<b>{{ !empty($logoPerusahaan->name) ? $logoPerusahaan->name : '' }}</b><br>
@php
}
@@ -317,4 +317,4 @@
</div>
</div>
</body>
</html>
</html>

View File

@@ -425,7 +425,7 @@
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
@php
if (!empty($logoPerusahaan->code) === 'VALEIND') {
if (!empty($logoPerusahaan->code) == 'VALEIND') {
@endphp
<u><b>Dr. Hery Hermas, M.Kes</b></u>
@php
@@ -450,7 +450,7 @@
</div>
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
@php
if (!empty($logoPerusahaan->code) === 'VALEIND') {
if (!empty($logoPerusahaan->code) == 'VALEIND') {
@endphp
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
@@ -458,7 +458,7 @@
Lt. 1, Jalan Somba Opu 281, Ujung Pandang, Losari, <br> Kec. Makassar, Kota Makassar, Sulawesi Selatan 90113
@php
} else if(!empty($logoPerusahaan->code) === 'PETROLAB') {
} else if(!empty($logoPerusahaan->code) == 'PETROLAB') {
@endphp
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>