Merge remote-tracking branch 'origin/staging' into origin/production
This commit is contained in:
@@ -73,20 +73,22 @@ class LivechatController extends Controller
|
||||
$query->where('dCreateOn', '<=', $endDate);
|
||||
}
|
||||
})
|
||||
->get(['nId', 'nIDUser', 'nIDDokter', 'nIDHealthCare', 'nIDAppointment', 'sStatus', 'sMediaDokter', 'sMedia']);
|
||||
->get(['nID', 'nIDUser', 'nIDDokter', 'nIDHealthCare', 'nIDAppointment', 'sStatus', 'sMediaDokter', 'sMedia']);
|
||||
|
||||
$headers = [
|
||||
['value' => 'No', 'cell' => 'A1', 'mergeCell' => true, 'mergeToCell' => 'A2'],
|
||||
['value' => 'Nama Dokter', 'cell' => 'B1', 'mergeCell' => true, 'mergeToCell' => 'B2'],
|
||||
['value' => 'Nama Pasien', 'cell' => 'C1', 'mergeCell' => true, 'mergeToCell' => 'C2'],
|
||||
['value' => 'No Telepon Pasien', 'cell' => 'D1', 'mergeCell' => true, 'mergeToCell' => 'D2'],
|
||||
['value' => 'Email Pasien', 'cell' => 'E1', 'mergeCell' => true, 'mergeToCell' => 'E2'],
|
||||
['value' => 'Faskes', 'cell' => 'F1', 'mergeCell' => true, 'mergeToCell' => 'F2'],
|
||||
['value' => 'Tanggal Appointment', 'cell' => 'G1', 'mergeCell' => true, 'mergeToCell' => 'G2'],
|
||||
['value' => 'Chat Via App/Website', 'cell' => 'H1', 'mergeCell' => true, 'mergeToCell' => 'I1'],
|
||||
['value' => 'Pasien', 'cell' => 'H2', 'mergeCell' => false, 'mergeToCell' => ''],
|
||||
['value' => 'Dokter', 'cell' => 'I2', 'mergeCell' => false, 'mergeToCell' => ''],
|
||||
['value' => 'Status Appointment', 'cell' => 'J1', 'mergeCell' => true, 'mergeToCell' => 'J2'],
|
||||
['value' => 'Kode TC', 'cell' => 'B1', 'mergeCell' => true, 'mergeToCell' => 'B2'],
|
||||
['value' => 'Nama Dokter', 'cell' => 'C1', 'mergeCell' => true, 'mergeToCell' => 'C2'],
|
||||
['value' => 'Nama Pasien', 'cell' => 'D1', 'mergeCell' => true, 'mergeToCell' => 'D2'],
|
||||
['value' => 'No Telepon Pasien', 'cell' => 'E1', 'mergeCell' => true, 'mergeToCell' => 'E2'],
|
||||
['value' => 'Email Pasien', 'cell' => 'F1', 'mergeCell' => true, 'mergeToCell' => 'F2'],
|
||||
['value' => 'Faskes', 'cell' => 'G1', 'mergeCell' => true, 'mergeToCell' => 'G2'],
|
||||
['value' => 'Tanggal Request', 'cell' => 'H1', 'mergeCell' => true, 'mergeToCell' => 'H2'],
|
||||
['value' => 'Waktu Request', 'cell' => 'I1', 'mergeCell' => true, 'mergeToCell' => 'I2'],
|
||||
['value' => 'Chat Via App/Website', 'cell' => 'J1', 'mergeCell' => true, 'mergeToCell' => 'K1'],
|
||||
['value' => 'Pasien', 'cell' => 'J2', 'mergeCell' => false, 'mergeToCell' => ''],
|
||||
['value' => 'Dokter', 'cell' => 'K2', 'mergeCell' => false, 'mergeToCell' => ''],
|
||||
['value' => 'Status', 'cell' => 'L1', 'mergeCell' => true, 'mergeToCell' => 'L2'],
|
||||
];
|
||||
|
||||
$spreadsheet = new Spreadsheet();
|
||||
@@ -105,23 +107,47 @@ class LivechatController extends Controller
|
||||
|
||||
$startFrom = 3;
|
||||
foreach ($liveChats as $indexLiveChat => $liveChat) {
|
||||
$phone = $liveChat->user->sPhone ?? '-';
|
||||
$status = $liveChat->sStatus;
|
||||
switch ($status) {
|
||||
case 0:
|
||||
$statusLivechat = "Request TC";
|
||||
break;
|
||||
case 1:
|
||||
$statusLivechat = "Accepted by Doctor but User not Payment";
|
||||
break;
|
||||
case 2:
|
||||
$statusLivechat = "Payment Success";
|
||||
break;
|
||||
case 3:
|
||||
$statusLivechat = "Decline by Doctor";
|
||||
break;
|
||||
case 4:
|
||||
$statusLivechat = "Payment Expired";
|
||||
break;
|
||||
default:
|
||||
$statusLivechat = "Cancel by Patient";
|
||||
}
|
||||
|
||||
$sheet->setCellValue('A' . $startFrom, $indexLiveChat + 1);
|
||||
$sheet->setCellValue('B' . $startFrom, $liveChat->doctor->user->full_name ?? '-');
|
||||
$sheet->setCellValue('C' . $startFrom, $liveChat->user->full_name ?? '-');
|
||||
$sheet->setCellValue('D' . $startFrom, preg_replace('/(\d{3})(\d{4})(\d{3})/', '$1 $2 $3', $liveChat->user->sPhone) ?? '-');
|
||||
$sheet->setCellValue('E' . $startFrom, $liveChat->user->sEmail ?? '-');
|
||||
$sheet->setCellValue('F' . $startFrom, $liveChat->healthCare->sHealthCare ?? '-');
|
||||
$sheet->setCellValue('G' . $startFrom, isset($liveChat->appointment->appointmentDetail) ? Carbon::parse($liveChat->appointment->appointmentDetail->dTanggalAppointment)->format('d-m-Y') . ' ' . $liveChat->appointment->appointmentDetail->tTimeAppointment : '-');
|
||||
$sheet->setCellValue('H' . $startFrom, $liveChat->sMedia ?? '-');
|
||||
$sheet->setCellValue('I' . $startFrom, $liveChat->sMediaDokter ?? '-');
|
||||
$sheet->setCellValue('J' . $startFrom, $liveChat->appointment->paymentStatus ?? '-');
|
||||
$sheet->setCellValue('B' . $startFrom, $liveChat->nID ?? '-');
|
||||
$sheet->setCellValue('C' . $startFrom, $liveChat->doctor->user->full_name ?? '-');
|
||||
$sheet->setCellValue('D' . $startFrom, $liveChat->user->full_name ?? '-');
|
||||
$sheet->setCellValue('E' . $startFrom, preg_replace('/(\d{3})(\d{4})(\d{3})/', '$1 $2 $3', $phone));
|
||||
$sheet->setCellValue('F' . $startFrom, $liveChat->user->sEmail ?? '-');
|
||||
$sheet->setCellValue('G' . $startFrom, $liveChat->healthCare->sHealthCare ?? '-');
|
||||
$sheet->setCellValue('H' . $startFrom, Carbon::parse($liveChat->dRequestTime)->format('d-m-Y'));
|
||||
$sheet->setCellValue('I' . $startFrom, Carbon::parse($liveChat->dRequestTime)->format('H:i:s'));
|
||||
$sheet->setCellValue('J' . $startFrom, $liveChat->sMedia ?? '-');
|
||||
$sheet->setCellValue('K' . $startFrom, $liveChat->sMediaDokter ?? '-');
|
||||
$sheet->setCellValue('L' . $startFrom, $statusLivechat);
|
||||
$startFrom++;
|
||||
}
|
||||
|
||||
foreach (['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'] as $header) {
|
||||
foreach (['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J','K', 'L'] as $header) {
|
||||
if ($header === 'A') {
|
||||
$spreadsheet->getActiveSheet()->getColumnDimension($header)->setWidth(35, 'px');
|
||||
} elseif ($header === 'H' || $header === 'I') {
|
||||
} elseif ($header === 'J' || $header === 'K') {
|
||||
$spreadsheet->getActiveSheet()->getColumnDimension($header)->setWidth(100, 'px');
|
||||
} else {
|
||||
$spreadsheet->getActiveSheet()->getColumnDimension($header)->setAutoSize(true);
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Modules\Internal\Transformers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
use App\Helpers\Helper;
|
||||
|
||||
class LivechatResource extends JsonResource
|
||||
{
|
||||
@@ -26,7 +27,8 @@ class LivechatResource extends JsonResource
|
||||
'date_appointment' => Carbon::parse($this->appointment->appointmentDetail->dTanggalAppointment)->format('d-m-Y')
|
||||
. ' ' . $this->appointment->appointmentDetail->tTimeAppointment ?? null,
|
||||
'status_appointment' => $this->appointment->paymentStatus ?? null,
|
||||
'date_created' => Carbon::parse($this->appointment->dCreateOn)->format('d-m-Y H:i:s') ?? null,
|
||||
'date_created' => Carbon::parse($this->dRequestTime)->format('d-m-Y') ?? null,
|
||||
'time_request' => Carbon::parse($this->dRequestTime)->format('H:i:s') ?? null,
|
||||
'patient_media' => $this->sMedia ?? null,
|
||||
'doctor_media' => $this->sMediaDokter ?? null,
|
||||
'appointment_media' => $this->appointment->sMedia ?? null,
|
||||
@@ -53,7 +55,7 @@ class LivechatResource extends JsonResource
|
||||
$payment_detail = [
|
||||
'payment_type' => $this->appointment->appointmentDetail->sPaymentDetails['payment_type'],
|
||||
'transaction_time' => $this->appointment->appointmentDetail->sPaymentDetails['transaction_time'],
|
||||
'gross_amount' => $this->appointment->appointmentDetail->sPaymentDetails['gross_amount'],
|
||||
'gross_amount' => Helper::formatRupiah($this->appointment->appointmentDetail->sPaymentDetails['gross_amount']),
|
||||
'currency' => $this->appointment->appointmentDetail->sPaymentDetails['currency'],
|
||||
'status_message' => $this->appointment->appointmentDetail->sPaymentDetails['status_message'],
|
||||
];
|
||||
|
||||
@@ -198,6 +198,11 @@ class Helper
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function formatRupiah($angka)
|
||||
{
|
||||
return "Rp " . number_format($angka, 0, ',', '.');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,12 +11,21 @@ class Livechat extends Model
|
||||
use HasFactory;
|
||||
|
||||
|
||||
// public $sStatusNames = [
|
||||
// 0 => 'Menunggu Konfirmasi',
|
||||
// 1 => 'Diterima',
|
||||
// 3 => 'Ditolak',
|
||||
// 2 => 'Selesai',
|
||||
// 4 => 'Expired',
|
||||
// ];
|
||||
|
||||
public $sStatusNames = [
|
||||
0 => 'Menunggu Konfirmasi',
|
||||
1 => 'Diterima',
|
||||
3 => 'Ditolak',
|
||||
2 => 'Selesai',
|
||||
4 => 'Expired',
|
||||
0 => 'Request TC',
|
||||
1 => 'Accepted by Doctor but User not Payment',
|
||||
3 => 'Decline by Doctor',
|
||||
2 => 'Payment Success',
|
||||
4 => 'Payment Expired',
|
||||
5 => 'Cancel by Patient'
|
||||
];
|
||||
|
||||
const CREATED_AT = 'dCreateOn';
|
||||
|
||||
@@ -10,7 +10,7 @@ export default function Doctor() {
|
||||
|
||||
const { id } = useParams();
|
||||
|
||||
const pageTitle = 'Payment';
|
||||
const pageTitle = 'Livechat';
|
||||
return (
|
||||
<Page title={pageTitle}>
|
||||
<Container maxWidth={themeStretch ? false : 'xl'}>
|
||||
@@ -22,8 +22,8 @@ export default function Doctor() {
|
||||
href: '/report',
|
||||
},
|
||||
{
|
||||
name: 'Payment',
|
||||
href: '/report/payment',
|
||||
name: 'Livechat',
|
||||
href: '/report/live-chat',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -256,7 +256,7 @@ export default function List() {
|
||||
</IconButton>
|
||||
</TableCell>
|
||||
<TableCell align="left">{row.date_created ? row.date_created : '-'}</TableCell>
|
||||
<TableCell align="left">{row.date_appointment ? row.date_appointment : '-'}</TableCell>
|
||||
<TableCell align="left">{row.time_request ? row.time_request : '-'}</TableCell>
|
||||
<TableCell align="left">{row.health_care ? row.health_care : '-'}</TableCell>
|
||||
<TableCell align="left">{row.doctor_name ? row.doctor_name : '-'}</TableCell>
|
||||
<TableCell align="left">{row.speciality ? row.speciality : '-'}</TableCell>
|
||||
@@ -309,6 +309,12 @@ export default function List() {
|
||||
<Grid item xs={6}>
|
||||
: {row.duration ? row.duration : '-'}
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
Kode
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
: {row.id ? row.id : '-'}
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -471,10 +477,10 @@ export default function List() {
|
||||
{/* <TableCell colSpan={8} rowSpan={1} align="center" /> */}
|
||||
<TableCell style={headStyle} align="left" />
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Tanggal Booking
|
||||
Tanggal Request
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Tanggal Appointment
|
||||
Waktu Request
|
||||
</TableCell>
|
||||
<TableCell style={headStyle} rowSpan={2} align="left">
|
||||
Faskes
|
||||
|
||||
Reference in New Issue
Block a user