finishing benefit configuration
This commit is contained in:
@@ -999,4 +999,81 @@ class ClaimController extends Controller
|
||||
|
||||
return Helper::responseJson(message: 'Data Berhasil di update');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Benefit Configuration
|
||||
*
|
||||
* Bagaskoro, BSD 03 November 2023
|
||||
*/
|
||||
public function getBenefitConfiguration(Request $request, $claim_id) {
|
||||
|
||||
$benefit_list = DB::table('claims')
|
||||
->leftJoin('claim_services', 'claims.claim_request_id', '=', 'claim_services.claim_request_id')
|
||||
->leftJoin('claim_service_benefits', 'claim_services.id', '=', 'claim_service_benefits.claim_service_id')
|
||||
->leftJoin('benefits', 'claim_service_benefits.benefit_id', '=', 'benefits.id')
|
||||
->select("claim_service_benefits.id AS claim_service_benefits_id", "benefits.description AS benefit_name", "claim_service_benefits.amount_incurred", "claim_service_benefits.amount_approved", "claim_service_benefits.amount_not_approved", "claim_service_benefits.excess_paid")
|
||||
->where("claims.id", "=", $claim_id)
|
||||
->get();
|
||||
|
||||
return response()->json([
|
||||
'error' => false,
|
||||
'message' => "success",
|
||||
'data' => [
|
||||
'benefit_list' => $benefit_list,
|
||||
]
|
||||
],200);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Benefit Configuration
|
||||
*
|
||||
* Bagaskoro, BSD 03 November 2023
|
||||
*/
|
||||
public function editBenefitConfiguration(Request $request, $claim_service_benefits_id) {
|
||||
$request->merge(['claim_service_benefits_id' => $claim_service_benefits_id]);
|
||||
|
||||
// validation rule
|
||||
$validator = Validator::make($request->all(),[
|
||||
'claim_service_benefits_id' => 'required|exists:claim_service_benefits,id',
|
||||
'amount_incurred' => 'required|numeric',
|
||||
'amount_approved' => 'required|numeric',
|
||||
'amount_not_approved' => 'required|numeric',
|
||||
'excess_paid' => 'required|numeric',
|
||||
],$this->messages());
|
||||
|
||||
// validation error
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => true,
|
||||
'message' => $validator->getMessageBag()
|
||||
],400);
|
||||
}
|
||||
|
||||
try {
|
||||
DB::table('claim_service_benefits')->where('id', $claim_service_benefits_id)->update([
|
||||
'amount_incurred' => $request->amount_incurred,
|
||||
'amount_approved' => $request->amount_approved,
|
||||
'amount_not_approved' => $request->amount_not_approved,
|
||||
'excess_paid' => $request->excess_paid,
|
||||
]);
|
||||
}
|
||||
catch (\Throwable $th) {
|
||||
return Helper::responseJson(status: 'failed', statusCode: 500, message: $th->getMessage());
|
||||
}
|
||||
|
||||
return Helper::responseJson(status: 'success', statusCode: 200, message: "data berhasil disimpan !");
|
||||
}
|
||||
|
||||
protected function messages()
|
||||
{
|
||||
return [
|
||||
'required' => ':attribute harus diisi',
|
||||
'integer' => ':attribute harus angka',
|
||||
'unique' => ':attribute (:input) sudah ada',
|
||||
'max' => ':attribute maximal :max karakter',
|
||||
'exists' => ':attribute (:input) tidak ditemukan',
|
||||
'numeric' => ':attribute harus angka',
|
||||
'digits_between'=> ':attribute maximal :max digit minimal :min digit'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +231,8 @@ Route::prefix('internal')->group(function () {
|
||||
Route::post('claims/request-documents', [ClaimController::class, 'requestDocuments']);
|
||||
Route::get('claims/get-services/{id}', [ClaimController::class, 'getServices']);
|
||||
Route::post('claims/save-services', [ClaimController::class, 'saveServices']);
|
||||
Route::get('claims/{id}/benefit-configuration', [ClaimController::class, 'getBenefitConfiguration']); // Bagaskoro, BSD 03 November 2023
|
||||
Route::put('claims/benefit-configuration/edit/{id}', [ClaimController::class, 'editBenefitConfiguration']); // Bagaskoro, BSD 03 November 2023
|
||||
|
||||
Route::get('search-organizations', [OrganizationController::class, 'searchOrganization']);
|
||||
Route::get('search-specialities', [SpecialityController::class, 'searchSpeciality']);
|
||||
|
||||
@@ -23,7 +23,7 @@ class ClaimHistoryCareResource extends JsonResource
|
||||
$data = [
|
||||
'id' => $claim['id'],
|
||||
'service_code' => $claim['service_code'],
|
||||
'admision_date' => $claim['admision_date'],
|
||||
'admission_date' => $claim['admission_date'],
|
||||
'discharge_date' => $claim['discharge_date'],
|
||||
'claim_id' => $claim['claim_id'],
|
||||
'organization_id' => $claim['organization_id'],
|
||||
|
||||
@@ -10,7 +10,7 @@ class ClaimHistoryCare extends Model
|
||||
use HasFactory;
|
||||
protected $fillable = [
|
||||
'service_code',
|
||||
'admision_date',
|
||||
'admission_date',
|
||||
'discharge_date',
|
||||
'claim_id',
|
||||
'organization_id',
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('claim_service_benefits', function (Blueprint $table) {
|
||||
$table->integer('amount_incurred')->default(0)->after('benefit_id');
|
||||
$table->integer('amount_approved')->default(0)->after('amount_incurred');
|
||||
$table->integer('amount_not_approved')->default(0)->after('amount_approved');
|
||||
$table->integer('excess_paid')->default(0)->after('amount_not_approved');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('claim_service_benefits', function (Blueprint $table) {
|
||||
$table->dropColumn('amount_incurred');
|
||||
$table->dropColumn('amount_approved');
|
||||
$table->dropColumn('amount_not_approved');
|
||||
$table->dropColumn('excess_paid');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -26,8 +26,6 @@ export default function RHFTextFieldMoney({ name, ...other }: IProps & TextField
|
||||
autoComplete="off"
|
||||
fullWidth error={!!error}
|
||||
helperText={error?.message}
|
||||
onFocus={() => { (values[name] === '0') && setValue(name, '') }}
|
||||
onBlur={() => { (values[name] === '') && setValue(name, '0') }}
|
||||
{...other}
|
||||
inputProps={{ min: 0, max: 5, style: { textAlign: 'right' } }}
|
||||
InputProps={{
|
||||
|
||||
@@ -219,7 +219,7 @@ export default function Detail() {
|
||||
.then((response) => {
|
||||
reset({
|
||||
service_code: response.data.data.service_code,
|
||||
admision_date: response.data.data.admision_date,
|
||||
admission_date: response.data.data.admission_date,
|
||||
discharge_date: response.data.data.discharge_date,
|
||||
organization_id: response.data.data.organization_id,
|
||||
practitioner_id: response.data.data.practitioner_id,
|
||||
@@ -329,7 +329,7 @@ export default function Detail() {
|
||||
value: 0
|
||||
}
|
||||
}],
|
||||
admision_date: isEdit ? carehistory?.admision_date : '',
|
||||
admission_date: isEdit ? carehistory?.admission_date : '',
|
||||
discharge_date: isEdit ? carehistory?.discharge_date : '',
|
||||
organization_id: isEdit ? carehistory?.organization_id : '',
|
||||
practitioner_id: isEdit ? carehistory?.practitioner_id : '',
|
||||
@@ -343,7 +343,7 @@ export default function Detail() {
|
||||
|
||||
let NewClaimHistoryCareSchema = Yup.object().shape({
|
||||
service_code: Yup.string().required('Name is required'),
|
||||
// admision_date: Yup.date().required('Admisision Date is required'),
|
||||
// admission_date: Yup.date().required('Admisision Date is required'),
|
||||
// discharge_date: Yup.date().required('Discharge Date is required'),
|
||||
// organization_id: Yup.number().required('Location is required'),
|
||||
// practitioner_id: Yup.number().required('Doctor is required'),
|
||||
@@ -381,7 +381,7 @@ export default function Detail() {
|
||||
if (isEdit){
|
||||
let newData = {
|
||||
service_code: data.service_code,
|
||||
admision_date: data.admision_date ? fDateOnly(data.admision_date) : null,
|
||||
admission_date: data.admission_date ? fDateOnly(data.admission_date) : null,
|
||||
discharge_date: data.discharge_date ? fDateOnly(data.discharge_date) : null,
|
||||
organization_id: data.organization_id,
|
||||
practitioner_id: data.practitioner_id,
|
||||
@@ -406,7 +406,7 @@ export default function Detail() {
|
||||
} else {
|
||||
let newData = {
|
||||
service_code: data.service_code,
|
||||
admision_date: data.admision_date ? fDateOnly(data.admision_date) : null,
|
||||
admission_date: data.admission_date ? fDateOnly(data.admission_date) : null,
|
||||
discharge_date: data.discharge_date ? fDateOnly(data.discharge_date) : null,
|
||||
organization_id: data.organization_id,
|
||||
practitioner_id: data.practitioner_id,
|
||||
@@ -814,7 +814,7 @@ export default function Detail() {
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Admission Date :</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{ fDate(claimHistoryCare.admision_date)}</Typography> {/* Perbaikan typo di 'admission_date' */}
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{ fDate(claimHistoryCare.admission_date)}</Typography> {/* Perbaikan typo di 'admission_date' */}
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date :</Typography>
|
||||
@@ -873,7 +873,7 @@ export default function Detail() {
|
||||
</Grid>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Typography variant="subtitle1" sx={{marginBottom: '10px'}}>Admission Date*</Typography>
|
||||
<RHFDatepicker name="admision_date" label="Admission Date" required/>
|
||||
<RHFDatepicker name="admission_date" label="Admission Date" required/>
|
||||
</Grid>
|
||||
<Grid item xs={6} md={6}>
|
||||
<Typography variant="subtitle1" sx={{marginBottom: '10px'}}>Discharge Date*</Typography>
|
||||
@@ -1038,7 +1038,7 @@ export default function Detail() {
|
||||
<Card sx={{padding: 2}}>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Admission Date</Typography>
|
||||
<Typography variant='subtitle1' gutterBottom>{ carehistory ? fDate(carehistory?.admision_date) : '-'}</Typography>
|
||||
<Typography variant='subtitle1' gutterBottom>{ carehistory ? fDate(carehistory?.admission_date) : '-'}</Typography>
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date</Typography>
|
||||
@@ -1094,7 +1094,7 @@ export default function Detail() {
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Admission Date :</Typography>
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{ fDate(claimHistoryCare.admision_date)}</Typography> {/* Perbaikan typo di 'admission_date' */}
|
||||
<Typography variant='subtitle2' sx={style2} gutterBottom>{ fDate(claimHistoryCare.admission_date)}</Typography> {/* Perbaikan typo di 'admission_date' */}
|
||||
</Stack>
|
||||
<Stack direction='row' spacing={2} sx={marginBottom1}>
|
||||
<Typography variant='subtitle2' sx={style1} gutterBottom>Discharge Date :</Typography>
|
||||
|
||||
@@ -1,23 +1,58 @@
|
||||
import axios from "@/utils/axios";
|
||||
import { enqueueSnackbar } from "notistack";
|
||||
import { BenefitConfigurationListType } from "./Types";
|
||||
|
||||
/**
|
||||
* Get Benefit Configuration List
|
||||
*/
|
||||
export const getBenefitConfigurationList = async ( ): Promise<BenefitConfigurationListType[]> => {
|
||||
return [
|
||||
{
|
||||
benefit_name: 'Konsultasi Dokter Umum',
|
||||
amount_incurred: 75000,
|
||||
amount_approved: 75000,
|
||||
amount_not_approved: 0,
|
||||
excess_paid: 0
|
||||
},
|
||||
{
|
||||
benefit_name: 'Biaya Perawatan Setelah Rawat Inap',
|
||||
amount_incurred: 925000,
|
||||
amount_approved: 50000,
|
||||
amount_not_approved: 425000,
|
||||
excess_paid: 0
|
||||
},
|
||||
];
|
||||
export const getBenefitConfigurationList = async ( claim_id: string ): Promise<BenefitConfigurationListType[]> => {
|
||||
const response = await axios.get(`/claims/${claim_id}/benefit-configuration`)
|
||||
.then((res) =>{
|
||||
return res.data.data.benefit_list;
|
||||
})
|
||||
.catch((res) => {
|
||||
enqueueSnackbar("server error !", {
|
||||
variant: 'error',
|
||||
});
|
||||
|
||||
return [];
|
||||
});
|
||||
|
||||
return response;
|
||||
};
|
||||
|
||||
/**
|
||||
* Edit Benefit Configuration
|
||||
*/
|
||||
export const editBenefitConfiguration = async ( data: BenefitConfigurationListType ): Promise<boolean> => {
|
||||
const response = await axios.put(`/claims/benefit-configuration/edit/${data.claim_service_benefits_id}`, {
|
||||
...data
|
||||
})
|
||||
.then((res) =>{
|
||||
enqueueSnackbar(res.data.message, {
|
||||
variant: 'success',
|
||||
});
|
||||
|
||||
return true;
|
||||
})
|
||||
.catch((res) => {
|
||||
if (res.response.status == 400) {
|
||||
let arr_message = res.response.data.message;
|
||||
|
||||
for (const key in arr_message) {
|
||||
enqueueSnackbar(arr_message[key][0], {
|
||||
variant: 'warning',
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
enqueueSnackbar("server error !", {
|
||||
variant: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return response;
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Benefit Configuration List Type
|
||||
*/
|
||||
export type BenefitConfigurationListType = {
|
||||
claim_service_benefits_id: number,
|
||||
benefit_name: string,
|
||||
amount_incurred: number,
|
||||
amount_approved: number,
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import * as Yup from 'yup';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { Box, Grid } from '@mui/material';
|
||||
import { LoadingButton } from '@mui/lab';
|
||||
import Button from '@mui/material/Button';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import Dialog from '@mui/material/Dialog';
|
||||
@@ -10,7 +13,8 @@ import IconButton from '@mui/material/IconButton';
|
||||
import CloseIcon from '@mui/icons-material/Close';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { FormProvider, RHFTextField } from '@/components/hook-form';
|
||||
import { FormProvider } from '@/components/hook-form';
|
||||
import RHFTextFieldMoney from '@/components/hook-form/v2/RHFTextFieldMoney';
|
||||
|
||||
/**
|
||||
* Custom Style
|
||||
@@ -24,8 +28,9 @@ const BootstrapDialog = styled(Dialog)(({ theme }) => ({
|
||||
* Utils, Types, Functions
|
||||
* ============================================
|
||||
*/
|
||||
import { BenefitConfigurationListType } from '../Model/Types';
|
||||
import palette from '@/theme/palette';
|
||||
import { BenefitConfigurationListType } from '../Model/Types';
|
||||
import { editBenefitConfiguration } from '../Model/Functions';
|
||||
|
||||
/**
|
||||
* Props
|
||||
@@ -35,6 +40,7 @@ type Props = {
|
||||
data?: BenefitConfigurationListType,
|
||||
isOpen: boolean,
|
||||
handleCancleProp: () => void,
|
||||
handleSuccessProp: () => void,
|
||||
};
|
||||
|
||||
export default function BenefitConfigurationDialog({ ...props }: Props) {
|
||||
@@ -42,6 +48,7 @@ export default function BenefitConfigurationDialog({ ...props }: Props) {
|
||||
// setup form
|
||||
// ====================================
|
||||
const defaultValues: BenefitConfigurationListType = {
|
||||
claim_service_benefits_id: 0,
|
||||
benefit_name: '',
|
||||
amount_incurred: 0,
|
||||
amount_approved: 0,
|
||||
@@ -49,21 +56,38 @@ export default function BenefitConfigurationDialog({ ...props }: Props) {
|
||||
excess_paid: 0,
|
||||
};
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
amount_incurred : Yup.string().typeError('').required(''),
|
||||
amount_approved : Yup.string().typeError('').required(''),
|
||||
amount_not_approved : Yup.string().typeError('').required(''),
|
||||
excess_paid : Yup.string().typeError('').required(''),
|
||||
});
|
||||
|
||||
const methods = useForm<any>({
|
||||
resolver: yupResolver(validationSchema),
|
||||
defaultValues
|
||||
});
|
||||
|
||||
const { handleSubmit, reset, setValue, formState: { isDirty, isSubmitting } } = methods;
|
||||
const { handleSubmit, reset, watch, setValue, formState: { isDirty, isSubmitting, errors } } = methods;
|
||||
|
||||
console.log(errors);
|
||||
console.log(watch());
|
||||
|
||||
// Submit Form
|
||||
// =====================================
|
||||
const submitHandler = async (data: BenefitConfigurationListType) => {
|
||||
return true;
|
||||
let response = await editBenefitConfiguration(data);
|
||||
|
||||
if (response == true) {
|
||||
props.handleSuccessProp()
|
||||
props.handleCancleProp()
|
||||
}
|
||||
}
|
||||
|
||||
// Set Value Form
|
||||
// =====================================
|
||||
useEffect(() => {
|
||||
setValue('claim_service_benefits_id', props.data?.claim_service_benefits_id)
|
||||
setValue('amount_incurred', props.data?.amount_incurred)
|
||||
setValue('amount_approved', props.data?.amount_approved)
|
||||
setValue('amount_not_approved', props.data?.amount_not_approved)
|
||||
@@ -71,124 +95,124 @@ export default function BenefitConfigurationDialog({ ...props }: Props) {
|
||||
}, [props.data])
|
||||
|
||||
return (
|
||||
<FormProvider methods={methods} onSubmit={handleSubmit(submitHandler)}>
|
||||
<BootstrapDialog
|
||||
onClose={props.handleCancleProp}
|
||||
aria-labelledby="customized-dialog-title"
|
||||
open={props.isOpen}
|
||||
maxWidth={'md'}
|
||||
>
|
||||
<DialogTitle sx={{ m: 0, p: 2, background: palette.light.primary.main, color: palette.light.grey[0], display: 'flex', alignItems: 'center', justifyContent: 'space-between' }} id="customized-dialog-title">
|
||||
<Typography variant="body2" sx={{ fontWeight: 'bold' }}>
|
||||
Client Benefit Configuration
|
||||
</Typography>
|
||||
<Dialog
|
||||
onClose={props.handleCancleProp}
|
||||
aria-labelledby="customized-dialog-title"
|
||||
open={props.isOpen}
|
||||
maxWidth={'md'}
|
||||
>
|
||||
<FormProvider methods={methods} onSubmit={handleSubmit(submitHandler)}>
|
||||
<DialogTitle sx={{ m: 0, p: 2, background: palette.light.primary.main, color: palette.light.grey[0], display: 'flex', alignItems: 'center', justifyContent: 'space-between' }} id="customized-dialog-title">
|
||||
<Typography variant="body2" sx={{ fontWeight: 'bold' }}>
|
||||
Client Benefit Configuration
|
||||
</Typography>
|
||||
|
||||
<IconButton
|
||||
aria-label="close"
|
||||
onClick={props.handleCancleProp}
|
||||
sx={{color: (theme) => theme.palette.grey[0]}}
|
||||
>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
<IconButton
|
||||
aria-label="close"
|
||||
onClick={props.handleCancleProp}
|
||||
sx={{color: (theme) => theme.palette.grey[0]}}
|
||||
>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
</DialogTitle>
|
||||
|
||||
<DialogContent sx={{ p: '0px' }}>
|
||||
<Box sx={{ py: '24px', px: '32px'}}>
|
||||
<Box sx={{ p: '24px', border: '1px solid rgba(0,0,0,0.125)', borderRadius: '12px'}}>
|
||||
<Grid container spacing={3}>
|
||||
{/* Benefit Name */}
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" sx={{ fontWeight: 'bold'}}>
|
||||
{props.data?.benefit_name}
|
||||
</Typography>
|
||||
</Grid>
|
||||
<DialogContent sx={{ p: '0px' }}>
|
||||
<Box sx={{ py: '24px', px: '32px'}}>
|
||||
<Box sx={{ p: '24px', border: '1px solid rgba(0,0,0,0.125)', borderRadius: '12px'}}>
|
||||
<Grid container spacing={3}>
|
||||
{/* Benefit Name */}
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" sx={{ fontWeight: 'bold'}}>
|
||||
{props.data?.benefit_name}
|
||||
</Typography>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Amount Incurred*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextField
|
||||
id="amount_incurred"
|
||||
name='amount_incurred'
|
||||
placeholder='Amount Incurred'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Grid container spacing={3}>
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Amount Incurred*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextFieldMoney
|
||||
id="amount_incurred"
|
||||
name='amount_incurred'
|
||||
placeholder='Amount Incurred'
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Amount Approved*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextField
|
||||
id="amount_approved"
|
||||
name='amount_approved'
|
||||
placeholder='Amount Approved'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Amount Approved*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextFieldMoney
|
||||
id="amount_approved"
|
||||
name='amount_approved'
|
||||
placeholder='Amount Approved'
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Amount Not Approved*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextField
|
||||
id="amount_not_approved"
|
||||
name='amount_not_approved'
|
||||
placeholder='Amount Not Approved'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Amount Not Approved*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextFieldMoney
|
||||
id="amount_not_approved"
|
||||
name='amount_not_approved'
|
||||
placeholder='Amount Not Approved'
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Excess Paid*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextField
|
||||
id="excess_paid"
|
||||
name='excess_paid'
|
||||
placeholder='Excess Paid'
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item xs={3}>
|
||||
<Grid container spacing={2}>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="body2" component="div">
|
||||
Excess Paid*
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item xs={12} sx={{display: 'flex', gap: 1}}>
|
||||
<RHFTextFieldMoney
|
||||
id="excess_paid"
|
||||
name='excess_paid'
|
||||
placeholder='Excess Paid'
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
</Grid>
|
||||
</Box>
|
||||
</DialogContent>
|
||||
</Box>
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button variant='outlined' onClick={props.handleCancleProp} aria-label="close">
|
||||
Cancle
|
||||
</Button>
|
||||
<Button variant='contained' onClick={props.handleCancleProp}>
|
||||
Save
|
||||
</Button>
|
||||
</DialogActions>
|
||||
</BootstrapDialog>
|
||||
</FormProvider>
|
||||
<DialogActions>
|
||||
<Button variant='outlined' onClick={props.handleCancleProp} aria-label="close">
|
||||
Cancle
|
||||
</Button>
|
||||
<LoadingButton disabled={!isDirty} type="submit" variant="contained" loading={isSubmitting}>
|
||||
Save Changes
|
||||
</LoadingButton>
|
||||
</DialogActions>
|
||||
</FormProvider>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* ============================================
|
||||
*/
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useParams } from 'react-router';
|
||||
import { Box, Typography, Grid, MenuItem } from '@mui/material';
|
||||
|
||||
/**
|
||||
@@ -26,8 +27,11 @@ import { BenefitConfigurationListType } from '../Model/Types';
|
||||
import { getBenefitConfigurationList } from '../Model/Functions';
|
||||
import palette from '@/theme/palette';
|
||||
import BenefitConfigurationDialog from './BenefitConfigurationDialog';
|
||||
import { fNumber } from '@/utils/formatNumber';
|
||||
|
||||
export default function BenefitConfigurationList() {
|
||||
const { id: claim_id } = useParams();
|
||||
|
||||
// State
|
||||
// --------------------
|
||||
const [BenefitConfigurationList, setBenefitConfigurationList] = useState<BenefitConfigurationListType[]>();
|
||||
@@ -43,7 +47,7 @@ export default function BenefitConfigurationList() {
|
||||
// Load Data
|
||||
// -------------------
|
||||
const loadDataTableData = async () => {
|
||||
const response = await getBenefitConfigurationList();
|
||||
const response = await getBenefitConfigurationList(claim_id??'');
|
||||
|
||||
setBenefitConfigurationList(response);
|
||||
}
|
||||
@@ -94,7 +98,7 @@ export default function BenefitConfigurationList() {
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold' }}>
|
||||
{row.amount_incurred}
|
||||
{fNumber(row.amount_incurred)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -110,7 +114,7 @@ export default function BenefitConfigurationList() {
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold' }}>
|
||||
{row.amount_approved}
|
||||
{fNumber(row.amount_approved)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -126,7 +130,7 @@ export default function BenefitConfigurationList() {
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold' }}>
|
||||
{row.amount_not_approved}
|
||||
{fNumber(row.amount_not_approved)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -142,7 +146,7 @@ export default function BenefitConfigurationList() {
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Typography variant="caption" sx={{ fontWeight: 'bold' }}>
|
||||
{row.excess_paid}
|
||||
{fNumber(row.excess_paid)}
|
||||
</Typography>
|
||||
</Grid>
|
||||
</Grid>
|
||||
@@ -158,7 +162,7 @@ export default function BenefitConfigurationList() {
|
||||
}
|
||||
|
||||
{/* Dialog */}
|
||||
<BenefitConfigurationDialog data={BenefitConfigurationData} isOpen={isDialogOpen} handleCancleProp={() => setIsDialogOpen(false)} />
|
||||
<BenefitConfigurationDialog data={BenefitConfigurationData} isOpen={isDialogOpen} handleCancleProp={() => setIsDialogOpen(false)} handleSuccessProp={() => loadDataTableData()} />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user