Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add event type voucher type #3764

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading