Skip to content

Commit

Permalink
Shared - Fix Repeat Transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Jan 17, 2023
1 parent 8141707 commit 0377098
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions NickvisionMoney.Shared/Models/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -713,14 +713,15 @@ public async Task UpdateSourceTransactionAsync(Transaction transaction, bool upd
{
if (t.RepeatFrom == (int)transaction.Id)
{
t.Description = transaction.Description;
t.Type = transaction.Type;
t.Amount = transaction.Amount;
t.GroupId = transaction.GroupId;
t.RGBA = transaction.RGBA;
t.Receipt = transaction.Receipt;
t.RepeatEndDate = transaction.RepeatEndDate;
await UpdateTransactionAsync(t);
var tt = (Transaction)t.Clone();
tt.Description = transaction.Description;
tt.Type = transaction.Type;
tt.Amount = transaction.Amount;
tt.GroupId = transaction.GroupId;
tt.RGBA = transaction.RGBA;
tt.Receipt = transaction.Receipt;
tt.RepeatEndDate = transaction.RepeatEndDate;
await UpdateTransactionAsync(tt);
}
}
await UpdateTransactionAsync(transaction);
Expand All @@ -731,10 +732,11 @@ public async Task UpdateSourceTransactionAsync(Transaction transaction, bool upd
{
if (t.RepeatFrom == (int)transaction.Id)
{
t.RepeatInterval = TransactionRepeatInterval.Never;
t.RepeatFrom = -1;
t.RepeatEndDate = null;
await UpdateTransactionAsync(t);
var tt = (Transaction)t.Clone();
tt.RepeatInterval = TransactionRepeatInterval.Never;
tt.RepeatFrom = -1;
tt.RepeatEndDate = null;
await UpdateTransactionAsync(tt);
}
}
await UpdateTransactionAsync(transaction);
Expand Down Expand Up @@ -805,10 +807,11 @@ public async Task DeleteSourceTransactionAsync(uint id, bool deleteGenerated)
{
if(transaction.RepeatFrom == (int)id)
{
transaction.RepeatInterval = TransactionRepeatInterval.Never;
transaction.RepeatFrom = -1;
transaction.RepeatEndDate = null;
await UpdateTransactionAsync(transaction);
var t = (Transaction)transaction.Clone();
t.RepeatInterval = TransactionRepeatInterval.Never;
t.RepeatFrom = -1;
t.RepeatEndDate = null;
await UpdateTransactionAsync(t);
}
}
}
Expand Down

0 comments on commit 0377098

Please sign in to comment.