Skip to content

Commit

Permalink
add event type voucher type
Browse files Browse the repository at this point in the history
  • Loading branch information
TinyMurky committed Dec 25, 2024
1 parent 11492e4 commit f763aa4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/new_journal_form/new_journal_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const eventTypeMap: { [key in EventType]: string } = {
[EventType.PAYMENT]: 'journal:JOURNAL.PAYMENT',
[EventType.INCOME]: 'project:PROJECT.INCOME',
[EventType.TRANSFER]: 'common:COMMON.TRANSFER',
[EventType.OPENING_ACCOUNT_BOOK]: 'common:COMMON.OPENING_ACCOUNT_BOOK', // Info: (20241225 - Murky) @Anna 目前翻譯檔暫時沒有開帳的翻譯
};
const taxRateSelection: number[] = [0, 5, 20, 25];

Expand Down
4 changes: 4 additions & 0 deletions src/constants/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export enum EventType {
PAYMENT = 'payment',
INCOME = 'income',
TRANSFER = 'transfer',
OPENING_ACCOUNT_BOOK = 'openingAccountBook',
}

export enum AccountType {
Expand Down Expand Up @@ -52,6 +53,7 @@ export enum VoucherType {
RECEIVE = 'receive',
EXPENSE = 'expense',
TRANSFER = 'transfer',
OPENING_ACCOUNT_BOOK = 'openingAccountBook',
}

export enum PaymentStatusType {
Expand Down Expand Up @@ -83,6 +85,7 @@ export const EVENT_TYPE_TO_VOUCHER_TYPE_MAP: {
[EventType.INCOME]: VoucherType.RECEIVE,
[EventType.PAYMENT]: VoucherType.EXPENSE,
[EventType.TRANSFER]: VoucherType.TRANSFER,
[EventType.OPENING_ACCOUNT_BOOK]: VoucherType.OPENING_ACCOUNT_BOOK,
};

export const VOUCHER_TYPE_TO_EVENT_TYPE_MAP: {
Expand All @@ -91,6 +94,7 @@ export const VOUCHER_TYPE_TO_EVENT_TYPE_MAP: {
[VoucherType.RECEIVE]: EventType.INCOME,
[VoucherType.EXPENSE]: EventType.PAYMENT,
[VoucherType.TRANSFER]: EventType.TRANSFER,
[VoucherType.OPENING_ACCOUNT_BOOK]: EventType.OPENING_ACCOUNT_BOOK,
};

export const MISSING_CODE_MARKERS = ['!', '@', '#', '$', '%'];
Expand Down
2 changes: 2 additions & 0 deletions src/lib/utils/zod_schema/ledger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ const ledgerListResponseSchema = z.object({
VoucherType.EXPENSE,
VoucherType.RECEIVE,
VoucherType.TRANSFER,
VoucherType.OPENING_ACCOUNT_BOOK,

EventType.INCOME,
EventType.PAYMENT,
EventType.TRANSFER,
EventType.OPENING_ACCOUNT_BOOK,
]),
particulars: z.string(),
debitAmount: z.number(),
Expand Down

0 comments on commit f763aa4

Please sign in to comment.