Merge remote-tracking branch 'origin/staging' into origin/production

This commit is contained in:
Linksehat Staging Server
2024-02-01 09:52:37 +07:00
7 changed files with 86 additions and 9 deletions

View File

@@ -53,6 +53,7 @@ class OrganizationController extends Controller
'type' => 'hospital',
'status' => $request->active == 1 ? 'active' : 'inactive',
'description' => $request->description,
'corporate_id_partner' => $request->corporate_id_partner
];
$create_organization = Organization::create($organization);

View File

@@ -167,7 +167,8 @@ class ReportLogController extends Controller
'Duration GL',
'Duration FGL',
'Status GL',
'Status Final GL'
'Status Final GL',
'Import By Excel'
];
// Sheet 1
$writer->getCurrentSheet()->setName('Data');
@@ -209,6 +210,15 @@ class ReportLogController extends Controller
$durationGl = 0;
}
$approveByFgl = '-';
if ($row['import_system']) {
$approveByFgl = 'Import By Excel';
} else if ($row['final_log'] == 1 && $row['status_final_log'] == 'requested'){
$approveByFgl = '-';
} else {
$approveByFgl = Helper::userName($row['approved_final_log_by']);
}
$rowData = [
$row['code'], // code
@@ -218,7 +228,7 @@ class ReportLogController extends Controller
$row['approved_by'] ? Helper::userName($row['approved_by']) : '-', // created by
$created_final_at ? $created_final_at : "-", // fgl create time
$row['approved_final_log_at'] ? $row['approved_final_log_at'] : "", // fgl submit time
$row['final_log'] == 1 ? Helper::userName($row['approved_final_log_by']) : '-', // fgl create by
$approveByFgl, // fgl create by
$serviceName, // service
$provider ? $provider->name : '-', // provider
count($documentQty), // dokument qty
@@ -226,6 +236,7 @@ class ReportLogController extends Controller
$row['final_log'] == 1 ? $durationFinalGl : '-', // duration fgl
$row['status'] ?? '-', // status gl
$row['status_final_log'] ?? '-', // status fgl
$row['import_system'] == 1 ? 'True' : 'False', // status fgl
];
$row = WriterEntityFactory::createRowFromArray($rowData);
$writer->addRow($row);

View File

@@ -31,6 +31,7 @@ class OrganizationResource extends JsonResource
'district_id' => $this->currentAddress->district_id ?? null,
'village_id' => $this->currentAddress->village_id ?? null,
'postal_code' => $this->currentAddress->postal_code ?? null,
'corporate_id_partner' => $this->corporate_id_partner ?? null,
'active' => $this->status == 'active' ? 1 : 0,
];

View File

@@ -40,13 +40,16 @@ class ReportLogResource extends JsonResource
$created_final_at = null;
}
if ($this->approved_at){
$durationGl = Helper::differenceTime($formattedDateTime, $this->approved_at);
$durationGl = Helper::differenceTime($formattedDateTime, $this->submission_date);
$approveByFgl = '-';
if ($this->import_system) {
$approveByFgl = 'Import By Excel';
} else if ($this->final_log == 1 && $this->status_final_log == 'requested'){
$approveByFgl = '-';
} else {
$durationGl = 0;
$approveByFgl = Helper::userName($this->approved_final_log_by);
}
$data = [
'id' => $this->id,
'code' => $this->code,
@@ -55,7 +58,7 @@ class ReportLogResource extends JsonResource
'submission_date' => $this->approved_at ? $this->approved_at : null,
'approved_by' => Helper::userName($this->approved_by),
'approved_final_log_at' => $this->approved_final_log_at,
'approved_final_log_by' => $this->final_log == 1 ? Helper::userName($this->approved_final_log_by) : '-',
'approved_final_log_by' => $approveByFgl,
'service_name' => $this->service ? $this->service->name : '',
'provider' => $provider ? $provider->name : '-',
'document_qty' => count($documentQty),