Add payment method selection
Adds a payment method selection (Credit Card, Cash) to the expense form and includes a line separator. Also requests to add a graph showing the proportion of credit card and cash usage in expense analytics, but this part is not implemented in this commit.
This commit is contained in:
@@ -31,6 +31,7 @@ export const useTransactionEdit = (
|
||||
title: transaction.title,
|
||||
amount: formatWithCommas(transaction.amount.toString()),
|
||||
category: mapCategoryToNew(transaction.category),
|
||||
paymentMethod: transaction.paymentMethod || '신용카드', // 지출 방법 추가, 기본값은 신용카드
|
||||
},
|
||||
});
|
||||
|
||||
@@ -41,6 +42,7 @@ export const useTransactionEdit = (
|
||||
title: transaction.title,
|
||||
amount: formatWithCommas(transaction.amount.toString()),
|
||||
category: mapCategoryToNew(transaction.category),
|
||||
paymentMethod: transaction.paymentMethod || '신용카드', // 지출 방법 기본값
|
||||
});
|
||||
}
|
||||
}, [open, transaction, form]);
|
||||
@@ -61,6 +63,7 @@ export const useTransactionEdit = (
|
||||
title: values.title,
|
||||
amount: Number(cleanAmount),
|
||||
category: values.category,
|
||||
paymentMethod: values.paymentMethod, // 지출 방법 업데이트
|
||||
};
|
||||
|
||||
// 컨텍스트를 통해 트랜잭션 업데이트
|
||||
|
||||
Reference in New Issue
Block a user