mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-06-09 14:56:00 +00:00
Merge branch 'pr-72'
This commit is contained in:
@@ -124,10 +124,11 @@ interface TransactionRow {
|
||||
|
||||
function createEmptyTransactionRow(
|
||||
defaultPayerId?: string | null,
|
||||
lastPurchaseDate?: string,
|
||||
): TransactionRow {
|
||||
return {
|
||||
id: createClientSafeId(),
|
||||
purchaseDate: getTodayDateString(),
|
||||
purchaseDate: lastPurchaseDate ?? getTodayDateString(),
|
||||
name: "",
|
||||
amount: "",
|
||||
categoryId: undefined,
|
||||
@@ -194,9 +195,10 @@ export function MassAddDialog({
|
||||
};
|
||||
|
||||
const addTransaction = () => {
|
||||
const lastTransaction = transactions[transactions.length - 1];
|
||||
setTransactions([
|
||||
...transactions,
|
||||
createEmptyTransactionRow(defaultPayerId),
|
||||
createEmptyTransactionRow(defaultPayerId, lastTransaction?.purchaseDate),
|
||||
]);
|
||||
setIsDirty(true);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user