updat trx kind
This commit is contained in:
@ -134,7 +134,7 @@ const DetailTransaction = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
const formatTokenDec = (token:any) => {
|
||||
const formatTokenDec = (token: any) => {
|
||||
if (token != null && token !== "") {
|
||||
return token.match(/.{1,4}/g)?.join(" ");
|
||||
} else {
|
||||
@ -468,44 +468,46 @@ const DetailTransaction = () => {
|
||||
<p className="font-medium">
|
||||
{(() => {
|
||||
let kind;
|
||||
if (transactionDetails?.kind === 'T') {
|
||||
kind = 'TRANSFER';
|
||||
if (transactionDetails?.kind === 'R') {
|
||||
kind = 'Return';
|
||||
} else if (transactionDetails?.kind === 'T') {
|
||||
kind = 'Transfer';
|
||||
} else if (transactionDetails?.kind === 'P') {
|
||||
kind = 'PURCHASE';
|
||||
} else if (transactionDetails?.kind === 'W') {
|
||||
kind = 'WITHDRAW';
|
||||
} else if (transactionDetails?.kind === 'U') {
|
||||
kind = 'TOP UP';
|
||||
} else if (transactionDetails?.kind === 'R') {
|
||||
kind = 'RETURN';
|
||||
} else if (transactionDetails?.kind === 'E') {
|
||||
kind = 'REWARD';
|
||||
kind = 'Purchase';
|
||||
} else if (transactionDetails?.kind === 'L') {
|
||||
kind = 'PURCHASE LOJA';
|
||||
kind = 'Purchase Loja';
|
||||
} else if (transactionDetails?.kind === 'W') {
|
||||
kind = 'Withdraw';
|
||||
} else if (transactionDetails?.kind === 'U') {
|
||||
kind = 'Topup';
|
||||
} else if (transactionDetails?.kind === 'B') {
|
||||
kind = 'TOP UP P24';
|
||||
kind = 'Topup P24';
|
||||
} else if (transactionDetails?.kind === 'N') {
|
||||
kind = 'Topup Partner';
|
||||
} else if (transactionDetails?.kind === 'E') {
|
||||
kind = 'Reward';
|
||||
} else if (transactionDetails?.kind === 'A') {
|
||||
kind = 'TRANSFER AGENT';
|
||||
kind = 'Transfer Agent';
|
||||
} else if (transactionDetails?.kind === 'M') {
|
||||
kind = 'WITHDRAWAL AGENT';
|
||||
kind = 'Withdraw Agent';
|
||||
} else if (transactionDetails?.kind === 'O') {
|
||||
kind = 'TOPUP AGENT';
|
||||
kind = 'Topup Agent';
|
||||
} else if (transactionDetails?.kind === 'S') {
|
||||
kind = 'TOPUP P24';
|
||||
kind = 'Transfer P24';
|
||||
} else if (transactionDetails?.kind === 'I') {
|
||||
kind = 'WITHDRAW MERCHANT';
|
||||
kind = 'Withdraw Merchant';
|
||||
} else if (transactionDetails?.kind === 'D') {
|
||||
kind = 'DONATION';
|
||||
kind = 'Donation';
|
||||
} else if (transactionDetails?.kind === 'F') {
|
||||
kind = 'FEE';
|
||||
kind = 'Fee';
|
||||
} else if (transactionDetails?.kind === 'V') {
|
||||
kind = 'REVERSAL';
|
||||
kind = 'Raversal';
|
||||
} else if (transactionDetails?.kind === 'C') {
|
||||
kind = 'CASHBACK CASH';
|
||||
kind = 'Cashback Cash';
|
||||
} else if (transactionDetails?.kind === 'H') {
|
||||
kind = 'CASHBACK POINT';
|
||||
kind = 'Cashback Point';
|
||||
} else if (transactionDetails?.kind === 'J') {
|
||||
kind = 'WITHDRAW ADMIN';
|
||||
kind = 'Withdraw Admin';
|
||||
}
|
||||
|
||||
return kind;
|
||||
|
||||
@ -14,13 +14,13 @@ import { start } from 'repl';
|
||||
interface TransactionProps {
|
||||
id: number;
|
||||
name: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface ContextProps {
|
||||
getTransactionLists: (
|
||||
limit: number,
|
||||
page: number,
|
||||
with_deleted: boolean,
|
||||
with_deleted: boolean,
|
||||
order_field: any,
|
||||
order_direction: any,
|
||||
filter: any
|
||||
@ -36,11 +36,11 @@ interface ContextProps {
|
||||
const initialProps: ContextProps = {
|
||||
getTransactionLists: async () => ({ data: [], totalCount: 0 }),
|
||||
showDetailDialog: false,
|
||||
setShowDetailDialog: () => {},
|
||||
setShowDetailDialog: () => { },
|
||||
showRollbackDialog: false,
|
||||
setShowRollbackDialog: () => {},
|
||||
setShowRollbackDialog: () => { },
|
||||
selectedTransactionId: null,
|
||||
setSelectedTransactionId: () => {}
|
||||
setSelectedTransactionId: () => { }
|
||||
};
|
||||
|
||||
const ManageTransactionContext = createContext<ContextProps>(initialProps);
|
||||
@ -83,46 +83,46 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
{
|
||||
accessorFn: (row) => {
|
||||
switch (row.kind) {
|
||||
case 'T':
|
||||
return 'TRANSFER';
|
||||
case 'P':
|
||||
return 'PURCHASE';
|
||||
case 'W':
|
||||
return 'WITHDRAW';
|
||||
case 'U':
|
||||
return 'TOP UP';
|
||||
case 'R':
|
||||
return 'RETURN';
|
||||
case 'N':
|
||||
return 'TOP UP PARTNER';
|
||||
case 'E':
|
||||
return 'REWARD';
|
||||
return 'Return';
|
||||
case 'T':
|
||||
return 'Transfer';
|
||||
case 'P':
|
||||
return 'Purchase';
|
||||
case 'L':
|
||||
return 'PURCHASE LOJA';
|
||||
return 'Purchase Loja';
|
||||
case 'W':
|
||||
return 'Withdraw';
|
||||
case 'U':
|
||||
return 'Topup';
|
||||
case 'B':
|
||||
return 'TOP UP P24';
|
||||
return 'Topup P24';
|
||||
case 'N':
|
||||
return 'Topup Partner';
|
||||
case 'E':
|
||||
return 'Reward';
|
||||
case 'A':
|
||||
return 'TRANSFER AGENT';
|
||||
return 'Transfer Agent';
|
||||
case 'M':
|
||||
return 'WITHDRAWAL AGENT';
|
||||
return 'Withdraw Agent';
|
||||
case 'O':
|
||||
return 'TOP UP AGENT';
|
||||
return 'Topup Agent';
|
||||
case 'S':
|
||||
return 'TRANSFER P24';
|
||||
return 'Transfer P24';
|
||||
case 'I':
|
||||
return 'WIJTDRAW MERCHANT';
|
||||
return 'Withdraw Merchant';
|
||||
case 'D':
|
||||
return 'DONATION';
|
||||
return 'Donation';
|
||||
case 'F':
|
||||
return 'FEE';
|
||||
return 'Fee';
|
||||
case 'V':
|
||||
return 'REVERSAL';
|
||||
return 'Raversal';
|
||||
case 'C':
|
||||
return 'CASHBACK CASH';
|
||||
return 'Cashback Cash';
|
||||
case 'H':
|
||||
return 'CASHBACK POINT';
|
||||
return 'Cashback Point';
|
||||
case 'J':
|
||||
return 'WITHDRAW ADMIN';
|
||||
return 'Withdraw Admin';
|
||||
default:
|
||||
return '_';
|
||||
}
|
||||
@ -340,7 +340,7 @@ const TransactionProvider = ({ children }: { children: React.ReactNode }) => {
|
||||
let enddate: string | undefined;
|
||||
// let transactioncode = '';
|
||||
let type = '';
|
||||
let status = '';
|
||||
let status = '';
|
||||
let searchType = '';
|
||||
let codeValue = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user