account edit page displays the debt amount instead of the balance for credit card and debt accounts

This commit is contained in:
MaysWind
2025-02-11 00:45:23 +08:00
parent 18a6d25ed6
commit ab58109e5e
12 changed files with 133 additions and 28 deletions
+14 -10
View File
@@ -25,27 +25,31 @@ export class AccountCategory implements TypeAndName {
private static readonly allInstances: AccountCategory[] = [];
private static readonly allInstancesByType: Record<number, AccountCategory> = {};
public static readonly Cash = new AccountCategory(1, 1, 'Cash', '1');
public static readonly CheckingAccount = new AccountCategory(2, 2, 'Checking Account', '100');
public static readonly SavingsAccount = new AccountCategory(8, 3, 'Savings Account', '100');
public static readonly CreditCard = new AccountCategory(3, 4, 'Credit Card', '100');
public static readonly VirtualAccount = new AccountCategory(4, 5, 'Virtual Account', '500');
public static readonly DebtAccount = new AccountCategory(5, 6, 'Debt Account', '600');
public static readonly Receivables = new AccountCategory(6, 7, 'Receivables', '700');
public static readonly CertificateOfDeposit = new AccountCategory(9, 8, 'Certificate of Deposit', '110');
public static readonly InvestmentAccount = new AccountCategory(7, 9, 'Investment Account', '800');
public static readonly Cash = new AccountCategory(1, 1, 'Cash', true, false, '1');
public static readonly CheckingAccount = new AccountCategory(2, 2, 'Checking Account', true, false, '100');
public static readonly SavingsAccount = new AccountCategory(8, 3, 'Savings Account', true, false, '100');
public static readonly CreditCard = new AccountCategory(3, 4, 'Credit Card', false, true, '100');
public static readonly VirtualAccount = new AccountCategory(4, 5, 'Virtual Account', true, false, '500');
public static readonly DebtAccount = new AccountCategory(5, 6, 'Debt Account', false, true, '600');
public static readonly Receivables = new AccountCategory(6, 7, 'Receivables', true, false, '700');
public static readonly CertificateOfDeposit = new AccountCategory(9, 8, 'Certificate of Deposit', true, false, '110');
public static readonly InvestmentAccount = new AccountCategory(7, 9, 'Investment Account', true, false, '800');
public static readonly Default = AccountCategory.Cash;
public readonly type: number;
public readonly displayOrder: number;
public readonly name: string;
public readonly isAsset: boolean;
public readonly isLiability: boolean
public readonly defaultAccountIconId: string;
private constructor(type: number, displayOrder: number, name: string, defaultAccountIconId: string) {
private constructor(type: number, displayOrder: number, name: string, isAsset: boolean, isLiability: boolean, defaultAccountIconId: string) {
this.type = type;
this.displayOrder = displayOrder;
this.name = name;
this.isAsset = isAsset;
this.isLiability = isLiability;
this.defaultAccountIconId = defaultAccountIconId;
AccountCategory.allInstances.push(this);