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