fitur is reversal
This commit is contained in:
@@ -71,6 +71,17 @@ class ClaimRequestShowResource extends JsonResource
|
|||||||
'total_excess_paid' => $total_excess_paid,
|
'total_excess_paid' => $total_excess_paid,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$isReversal = false;
|
||||||
|
$isRole = auth()->user()->role_id;
|
||||||
|
if ($data['request_log']['status'] == 'approved' &&
|
||||||
|
$data['request_log']['status_final_log'] == 'approved' &&
|
||||||
|
$data['status'] == 'approved' &&
|
||||||
|
$data['status_claim_management'] == 'approved' &&
|
||||||
|
$isRole != 1 // is admin
|
||||||
|
){
|
||||||
|
$isReversal = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$response = [
|
$response = [
|
||||||
'id' => $data['id'],
|
'id' => $data['id'],
|
||||||
@@ -101,6 +112,7 @@ class ClaimRequestShowResource extends JsonResource
|
|||||||
'files' => $data['request_log']['files'],
|
'files' => $data['request_log']['files'],
|
||||||
'reason_decline' => $data['reason_decline'],
|
'reason_decline' => $data['reason_decline'],
|
||||||
// 'benefit_data' => $benefitDetailLog,
|
// 'benefit_data' => $benefitDetailLog,
|
||||||
|
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,19 @@ class RequestLogShowResource extends JsonResource
|
|||||||
$claimRequest = ClaimRequest::where('request_log_id', $requestLog['id'])->first();
|
$claimRequest = ClaimRequest::where('request_log_id', $requestLog['id'])->first();
|
||||||
if ($claimRequest) {
|
if ($claimRequest) {
|
||||||
$claimCode = $claimRequest->code;
|
$claimCode = $claimRequest->code;
|
||||||
|
$isReversal = false;
|
||||||
|
$isRole = auth()->user()->role_id;
|
||||||
|
if ($requestLog['status'] == 'approved' &&
|
||||||
|
$requestLog['status_final_log'] == 'approved' &&
|
||||||
|
$claimRequest->status == 'approved' &&
|
||||||
|
$claimRequest->status_claim_management == 'approved' &&
|
||||||
|
$isRole != 1
|
||||||
|
){
|
||||||
|
$isReversal = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$claimCode = '-';
|
$claimCode = '-';
|
||||||
|
$isReversal = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($provider){
|
if ($provider){
|
||||||
@@ -136,6 +147,7 @@ class RequestLogShowResource extends JsonResource
|
|||||||
'catatan' => $requestLog['catatan'],
|
'catatan' => $requestLog['catatan'],
|
||||||
'reason' => $requestLog['reason'],
|
'reason' => $requestLog['reason'],
|
||||||
'diagnosis' => $icd,
|
'diagnosis' => $icd,
|
||||||
|
'is_reversal' => $isReversal, // untuk penjagaan, jika true tidak bisa di edit/hapus lagi
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -78,15 +78,13 @@ export default function FormEdit({ isEdit, currentClaim }: Props) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
const [date, setDate] = useState(currentClaim?.submission_date)
|
const [date, setDate] = useState(currentClaim?.submission_date ? fDateTimesecond(currentClaim?.submission_date) : null)
|
||||||
const id = currentClaim?.id
|
const id = currentClaim?.id
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setDate(currentClaim?.submission_date)
|
setDate(currentClaim?.submission_date)
|
||||||
}, [currentClaim]);
|
}, [currentClaim]);
|
||||||
|
|
||||||
console.log(date);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isEdit && currentClaim) {
|
if (isEdit && currentClaim) {
|
||||||
reset(defaultValues);
|
reset(defaultValues);
|
||||||
@@ -254,7 +252,6 @@ export default function FormEdit({ isEdit, currentClaim }: Props) {
|
|||||||
</Stack>
|
</Stack>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
|
<FormProvider methods={methods} onSubmit={handleSubmit(onSubmit)}>
|
||||||
<Stack direction="row" alignItems="center" sx={{ mb: 5 }}>
|
<Stack direction="row" alignItems="center" sx={{ mb: 5 }}>
|
||||||
@@ -310,10 +307,14 @@ export default function FormEdit({ isEdit, currentClaim }: Props) {
|
|||||||
<RHFDateTimePicker
|
<RHFDateTimePicker
|
||||||
{...field}
|
{...field}
|
||||||
label="Date of Submission"
|
label="Date of Submission"
|
||||||
value={field.value || null}
|
value={field.value}
|
||||||
onChange={() => setDate(field.value)}
|
onChange={() =>
|
||||||
|
setDate(field.value)
|
||||||
|
}
|
||||||
|
dateFormat='dd MMM yyyy HH:mm:ss'
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={3}>
|
<Grid item xs={3}>
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export default function Detail() {
|
|||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
const [claimRequests, setClaimRequest] = useState<DetailClaimRequest>();
|
const [claimRequests, setClaimRequest] = useState<DetailClaimRequest>();
|
||||||
const [openDialogSubmit, setOpenDialogSubmit] = useState(false);
|
const [openDialogSubmit, setOpenDialogSubmit] = useState(false);
|
||||||
|
const [isReversal, setIsReversal] = useState(false);
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
|
|
||||||
@@ -60,6 +61,7 @@ export default function Detail() {
|
|||||||
.get('claim-requests/detail/'+id)
|
.get('claim-requests/detail/'+id)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
setClaimRequest(response.data.data)
|
setClaimRequest(response.data.data)
|
||||||
|
setIsReversal(response.data.data.is_reversal)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -226,13 +228,18 @@ export default function Detail() {
|
|||||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||||
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Document </Typography>
|
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Document </Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
{
|
||||||
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
!isReversal ? (
|
||||||
setDialogUploadFileLog(true)
|
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||||
}} >
|
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
||||||
<Typography variant="button" display="block">File</Typography>
|
setDialogUploadFileLog(true)
|
||||||
</Button>
|
}} >
|
||||||
</Stack>
|
<Typography variant="button" display="block">File</Typography>
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
{claimRequests?.files?.map((documentType, index) => (
|
{claimRequests?.files?.map((documentType, index) => (
|
||||||
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{marginBottom: 2}} key={index}>
|
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{marginBottom: 2}} key={index}>
|
||||||
@@ -253,14 +260,19 @@ export default function Detail() {
|
|||||||
<Typography variant="body1" gutterBottom>{documentType.original_name ? documentType.original_name : '-'}</Typography>
|
<Typography variant="body1" gutterBottom>{documentType.original_name ? documentType.original_name : '-'}</Typography>
|
||||||
</a>
|
</a>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="column" spacing={2}>
|
{
|
||||||
<IconButton onClick={() => {
|
!isReversal ? (
|
||||||
setDialogDeleteFileLog(true)
|
<Stack direction="column" spacing={2}>
|
||||||
setPathFile(documentType.path)
|
<IconButton onClick={() => {
|
||||||
}} aria-label="delete" size="small" sx={{ marginLeft: 'auto' }}>
|
setDialogDeleteFileLog(true)
|
||||||
<Delete color='error' fontSize="small" />
|
setPathFile(documentType.path)
|
||||||
</IconButton>
|
}} aria-label="delete" size="small" sx={{ marginLeft: 'auto' }}>
|
||||||
</Stack>
|
<Delete color='error' fontSize="small" />
|
||||||
|
</IconButton>
|
||||||
|
</Stack>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
@@ -284,11 +296,15 @@ export default function Detail() {
|
|||||||
<Card sx={{padding:2}} >
|
<Card sx={{padding:2}} >
|
||||||
<Stack direction="row" alignItems="center" sx={{marginBottom: 4}}>
|
<Stack direction="row" alignItems="center" sx={{marginBottom: 4}}>
|
||||||
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Benefit</Typography>
|
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Benefit</Typography>
|
||||||
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
{
|
||||||
setDialogBenefit(true);
|
!isReversal ? (
|
||||||
}} >
|
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
||||||
<Typography variant="button" display="block">Benefit</Typography>
|
setDialogBenefit(true);
|
||||||
</Button>
|
}} >
|
||||||
|
<Typography variant="button" display="block">Benefit</Typography>
|
||||||
|
</Button>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Box sx={{ border: '1px solid rgba(0,0,0,0.125)', px: '24px', py: '20px', marginBottom: '24px', borderRadius: '12px'}}>
|
<Box sx={{ border: '1px solid rgba(0,0,0,0.125)', px: '24px', py: '20px', marginBottom: '24px', borderRadius: '12px'}}>
|
||||||
@@ -301,29 +317,34 @@ export default function Detail() {
|
|||||||
{item.benefit?.description}
|
{item.benefit?.description}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
{
|
||||||
<MoreMenu actions={
|
!isReversal ? (
|
||||||
<>
|
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
||||||
<MenuItem onClick={() => {
|
<MoreMenu actions={
|
||||||
setDialogEditBenefit(true)
|
<>
|
||||||
setIdBenefitData(item.id)
|
<MenuItem onClick={() => {
|
||||||
setBenefitConfigurationData(item)
|
setDialogEditBenefit(true)
|
||||||
}}
|
setIdBenefitData(item.id)
|
||||||
>
|
setBenefitConfigurationData(item)
|
||||||
<EditOutlined />
|
}}
|
||||||
Edit
|
>
|
||||||
</MenuItem>
|
<EditOutlined />
|
||||||
<MenuItem onClick={() => {
|
Edit
|
||||||
setIdBenefitData(item.id)
|
</MenuItem>
|
||||||
setDialogDeleteBenefit(true)
|
<MenuItem onClick={() => {
|
||||||
}}
|
setIdBenefitData(item.id)
|
||||||
>
|
setDialogDeleteBenefit(true)
|
||||||
<Delete color='error'/>
|
}}
|
||||||
Delete
|
>
|
||||||
</MenuItem>
|
<Delete color='error'/>
|
||||||
</>
|
Delete
|
||||||
} />
|
</MenuItem>
|
||||||
</Grid>
|
</>
|
||||||
|
} />
|
||||||
|
</Grid>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} py={2}>
|
<Grid item xs={12} py={2}>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export default function Detail() {
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { themeStretch } = useSettings();
|
const { themeStretch } = useSettings();
|
||||||
const [requestLog, setRequestLog] = useState<DetailFinalLogType>();
|
const [requestLog, setRequestLog] = useState<DetailFinalLogType>();
|
||||||
|
const [isReversal, setIsReversal] = useState(false);
|
||||||
|
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
@@ -77,6 +78,7 @@ export default function Detail() {
|
|||||||
.get('customer-service/request/'+id)
|
.get('customer-service/request/'+id)
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
setRequestLog(response.data.data)
|
setRequestLog(response.data.data)
|
||||||
|
setIsReversal(response.data.data.is_reversal)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
@@ -283,11 +285,15 @@ export default function Detail() {
|
|||||||
<Card sx={{padding:2}} >
|
<Card sx={{padding:2}} >
|
||||||
<Stack direction="row" alignItems="center" sx={{marginBottom: 4}}>
|
<Stack direction="row" alignItems="center" sx={{marginBottom: 4}}>
|
||||||
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Benefit</Typography>
|
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Benefit</Typography>
|
||||||
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
{
|
||||||
setDialogBenefit(true);
|
!isReversal ? (
|
||||||
}} >
|
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
||||||
<Typography variant="button" display="block">Benefit</Typography>
|
setDialogBenefit(true);
|
||||||
</Button>
|
}} >
|
||||||
|
<Typography variant="button" display="block">Benefit</Typography>
|
||||||
|
</Button>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
{requestLog?.benefit_data?.map((item, index) => (
|
{requestLog?.benefit_data?.map((item, index) => (
|
||||||
@@ -300,29 +306,33 @@ export default function Detail() {
|
|||||||
{item.benefit?.description}
|
{item.benefit?.description}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
{
|
||||||
<MoreMenu actions={
|
!isReversal ? (
|
||||||
<>
|
<Grid item xs={6} sx={{ display: 'flex', placeContent: 'end' }}>
|
||||||
<MenuItem onClick={() => {
|
<MoreMenu actions={
|
||||||
setDialogEditBenefit(true)
|
<>
|
||||||
setIdBenefitData(item.id)
|
<MenuItem onClick={() => {
|
||||||
setBenefitConfigurationData(item)
|
setDialogEditBenefit(true)
|
||||||
}}
|
setIdBenefitData(item.id)
|
||||||
>
|
setBenefitConfigurationData(item)
|
||||||
<EditOutlined />
|
}}
|
||||||
Edit
|
>
|
||||||
</MenuItem>
|
<EditOutlined />
|
||||||
<MenuItem onClick={() => {
|
Edit
|
||||||
setIdBenefitData(item.id)
|
</MenuItem>
|
||||||
setDialogDeleteBenefit(true)
|
<MenuItem onClick={() => {
|
||||||
}}
|
setIdBenefitData(item.id)
|
||||||
>
|
setDialogDeleteBenefit(true)
|
||||||
<Delete color='error'/>
|
}}
|
||||||
Delete
|
>
|
||||||
</MenuItem>
|
<Delete color='error'/>
|
||||||
</>
|
Delete
|
||||||
} />
|
</MenuItem>
|
||||||
</Grid>
|
</>
|
||||||
|
} />
|
||||||
|
</Grid>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12}>
|
<Grid item xs={12}>
|
||||||
@@ -598,13 +608,16 @@ export default function Detail() {
|
|||||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||||
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Files </Typography>
|
<Typography variant='subtitle1' sx={{color: '#19BBBB'}} gutterBottom>Files </Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
{ !isReversal ? (
|
||||||
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
<Stack direction="column" spacing={2} sx={{marginBottom: 2}}>
|
||||||
setDialogUploadFileLog(true)
|
<Button variant="outlined" startIcon={<AddIcon/>} sx={{marginLeft: 'auto'}} onClick={() => {
|
||||||
}} >
|
setDialogUploadFileLog(true)
|
||||||
<Typography variant="button" display="block">Files</Typography>
|
}} >
|
||||||
</Button>
|
<Typography variant="button" display="block">Files</Typography>
|
||||||
</Stack>
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
) : null }
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
{requestLog?.files?.map((documentType, index) => (
|
{requestLog?.files?.map((documentType, index) => (
|
||||||
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{marginBottom: 2}} key={index}>
|
<Stack direction="row" alignItems="center" justifyContent="space-between" sx={{marginBottom: 2}} key={index}>
|
||||||
@@ -617,14 +630,17 @@ export default function Detail() {
|
|||||||
<Typography variant="body2" gutterBottom>{documentType.original_name ? documentType.original_name : '-'}</Typography>
|
<Typography variant="body2" gutterBottom>{documentType.original_name ? documentType.original_name : '-'}</Typography>
|
||||||
</a>
|
</a>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="column" spacing={2}>
|
{ !isReversal ? (
|
||||||
<IconButton onClick={() => {
|
<Stack direction="column" spacing={2}>
|
||||||
setDialogDeleteFileLog(true)
|
<IconButton onClick={() => {
|
||||||
setPathFile(documentType.path)
|
setDialogDeleteFileLog(true)
|
||||||
}} aria-label="delete" size="small" sx={{ marginLeft: 'auto' }}>
|
setPathFile(documentType.path)
|
||||||
<Delete color='error' fontSize="small" />
|
}} aria-label="delete" size="small" sx={{ marginLeft: 'auto' }}>
|
||||||
</IconButton>
|
<Delete color='error' fontSize="small" />
|
||||||
</Stack>
|
</IconButton>
|
||||||
|
</Stack>
|
||||||
|
) : null }
|
||||||
|
|
||||||
</Stack>
|
</Stack>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user