Merge branch 'staging' of itcorp.primaya.id:rajif/aso into staging
This commit is contained in:
@@ -565,6 +565,7 @@ class MemberEnrollmentService
|
|||||||
"policy_in_force" => $row['policy_in_force'] ?? null,
|
"policy_in_force" => $row['policy_in_force'] ?? null,
|
||||||
"start_no_claim" => $row['start_no_claim'] ?? null,
|
"start_no_claim" => $row['start_no_claim'] ?? null,
|
||||||
"end_no_claim" => $row['end_no_claim'] ?? null,
|
"end_no_claim" => $row['end_no_claim'] ?? null,
|
||||||
|
"plan_id" => $row['plan_id'] ?? null,
|
||||||
|
|
||||||
"members_effective_date" => $row['member_effective_date'] ?? null,
|
"members_effective_date" => $row['member_effective_date'] ?? null,
|
||||||
"members_expire_date" => $row['member_expiry_date'] ?? null,
|
"members_expire_date" => $row['member_expiry_date'] ?? null,
|
||||||
@@ -575,14 +576,13 @@ class MemberEnrollmentService
|
|||||||
"telephone_res" => $row['telephone_res'] ?? null,
|
"telephone_res" => $row['telephone_res'] ?? null,
|
||||||
"telephone_office" => $row['telephone_office'] ?? null,
|
"telephone_office" => $row['telephone_office'] ?? null,
|
||||||
];
|
];
|
||||||
|
|
||||||
// $this->validateRow($row);
|
// $this->validateRow($row);
|
||||||
if (!isset($corporate->currentPolicy) || $corporate->currentPolicy->code != $row['policy_number']) {
|
if (!isset($corporate->currentPolicy) || $corporate->currentPolicy->code != $row['policy_number']) {
|
||||||
throw new ImportRowException(__('enrollment.POLICY_NUMBER_NOT_MATCH', [
|
throw new ImportRowException(__('enrollment.POLICY_NUMBER_NOT_MATCH', [
|
||||||
'policy_id' => $row['policy_number']
|
'policy_id' => $row['policy_number']
|
||||||
]), 0, null, $row);
|
]), 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']));
|
$member_effective_date = date("Y-m-d", strtotime($row['member_effective_date']));
|
||||||
$date_terminated = date("Y-m-d", strtotime($row['date_terminated']));
|
$date_terminated = date("Y-m-d", strtotime($row['date_terminated']));
|
||||||
@@ -648,6 +648,7 @@ class MemberEnrollmentService
|
|||||||
'start' => $corporate->currentPolicy->start
|
'start' => $corporate->currentPolicy->start
|
||||||
]), 0, null, $row);
|
]), 0, null, $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($members_expire_date >= $corporate->currentPolicy->end && ($members_expire_date != $corporate->currentPolicy->end)) {
|
if ($members_expire_date >= $corporate->currentPolicy->end && ($members_expire_date != $corporate->currentPolicy->end)) {
|
||||||
throw new ImportRowException(__('enrollment.LESS_THAN', [
|
throw new ImportRowException(__('enrollment.LESS_THAN', [
|
||||||
'date_param' => 'Member Expired Date',
|
'date_param' => 'Member Expired Date',
|
||||||
@@ -656,6 +657,7 @@ class MemberEnrollmentService
|
|||||||
'end' => $corporate->currentPolicy->end
|
'end' => $corporate->currentPolicy->end
|
||||||
]), 0, null, $row);
|
]), 0, null, $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ($members_expire_date <= $member_effective_date && ($members_expire_date != $member_effective_date)) {
|
if ($members_expire_date <= $member_effective_date && ($members_expire_date != $member_effective_date)) {
|
||||||
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
throw new ImportRowException(__('enrollment.MORE_THAN', [
|
||||||
@@ -665,14 +667,14 @@ class MemberEnrollmentService
|
|||||||
'start' => $member_effective_date
|
'start' => $member_effective_date
|
||||||
]), 0, null, $row);
|
]), 0, null, $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($corporate->code != $row['corporate_id']){
|
if($corporate->code != $row['corporate_id']){
|
||||||
throw new ImportRowException(__('enrollment.CORPORATE_CODE_NOT_MATCH', [
|
throw new ImportRowException(__('enrollment.CORPORATE_CODE_NOT_MATCH', [
|
||||||
'corporate_id' => $row['corporate_id']
|
'corporate_id' => $row['corporate_id']
|
||||||
]), 0, null, $row);
|
]), 0, null, $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($row['record_mode']) {
|
switch ($row['record_mode']) {
|
||||||
case "1": // New Member
|
case "1": // New Member
|
||||||
$this->validateRow($row);
|
$this->validateRow($row);
|
||||||
@@ -794,7 +796,7 @@ class MemberEnrollmentService
|
|||||||
$member = Member::query()
|
$member = Member::query()
|
||||||
->where('member_id', $row['member_id'])
|
->where('member_id', $row['member_id'])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
// Validate If Exist Member
|
// Validate If Exist Member
|
||||||
if (!$member) {
|
if (!$member) {
|
||||||
throw new ImportRowException(__('enrollment.MEMBER_NOT_FOUND', [
|
throw new ImportRowException(__('enrollment.MEMBER_NOT_FOUND', [
|
||||||
|
|||||||
Reference in New Issue
Block a user