Hid the country manager from the corporate on the payment records
This commit is contained in:
@@ -540,9 +540,25 @@ export default function PaymentRecord() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const commissionColumn = () => {
|
const hiddenToCorporateColumns = () => {
|
||||||
if (user && user.type !== "corporate")
|
if (user && user.type !== "corporate")
|
||||||
return [
|
return [
|
||||||
|
columnHelper.accessor("agent", {
|
||||||
|
header: "Country Manager",
|
||||||
|
id: "agent",
|
||||||
|
cell: (info) => {
|
||||||
|
const {user, value} = columHelperValue(info.column.id, info);
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className={clsx(
|
||||||
|
"underline text-mti-purple-light hover:text-mti-purple-dark transition ease-in-out duration-300 cursor-pointer",
|
||||||
|
)}
|
||||||
|
onClick={() => setSelectedAgentUser(user)}>
|
||||||
|
{value}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}),
|
||||||
columnHelper.accessor("agentCommission", {
|
columnHelper.accessor("agentCommission", {
|
||||||
header: "Commission",
|
header: "Commission",
|
||||||
id: "agentCommission",
|
id: "agentCommission",
|
||||||
@@ -608,23 +624,7 @@ export default function PaymentRecord() {
|
|||||||
return <span>{finalValue}</span>;
|
return <span>{finalValue}</span>;
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
columnHelper.accessor("agent", {
|
...hiddenToCorporateColumns(),
|
||||||
header: "Country Manager",
|
|
||||||
id: "agent",
|
|
||||||
cell: (info) => {
|
|
||||||
const {user, value} = columHelperValue(info.column.id, info);
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className={clsx(
|
|
||||||
"underline text-mti-purple-light hover:text-mti-purple-dark transition ease-in-out duration-300 cursor-pointer",
|
|
||||||
)}
|
|
||||||
onClick={() => setSelectedAgentUser(user)}>
|
|
||||||
{value}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
...commissionColumn(),
|
|
||||||
columnHelper.accessor("isPaid", {
|
columnHelper.accessor("isPaid", {
|
||||||
header: "Paid",
|
header: "Paid",
|
||||||
id: "isPaid",
|
id: "isPaid",
|
||||||
|
|||||||
Reference in New Issue
Block a user