fix cleint portal employee-data, dashboard, hide notification
This commit is contained in:
@@ -18,7 +18,7 @@ class CorporatePolicyController extends Controller
|
||||
public function index($corporate_id)
|
||||
{
|
||||
$currentCorporate = Auth::user()->managedCorporates()
|
||||
->with(['currentPolicy', 'employees'])
|
||||
->with(['currentPolicy'])
|
||||
->find($corporate_id);
|
||||
|
||||
$data = LimitResources::make($currentCorporate);
|
||||
|
||||
@@ -20,7 +20,7 @@ class TopUpController extends Controller
|
||||
{
|
||||
$data = Auth::user()
|
||||
->managedCorporates()
|
||||
->with(['currentPolicy', 'employees'])
|
||||
->with(['currentPolicy'])
|
||||
->withCount(['employees', 'claims' => function ($query) {
|
||||
$query->where('claims.status', 'paid');
|
||||
}])
|
||||
@@ -36,20 +36,20 @@ class TopUpController extends Controller
|
||||
*/
|
||||
public function store(Request $request, $corporate_id)
|
||||
{
|
||||
|
||||
|
||||
$data = $request->validate([
|
||||
'topup' => 'required|numeric',
|
||||
]);
|
||||
|
||||
$corporatePolicy = CorporatePolicy::query()->where('corporate_id',$corporate_id)->firstOrFail();
|
||||
$corporatePolicy = CorporatePolicy::query()->where('corporate_id', $corporate_id)->firstOrFail();
|
||||
if (!$corporatePolicy) {
|
||||
return response() -> json (['message' => 'Corporate policy not found'],404);
|
||||
return response()->json(['message' => 'Corporate policy not found'], 404);
|
||||
}
|
||||
|
||||
$corporatePolicy -> total_premi += $data ['topup'];
|
||||
$corporatePolicy -> save();
|
||||
$corporatePolicy->total_premi += $data['topup'];
|
||||
$corporatePolicy->save();
|
||||
|
||||
return response () -> json (['message' => 'Amount added to total_premi successfully'], 200);
|
||||
return response()->json(['message' => 'Amount added to total_premi successfully'], 200);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Client\Transformers\Dashboard;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
@@ -18,7 +19,7 @@ class MemberEmployeeDataResources extends JsonResource
|
||||
'personId' => $this->person_id,
|
||||
'memberId' => $this->member_id,
|
||||
'fullName' => $this->full_name,
|
||||
'service' => $this->service_code,
|
||||
// 'service' => $this->service_code,
|
||||
'start_date' => $this->start_date,
|
||||
'end_date' => $this->end_date,
|
||||
'status' => $this->active,
|
||||
|
||||
@@ -26,7 +26,7 @@ class MemberResources extends JsonResource
|
||||
'percentage' => (!empty($this->currentPlan->limit_rules ?? 0)) ? (($this->claims_sum_total_claim / $this->currentPlan->limit_rules) * 100) : 0
|
||||
],
|
||||
'status' => $this->active,
|
||||
'service_type' => $this->currentPlans,
|
||||
// 'service_type' => $this->currentPlans,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Modules\Internal\Http\Controllers\Api;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Crypt;
|
||||
use Error;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
@@ -91,7 +90,7 @@ class AuthController extends Controller
|
||||
|
||||
Event(new ForgetPassword($user));
|
||||
|
||||
// Mail::to($user->email)->send(new SendVerifyEmail($user));
|
||||
Mail::to($user->email)->send(new SendVerifyEmail($user));
|
||||
|
||||
return response()->json($user);
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ class MemberEnrollmentService
|
||||
"ingestion_code" => "Ingestion Code",
|
||||
"ingestion_status" => "Ingestion Status",
|
||||
];
|
||||
|
||||
|
||||
public $result_doc_headers = [
|
||||
"Record Mode",
|
||||
"Record Type",
|
||||
@@ -357,7 +357,7 @@ class MemberEnrollmentService
|
||||
'activation_date' => 'Activation Date',
|
||||
'date_of_birth' => 'Date of Birth',
|
||||
'date_terminated' => 'Date Terminated',
|
||||
|
||||
|
||||
];
|
||||
|
||||
if (empty($row['record_type'])) {
|
||||
@@ -372,6 +372,10 @@ class MemberEnrollmentService
|
||||
throw new ImportRowException(__('enrollment.MEMBER_ID_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
|
||||
if (empty($row['plan_id'])) {
|
||||
throw new ImportRowException(__('Plan ID Required'), 0, null, $row);
|
||||
}
|
||||
|
||||
if ($row['record_type'] == 'P') {
|
||||
if (!empty($row['principal_id'])) {
|
||||
throw new ImportRowException(__('enrollment.PRINCIPAL_ID_NOT_REQUIRED'), 0, null, $row);
|
||||
@@ -391,22 +395,22 @@ class MemberEnrollmentService
|
||||
->first();
|
||||
|
||||
if(empty($member)){
|
||||
throw new ImportRowException(__('enrollment.PRINCIPAL_NOT_IN_MEMBER_ID'), 0, null, $row);
|
||||
// throw new ImportRowException(__('enrollment.PRINCIPAL_NOT_IN_MEMBER_ID'), 0, null, $row);
|
||||
} else {
|
||||
if ($member['record_type'] != 'P'){
|
||||
throw new ImportRowException(__('enrollment.PRINCIPAL_ID_NOT_SAME_MEMBER_ID'), 0, null, $row);
|
||||
}
|
||||
// if ($member['record_type'] != 'P'){
|
||||
// throw new ImportRowException(__('enrollment.PRINCIPAL_ID_NOT_SAME_MEMBER_ID'), 0, null, $row);
|
||||
// }
|
||||
}
|
||||
if (empty($row['principal_id'])) {
|
||||
throw new ImportRowException(__('enrollment.PRINCIPAL_ID_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
if (empty($row['relationship_with_principal'])){
|
||||
throw new ImportRowException(__('enrollment.RELATIONSHIP_WITH_PRICIPAL_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
if (!empty($row['relationship_with_principal']) && !in_array($row['relationship_with_principal'], ['H', 'W', 'D', 'S'])){
|
||||
throw new ImportRowException(__('enrollment.RELATIONSHIP_WITH_PRICIPAL_NOT_VALID'), 0, null, $row);
|
||||
}
|
||||
|
||||
// if (empty($row['relationship_with_principal'])){
|
||||
// throw new ImportRowException(__('enrollment.RELATIONSHIP_WITH_PRICIPAL_REQUIRED'), 0, null, $row);
|
||||
// }
|
||||
// if (!empty($row['relationship_with_principal']) && !in_array($row['relationship_with_principal'], ['H', 'W', 'D', 'S'])){
|
||||
// throw new ImportRowException(__('enrollment.RELATIONSHIP_WITH_PRICIPAL_NOT_VALID'), 0, null, $row);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -420,26 +424,26 @@ class MemberEnrollmentService
|
||||
// throw new ImportRowException(__('enrollment.BRANCH_CODE_NOT_REQUIRED'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (!empty($row['language']) && !in_array($row['language'], ['M', 'E', 'C', 'I', 'O'])) {
|
||||
throw new ImportRowException(__('enrollment.INVALID_LANGUAGE'), 0, null, $row);
|
||||
}
|
||||
// if (!empty($row['language']) && !in_array($row['language'], ['M', 'E', 'C', 'I', 'O'])) {
|
||||
// throw new ImportRowException(__('enrollment.INVALID_LANGUAGE'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (!empty($row['type_of_work']) && !in_array($row['type_of_work'], ['0', '1', '2', '3'])) {
|
||||
throw new ImportRowException(__('enrollment.INVALID_TYPE_OF_WORK'), 0, null, $row);
|
||||
}
|
||||
// if (!empty($row['type_of_work']) && !in_array($row['type_of_work'], ['0', '1', '2', '3'])) {
|
||||
// throw new ImportRowException(__('enrollment.INVALID_TYPE_OF_WORK'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (!empty($row['race']) && !in_array($row['race'], ['M', 'C', 'I', 'O'])) {
|
||||
throw new ImportRowException(__('enrollment.INVALID_RACE'), 0, null, $row);
|
||||
}
|
||||
// if (!empty($row['race']) && !in_array($row['race'], ['M', 'C', 'I', 'O'])) {
|
||||
// throw new ImportRowException(__('enrollment.INVALID_RACE'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (empty($row['policy_number'])) {
|
||||
throw new ImportRowException(__('enrollment.POLICY_NUMBER_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
|
||||
if (!empty($row['marital_status']) && !in_array($row['marital_status'], ['S', 'M', 'D'])) {
|
||||
throw new ImportRowException(__('enrollment.INVALID_MARITAL_STATUS'), 0, null, $row);
|
||||
}
|
||||
|
||||
// if (!empty($row['marital_status']) && !in_array($row['marital_status'], ['S', 'M', 'D'])) {
|
||||
// throw new ImportRowException(__('enrollment.INVALID_MARITAL_STATUS'), 0, null, $row);
|
||||
// }
|
||||
|
||||
// TODO EFFECTIVE DATE VALIDATION
|
||||
if (empty($row['member_effective_date'])) {
|
||||
throw new ImportRowException(__('enrollment.MEMBER_EFFECTIVE_REQUIRED'), 0, null, $row);
|
||||
@@ -458,7 +462,7 @@ class MemberEnrollmentService
|
||||
// 'title' => $title['member_expiry_date']
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
|
||||
|
||||
// TODO EFFECTIVE DATE VALIDATION
|
||||
// if (empty($row['activation_date'])) {
|
||||
// throw new ImportRowException(__('enrollment.ACTIVATION_DATE_REQUIRED'), 0, null, $row);
|
||||
@@ -473,35 +477,35 @@ class MemberEnrollmentService
|
||||
// TODO FKTP VALIDATION
|
||||
// TODO FKRTL VALIDATION
|
||||
|
||||
if (!empty($row['marital_status']) && !in_array($row['marital_status'], ['S', 'M', 'D'])) {
|
||||
throw new ImportRowException(__('enrollment.INVALID_MARITAL_STATUS'), 0, null, $row);
|
||||
}
|
||||
// if (!empty($row['marital_status']) && !in_array($row['marital_status'], ['S', 'M', 'D'])) {
|
||||
// throw new ImportRowException(__('enrollment.INVALID_MARITAL_STATUS'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (empty($row['name'])) {
|
||||
throw new ImportRowException(__('enrollment.NAME_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
|
||||
if (!Helper::validatePhoneNumber($row['telephone_mobile'])){
|
||||
throw new ImportRowException(__('enrollment.PHONE_INVALID'), 0, null, $row);
|
||||
}
|
||||
// if (!Helper::validatePhoneNumber($row['telephone_mobile'])){
|
||||
// throw new ImportRowException(__('enrollment.PHONE_INVALID'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (
|
||||
!empty($row['telephone_mobile'])
|
||||
&& !(substr($row['telephone_mobile'], 0, 4) == '+628' || substr($row['telephone_mobile'], 0, 3) == '628')
|
||||
) {
|
||||
throw new ImportRowException(__('enrollment.PHONE_INVALID'), 0, null, $row);
|
||||
}
|
||||
// if (
|
||||
// !empty($row['telephone_mobile'])
|
||||
// && !(substr($row['telephone_mobile'], 0, 4) == '+628' || substr($row['telephone_mobile'], 0, 3) == '628')
|
||||
// ) {
|
||||
// throw new ImportRowException(__('enrollment.PHONE_INVALID'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (
|
||||
!empty($row['email'])
|
||||
&& !filter_var($row['email'], FILTER_VALIDATE_EMAIL)
|
||||
) {
|
||||
throw new ImportRowException(__('enrollment.EMAIL_INVALID'), 0, null, $row);
|
||||
}
|
||||
// if (
|
||||
// !empty($row['email'])
|
||||
// && !filter_var($row['email'], FILTER_VALIDATE_EMAIL)
|
||||
// ) {
|
||||
// throw new ImportRowException(__('enrollment.EMAIL_INVALID'), 0, null, $row);
|
||||
// }
|
||||
|
||||
if (empty($row['date_of_birth'])) {
|
||||
throw new ImportRowException(__('enrollment.DATE_OF_BIRTH_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
// if (empty($row['date_of_birth'])) {
|
||||
// throw new ImportRowException(__('enrollment.DATE_OF_BIRTH_REQUIRED'), 0, null, $row);
|
||||
// }
|
||||
// if(!$this->validateDate($row['date_of_birth'])){
|
||||
// throw new ImportRowException(__('enrollment.INVALID_DATE', [
|
||||
// 'title' => $title['date_of_birth']
|
||||
@@ -520,16 +524,16 @@ class MemberEnrollmentService
|
||||
// }
|
||||
// TODO DOB FORMAT VALIDATION
|
||||
|
||||
if (empty($row['sex'])) {
|
||||
throw new ImportRowException(__('enrollment.SEX_REQUIRED'), 0, null, $row);
|
||||
}
|
||||
|
||||
if (!in_array($row['sex'], ['F', 'M'])){
|
||||
throw new ImportRowException(__('enrollment.SEX_CODE_NOT_VALID'), 0, null, $row);
|
||||
}
|
||||
// if (empty($row['sex'])) {
|
||||
// throw new ImportRowException(__('enrollment.SEX_REQUIRED'), 0, null, $row);
|
||||
// }
|
||||
|
||||
// if (!in_array($row['sex'], ['F', 'M'])){
|
||||
// throw new ImportRowException(__('enrollment.SEX_CODE_NOT_VALID'), 0, null, $row);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function handleImportRow(Corporate $corporate, $row)
|
||||
{
|
||||
try {
|
||||
@@ -546,7 +550,7 @@ class MemberEnrollmentService
|
||||
"member_id" => $row['member_id'] ?? null,
|
||||
"payor_id" => $row['payor_id'] ?? null,
|
||||
"nik" => $row['nik'] ?? null,
|
||||
"birth_date" => $row['date_of_birth'],
|
||||
"birth_date" => $row['date_of_birth'] ? date("Y-m-d",$row['date_of_birth']) : null,
|
||||
"gender" => Helper::genderNormalization($row['sex']),
|
||||
"language" => $row['language'] ?? null,
|
||||
"race" => $row['race'] ?? null,
|
||||
@@ -588,6 +592,8 @@ class MemberEnrollmentService
|
||||
"telephone_res" => $row['telephone_res'] ?? null,
|
||||
"telephone_office" => $row['telephone_office'] ?? null,
|
||||
"suspended" => $row['member_suspended'] ?? null,
|
||||
|
||||
"active" => $row['employment_status'] == 'INACTIVE' ? 0 : 1
|
||||
];
|
||||
// $this->validateRow($row);
|
||||
if (!isset($corporate->currentPolicy) || $corporate->currentPolicy->code != $row['policy_number']) {
|
||||
@@ -595,101 +601,101 @@ class MemberEnrollmentService
|
||||
'policy_id' => $row['policy_number']
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
// validasi member efektif date range date in periode date coroporate
|
||||
|
||||
// validasi member efektif date range date in periode date coroporate
|
||||
$member_effective_date = date("Y-m-d", strtotime($row['member_effective_date']));
|
||||
$date_terminated = date("Y-m-d", strtotime($row['date_terminated']));
|
||||
if(!empty($row['activation_date'])){
|
||||
$activation_date = date("Y-m-d", strtotime($row['activation_date']));
|
||||
if (($activation_date == $date_terminated) && ($activation_date == $member_effective_date)) {
|
||||
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
'date_param' => 'Activation Date',
|
||||
'date' => $activation_date,
|
||||
'date_param2' => 'Member Effective Date',
|
||||
'start' => $activation_date
|
||||
]), 0, null, $row);
|
||||
}
|
||||
// $activation_date = date("Y-m-d", strtotime($row['activation_date']));
|
||||
// if (($activation_date == $date_terminated) && ($activation_date == $member_effective_date)) {
|
||||
// throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
// 'date_param' => 'Activation Date',
|
||||
// 'date' => $activation_date,
|
||||
// 'date_param2' => 'Member Effective Date',
|
||||
// 'start' => $activation_date
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
}
|
||||
if (!empty($row['date_terminated'])){
|
||||
$date_terminated = date("Y-m-d", strtotime($row['date_terminated']));
|
||||
if($date_terminated){
|
||||
if ($date_terminated <= $member_effective_date && ($date_terminated != $member_effective_date)) {
|
||||
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
'date_param' => 'Date Terminated Date',
|
||||
'date' => $date_terminated,
|
||||
'date_param2' => 'Member Effective Date',
|
||||
'start' => $member_effective_date
|
||||
]), 0, null, $row);
|
||||
}
|
||||
}
|
||||
// $date_terminated = date("Y-m-d", strtotime($row['date_terminated']));
|
||||
// if($date_terminated){
|
||||
// if ($date_terminated <= $member_effective_date && ($date_terminated != $member_effective_date)) {
|
||||
// throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
// 'date_param' => 'Date Terminated Date',
|
||||
// 'date' => $date_terminated,
|
||||
// 'date_param2' => 'Member Effective Date',
|
||||
// 'start' => $member_effective_date
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
// validasi member expried date range date in periode date coroporate
|
||||
// validasi member expried date range date in periode date coroporate
|
||||
$members_expire_date = date("Y-m-d", strtotime($row['member_expiry_date']));
|
||||
// validasi member expried date must less date member effective
|
||||
$members_expire_date = date("Y-m-d", strtotime($row['member_expiry_date']));
|
||||
$members_expire_date = date("Y-m-d", strtotime($row['member_expiry_date']));
|
||||
|
||||
if ($member_effective_date <= $corporate->currentPolicy->start && ($member_effective_date != $corporate->currentPolicy->start)) {
|
||||
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
'date_param' => 'Member Effective Date',
|
||||
'date' => $member_effective_date,
|
||||
'date_param2' => 'Start Period Date',
|
||||
'start' => $corporate->currentPolicy->start
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
if ($member_effective_date >= $corporate->currentPolicy->end && ($member_effective_date != $corporate->currentPolicy->end)) {
|
||||
throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||
'date_param' => 'Member Effective Date',
|
||||
'date' => $member_effective_date,
|
||||
'date_param2' => 'End Period Date',
|
||||
'end' => $corporate->currentPolicy->end
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
if ($member_effective_date >= $corporate->currentPolicy->end && ($member_effective_date != $corporate->currentPolicy->end)) {
|
||||
throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||
'date_param' => 'Member Effective Date',
|
||||
'date' => $member_effective_date,
|
||||
'date_param2' => 'End Period Date',
|
||||
'end' => $corporate->currentPolicy->end
|
||||
]), 0, null, $row);
|
||||
}
|
||||
if ($members_expire_date <= $corporate->currentPolicy->start && ($members_expire_date != $corporate->currentPolicy->start) ) {
|
||||
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
'date_param' => 'Member Expired Date',
|
||||
'date' => $members_expire_date,
|
||||
'date_param2' => 'Start Period Date',
|
||||
'start' => $corporate->currentPolicy->start
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
if ($members_expire_date >= $corporate->currentPolicy->end && ($members_expire_date != $corporate->currentPolicy->end)) {
|
||||
throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||
'date_param' => 'Member Expired Date',
|
||||
'date' => $members_expire_date,
|
||||
'date_param2' => 'END Period Date',
|
||||
'end' => $corporate->currentPolicy->end
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
|
||||
if ($members_expire_date <= $member_effective_date && ($members_expire_date != $member_effective_date)) {
|
||||
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
'date_param' => 'Member Expired Date',
|
||||
'date' => $members_expire_date,
|
||||
'date_param2' => 'Member Effective Date',
|
||||
'start' => $member_effective_date
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
|
||||
// if ($member_effective_date <= $corporate->currentPolicy->start && ($member_effective_date != $corporate->currentPolicy->start)) {
|
||||
// throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
// 'date_param' => 'Member Effective Date',
|
||||
// 'date' => $member_effective_date,
|
||||
// 'date_param2' => 'Start Period Date',
|
||||
// 'start' => $corporate->currentPolicy->start
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
|
||||
// if ($member_effective_date >= $corporate->currentPolicy->end && ($member_effective_date != $corporate->currentPolicy->end)) {
|
||||
// throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||
// 'date_param' => 'Member Effective Date',
|
||||
// 'date' => $member_effective_date,
|
||||
// 'date_param2' => 'End Period Date',
|
||||
// 'end' => $corporate->currentPolicy->end
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
|
||||
// if ($member_effective_date >= $corporate->currentPolicy->end && ($member_effective_date != $corporate->currentPolicy->end)) {
|
||||
// throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||
// 'date_param' => 'Member Effective Date',
|
||||
// 'date' => $member_effective_date,
|
||||
// 'date_param2' => 'End Period Date',
|
||||
// 'end' => $corporate->currentPolicy->end
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
// if ($members_expire_date <= $corporate->currentPolicy->start && ($members_expire_date != $corporate->currentPolicy->start) ) {
|
||||
// throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
// 'date_param' => 'Member Expired Date',
|
||||
// 'date' => $members_expire_date,
|
||||
// 'date_param2' => 'Start Period Date',
|
||||
// 'start' => $corporate->currentPolicy->start
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
|
||||
// if ($members_expire_date >= $corporate->currentPolicy->end && ($members_expire_date != $corporate->currentPolicy->end)) {
|
||||
// throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||
// 'date_param' => 'Member Expired Date',
|
||||
// 'date' => $members_expire_date,
|
||||
// 'date_param2' => 'END Period Date',
|
||||
// 'end' => $corporate->currentPolicy->end
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
|
||||
|
||||
// if ($members_expire_date <= $member_effective_date && ($members_expire_date != $member_effective_date)) {
|
||||
// throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||
// 'date_param' => 'Member Expired Date',
|
||||
// 'date' => $members_expire_date,
|
||||
// 'date_param2' => 'Member Effective Date',
|
||||
// 'start' => $member_effective_date
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
|
||||
|
||||
if($corporate->code != $row['corporate_id']){
|
||||
throw new ImportRowException(__('enrollment.CORPORATE_CODE_NOT_MATCH', [
|
||||
'corporate_id' => $row['corporate_id']
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
|
||||
switch ($row['record_mode']) {
|
||||
case "1": // New Member
|
||||
$this->validateRow($row);
|
||||
@@ -707,8 +713,8 @@ class MemberEnrollmentService
|
||||
],
|
||||
[
|
||||
'name' => $row['name'] ?? null,
|
||||
// 'birth_date' => $this->dateParser($row['date_of_birth']),
|
||||
'birth_date' => $row['date_of_birth'],
|
||||
'birth_date' => $this->dateParser($row['date_of_birth']),
|
||||
// 'birth_date' => $row['date_of_birth'],
|
||||
'gender' => Helper::genderNormalization($row['sex']),
|
||||
'language' => $row['language'] ?? null,
|
||||
'race' => $row['race'] ?? null,
|
||||
@@ -758,22 +764,23 @@ class MemberEnrollmentService
|
||||
throw new ImportRowException(__('enrollment.PLAN_NOT_FOUND'), 0, null, $row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
DB::beginTransaction();
|
||||
$member->fill($member_data);
|
||||
if ($member->save()) {
|
||||
$person = Person::create([
|
||||
'name' => $row['name'],
|
||||
'birth_date' => $row['date_of_birth'],
|
||||
'gender' => Helper::genderNormalization($row['sex']),
|
||||
'birth_date' => $this->dateParser($row['date_of_birth']) ?? null,
|
||||
'gender' => Helper::genderNormalization($row['sex']) ?? '-',
|
||||
'language' => $row['language'] ?? null,
|
||||
'race' => $row['race'] ?? null,
|
||||
'phone' => $row['telephone_mobile'],
|
||||
]);
|
||||
|
||||
$member->person_id = $person->id;
|
||||
|
||||
$member->save();
|
||||
|
||||
$memberPolicy = new MemberPolicy();
|
||||
$memberPolicy->fill([
|
||||
'member_id' => $member->member_id,
|
||||
@@ -782,7 +789,7 @@ class MemberEnrollmentService
|
||||
'end' => $this->dateParser($row['member_expiry_date']),
|
||||
'status' => 'active'
|
||||
]);
|
||||
|
||||
|
||||
$memberPolicy->save();
|
||||
|
||||
if (!empty($row['division_name'])) {
|
||||
@@ -807,7 +814,7 @@ class MemberEnrollmentService
|
||||
'status' => $row['employment_status']
|
||||
]);
|
||||
// Bisa disini penyebab data dobel
|
||||
|
||||
|
||||
$plans = explode(",",$row['plan_id']);
|
||||
if (count($plans) > 0) {
|
||||
foreach($plans as $d){
|
||||
@@ -840,7 +847,7 @@ class MemberEnrollmentService
|
||||
'end' => $this->dateParser($row['member_expiry_date']),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
@@ -849,12 +856,12 @@ class MemberEnrollmentService
|
||||
}
|
||||
break;
|
||||
case "2": // Member Information Update (Without Replacement Card)
|
||||
|
||||
|
||||
// $this->validateRow($row);
|
||||
$member = Member::query()
|
||||
->where('member_id', $row['member_id'])
|
||||
->first();
|
||||
|
||||
|
||||
// // Validate If Exist Member
|
||||
if (!$member) {
|
||||
throw new ImportRowException(__('enrollment.MEMBER_NOT_FOUND', [
|
||||
@@ -862,7 +869,7 @@ class MemberEnrollmentService
|
||||
'policy_id' => $row['policy_number']
|
||||
]), 0, null, $row);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$person = Person::updateOrCreate(
|
||||
[
|
||||
@@ -870,15 +877,14 @@ class MemberEnrollmentService
|
||||
],
|
||||
[
|
||||
'name' => $row['name'] ?? null,
|
||||
// 'birth_date' => $this->dateParser($row['date_of_birth']),
|
||||
'birth_date' => $row['date_of_birth'],
|
||||
'birth_date' => $this->dateParser($row['date_of_birth']),
|
||||
'gender' => Helper::genderPerson($row['sex']),
|
||||
'language' => $row['language'] ?? null,
|
||||
'race' => $row['race'] ?? null,
|
||||
'phone' => $row['telephone_mobile']
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$member->person_id = $person->id;
|
||||
$member->save();
|
||||
try {
|
||||
@@ -952,7 +958,7 @@ class MemberEnrollmentService
|
||||
// 'end' => $this->dateParser($row['member_expiry_date']),
|
||||
// ]);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// end update plan
|
||||
|
||||
@@ -1024,14 +1030,15 @@ class MemberEnrollmentService
|
||||
'dUpdateOn' => date('Y-m-d H:i:s'),
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$userLmsDetail = UserDetail::updateOrCreate(
|
||||
[
|
||||
'nIDUser' => $nIDUser
|
||||
],
|
||||
[
|
||||
'nIDUser' => $nIDUser,
|
||||
'dTanggalLahir' => $row['date_of_birth'],
|
||||
// 'dTanggalLahir' => $row['date_of_birth'],
|
||||
'dTanggalLahir' => $this->dateParser($row['date_of_birth']),
|
||||
'dCreateOn' => date('Y-m-d H:i:s'),
|
||||
'sMartialStatus' => $sMartialStatus != 0 ? $sMartialStatus : null,
|
||||
'nIDJenisKelamin' => $nIDJenisKelamin,
|
||||
@@ -1059,7 +1066,7 @@ class MemberEnrollmentService
|
||||
if (!$memberPolicy->member->isDirty()) {
|
||||
throw new ImportRowException(__('enrollment.MEMBER_NO_CHANGE'), 0, null, $row);
|
||||
}
|
||||
|
||||
|
||||
$memberPolicy->member->save();
|
||||
$member->save();
|
||||
// update informasi person
|
||||
@@ -1205,7 +1212,7 @@ class MemberEnrollmentService
|
||||
|
||||
// if (empty($row["option_mode"])) {
|
||||
// throw new ImportRowException(__('enrollment.OPTION_MODE_INVALID_FORMAT', [
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'policy_id' => $row['policy_number']
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
@@ -1218,7 +1225,7 @@ class MemberEnrollmentService
|
||||
// // Validate
|
||||
// if ( !in_array($option_mode[0], ['P', 'D']) || empty($corp_code) || empty($policy_number) || empty($member_id) ) {
|
||||
// throw new ImportRowException(__('enrollment.OPTION_MODE_INVALID_FORMAT', [
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'policy_id' => $row['policy_number']
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
@@ -1280,7 +1287,7 @@ class MemberEnrollmentService
|
||||
// $memberPolicy->member->record_type == $row['record_type']
|
||||
// ) {
|
||||
// throw new ImportRowException(__('enrollment.UNIQUE_CHANGE_PRINCIPAL_INVALID', [
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'policy_id' => $row['policy_number']
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
@@ -1293,7 +1300,7 @@ class MemberEnrollmentService
|
||||
// $memberPolicy->member->payor_id == $row['payor_id']
|
||||
// ) {
|
||||
// throw new ImportRowException(__('enrollment.UNIQUE_CHANGE_DEPENDANT_INVALID', [
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'member_id' => $row['member_id'],
|
||||
// 'policy_id' => $row['policy_number']
|
||||
// ]), 0, null, $row);
|
||||
// }
|
||||
@@ -1533,10 +1540,10 @@ class MemberEnrollmentService
|
||||
$value = $row_data[$this->doc_headers_to_field_map[$header]] ?? null;
|
||||
if (is_string($value)) {
|
||||
$cells[] = WriterEntityFactory::createCell($value);
|
||||
}
|
||||
}
|
||||
else if ($value instanceof DateTime) {
|
||||
$cells[] = WriterEntityFactory::createCell(Carbon::parse($value)->format('Ymd'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
$cells[] = WriterEntityFactory::createCell($value);
|
||||
}
|
||||
@@ -1549,7 +1556,7 @@ class MemberEnrollmentService
|
||||
public function validateRangePeriode($dates){
|
||||
$date = date("Y-m-d", strtotime($dates));
|
||||
if (!isset($corporate->currentPolicy) || $corporate->currentPolicy->start <= $date) {
|
||||
|
||||
|
||||
}
|
||||
if (!isset($corporate->currentPolicy) || $corporate->currentPolicy->end >= $date) {
|
||||
dd($corporate->currentPolicy->end, $dates);
|
||||
|
||||
@@ -13,17 +13,17 @@ use App\Models\Service;
|
||||
|
||||
class Helper
|
||||
{
|
||||
public static function genderNormalization($anyGenderCode)
|
||||
public static function genderNormalization($anyGenderCode = '-')
|
||||
{
|
||||
|
||||
|
||||
if ($anyGenderCode == 'M') {
|
||||
return 'Male';
|
||||
return 'male';
|
||||
} else if ($anyGenderCode == 'F') {
|
||||
return 'Female';
|
||||
return 'female';
|
||||
} else if ($anyGenderCode == 'O') {
|
||||
return 'Others';
|
||||
return 'others';
|
||||
} else if ($anyGenderCode == 'U') {
|
||||
return 'Unknown';
|
||||
return 'unknown';
|
||||
} else {
|
||||
return '-';
|
||||
}
|
||||
@@ -57,7 +57,8 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static function memberType($code){
|
||||
public static function memberType($code)
|
||||
{
|
||||
if ($code == 'P') {
|
||||
return 'Principal';
|
||||
} else if ($code == 'D') {
|
||||
@@ -67,30 +68,29 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static function relationWithPrincipal($code){
|
||||
public static function relationWithPrincipal($code)
|
||||
{
|
||||
if ($code == 'H') {
|
||||
return 'Husbund';
|
||||
}
|
||||
else if ($code == 'W') {
|
||||
} else if ($code == 'W') {
|
||||
return 'Wife';
|
||||
}
|
||||
else if ($code == 'S') {
|
||||
} else if ($code == 'S') {
|
||||
return 'Son';
|
||||
}
|
||||
else if ($code == 'D') {
|
||||
} else if ($code == 'D') {
|
||||
return 'Daughter';
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
'-';
|
||||
}
|
||||
}
|
||||
|
||||
public static function principalName($code){
|
||||
public static function principalName($code)
|
||||
{
|
||||
$principalName = Member::where('member_id', $code)->get()->first();
|
||||
return $principalName->name;
|
||||
}
|
||||
|
||||
public static function serviceName($code){
|
||||
public static function serviceName($code)
|
||||
{
|
||||
$serviceName = Service::where('code', $code)->get()->first();
|
||||
return $serviceName->name;
|
||||
}
|
||||
@@ -241,10 +241,11 @@ class Helper
|
||||
], $statusCode);
|
||||
}
|
||||
|
||||
public static function validatePhoneNumber($phoneNumber) {
|
||||
public static function validatePhoneNumber($phoneNumber)
|
||||
{
|
||||
// Menghapus semua karakter selain angka dan +
|
||||
$cleanedNumber = preg_replace('/[^0-9+]/', '', $phoneNumber);
|
||||
|
||||
|
||||
// Memeriksa apakah nomor telepon hanya terdiri dari angka dan +
|
||||
if ($cleanedNumber == $phoneNumber) {
|
||||
// Nomor telepon valid
|
||||
@@ -255,11 +256,13 @@ class Helper
|
||||
}
|
||||
}
|
||||
|
||||
public static function formatRupiah($angka) {
|
||||
public static function formatRupiah($angka)
|
||||
{
|
||||
return "Rp " . number_format($angka, 0, ',', '.');
|
||||
}
|
||||
|
||||
public static function sPaymentMethod($id) {
|
||||
public static function sPaymentMethod($id)
|
||||
{
|
||||
$sPaymentMethod = [
|
||||
1 => 'Pribadi',
|
||||
2 => 'On-Site Payment',
|
||||
@@ -268,17 +271,19 @@ class Helper
|
||||
5 => 'Voucher',
|
||||
6 => 'ASO'
|
||||
];
|
||||
|
||||
|
||||
return $sPaymentMethod[$id];
|
||||
}
|
||||
|
||||
public static function formatDateDB($date){
|
||||
public static function formatDateDB($date)
|
||||
{
|
||||
$convertedDate = Carbon::createFromFormat('d-m-Y', $date)->format('Y-m-d H:i:s');
|
||||
return $convertedDate;
|
||||
}
|
||||
|
||||
|
||||
public static function formatDateOnly($date){
|
||||
public static function formatDateOnly($date)
|
||||
{
|
||||
// Membuat objek Carbon dengan tanggal asli dan zona waktu UTC
|
||||
$carbonDate = Carbon::createFromFormat('Y-m-d\TH:i:s.u\Z', $date, 'UTC');
|
||||
|
||||
@@ -289,7 +294,8 @@ class Helper
|
||||
return $convertedDate;
|
||||
}
|
||||
|
||||
public static function formatTimeOnly($date){
|
||||
public static function formatTimeOnly($date)
|
||||
{
|
||||
// Membuat objek Carbon dengan tanggal asli dan zona waktu UTC
|
||||
$carbonDate = Carbon::createFromFormat('Y-m-d\TH:i:s.u\Z', $date, 'UTC');
|
||||
|
||||
@@ -307,8 +313,7 @@ class Helper
|
||||
DB::table('notifications')->insert($data);
|
||||
DB::commit();
|
||||
return true;
|
||||
}
|
||||
catch (\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
DB::rollback();
|
||||
return $e->getMessage();
|
||||
}
|
||||
@@ -320,28 +325,27 @@ class Helper
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
// Server settings
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
|
||||
// Penerima email
|
||||
$mail->setFrom(env('EMAIL'), env('NAME_EMAIL'));
|
||||
$mail->addAddress($data['email'], $data['name']);
|
||||
|
||||
// Konten email
|
||||
$mail->isHTML(true);
|
||||
$mail->isHTML(true);
|
||||
$mail->Subject = $data['subject'];
|
||||
$mail->Body = $data['body'];
|
||||
|
||||
// Kirim email
|
||||
$mail->send();
|
||||
return true;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
dd($e);
|
||||
return ($mail->ErrorInfo);
|
||||
@@ -355,21 +359,21 @@ class Helper
|
||||
$mail = new PHPMailer(true);
|
||||
try {
|
||||
// Server settings
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
$mail->isSMTP();
|
||||
$mail->Host = 'smtp.gmail.com';
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = env('EMAIL');
|
||||
$mail->Password = env('PW_EMAIL');
|
||||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||
$mail->Port = 465;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
|
||||
// Penerima email
|
||||
$mail->setFrom(env('EMAIL'), env('NAME_EMAIL'));
|
||||
$mail->addAddress($data['email'], $data['name']);
|
||||
|
||||
// Konten email
|
||||
$mail->isHTML(true);
|
||||
$mail->isHTML(true);
|
||||
$mail->Subject = $data['subject'];
|
||||
$mail->Body = $data['body'];
|
||||
$mail->addAttachment($data['attach'], 'e-card.pdf');
|
||||
@@ -377,12 +381,10 @@ class Helper
|
||||
// Kirim email
|
||||
$mail->send();
|
||||
return true;
|
||||
|
||||
} catch (\Exception $e) {
|
||||
dd($mail->ErrorInfo);
|
||||
return ($mail->ErrorInfo);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ class Member extends Model
|
||||
"policy_in_force",
|
||||
"start_no_claim",
|
||||
"end_no_claim",
|
||||
"suspended"
|
||||
"suspended",
|
||||
"active",
|
||||
];
|
||||
|
||||
protected $appends = [
|
||||
@@ -152,14 +153,14 @@ class Member extends Model
|
||||
public function currentPlans()
|
||||
{
|
||||
return $this->hasManyThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id');
|
||||
// ->latest(); // TODO Fix This
|
||||
// ->latest(); // TODO Fix This
|
||||
}
|
||||
|
||||
public function currentPlan()
|
||||
{
|
||||
return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id', )
|
||||
->latest();
|
||||
// ->where('plans.service_code', $this->claimRequest->service_code); // TODO Fix This
|
||||
return $this->hasOneThrough(Plan::class, MemberPlan::class, 'member_id', 'id', 'id', 'plan_id',)
|
||||
->latest();
|
||||
// ->where('plans.service_code', $this->claimRequest->service_code); // TODO Fix This
|
||||
}
|
||||
|
||||
// public function currentPlan()
|
||||
@@ -230,7 +231,7 @@ class Member extends Model
|
||||
$arr[] = $this->person->name_prefix;
|
||||
}
|
||||
|
||||
$arr[] = $this->person->name;
|
||||
$arr[] = $this->person->name ?? '-';
|
||||
|
||||
if (!empty($this->person->name_suffix)) {
|
||||
$arr[] = $this->person->name_suffix;
|
||||
@@ -258,19 +259,33 @@ class Member extends Model
|
||||
// protected function birthDate(): Attribute
|
||||
// {
|
||||
// // $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||
// $date = $this->birth_date ?? ($this->person->birth_date ?? null);
|
||||
// return Attribute::make(
|
||||
// get: fn () => !empty($date) ? Carbon::parse($date)->format('Y-m-d') : null
|
||||
// );
|
||||
// $date = $this->birth_date;
|
||||
// if ($date){
|
||||
// $date = ($this->birth_date ?? $this->person->birth_date);
|
||||
// return Attribute::make(
|
||||
// get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : '-'
|
||||
// );
|
||||
// } else {
|
||||
// return Attribute::make(
|
||||
// get: fn () => '-'
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
protected function birthDateeCard(): Attribute
|
||||
{
|
||||
// $date = $this->person->birth_date ?? ($this->birth_date ?? null);
|
||||
$date = $this->birth_date ?? ($this->birth_date ?? this->person->birth_date);
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : null
|
||||
);
|
||||
$date = $this->birth_date;
|
||||
if ($date) {
|
||||
$date = ($this->birth_date ?? $this->person->birth_date);
|
||||
return Attribute::make(
|
||||
get: fn () => !empty($date) ? Carbon::parse($date)->format('d / M / Y') : '-'
|
||||
);
|
||||
} else {
|
||||
return Attribute::make(
|
||||
get: fn () => '-'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
protected function startDate(): Attribute
|
||||
@@ -291,18 +306,19 @@ class Member extends Model
|
||||
);
|
||||
}
|
||||
|
||||
protected function gender(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn () => ucfirst($this->person->gender) ?? null
|
||||
);
|
||||
}
|
||||
// protected function gender(): Attribute
|
||||
// {
|
||||
// return Attribute::make(
|
||||
// get: fn () => $this->person->gender ? ucfirst($this->person->gender) : '-'
|
||||
// // get: fn () => '-'
|
||||
// );
|
||||
// }
|
||||
|
||||
protected function corporateLogo(): Attribute
|
||||
{
|
||||
$avatar = File::where(['type' => 'avatar', 'fileable_id' => $this->currentPolicy->corporate->id])->orderBy('id', 'desc')->get()->first();
|
||||
if ($avatar){
|
||||
$path = $_ENV['LMS_APP_STORAGE'] . $avatar->path ? $avatar->path :'';
|
||||
if ($avatar) {
|
||||
$path = $_ENV['LMS_APP_STORAGE'] . $avatar->path ? $avatar->path : '';
|
||||
return Attribute::make(
|
||||
get: fn () => $avatar ? $path : null
|
||||
);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\CorporateEmployee;
|
||||
use App\Models\Member;
|
||||
use App\Models\Encounter;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -13,34 +14,42 @@ class CorporateMemberService
|
||||
public function getAllMemberDashboards(int $corporateId, Request $request)
|
||||
{
|
||||
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
||||
return Member::query()
|
||||
->joinCorporateEmployees('left')
|
||||
->joinCorporateDivisions('left')
|
||||
->with(['currentPlan', 'person'])
|
||||
->where('corporate_employees.corporate_id', $corporateId)
|
||||
->when($request->input('search'), function (Builder $query, $search) {
|
||||
$query->where(function (Builder $query) use ($search) {
|
||||
$query->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%");
|
||||
$memberIds = CorporateEmployee::where('corporate_id', $corporateId)
|
||||
->when($request->input('division'), function ($query, $value) {
|
||||
$query->where('division_id', $value);
|
||||
})
|
||||
->pluck('member_id');
|
||||
return Member::with(['person'])
|
||||
->whereIn('id', $memberIds)
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('name', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->input('division'), function (Builder $query, $value) {
|
||||
$query->where('corporate_employees.division_id', $value);
|
||||
})
|
||||
->when($request->has('orderBy'), function (Builder $query) use ($request) {
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = match ($request->input('orderBy')) {
|
||||
'memberId' => 'member_id',
|
||||
'fullName' => 'name',
|
||||
'status' => 'active',
|
||||
'division' => 'corporate_divisions.name',
|
||||
default => ''
|
||||
default => null,
|
||||
};
|
||||
if ($request->order) {
|
||||
$query->getQuery()->orderBy($orderBy, $request->order);
|
||||
if ($orderBy !== null && $request->order) {
|
||||
$query->orderBy($orderBy, $request->order);
|
||||
}
|
||||
})
|
||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active'])
|
||||
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
->select([
|
||||
'id',
|
||||
'person_id',
|
||||
'member_id',
|
||||
'name',
|
||||
'active',
|
||||
])
|
||||
->withCount([
|
||||
'claims as claims_sum_total_claim' => function ($query) {
|
||||
$query->select(DB::raw('COALESCE(SUM(total_claim), 0)'))->whereNull('deleted_at');
|
||||
},
|
||||
])
|
||||
->paginate($limit);
|
||||
}
|
||||
|
||||
@@ -49,41 +58,48 @@ class CorporateMemberService
|
||||
$limit = $request->has('per_page') ? $request->input('per_page') : 10;
|
||||
|
||||
$results = DB::table('claim_requests')
|
||||
->leftJoin('claims', 'claim_requests.id', '=', 'claims.claim_request_id')
|
||||
->leftJoin('members', 'claim_requests.member_id', '=', 'members.id')
|
||||
->leftJoin('corporate_employees', 'members.id', '=', 'corporate_employees.member_id')
|
||||
->leftJoin('corporate_divisions', 'corporate_employees.division_id', '=', 'corporate_divisions.id')
|
||||
->where('corporate_employees.corporate_id', '=', $corporateId)
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('claim_requests.code', 'like', "%" . $search . "%")
|
||||
->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%")
|
||||
->orWhere('corporate_divisions.name', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.status', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.submission_date', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = $request->orderBy;
|
||||
$direction = $request->order ?? 'asc';
|
||||
->leftJoin('claims', 'claim_requests.id', '=', 'claims.claim_request_id')
|
||||
->leftJoin('members', 'claim_requests.member_id', '=', 'members.id')
|
||||
->leftJoin('corporate_employees', 'members.id', '=', 'corporate_employees.member_id')
|
||||
->leftJoin('corporate_divisions', 'corporate_employees.division_id', '=', 'corporate_divisions.id')
|
||||
->where('corporate_employees.corporate_id', '=', $corporateId)
|
||||
->when($request->input('search'), function ($query, $search) {
|
||||
$query->where(function ($query) use ($search) {
|
||||
$query->orWhere('claim_requests.code', 'like', "%" . $search . "%")
|
||||
->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%")
|
||||
->orWhere('corporate_divisions.name', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.status', 'like', "%" . $search . "%")
|
||||
->orWhere('claim_requests.submission_date', 'like', "%" . $search . "%");
|
||||
});
|
||||
})
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = $request->orderBy;
|
||||
$direction = $request->order ?? 'asc';
|
||||
|
||||
$query->orderBy($orderBy, $direction);
|
||||
})
|
||||
->select('members.id', 'claim_requests.code','members.member_id', 'members.name as full_name', 'corporate_divisions.name AS division_name',
|
||||
DB::raw('
|
||||
CASE
|
||||
$query->orderBy($orderBy, $direction);
|
||||
})
|
||||
->select(
|
||||
'members.id',
|
||||
'claim_requests.code',
|
||||
'members.member_id',
|
||||
'members.name as full_name',
|
||||
'corporate_divisions.name AS division_name',
|
||||
DB::raw('
|
||||
CASE
|
||||
WHEN claim_requests.status = "requested" THEN "requested"
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "approved" THEN "approved"
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "declined" THEN "declined"
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "disbrusmented" THEN "disbrusmented"
|
||||
/*WHEN claim_requests.status = "approved" AND claims.status = "received" THEN "pending"*/
|
||||
WHEN claim_requests.status = "approved" AND claims.status = "received" THEN "reviewed"
|
||||
ELSE ""
|
||||
ELSE ""
|
||||
END AS status
|
||||
'),
|
||||
'claim_requests.id AS claim_request_id', 'claim_requests.submission_date')
|
||||
->paginate($limit);
|
||||
'),
|
||||
'claim_requests.id AS claim_request_id',
|
||||
'claim_requests.submission_date'
|
||||
)
|
||||
->paginate($limit);
|
||||
return $results;
|
||||
}
|
||||
|
||||
@@ -125,7 +141,7 @@ class CorporateMemberService
|
||||
}
|
||||
})
|
||||
// ->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', 'claim_requests.id', 'claim_requests.member_id', 'claim_requests.submission_date'])
|
||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active', ])
|
||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'corporate_divisions.name AS division_name', 'members.active',])
|
||||
->paginate($limit);
|
||||
}
|
||||
|
||||
@@ -184,36 +200,32 @@ class CorporateMemberService
|
||||
$limit = $request->has('perPage') ? $request->input('perPage') : 10;
|
||||
|
||||
return Member::query()
|
||||
->joinCorporateEmployees('left')
|
||||
->joinMemberPlans('left')
|
||||
->joinPlans('left')
|
||||
->with(['currentPlan', 'person'])
|
||||
->where('corporate_employees.corporate_id', $corporateId)
|
||||
->when($request->input('search'), function (Builder $query, $search) {
|
||||
$query->where(function (Builder $query) use ($search) {
|
||||
$query->orWhere('members.member_id', 'like', "%" . $search . "%")
|
||||
->orWhere('members.name', 'like', "%" . $search . "%");
|
||||
});
|
||||
->whereHas('employeds', function ($query) use ($corporateId) {
|
||||
$query->where('corporate_id', $corporateId);
|
||||
})
|
||||
->when($request->input('division'), function (Builder $query, $value) {
|
||||
$query->where('corporate_employees.division_id', $value);
|
||||
})
|
||||
->when($request->has('orderBy'), function (Builder $query) use ($request) {
|
||||
->when($request->has('orderBy'), function ($query) use ($request) {
|
||||
$orderBy = match ($request->input('orderBy')) {
|
||||
'memberId' => 'member_id',
|
||||
'fullName' => 'name',
|
||||
'status' => 'active',
|
||||
'start_date' => 'member_plans.start',
|
||||
'end_date' => 'member_plans.end',
|
||||
'service' => 'plans.service_code',
|
||||
|
||||
default => ''
|
||||
'start_date' => 'members_effective_date',
|
||||
'end_date' => 'members_expire_date',
|
||||
default => null,
|
||||
};
|
||||
|
||||
$query->getQuery()->orderBy($orderBy, $request->order);
|
||||
if ($orderBy !== null && $request->order) {
|
||||
$query->orderBy($orderBy, $request->order);
|
||||
}
|
||||
})
|
||||
->select(['members.id', 'members.person_id', 'members.member_id', 'members.name', 'member_plans.start AS start_date', 'member_plans.end AS end_date', 'plans.active', 'plans.service_code'])
|
||||
->selectRaw("(select sum(`claims`.`total_claim`) from `claims` where `members`.`id` = `claims`.`member_id` AND `claims`.`deleted_at` IS NULL) AS `claims_sum_total_claim`")
|
||||
->select([
|
||||
'id',
|
||||
'person_id',
|
||||
'member_id',
|
||||
'name',
|
||||
'members_effective_date',
|
||||
'members_expire_date',
|
||||
'active',
|
||||
])
|
||||
->paginate($limit);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ return new class extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table(' plans', function (Blueprint $table) {
|
||||
Schema::table('plans', function (Blueprint $table) {
|
||||
$table->string('limit_telecon')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ PORT=8083
|
||||
REACT_APP_HOST_API_URL="https://aso-api.linksehat.dev/api/client"
|
||||
|
||||
# VITE_API_URL="https://aso-api.linksehat.dev/api/client"
|
||||
VITE_API_URL="http://localhost:8000/api/client"
|
||||
VITE_API_URL="https://primecenter-api.linksehat.com/api/client"
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
GENERATE_SOURCEMAP=false
|
||||
|
||||
VITE_API_URL="https://aso-api.linksehat.dev/api/client"
|
||||
VITE_API_URL="https://primecenter-api.linksehat.com/api/client"
|
||||
|
||||
@@ -82,7 +82,7 @@ export type TableListProps<DataType> = {
|
||||
appliedParams: {};
|
||||
setAppliedParams: Dispatch<SetStateAction<{}>>;
|
||||
};
|
||||
searchs: {
|
||||
searchs?: {
|
||||
useSearchs: boolean;
|
||||
searchText: string;
|
||||
setSearchText: Dispatch<SetStateAction<string>>;
|
||||
|
||||
@@ -5,7 +5,6 @@ import {
|
||||
Container,
|
||||
Grid,
|
||||
Button,
|
||||
IconButton,
|
||||
LinearProgress,
|
||||
linearProgressClasses,
|
||||
SelectChangeEvent,
|
||||
@@ -25,15 +24,14 @@ import Table from '../../components/Table';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import palette from '../../theme/palette';
|
||||
import { MoreVert as MoreVertIcon } from '@mui/icons-material';
|
||||
import { fSplit } from '../../utils/formatNumber';
|
||||
|
||||
const itemList = [
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
{ info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
];
|
||||
// const itemList = [
|
||||
// { info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
// { info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
// { info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
// { info: 'Mohon lengkapi dokumen Alison Born', date: 'Selasa, 13 Februari 23', time: '09:43 WIB' },
|
||||
// ];
|
||||
|
||||
/* ------------------------------ default data ------------------------------ */
|
||||
type DataMember = {
|
||||
@@ -256,12 +254,6 @@ export default function Index() {
|
||||
];
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------- handler action ----------------------------- */
|
||||
const handleAction = () => {
|
||||
alert('action');
|
||||
};
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
setIsLoading(true);
|
||||
@@ -279,7 +271,7 @@ export default function Index() {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
// console.log('member', corporateMembers);
|
||||
// console.log('member', corporateMembers);
|
||||
const corporateTopUpLimit = await axios.get(`${corporateValue}/topup`);
|
||||
|
||||
setSearchParams(parameters);
|
||||
@@ -289,58 +281,56 @@ export default function Index() {
|
||||
});
|
||||
setDivisionData(corporateDivision.data);
|
||||
setMemberData(
|
||||
corporateMembers.data.data.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
limit: (
|
||||
<Stack>
|
||||
<BorderLinearProgress
|
||||
variant="determinate"
|
||||
value={obj.limit.percentage}
|
||||
sx={{ mb: 1 }}
|
||||
/>
|
||||
<Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
{fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
corporateMembers.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
limit: (
|
||||
<Stack>
|
||||
<BorderLinearProgress
|
||||
variant="determinate"
|
||||
value={obj.limit.percentage}
|
||||
sx={{ mb: 1 }}
|
||||
/>
|
||||
<Typography sx={{ typography: 'caption', color: '#637381' }}>
|
||||
{fSplit(obj.limit.current)} / {fSplit(obj.limit.total)}
|
||||
</Typography>
|
||||
</Stack>
|
||||
),
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||
color: palette.dark.success.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.32)',
|
||||
color: palette.dark.success.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.16)',
|
||||
color: palette.dark.error.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.32)',
|
||||
color: palette.dark.error.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Inactive
|
||||
</Button>
|
||||
),
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.16)',
|
||||
color: palette.dark.success.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(84, 214, 44, 0.32)',
|
||||
color: palette.dark.success.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Active
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
sx={{
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.16)',
|
||||
color: palette.dark.error.dark,
|
||||
paddingY: 0,
|
||||
'&:hover': {
|
||||
backgroundColor: 'rgba(255, 72, 66, 0.32)',
|
||||
color: palette.dark.error.darker,
|
||||
},
|
||||
}}
|
||||
>
|
||||
Inactive
|
||||
</Button>
|
||||
),
|
||||
/* action: (
|
||||
/* action: (
|
||||
<IconButton onClick={handleAction}>
|
||||
<MoreVertIcon />
|
||||
</IconButton>
|
||||
), */
|
||||
};
|
||||
})
|
||||
}))
|
||||
);
|
||||
setPaginationTable(corporateMembers.data);
|
||||
setRowsPerPage(corporateMembers.data.per_page);
|
||||
@@ -357,8 +347,6 @@ export default function Index() {
|
||||
})();
|
||||
}, [appliedParams, searchParams, order, orderBy, setSearchParams, corporateValue]);
|
||||
|
||||
// console.log(policyData);
|
||||
|
||||
return (
|
||||
<Page title="Dashboard">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
@@ -370,7 +358,7 @@ export default function Index() {
|
||||
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12} lg={6} md={12}>
|
||||
<CardNotification data={itemList} />
|
||||
<CardNotification />
|
||||
</Grid>
|
||||
<Grid item xs={12} lg={6} md={12}>
|
||||
<CardPolicy data={policyData} />
|
||||
|
||||
@@ -1,121 +1,26 @@
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useState, SyntheticEvent } from 'react';
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import { Box, Tabs, Tab, Container, Grid, Card, Stack } from '@mui/material';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import { Container, Grid } from '@mui/material';
|
||||
/* ------------------------------- components ------------------------------- */
|
||||
import Page from '../../components/Page';
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useSettings from '../../hooks/useSettings';
|
||||
import List from './List';
|
||||
import ServiceMonitoring from './ServiceMonitoring';
|
||||
import UserProfile from './UserProfile';
|
||||
|
||||
import HeaderBreadcrumbs from '../../components/HeaderBreadcrumbs';
|
||||
|
||||
/* ------------------------------ tabs setting ------------------------------ */
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
interface TabPanelProps {
|
||||
children?: React.ReactNode;
|
||||
index: number;
|
||||
value: number;
|
||||
}
|
||||
|
||||
interface StyledTabsProps {
|
||||
children?: React.ReactNode;
|
||||
value: number;
|
||||
onChange: (event: React.SyntheticEvent, newValue: number) => void;
|
||||
}
|
||||
|
||||
interface StyledTabProps {
|
||||
label: string;
|
||||
icon?: string | React.ReactElement;
|
||||
}
|
||||
|
||||
/* -------------------------------- tab style ------------------------------- */
|
||||
|
||||
function TabPanel(props: TabPanelProps) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
return (
|
||||
<div
|
||||
role="tabpanel"
|
||||
hidden={value !== index}
|
||||
id={`simple-tabpanel-${index}`}
|
||||
aria-labelledby={`simple-tab-${index}`}
|
||||
{...other}
|
||||
>
|
||||
{value === index && <Box>{children}</Box>}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function a11yProps(index: number) {
|
||||
return {
|
||||
id: `simple-tab-${index}`,
|
||||
'aria-controls': `simple-tabpanel-${index}`,
|
||||
};
|
||||
}
|
||||
|
||||
const StyledTabs = styled((props: StyledTabsProps) => <Tabs {...props} />)({
|
||||
backgroundColor: '#F4F6F8',
|
||||
padding: '0 24px',
|
||||
'& .MuiTabs-indicator': {
|
||||
display: 'flex',
|
||||
justifyContent: 'space-between',
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
'& .MuiTabs-indicatorSpan': {
|
||||
maxWidth: 40,
|
||||
backgroundColor: '#635ee7',
|
||||
},
|
||||
});
|
||||
|
||||
const StyledTab = styled((props: StyledTabProps) => <Tab disableRipple {...props} />)(
|
||||
({ theme }) => ({
|
||||
textTransform: 'none',
|
||||
fontWeight: 600,
|
||||
color: theme.palette.grey[600],
|
||||
marginRight: '5rem',
|
||||
'&.Mui-selected': {
|
||||
color: '#212B36',
|
||||
borderBottom: '2px solid ' + theme.palette.primary.main,
|
||||
},
|
||||
'&:hover': {
|
||||
color: '#212B36',
|
||||
opacity: 1,
|
||||
borderBottom: '2px solid ' + theme.palette.primary.main,
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
export default function Drugs() {
|
||||
const { themeStretch } = useSettings();
|
||||
|
||||
const [value, setValue] = useState(0);
|
||||
const handleChange = (event: SyntheticEvent, newValue: number) => {
|
||||
setValue(newValue);
|
||||
};
|
||||
|
||||
return (
|
||||
<Page title="Employee Data">
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
<HeaderBreadcrumbs
|
||||
heading={'Employee Data'}
|
||||
links={[
|
||||
{ name: 'Case Management', href: '/employee-data' },
|
||||
{ name: 'Employee Data', href: '/employee-data'}
|
||||
]}
|
||||
links={[{ name: 'Case Management' }, { name: 'Employee Data', href: '/employee-data' }]}
|
||||
/>
|
||||
<Grid container>
|
||||
<Grid item xs={12} lg={12} md={12}>
|
||||
<TabPanel value={value} index={0}>
|
||||
<List />
|
||||
</TabPanel>
|
||||
<List />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
@@ -1,150 +1,23 @@
|
||||
/* ---------------------------------- @mui ---------------------------------- */
|
||||
import {
|
||||
Paper,
|
||||
Table,
|
||||
TableBody,
|
||||
TableCell,
|
||||
TableContainer,
|
||||
TableHead,
|
||||
TableRow,
|
||||
TextField,
|
||||
Stack,
|
||||
Button,
|
||||
TableSortLabel,
|
||||
Box,
|
||||
MenuItem
|
||||
} from '@mui/material';
|
||||
import { visuallyHidden } from '@mui/utils';
|
||||
import { Stack, MenuItem } from '@mui/material';
|
||||
/* ---------------------------------- axios --------------------------------- */
|
||||
// import axios from 'axios';
|
||||
import axios from '../../utils/axios';
|
||||
/* ---------------------------------- react --------------------------------- */
|
||||
import { useContext, useEffect, useState } from 'react';
|
||||
|
||||
/* -------------------------------- component ------------------------------- */
|
||||
import Iconify from '../../components/Iconify';
|
||||
import BaseTablePagination from '../../components/BaseTablePagination';
|
||||
import TableComponent from '../../components/Table';
|
||||
|
||||
/* ---------------------------------- hooks --------------------------------- */
|
||||
import useMap from '../../hooks/useMap';
|
||||
/* ---------------------------------- theme --------------------------------- */
|
||||
import palette from '../../theme/palette';
|
||||
import { UserCurrentCorporateContext } from '../../contexts/UserCurrentCorporate';
|
||||
import { HeadCell, Order, PaginationTableProps } from '../../@types/table';
|
||||
import { useSearchParams, useNavigate, Link } from 'react-router-dom';
|
||||
import { fDate, fDateSuffix } from '../../utils/formatTime';
|
||||
import { format } from 'date-fns';
|
||||
import { useSearchParams, useNavigate } from 'react-router-dom';
|
||||
import { fDateSuffix } from '../../utils/formatTime';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import TableMoreMenu from '../../components/table/TableMoreMenu';
|
||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||
import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
|
||||
import Label from '../../components/Label';
|
||||
|
||||
|
||||
/* ---------------------------------- types --------------------------------- */
|
||||
|
||||
// type PaginationTableProps = {
|
||||
// current_page: number;
|
||||
// from: number;
|
||||
// last_page: number;
|
||||
// links: [];
|
||||
// path: string;
|
||||
// per_page: number;
|
||||
// to: number;
|
||||
// total: number;
|
||||
// };
|
||||
|
||||
// type DataTableProps = {
|
||||
// fullName: string;
|
||||
// memberId: string;
|
||||
// service: string;
|
||||
// start_date: string;
|
||||
// end_date: string;
|
||||
// status: boolean | number;
|
||||
// };
|
||||
|
||||
// /* -------------------------------------------------------------------------- */
|
||||
|
||||
// /* -------------------------- enchanced table head -------------------------- */
|
||||
|
||||
// type Order = 'asc' | 'desc';
|
||||
|
||||
// interface HeadCell {
|
||||
// id: string;
|
||||
// label: string;
|
||||
// }
|
||||
|
||||
// const headCells: readonly HeadCell[] = [
|
||||
// {
|
||||
// id: 'name',
|
||||
// label: 'Name',
|
||||
// },
|
||||
// {
|
||||
// id: 'member_id',
|
||||
// label: 'Member ID',
|
||||
// },
|
||||
// {
|
||||
// id: 'service',
|
||||
// label: 'Service',
|
||||
// },
|
||||
// {
|
||||
// id: 'start_date',
|
||||
// label: 'Start Date',
|
||||
// },
|
||||
// {
|
||||
// id: 'end_date',
|
||||
// label: 'End Date',
|
||||
// },
|
||||
// {
|
||||
// id: 'status',
|
||||
// label: 'Status',
|
||||
// },
|
||||
// ];
|
||||
|
||||
// interface EnhancedTableProps {
|
||||
// onRequestSort: (event: React.MouseEvent<unknown>, property: string) => void;
|
||||
// order: Order;
|
||||
// orderBy: string;
|
||||
// }
|
||||
|
||||
// function EnhancedTableHead(props: EnhancedTableProps) {
|
||||
// const { order, orderBy, onRequestSort } = props;
|
||||
// const createSortHandler = (property: string) => (event: React.MouseEvent<unknown>) => {
|
||||
// onRequestSort(event, property);
|
||||
// };
|
||||
|
||||
// return (
|
||||
// <TableHead>
|
||||
// <TableRow>
|
||||
// <TableCell align="center">No</TableCell>
|
||||
// {headCells.map((headCell) => (
|
||||
// <TableCell
|
||||
// key={headCell.id}
|
||||
// sortDirection={orderBy === headCell.id ? order : false}
|
||||
// align="center"
|
||||
// >
|
||||
// <TableSortLabel
|
||||
// active={orderBy === headCell.id}
|
||||
// direction={orderBy === headCell.id ? order : 'asc'}
|
||||
// onClick={createSortHandler(headCell.id)}
|
||||
// >
|
||||
// {headCell.label}
|
||||
// {orderBy === headCell.id ? (
|
||||
// <Box component="span" sx={visuallyHidden}>
|
||||
// {order === 'desc' ? 'sorted descending' : 'sorted ascending'}
|
||||
// </Box>
|
||||
// ) : null}
|
||||
// </TableSortLabel>
|
||||
// </TableCell>
|
||||
// ))}
|
||||
// </TableRow>
|
||||
// </TableHead>
|
||||
// );
|
||||
// }
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
export default function List() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
@@ -212,28 +85,6 @@ export default function List() {
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
/* ------------------------------ handle search ----------------------------- */
|
||||
const [searchText, setSearchText] = useState('');
|
||||
|
||||
const handleSearchSubmit = async (event: React.FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
|
||||
if (searchText === '') {
|
||||
searchParams.delete('search');
|
||||
const params = Object.fromEntries([...searchParams.entries()]);
|
||||
setAppliedParams(params);
|
||||
} else {
|
||||
const params = Object.fromEntries([...searchParams.entries(), ['search', searchText]]);
|
||||
setAppliedParams(params);
|
||||
}
|
||||
};
|
||||
|
||||
const searchs = {
|
||||
searchText: searchText,
|
||||
setSearchText: setSearchText,
|
||||
handleSearchSubmit: handleSearchSubmit,
|
||||
};
|
||||
|
||||
/* -------------------------------- headCell -------------------------------- */
|
||||
const headCells: HeadCell<never>[] = [
|
||||
{
|
||||
@@ -248,7 +99,7 @@ export default function List() {
|
||||
label: 'Name',
|
||||
isSort: true,
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
id: 'start_date',
|
||||
align: 'center',
|
||||
@@ -290,68 +141,44 @@ export default function List() {
|
||||
const response = await axios.get(`${corporateValue}/members?type=employee-data`, {
|
||||
params: { ...parameters },
|
||||
});
|
||||
|
||||
|
||||
setSearchParams(parameters);
|
||||
setData(
|
||||
response.data.data.map((obj: any) => {
|
||||
return {
|
||||
...obj,
|
||||
// memberId:
|
||||
// <Button
|
||||
// onClick={() => navigate ('/employee-data/user-profile/'+obj.personId)}
|
||||
// >{obj.memberId}</Button>
|
||||
// ,
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Label color='success'>
|
||||
Active
|
||||
</Label>
|
||||
) : (
|
||||
<Label color='error'>
|
||||
Inactive
|
||||
</Label>
|
||||
),
|
||||
start_date:
|
||||
<Label>
|
||||
{obj.start_date ? fDateSuffix(obj.start_date) : ''}
|
||||
</Label>
|
||||
,
|
||||
end_date:
|
||||
<Label>
|
||||
{obj.end_date ? fDateSuffix(obj.end_date) : ''}
|
||||
</Label>
|
||||
,
|
||||
fullName:
|
||||
<Typography
|
||||
variant="body2"
|
||||
>
|
||||
{obj.fullName}
|
||||
</Typography>
|
||||
,
|
||||
memberId:
|
||||
<Typography
|
||||
variant="body2"
|
||||
>
|
||||
{obj.memberId}
|
||||
</Typography>
|
||||
,
|
||||
action:
|
||||
<TableMoreMenu actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate ('/employee-data/user-profile/'+obj.personId)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
} />
|
||||
};
|
||||
})
|
||||
response.data.data.map((obj: any) => ({
|
||||
...obj,
|
||||
// memberId:
|
||||
// <Button
|
||||
// onClick={() => navigate ('/employee-data/user-profile/'+obj.personId)}
|
||||
// >{obj.memberId}</Button>
|
||||
// ,
|
||||
status:
|
||||
obj.status === 1 ? (
|
||||
<Label color="success">Active</Label>
|
||||
) : (
|
||||
<Label color="error">Inactive</Label>
|
||||
),
|
||||
start_date: <Label>{obj.start_date ? fDateSuffix(obj.start_date) : ''}</Label>,
|
||||
end_date: <Label>{obj.end_date ? fDateSuffix(obj.end_date) : ''}</Label>,
|
||||
fullName: <Typography variant="body2">{obj.fullName}</Typography>,
|
||||
memberId: <Typography variant="body2">{obj.memberId}</Typography>,
|
||||
action: (
|
||||
<TableMoreMenu
|
||||
actions={
|
||||
<>
|
||||
<MenuItem onClick={() => navigate('/employee-data/user-profile/' + obj.personId)}>
|
||||
<VisibilityOutlinedIcon />
|
||||
View
|
||||
</MenuItem>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
),
|
||||
}))
|
||||
);
|
||||
|
||||
setPaginationTable(response.data);
|
||||
setRowsPerPage(response.data.per_page);
|
||||
|
||||
|
||||
|
||||
if (searchParams.get('page')) {
|
||||
//@ts-ignore
|
||||
const currentPage = parseInt(searchParams.get('page')) - 1;
|
||||
@@ -373,7 +200,7 @@ export default function List() {
|
||||
paginations={paginations}
|
||||
loadings={loadings}
|
||||
params={params}
|
||||
searchs={searchs}
|
||||
// searchs={searchs}
|
||||
// filters={filters}
|
||||
/>
|
||||
</Stack>
|
||||
|
||||
@@ -41,6 +41,7 @@ const ItemNotificationStyle = styled(Card)(({ theme }) => ({
|
||||
marginTop: 2,
|
||||
overflowY: 'auto',
|
||||
maxHeight: '154px',
|
||||
minHeight: '154px',
|
||||
gap: '0.5rem',
|
||||
}));
|
||||
|
||||
@@ -100,31 +101,37 @@ export default function CardNotification({ data }: NotificationProps) {
|
||||
</Button>
|
||||
</Stack>
|
||||
|
||||
<ItemNotificationStyle>
|
||||
{data
|
||||
? data.map(({ info, date, time }, index) => (
|
||||
<div key={index}>
|
||||
{index >= 1 ? <Divider sx={{ marginY: 0.5 }} /> : ''}
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption' }}>{info}</Typography>
|
||||
<Link
|
||||
component="button"
|
||||
variant="caption"
|
||||
underline="always"
|
||||
onClick={() => clickHandler('infoDetail')}
|
||||
>
|
||||
Info Detail
|
||||
</Link>
|
||||
</Stack>
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{date}</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{time}</Typography>
|
||||
</Stack>
|
||||
<ItemNotificationStyle
|
||||
sx={{ display: data?.length === 0 || data === undefined ? 'flex' : 'block' }}
|
||||
>
|
||||
{data ? (
|
||||
data.map(({ info, date, time }, index) => (
|
||||
<div key={index}>
|
||||
{index >= 1 ? <Divider sx={{ marginY: 0.5 }} /> : ''}
|
||||
<Stack direction="row" justifyContent="space-between" alignItems="center">
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption' }}>{info}</Typography>
|
||||
<Link
|
||||
component="button"
|
||||
variant="caption"
|
||||
underline="always"
|
||||
onClick={() => clickHandler('infoDetail')}
|
||||
>
|
||||
Info Detail
|
||||
</Link>
|
||||
</Stack>
|
||||
</div>
|
||||
))
|
||||
: ''}
|
||||
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start">
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{date}</Typography>
|
||||
<Typography sx={{ typography: 'caption', color: '#656565' }}>{time}</Typography>
|
||||
</Stack>
|
||||
</Stack>
|
||||
</div>
|
||||
))
|
||||
) : (
|
||||
<Stack justifyContent="center" alignItems="center" flexGrow={1}>
|
||||
No Notification
|
||||
</Stack>
|
||||
)}
|
||||
</ItemNotificationStyle>
|
||||
|
||||
{isDialog === 'allNotification' && (
|
||||
|
||||
1
frontend/hospital-portal/.env.production
Normal file
1
frontend/hospital-portal/.env.production
Normal file
@@ -0,0 +1 @@
|
||||
VITE_API_URL="https://primecenter-api.linksehat.com/api/v1/hospitalportal"
|
||||
1
public/hospital-portal/image/ic_booking.svg
Normal file
1
public/hospital-portal/image/ic_booking.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g fill="#637381"><path d="m16.8125 2.83333h-1.1459v-.91667c0-.50599-.4097-.91666-.9166-.91666s-.9167.41067-.9167.91666v.91667h-7.33331v-.91667c0-.50599-.40975-.91666-.91667-.91666-.50691 0-.91666.41067-.91666.91666v.91667h-1.14583c-1.39058 0-2.52083 1.13025-2.52083 2.52083v10.31244c0 1.5162 1.23383 2.75 2.74999 2.75h4.58333c.50691 0 .91666-.4106.91666-.9166s-.40975-.9167-.91666-.9167h-4.58333c-.50599 0-.91666-.4116-.91666-.9167v-7.33328h14.66667c0 .506.4097.91666.9166.91666s.9167-.41066.9167-.91666v-2.97916c0-1.39058-1.1302-2.52083-2.5208-2.52083z"/><path d="m17.0413 11.0834c-3.2853 0-5.9583 2.673-5.9583 5.9583s2.673 5.9583 5.9583 5.9583 5.9583-2.673 5.9583-5.9583-2.673-5.9583-5.9583-5.9583zm2.7555 4.9545-2.9791 3.4375c-.1669.1925-.4061.3062-.66.3163-.011 0-.022 0-.033 0-.243 0-.4758-.0963-.6481-.2686l-1.6042-1.6042c-.3584-.3584-.3584-.9377 0-1.2961.3584-.3585.9378-.3585 1.2962 0l.9084.9084 2.3338-2.6932c.3318-.3831.9112-.4226 1.2934-.0926.3823.331.4235.9103.0926 1.2925z" opacity=".48"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
1
public/hospital-portal/image/ic_dashboard.svg
Normal file
1
public/hospital-portal/image/ic_dashboard.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><g transform="translate(2 4)"><path d="m18.38 4.57-1.23 1.85c1.2049 2.40314304 1.1222508 5.2507848-.22 7.58h-13.86c-1.76350331-3.059309-1.31261601-6.91298595 1.10947843-9.48257235s6.24242627-3.24722187 9.40052157-1.66742765l1.85-1.23c-3.8761922-2.48556317-8.94860517-2.00294347-12.28650726 1.16901179-3.3379021 3.17195526-4.07833512 8.21319061-1.79349274 12.21098821.35510459.6150891 1.00977788.9957131 1.72 1.0000158h13.85c.7173695.0028322 1.3813181-.3787474 1.74-1.0000158 1.8786438-3.25433 1.7743473-7.28712667-.27-10.44z"/><path d="m8.59 11.41c.37513651.3755541.8841815.5865733 1.415.5865733s1.0398635-.2110192 1.415-.5865733l5.66-8.49-8.49 5.66c-.37555409.37513651-.58657331.8841815-.58657331 1.415s.21101922 1.0398635.58657331 1.415z" opacity=".48"/></g></svg>
|
||||
|
After Width: | Height: | Size: 850 B |
18
public/hospital-portal/image/ic_flag_en.svg
Normal file
18
public/hospital-portal/image/ic_flag_en.svg
Normal file
@@ -0,0 +1,18 @@
|
||||
<svg height="20" viewBox="0 0 28 20" width="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs><rect id="a" height="20" rx="3" width="28"/>
|
||||
<mask id="b" fill="#fff">
|
||||
<use fill="#fff" fill-rule="evenodd" xlink:href="#a"/>
|
||||
</mask>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<use fill="#0a17a7" xlink:href="#a"/>
|
||||
<path d="m29.2824692-1.91644623 1.4911811 2.21076686-9.4483006 6.37223314 6.6746503.0001129v6.66666663l-6.6746503-.0007795 9.4483006 6.3731256-1.4911811 2.2107668-11.9501195-8.0608924.0009836 7.4777795h-6.6666666l-.000317-7.4777795-11.9488189 8.0608924-1.49118107-2.2107668 9.448-6.3731256-6.67434973.0007795v-6.66666663l6.67434973-.0001129-9.448-6.37223314 1.49118107-2.21076686 11.9488189 8.06.000317-7.4768871h6.6666666l-.0009836 7.4768871z" fill="#fff" mask="url(#b)"/>
|
||||
<g stroke="#db1f35" stroke-linecap="round" stroke-width=".667">
|
||||
<path d="m18.668 6.332 12.665-8.332" mask="url(#b)"/>
|
||||
<path d="m20.013 21.35 11.354-7.652" mask="url(#b)" transform="matrix(1 0 0 -1 0 35.048)"/>
|
||||
<path d="m8.006 6.31-11.843-7.981" mask="url(#b)"/>
|
||||
<path d="m9.29 22.31-13.127-8.705" mask="url(#b)" transform="matrix(1 0 0 -1 0 35.915)"/>
|
||||
</g>
|
||||
<path d="m0 12h12v8h4v-8h12v-4h-12v-8h-4v8h-12z" fill="#e6273e" mask="url(#b)"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
9
public/hospital-portal/image/ic_flag_id.svg
Normal file
9
public/hospital-portal/image/ic_flag_id.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg height="20" viewBox="0 0 28 20" width="28" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<rect id="a" height="10" rx="0" width="28"/>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<use fill="#D82028" xlink:href="#a"/>
|
||||
<use fill="#FFF" xlink:href="#a" y="10"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 335 B |
@@ -1,15 +1,38 @@
|
||||
{
|
||||
"greeting": "Hello",
|
||||
"buttonText": "Click Me",
|
||||
"infoLogin": "Enter the registered account",
|
||||
"txtLogin1" : "Sign in to Hospital Portal",
|
||||
"txtLogin2" : "Enter your details below",
|
||||
"txtCardSearchMember1" : "Guarantee Submission",
|
||||
"txtCardSearchMember2" : "Find Member",
|
||||
"txtCardSearchMember3" : "Date Birth",
|
||||
"txtCardSearchMember4" : "Member ID",
|
||||
"txtCardSearchMember5" : "Member",
|
||||
"txtDialogMember1" : "Benefit Summary",
|
||||
"txtDialogMember2" : "Request LOG",
|
||||
"txtDialogMember3" : "Member Detail"
|
||||
"greeting": "Hello",
|
||||
"buttonText": "Click Me",
|
||||
"infoLogin": "Enter the registered account",
|
||||
"txtLogin1": "Sign in to Hospital Portal",
|
||||
"txtLogin2": "Enter your details below",
|
||||
"txtCardSearchMember1": "Membership Query",
|
||||
"txtCardSearchMember2": "Search Member",
|
||||
"txtCardSearchMember3": "Date of Birth",
|
||||
"txtCardSearchMember4": "Member ID",
|
||||
"txtCardSearchMember5": "Member",
|
||||
"txtDialogMember1": "Services",
|
||||
"txtDialogMember2": "Request LOG",
|
||||
"txtDialogMember3": "Detail",
|
||||
"txtDialogMember4": "Please select services",
|
||||
"txtDialogMember5": "Submission Date",
|
||||
"txtDateBirth": "Date of Birth",
|
||||
"txtGender": "Gender",
|
||||
"txtMaritalStatus": "Marital Status",
|
||||
"txtLanguage": "Language",
|
||||
"txtRelationship": "Relationship",
|
||||
"txtRequestDate": "Request Date",
|
||||
"txtMemberID": "Member ID",
|
||||
"txtClaimCode": "Claim Code",
|
||||
"txtRequestCode": "Request Code",
|
||||
"txtName": "Name",
|
||||
"txtStatus": "Status",
|
||||
"txtSearch": "Search Name or Member ID...",
|
||||
"txtAll": "All",
|
||||
"txtSubmissionDate": "Submission Date",
|
||||
"txtDataNotFound": "Data Not Found",
|
||||
"txtConditionDocument": "Condition Document",
|
||||
"txtDiagnosisDokument": "Diagnosis Dokument",
|
||||
"txtSupportingResultDocument": "Supporting Result Document",
|
||||
"txtAddResult": "Add Result",
|
||||
"txtServiceType": "Service Type",
|
||||
"txtAdditionalDocuments": "Additional Documents"
|
||||
}
|
||||
|
||||
@@ -1,15 +1,38 @@
|
||||
{
|
||||
"greeting": "Halo",
|
||||
"buttonText": "Klik Saya",
|
||||
"infoLogin": "Masukan akun yang telah terdaftar",
|
||||
"txtLogin1" : "Masuk ke Hospital Portal",
|
||||
"txtLogin2" : "Masukkan detail Anda di bawah ini",
|
||||
"txtCardSearchMember1" : "Pengajuan Jaminan",
|
||||
"txtCardSearchMember2" : "Cari Anggota",
|
||||
"txtCardSearchMember3" : "Tanggal Lahir",
|
||||
"txtCardSearchMember4" : "Member ID",
|
||||
"txtCardSearchMember5" : "Member",
|
||||
"txtDialogMember1" : "Ringkasan Manfaat",
|
||||
"txtDialogMember2" : "Request LOG",
|
||||
"txtDialogMember3" : "Detail Member"
|
||||
"greeting": "Halo",
|
||||
"buttonText": "Klik Saya",
|
||||
"infoLogin": "Masukan akun yang telah terdaftar",
|
||||
"txtLogin1": "Masuk ke Hospital Portal",
|
||||
"txtLogin2": "Masukkan detail Anda di bawah ini",
|
||||
"txtCardSearchMember1": "Pengajuan Jaminan",
|
||||
"txtCardSearchMember2": "Cari Anggota",
|
||||
"txtCardSearchMember3": "Tanggal Lahir",
|
||||
"txtCardSearchMember4": "Member ID",
|
||||
"txtCardSearchMember5": "Member",
|
||||
"txtDialogMember1": "Layanan",
|
||||
"txtDialogMember2": "Request LOG",
|
||||
"txtDialogMember3": "Detail",
|
||||
"txtDialogMember4": "Mohon pilih layanan",
|
||||
"txtDialogMember5": "Tanggal Pengajuan",
|
||||
"txtDateBirth": "Tanggal Lahir",
|
||||
"txtGender": "Jenis Kelamin",
|
||||
"txtMaritalStatus": "Status Perkawinan",
|
||||
"txtLanguage": "Bahasa",
|
||||
"txtRelationship": "Hubungan",
|
||||
"txtRequestDate": "Tanggal Permintaan",
|
||||
"txtMemberID": "ID Anggota",
|
||||
"txtClaimCode": "Kode Klaim",
|
||||
"txtRequestCode": "Kode Pengajuan",
|
||||
"txtName": "Nama",
|
||||
"txtStatus": "Status",
|
||||
"txtSearch": "Cari Nama atau ID Anggota...",
|
||||
"txtAll": "Semua",
|
||||
"txtSubmissionDate": "Tanggal Pengajuan",
|
||||
"txtDataNotFound": "Data Tidak Ditemukan",
|
||||
"txtConditionDocument": "Dokumen Kondisi",
|
||||
"txtDiagnosisDokument": "Dokumen Diagnosa",
|
||||
"txtSupportingResultDocument": "Dokumen Hasil Pendukung",
|
||||
"txtAddResult": "Tambah Hasil",
|
||||
"txtServiceType": "Tipe Layanan",
|
||||
"txtAdditionalDocuments": "Dokumen Tambahan"
|
||||
}
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
{{-- <link rel="stylesheet" href="{{ asset('css/app.css') }}"> --}}
|
||||
|
||||
<style>
|
||||
/* @font-face {
|
||||
font-family: Public Sans;
|
||||
src: url('{{asset('fonts/PublicSans-Medium.ttf')}}');
|
||||
src: url('{{asset('fonts/PublicSans-Medium.ttf')}}') format('truetype');
|
||||
src: url('{{ asset('fonts/PublicSans-Medium.ttf') }}');
|
||||
src: url('{{ asset('fonts/PublicSans-Medium.ttf') }}') format('truetype');
|
||||
} */
|
||||
|
||||
html, body {
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@@ -22,101 +24,116 @@
|
||||
font-family: 'Public Sans';
|
||||
color: #404040;
|
||||
font-size: 20px;
|
||||
margin: 0; /* Reset default margin */
|
||||
padding: 0; /* Reset default padding */
|
||||
margin: 0;
|
||||
/* Reset default margin */
|
||||
padding: 0;
|
||||
/* Reset default padding */
|
||||
background-image: url("{{ public_path('images/background-vale.png') }}");
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover; /* Adjust as needed */
|
||||
background-size: cover;
|
||||
/* Adjust as needed */
|
||||
}
|
||||
|
||||
.text-sm {
|
||||
font-size: 18px;
|
||||
color: #FFFFFF
|
||||
}
|
||||
|
||||
.text-md {
|
||||
font-size: 18px;
|
||||
color: #159C9C
|
||||
}
|
||||
|
||||
.text-lg {
|
||||
font-size: 22px;
|
||||
color: #117D7D;
|
||||
|
||||
}
|
||||
|
||||
.text-gray {
|
||||
color: #919EAB;
|
||||
}
|
||||
|
||||
|
||||
.content {
|
||||
margin: 10% 0 0 0;
|
||||
margin: 10% 0 0 0;
|
||||
}
|
||||
|
||||
.image-container {
|
||||
margin-left: 75%; /* Adjust the margin as needed */
|
||||
margin-left: 75%;
|
||||
/* Adjust the margin as needed */
|
||||
}
|
||||
|
||||
.label {
|
||||
background-color: #117D7D;
|
||||
color: #fff;
|
||||
border-radius: 15px;
|
||||
padding: 8px; /* Sesuaikan dengan kebutuhan Anda */
|
||||
padding: 8px;
|
||||
/* Sesuaikan dengan kebutuhan Anda */
|
||||
font-size: 18px;
|
||||
gap: 4px;
|
||||
display: inline-flex; /* Untuk memastikan ikon dan teks berada dalam satu baris */
|
||||
align-items: center; /* Untuk memastikan ikon dan teks berada dalam satu baris */
|
||||
display: inline-flex;
|
||||
/* Untuk memastikan ikon dan teks berada dalam satu baris */
|
||||
align-items: center;
|
||||
/* Untuk memastikan ikon dan teks berada dalam satu baris */
|
||||
}
|
||||
|
||||
.label svg {
|
||||
margin-right: 4px; /* Jarak antara ikon dan teks */
|
||||
margin-right: 4px;
|
||||
/* Jarak antara ikon dan teks */
|
||||
}
|
||||
|
||||
.text-sm {
|
||||
font-size: 18px; /* Sesuaikan dengan kebutuhan Anda */
|
||||
font-size: 18px;
|
||||
/* Sesuaikan dengan kebutuhan Anda */
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<br><br><br><br>
|
||||
<div class="content">
|
||||
<div class="text-container">
|
||||
<span class="text-md"> Member Name </span>
|
||||
<p class="text-lg"><b>{{ $member->fullName }}</b></p>
|
||||
<br><br><br><br>
|
||||
<div class="content">
|
||||
<div class="text-container">
|
||||
<span class="text-md"> Member Name </span>
|
||||
<p class="text-lg"><b>{{ $member->fullName }}</b></p>
|
||||
|
||||
<span class="text-md"> Member ID </span>
|
||||
<p class="text-lg"><b>{{ $member->member_id }}</b></p>
|
||||
<span class="text-md"> Member ID </span>
|
||||
<p class="text-lg"><b>{{ $member->member_id }}</b></p>
|
||||
|
||||
<span class="text-md"> Policy Holder </span>
|
||||
<p class="text-lg"><b>{{ $member->currentCorporate->name }}</b></p>
|
||||
<span class="text-md"> Policy Holder </span>
|
||||
<p class="text-lg"><b>{{ $member->currentCorporate->name }}</b></p>
|
||||
|
||||
<span class="text-md"> Policy Number </span>
|
||||
<p class="text-lg"><b>{{ $member->currentPolicy->code }}</b></p>
|
||||
<span class="text-md"> Policy Number </span>
|
||||
<p class="text-lg"><b>{{ $member->currentPolicy->code }}</b></p>
|
||||
|
||||
<span class="text-md"> Date of Birth </span>
|
||||
<p class="text-lg"><b>{{ $member->birthDateeCard }}</b></p>
|
||||
<span class="text-md"> Date of Birth </span>
|
||||
<p class="text-lg"><b>{{ $member->birthDateeCard }}</b></p>
|
||||
|
||||
<span class="text-md"> Gender </span>
|
||||
<p class="text-lg"><b>{{ $member->gender }}</b></p>
|
||||
<span class="text-md"> Gender </span>
|
||||
<p class="text-lg"><b>{{ $member->gender }}</b></p>
|
||||
|
||||
<span class="text-md"> Start Date </span>
|
||||
<p class="text-lg"><b>{{ $member->startDate }}</b></p>
|
||||
<span class="text-md"> Start Date </span>
|
||||
<p class="text-lg"><b>{{ $member->startDate }}</b></p>
|
||||
|
||||
<div class="image-container">
|
||||
<img src="{{ public_path('images/logo-default.png')}}" height="30px">
|
||||
</div>
|
||||
<span class="label">
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M6.00082 0.166992C9.22257 0.166992 11.8342 2.77858 11.8342 6.00033C11.8342 9.22208 9.22257 11.8337 6.00082 11.8337C4.96994 11.8353 3.9572 11.5625 3.06666 11.0432L0.169822 11.8337L0.958489 8.93566C0.438793 8.04484 0.165766 7.03166 0.167489 6.00033C0.167489 2.77858 2.77907 0.166992 6.00082 0.166992ZM4.01282 3.25866L3.89615 3.26333C3.82063 3.26793 3.74681 3.28777 3.67916 3.32166C3.61588 3.35749 3.55811 3.40229 3.50766 3.45466C3.43766 3.52058 3.39799 3.57774 3.35541 3.63316C3.13964 3.91369 3.02347 4.25809 3.02524 4.61199C3.02641 4.89783 3.10107 5.17608 3.21774 5.43624C3.45632 5.96241 3.84891 6.51949 4.36691 7.03574C4.49174 7.15999 4.61424 7.28483 4.74607 7.40091C5.38972 7.9676 6.15672 8.37627 6.98607 8.59441L7.31741 8.64516C7.42532 8.65099 7.53324 8.64283 7.64174 8.63758C7.81163 8.62881 7.97751 8.5828 8.12766 8.50283C8.20405 8.46348 8.2786 8.42065 8.35107 8.37449C8.35107 8.37449 8.37615 8.35816 8.42399 8.32199C8.50274 8.26366 8.55116 8.22224 8.61649 8.15399C8.66491 8.10383 8.7069 8.04491 8.73899 7.97783C8.78449 7.88274 8.82999 7.70132 8.84865 7.55024C8.86265 7.43474 8.85857 7.37174 8.85682 7.33266C8.85449 7.27024 8.80257 7.20549 8.74599 7.17808L8.40649 7.02583C8.40649 7.02583 7.89899 6.80474 7.58865 6.66358C7.55618 6.6494 7.52138 6.64129 7.48599 6.63966C7.44608 6.63556 7.40575 6.64005 7.36772 6.65283C7.32969 6.66561 7.29483 6.68638 7.26549 6.71374C7.26257 6.71257 7.22349 6.74583 6.80174 7.25683C6.77753 7.28935 6.74419 7.31394 6.70596 7.32744C6.66773 7.34095 6.62634 7.34276 6.58707 7.33266C6.54907 7.32247 6.51184 7.3096 6.47565 7.29416C6.40332 7.26383 6.37824 7.25216 6.32865 7.23116C5.99386 7.08506 5.68389 6.88766 5.4099 6.64608C5.3364 6.58191 5.26816 6.51191 5.19815 6.44424C4.96866 6.22446 4.76866 5.97583 4.60315 5.70458L4.56874 5.64916C4.54402 5.61192 4.52403 5.57175 4.50924 5.52958C4.48707 5.44383 4.54482 5.37499 4.54482 5.37499C4.54482 5.37499 4.68657 5.21983 4.75249 5.13583C4.81666 5.05416 4.8709 4.97483 4.9059 4.91824C4.97474 4.80741 4.99632 4.69366 4.96016 4.60558C4.79682 4.20658 4.62766 3.80933 4.45382 3.41499C4.4194 3.33683 4.31732 3.28083 4.22457 3.26974C4.19307 3.26624 4.16157 3.26274 4.13007 3.26041C4.05173 3.25652 3.97323 3.2573 3.89499 3.26274L4.01224 3.25808L4.01282 3.25866Z" fill="white"/>
|
||||
</svg>
|
||||
<span class="text-sm">
|
||||
08114123962
|
||||
</span>
|
||||
</span>
|
||||
<span class="text-md" style="margin-left:39%"><b> Valid until: {{ $member->endDate }}</b></span>
|
||||
<div class="image-container">
|
||||
<img src="{{ public_path('images/logo-default.png') }}" height="30px">
|
||||
</div>
|
||||
|
||||
<span class="label">
|
||||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
d="M6.00082 0.166992C9.22257 0.166992 11.8342 2.77858 11.8342 6.00033C11.8342 9.22208 9.22257 11.8337 6.00082 11.8337C4.96994 11.8353 3.9572 11.5625 3.06666 11.0432L0.169822 11.8337L0.958489 8.93566C0.438793 8.04484 0.165766 7.03166 0.167489 6.00033C0.167489 2.77858 2.77907 0.166992 6.00082 0.166992ZM4.01282 3.25866L3.89615 3.26333C3.82063 3.26793 3.74681 3.28777 3.67916 3.32166C3.61588 3.35749 3.55811 3.40229 3.50766 3.45466C3.43766 3.52058 3.39799 3.57774 3.35541 3.63316C3.13964 3.91369 3.02347 4.25809 3.02524 4.61199C3.02641 4.89783 3.10107 5.17608 3.21774 5.43624C3.45632 5.96241 3.84891 6.51949 4.36691 7.03574C4.49174 7.15999 4.61424 7.28483 4.74607 7.40091C5.38972 7.9676 6.15672 8.37627 6.98607 8.59441L7.31741 8.64516C7.42532 8.65099 7.53324 8.64283 7.64174 8.63758C7.81163 8.62881 7.97751 8.5828 8.12766 8.50283C8.20405 8.46348 8.2786 8.42065 8.35107 8.37449C8.35107 8.37449 8.37615 8.35816 8.42399 8.32199C8.50274 8.26366 8.55116 8.22224 8.61649 8.15399C8.66491 8.10383 8.7069 8.04491 8.73899 7.97783C8.78449 7.88274 8.82999 7.70132 8.84865 7.55024C8.86265 7.43474 8.85857 7.37174 8.85682 7.33266C8.85449 7.27024 8.80257 7.20549 8.74599 7.17808L8.40649 7.02583C8.40649 7.02583 7.89899 6.80474 7.58865 6.66358C7.55618 6.6494 7.52138 6.64129 7.48599 6.63966C7.44608 6.63556 7.40575 6.64005 7.36772 6.65283C7.32969 6.66561 7.29483 6.68638 7.26549 6.71374C7.26257 6.71257 7.22349 6.74583 6.80174 7.25683C6.77753 7.28935 6.74419 7.31394 6.70596 7.32744C6.66773 7.34095 6.62634 7.34276 6.58707 7.33266C6.54907 7.32247 6.51184 7.3096 6.47565 7.29416C6.40332 7.26383 6.37824 7.25216 6.32865 7.23116C5.99386 7.08506 5.68389 6.88766 5.4099 6.64608C5.3364 6.58191 5.26816 6.51191 5.19815 6.44424C4.96866 6.22446 4.76866 5.97583 4.60315 5.70458L4.56874 5.64916C4.54402 5.61192 4.52403 5.57175 4.50924 5.52958C4.48707 5.44383 4.54482 5.37499 4.54482 5.37499C4.54482 5.37499 4.68657 5.21983 4.75249 5.13583C4.81666 5.05416 4.8709 4.97483 4.9059 4.91824C4.97474 4.80741 4.99632 4.69366 4.96016 4.60558C4.79682 4.20658 4.62766 3.80933 4.45382 3.41499C4.4194 3.33683 4.31732 3.28083 4.22457 3.26974C4.19307 3.26624 4.16157 3.26274 4.13007 3.26041C4.05173 3.25652 3.97323 3.2573 3.89499 3.26274L4.01224 3.25808L4.01282 3.25866Z"
|
||||
fill="white" />
|
||||
</svg>
|
||||
<span class="text-sm">
|
||||
08114123962
|
||||
</span>
|
||||
</span>
|
||||
<span class="text-md" style="margin-left:27%"><b> Valid until: {{ $member->endDate }}</b></span>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
@@ -32,8 +33,10 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
background-color: #ffffff; /* Ganti dengan warna latar belakang yang diinginkan */
|
||||
background-color: #ffffff;
|
||||
/* Ganti dengan warna latar belakang yang diinginkan */
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 20px;
|
||||
text-align: left;
|
||||
@@ -41,9 +44,12 @@
|
||||
|
||||
.content img {
|
||||
width: 25%;
|
||||
max-width: 600px; /* batasan lebar maksimum gambar */
|
||||
margin-top: 20px; /* jarak antara segitiga dan gambar */
|
||||
max-width: 600px;
|
||||
/* batasan lebar maksimum gambar */
|
||||
margin-top: 20px;
|
||||
/* jarak antara segitiga dan gambar */
|
||||
}
|
||||
|
||||
.corner-text {
|
||||
font-family: 'Calibri', sans-serif;
|
||||
font-size: 14px;
|
||||
@@ -60,11 +66,13 @@
|
||||
bottom: 10px;
|
||||
right: 10px;
|
||||
}
|
||||
|
||||
.bottom-left {
|
||||
bottom: 10px;
|
||||
left: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.title-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -84,6 +92,7 @@
|
||||
font-family: 'Calibri', sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.claim-info {
|
||||
font-family: 'Calibri', sans-serif;
|
||||
font-size: 14px;
|
||||
@@ -98,14 +107,18 @@
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
table, th, td {
|
||||
table,
|
||||
th,
|
||||
td {
|
||||
/* border: 1px solid #008C8C; */
|
||||
}
|
||||
|
||||
th, td {
|
||||
th,
|
||||
td {
|
||||
padding: 4px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.hot-line {
|
||||
font-family: 'Calibri', sans-serif;
|
||||
background-color: #048B8C;
|
||||
@@ -116,11 +129,13 @@
|
||||
padding: 2px;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.txt-tindakan {
|
||||
font-family: 'Calibri', sans-serif;
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.txt-pernyataan {
|
||||
font-family: 'Calibri', sans-serif;
|
||||
margin-top: 40px;
|
||||
@@ -128,6 +143,7 @@
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="triangle2"></div>
|
||||
<div class="triangle1"></div>
|
||||
@@ -135,7 +151,8 @@
|
||||
<div class="corner-text top-right">
|
||||
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') )) }}">
|
||||
<img
|
||||
src="data:image/png;base64,{{ base64_encode(file_get_contents(public_path('images/logo-default.png'))) }}">
|
||||
<div class="title-container">
|
||||
<div class="title">
|
||||
<b>SURAT JAMINAN</b>
|
||||
@@ -148,10 +165,11 @@
|
||||
<tr>
|
||||
<td style="width: 20%;">No. Klaim</td>
|
||||
<td style="width: 1%;">:</td>
|
||||
<td style="width: 29%;">{{ wordwrap($request_logs->code,15,"<br>\n")}}</td>
|
||||
<td style="width: 29%;">{{ wordwrap($request_logs->code, 15, "<br>\n") }}</td>
|
||||
<td style="width: 20%;">Tanggal</td>
|
||||
<td style="width: 1%;">:</td>
|
||||
<td style="width: 29%;">{{ \Carbon\Carbon::parse($request_logs->submission_date)->format('d M Y') }}</td>
|
||||
<td style="width: 29%;">{{ \Carbon\Carbon::parse($request_logs->submission_date)->format('d M Y') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kepada</td>
|
||||
@@ -166,7 +184,8 @@
|
||||
Call Center LinkSehat : 08114123962
|
||||
</div>
|
||||
<div class="txt-tindakan">
|
||||
Link Sehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Awal untuk peserta dibawah ini :
|
||||
LinkSehat bertindak mewakili perusahaan asuransi/penanggung untuk mengeluarkan Surat Jaminan Awal untuk
|
||||
peserta dibawah ini :
|
||||
</div>
|
||||
<table class="claim-info">
|
||||
<tr>
|
||||
@@ -202,7 +221,8 @@
|
||||
<td>{{ $dataMember->no_polis }}</td> -->
|
||||
<td>Tipe</td>
|
||||
<td>:</td>
|
||||
<td>{{ $dataMember->limit_rules == '999999999' ? 'As Charge' : 'Max Amount, Rp '.number_format($dataMember->limit_rules, 2, ',', '.') }}</td>
|
||||
<td>{{ $dataMember->limit_rules == '999999999' ? 'As Charge' : 'Max Amount, Rp ' . number_format($dataMember->limit_rules, 2, ',', '.') }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Jenis Kelamin</td>
|
||||
@@ -210,7 +230,7 @@
|
||||
<td>{{ $dataMember->gender == 'male' ? 'Laki-Laki' : 'Perempuan' }}</td>
|
||||
<!-- <td>Tipe</td>
|
||||
<td>:</td>
|
||||
<td>{{ $dataMember->limit_rules == '999999999' ? 'As Charge' : 'Max Amount, Rp '.number_format($dataMember->limit_rules, 2, ',', '.') }}</td> -->
|
||||
<td>{{ $dataMember->limit_rules == '999999999' ? 'As Charge' : 'Max Amount, Rp ' . number_format($dataMember->limit_rules, 2, ',', '.') }}</td> -->
|
||||
<td>Status Polis</td>
|
||||
<td>:</td>
|
||||
<td>{{ $dataMember->status_polis == 'active' ? 'Aktif' : 'Tidak Aktif' }}</td>
|
||||
@@ -224,7 +244,8 @@
|
||||
<td>{{ $dataMember->status_polis == 'active' ? 'Aktif' : 'Tidak Aktif' }}</td> -->
|
||||
<td>Tanggal Mulai/Akhir</td>
|
||||
<td>:</td>
|
||||
<td>{{ \Carbon\Carbon::parse($dataMember->mulai)->format('d M Y') }} - {{ \Carbon\Carbon::parse($dataMember->akhir)->format('d M Y') }}</td>
|
||||
<td>{{ \Carbon\Carbon::parse($dataMember->mulai)->format('d M Y') }} -
|
||||
{{ \Carbon\Carbon::parse($dataMember->akhir)->format('d M Y') }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Identitas Peserta</td>
|
||||
@@ -262,7 +283,8 @@
|
||||
</tr> -->
|
||||
</table>
|
||||
<div class="txt-pernyataan">
|
||||
Surat Jaminan ini dinyatakan berlaku apabila disertai surat jaminan akhir dengan nominal yang tertera pada akhir perawatan.
|
||||
Surat Jaminan ini dinyatakan berlaku apabila disertai surat jaminan akhir dengan nominal yang tertera pada
|
||||
akhir perawatan.
|
||||
</div>
|
||||
<div class="corner-text bottom-right">
|
||||
The Future Of Healthcare At Your Fingertips
|
||||
@@ -276,4 +298,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user