update request log pdf
This commit is contained in:
@@ -102,8 +102,8 @@ class RequestLogController extends Controller
|
|||||||
|
|
||||||
$memberValid = false;
|
$memberValid = false;
|
||||||
if ($member){
|
if ($member){
|
||||||
if (($member->members_effective_date <= date('Y-m-d')) &&
|
if (($member->members_effective_date <= date('Y-m-d')) &&
|
||||||
($member->members_expire_date >= date('Y-m-d')) &&
|
($member->members_expire_date >= date('Y-m-d')) &&
|
||||||
($member->active == 1) &&
|
($member->active == 1) &&
|
||||||
($member->suspended == 'N')
|
($member->suspended == 'N')
|
||||||
){
|
){
|
||||||
@@ -120,12 +120,12 @@ class RequestLogController extends Controller
|
|||||||
organization_id: $request->organization_id,
|
organization_id: $request->organization_id,
|
||||||
source: $request->source
|
source: $request->source
|
||||||
);
|
);
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
}
|
}
|
||||||
catch (\Throwable $th) {
|
catch (\Throwable $th) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
|
|
||||||
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
|
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -142,18 +142,18 @@ class RequestLogController extends Controller
|
|||||||
organization_id: $request->organization_id,
|
organization_id: $request->organization_id,
|
||||||
source: $request->source
|
source: $request->source
|
||||||
);
|
);
|
||||||
|
|
||||||
DB::commit();
|
DB::commit();
|
||||||
}
|
}
|
||||||
catch (\Throwable $th) {
|
catch (\Throwable $th) {
|
||||||
DB::rollBack();
|
DB::rollBack();
|
||||||
|
|
||||||
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
|
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: 'failed', statusCode: 500, message: 'Member Not Valid');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Helper::responseJson(status: 'success', statusCode: 200, message: 'Request LOG berhasil ajukan!', data: $request->toArray());
|
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',
|
// 'member.current_policy',
|
||||||
'claim',
|
'claim',
|
||||||
'organization',
|
'organization',
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return Helper::responseJson(data: RequestLogShowResource::make($claimRequest));
|
return Helper::responseJson(data: RequestLogShowResource::make($claimRequest));
|
||||||
@@ -214,7 +214,7 @@ class RequestLogController extends Controller
|
|||||||
$requestLog->approved_by = auth()->user()->id;
|
$requestLog->approved_by = auth()->user()->id;
|
||||||
$requestLog->approved_at = Carbon::now();
|
$requestLog->approved_at = Carbon::now();
|
||||||
$requestLog->save();
|
$requestLog->save();
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'error' => false,
|
'error' => false,
|
||||||
'message' => 'Update succses',
|
'message' => 'Update succses',
|
||||||
@@ -245,7 +245,7 @@ class RequestLogController extends Controller
|
|||||||
'error' => true,
|
'error' => true,
|
||||||
'message' => 'LOG Belum Terverifikasi',
|
'message' => 'LOG Belum Terverifikasi',
|
||||||
'data' => $requestLog],
|
'data' => $requestLog],
|
||||||
200);
|
200);
|
||||||
}
|
}
|
||||||
|
|
||||||
$member = Member::findOrFail($requestLog->member_id)
|
$member = Member::findOrFail($requestLog->member_id)
|
||||||
@@ -253,15 +253,15 @@ class RequestLogController extends Controller
|
|||||||
// 'currentPlan',
|
// 'currentPlan',
|
||||||
'currentPlan' => function ($plan) use ($id, $service_code) {
|
'currentPlan' => function ($plan) use ($id, $service_code) {
|
||||||
$plan->where('plans.service_code', $service_code);
|
$plan->where('plans.service_code', $service_code);
|
||||||
},
|
},
|
||||||
'currentPolicy',
|
'currentPolicy',
|
||||||
'currentPlan.corporateBenefits',
|
'currentPlan.corporateBenefits',
|
||||||
'currentPlan.corporateBenefits.benefit'
|
'currentPlan.corporateBenefits.benefit'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$pdf = PDF::loadView('pdf.guaranted_leter', compact('member', 'requestLog'));
|
$pdf = PDF::loadView('pdf.guaranted_leter', compact('member', 'requestLog'));
|
||||||
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
|
return $pdf->download('Guaranted Letter - '.$member->full_name.'.pdf');
|
||||||
|
|
||||||
return $requestLog;
|
return $requestLog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ class RequestLogController extends Controller
|
|||||||
$writer = WriterEntityFactory::createXLSXWriter();
|
$writer = WriterEntityFactory::createXLSXWriter();
|
||||||
// Membuka penulis untuk menulis ke file
|
// Membuka penulis untuk menulis ke file
|
||||||
$writer->openToFile(public_path('files/Data Request LOG.xlsx'));
|
$writer->openToFile(public_path('files/Data Request LOG.xlsx'));
|
||||||
|
|
||||||
// Sheet 1
|
// Sheet 1
|
||||||
$writer->getCurrentSheet()->setName('Data');
|
$writer->getCurrentSheet()->setName('Data');
|
||||||
$headers_map_to_table_fields = RequestLog::$listing_data_doc_headers;
|
$headers_map_to_table_fields = RequestLog::$listing_data_doc_headers;
|
||||||
@@ -293,7 +293,7 @@ class RequestLogController extends Controller
|
|||||||
// dd($dataRequestLog);
|
// dd($dataRequestLog);
|
||||||
foreach ($dataRequestLog as $index => $row){
|
foreach ($dataRequestLog as $index => $row){
|
||||||
$serviceType = $this->getServiceName($row['service_code']);
|
$serviceType = $this->getServiceName($row['service_code']);
|
||||||
|
|
||||||
$rowData = [
|
$rowData = [
|
||||||
$row['id'], // id
|
$row['id'], // id
|
||||||
$row['code'], // code
|
$row['code'], // code
|
||||||
@@ -660,7 +660,7 @@ class RequestLogController extends Controller
|
|||||||
->offset($offset)
|
->offset($offset)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$data = [];
|
$data = [];
|
||||||
if(count($memberList)>0){
|
if(count($memberList)>0){
|
||||||
$temp = [];
|
$temp = [];
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace Modules\Internal\Transformers;
|
namespace Modules\Internal\Transformers;
|
||||||
|
|
||||||
use App\Models\Benefit;
|
use App\Models\Plan;
|
||||||
use App\Models\CorporateBenefit;
|
use App\Models\CorporateBenefit;
|
||||||
use App\Models\ClaimRequest;
|
use App\Models\MemberPlan;
|
||||||
use App\Models\CorporateService;
|
use App\Models\CorporateService;
|
||||||
use App\Models\RequestLogBenefit;
|
use App\Models\RequestLogBenefit;
|
||||||
use App\Models\RequestLogMedicine;
|
use App\Models\RequestLogMedicine;
|
||||||
@@ -24,12 +24,23 @@ class RequestLogShowResource extends JsonResource
|
|||||||
*/
|
*/
|
||||||
public function toArray($request)
|
public function toArray($request)
|
||||||
{
|
{
|
||||||
|
// $requestLog = parent::toArray($request);
|
||||||
|
// $corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
|
||||||
|
|
||||||
$requestLog = parent::toArray($request);
|
$requestLog = parent::toArray($request);
|
||||||
$corporateId = $requestLog['member']['current_plan']['corporate_id'] ?? 0;
|
$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();
|
$benefitDetailLog = RequestLogBenefit::with('benefit')->where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||||
$medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
|
$medicineDetailLog = RequestLogMedicine::where('request_log_id', $requestLog['id'])->get()->toArray();
|
||||||
$benefitData = [];
|
$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)){
|
if (count($benefit)){
|
||||||
foreach($benefit as $data){
|
foreach($benefit as $data){
|
||||||
array_push($benefitData, $data['benefit']);
|
array_push($benefitData, $data['benefit']);
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
}
|
}
|
||||||
.txt-syarat-<?php echo now()->timestamp; ?> {
|
.txt-syarat-<?php echo now()->timestamp; ?> {
|
||||||
font-size: {{ $$dynamicVariableName }}px;
|
font-size: {{ $$dynamicVariableName }}px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
.bottom-left-ttd-<?php echo now()->timestamp; ?> {
|
.bottom-left-ttd-<?php echo now()->timestamp; ?> {
|
||||||
color: #000000;
|
color: #000000;
|
||||||
@@ -197,7 +197,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="triangle2"></div>
|
<div class="triangle2"></div>
|
||||||
<div class="triangle1"></div>
|
<div class="triangle1"></div>
|
||||||
@php
|
@php
|
||||||
if(!empty($logoPerusahaan->path)) {
|
if(!empty($logoPerusahaan->path)) {
|
||||||
$imgSrc = 'data:image/png;base64,' . base64_encode(file_get_contents(storage_path('app/public/' . $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 . '">';
|
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; ?>">
|
<div class="corner-text-<?php echo now()->timestamp; ?> top-right-<?php echo now()->timestamp; ?>">
|
||||||
The Future Of Healthcare At Your Fingertips
|
The Future Of Healthcare At Your Fingertips
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<img src="data:image/png;base64,{{ base64_encode(file_get_contents( public_path('images/logo-default.png') )) }}">
|
<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="title-container-page-<?php echo now()->timestamp; ?>">
|
||||||
<div class="txt-syarat-<?php echo now()->timestamp; ?>">SYARAT DAN KETENTUAN</div>
|
<div class="txt-syarat-<?php echo now()->timestamp; ?>">SYARAT DAN KETENTUAN</div>
|
||||||
<table class="claim-info-<?php echo now()->timestamp; ?>">
|
<table class="claim-info-<?php echo now()->timestamp; ?>">
|
||||||
@@ -253,7 +253,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
|
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
|
||||||
@php
|
@php
|
||||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||||
@endphp
|
@endphp
|
||||||
<u><b>Dr. Hery Hermas, M.Kes</b></u>
|
<u><b>Dr. Hery Hermas, M.Kes</b></u>
|
||||||
@php
|
@php
|
||||||
@@ -277,11 +277,11 @@
|
|||||||
(.......................................)
|
(.......................................)
|
||||||
</div>
|
</div>
|
||||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-right1-ttd-<?php echo now()->timestamp; ?> ">
|
<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>
|
||||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
|
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
|
||||||
@php
|
@php
|
||||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
<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
|
Lt. 1, Jalan Somba Opu 281, Ujung Pandang, Losari, <br> Kec. Makassar, Kota Makassar, Sulawesi Selatan 90113
|
||||||
|
|
||||||
@php
|
@php
|
||||||
} else if(!empty($logoPerusahaan->code) === 'PETROLAB') {
|
} else if(!empty($logoPerusahaan->code) == 'PETROLAB') {
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||||
@@ -302,7 +302,7 @@
|
|||||||
|
|
||||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||||
<b>{{ !empty($logoPerusahaan->name) ? $logoPerusahaan->name : '' }}</b><br>
|
<b>{{ !empty($logoPerusahaan->name) ? $logoPerusahaan->name : '' }}</b><br>
|
||||||
|
|
||||||
|
|
||||||
@php
|
@php
|
||||||
}
|
}
|
||||||
@@ -317,4 +317,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -425,7 +425,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
|
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-ttd-<?php echo now()->timestamp; ?> ">
|
||||||
@php
|
@php
|
||||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||||
@endphp
|
@endphp
|
||||||
<u><b>Dr. Hery Hermas, M.Kes</b></u>
|
<u><b>Dr. Hery Hermas, M.Kes</b></u>
|
||||||
@php
|
@php
|
||||||
@@ -450,7 +450,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
|
<div class="corner-text-<?php echo now()->timestamp; ?> bottom-left-<?php echo now()->timestamp; ?>">
|
||||||
@php
|
@php
|
||||||
if (!empty($logoPerusahaan->code) === 'VALEIND') {
|
if (!empty($logoPerusahaan->code) == 'VALEIND') {
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
<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
|
Lt. 1, Jalan Somba Opu 281, Ujung Pandang, Losari, <br> Kec. Makassar, Kota Makassar, Sulawesi Selatan 90113
|
||||||
|
|
||||||
@php
|
@php
|
||||||
} else if(!empty($logoPerusahaan->code) === 'PETROLAB') {
|
} else if(!empty($logoPerusahaan->code) == 'PETROLAB') {
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
<b>Alarm Center Vale MKS (LinkSehat) Office</b><br>
|
||||||
|
|||||||
Reference in New Issue
Block a user