Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BudgetMaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Robert Goldmann
BudgetMaster
Commits
156dab34
Commit
156dab34
authored
2 years ago
by
Robert Goldmann
Browse files
Options
Downloads
Patches
Plain Diff
#722 - cleanup: selecting the first transactions if repeating is no longer necessary since #703
parent
0b97a73e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/transactions/TransactionController.java
+4
-10
4 additions, 10 deletions
...ker8/budgetmaster/transactions/TransactionController.java
with
4 additions
and
10 deletions
BudgetMasterServer/src/main/java/de/deadlocker8/budgetmaster/transactions/TransactionController.java
+
4
−
10
View file @
156dab34
...
...
@@ -372,23 +372,17 @@ public class TransactionController extends BaseController
@GetMapping
(
"/{ID}/newFromExisting"
)
public
String
newFromExisting
(
Model
model
,
@PathVariable
(
"ID"
)
Integer
ID
,
@CookieValue
(
"currentDate"
)
String
cookieDate
)
{
Optional
<
Transaction
>
transactionOptional
=
transactionService
.
getRepository
().
findById
(
ID
);
final
Optional
<
Transaction
>
transactionOptional
=
transactionService
.
getRepository
().
findById
(
ID
);
if
(
transactionOptional
.
isEmpty
())
{
throw
new
ResourceNotFoundException
();
}
Transaction
existingTransaction
=
transactionOptional
.
get
();
final
Transaction
existingTransaction
=
transactionOptional
.
get
();
// select first transaction in order to provide correct start date for repeating transactions
if
(
existingTransaction
.
getRepeatingOption
()
!=
null
)
{
existingTransaction
=
existingTransaction
.
getRepeatingOption
().
getReferringTransactions
().
get
(
0
);
}
LocalDate
date
=
dateService
.
getDateTimeFromCookie
(
cookieDate
);
final
LocalDate
date
=
dateService
.
getDateTimeFromCookie
(
cookieDate
);
Transaction
newTransaction
=
new
Transaction
(
existingTransaction
);
final
Transaction
newTransaction
=
new
Transaction
(
existingTransaction
);
newTransaction
.
setID
(
null
);
newTransaction
.
setDate
(
null
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment