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