Payment Record: Prevent the tick without all files submitted
This commit is contained in:
@@ -577,16 +577,18 @@ export default function PaymentRecord() {
|
||||
id: "isPaid",
|
||||
cell: (info) => {
|
||||
const {value} = columHelperValue(info.column.id, info);
|
||||
|
||||
return (
|
||||
<Checkbox
|
||||
isChecked={value}
|
||||
onChange={(e) =>
|
||||
user?.type !== "agent" && !value
|
||||
? confirm(`Are you sure you want to consider this payment paid?`)
|
||||
? updatePayment(info.row.original, "isPaid", e)
|
||||
: null
|
||||
: null
|
||||
}>
|
||||
onChange={(e) => {
|
||||
if (user?.type === agent || value) return null;
|
||||
if (!info.row.original.commissionTransfer || !info.row.original.corporateTransfer)
|
||||
return alert("All files need to be uploaded to consider it paid!");
|
||||
if (!confirm(`Are you sure you want to consider this payment paid?`)) return null;
|
||||
|
||||
return updatePayment(info.row.original, "isPaid", e);
|
||||
}}>
|
||||
<span></span>
|
||||
</Checkbox>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user