Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
actual-vt-capstone
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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
danieljk
actual-vt-capstone
Commits
c1b99958
Unverified
Commit
c1b99958
authored
1 year ago
by
youngcw
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Goals: Add option to percent goal to use available funds (#1254)
parent
050f48ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/loot-core/src/server/budget/goaltemplates.ts
+8
-3
8 additions, 3 deletions
packages/loot-core/src/server/budget/goaltemplates.ts
upcoming-release-notes/1254.md
+6
-0
6 additions, 0 deletions
upcoming-release-notes/1254.md
with
14 additions
and
3 deletions
packages/loot-core/src/server/budget/goaltemplates.ts
+
8
−
3
View file @
c1b99958
...
@@ -90,13 +90,14 @@ async function processTemplate(month, force) {
...
@@ -90,13 +90,14 @@ async function processTemplate(month, force) {
// so the remainders don't get skiped
// so the remainders don't get skiped
if
(
remainder_found
)
lowestPriority
=
remainder_priority
;
if
(
remainder_found
)
lowestPriority
=
remainder_priority
;
let
sheetName
=
monthUtils
.
sheetForMonth
(
month
);
let
available_start
=
await
getSheetValue
(
sheetName
,
`to-budget`
);
for
(
let
priority
=
0
;
priority
<=
lowestPriority
;
priority
++
)
{
for
(
let
priority
=
0
;
priority
<=
lowestPriority
;
priority
++
)
{
// setup scaling for remainder
// setup scaling for remainder
let
remainder_scale
=
1
;
let
remainder_scale
=
1
;
if
(
priority
===
lowestPriority
)
{
if
(
priority
===
lowestPriority
)
{
let
sheetName
=
monthUtils
.
sheetForMonth
(
month
);
let
available_now
=
await
getSheetValue
(
sheetName
,
`to-budget`
);
let
budgetAvailable
=
await
getSheetValue
(
sheetName
,
`to-budget`
);
remainder_scale
=
Math
.
round
(
available_now
/
remainder_weight_total
);
remainder_scale
=
Math
.
round
(
budgetAvailable
/
remainder_weight_total
);
}
}
for
(
let
c
=
0
;
c
<
categories
.
length
;
c
++
)
{
for
(
let
c
=
0
;
c
<
categories
.
length
;
c
++
)
{
...
@@ -150,6 +151,7 @@ async function processTemplate(month, force) {
...
@@ -150,6 +151,7 @@ async function processTemplate(month, force) {
month
,
month
,
priority
,
priority
,
remainder_scale
,
remainder_scale
,
available_start
,
force
,
force
,
);
);
if
(
to_budget
!=
null
)
{
if
(
to_budget
!=
null
)
{
...
@@ -252,6 +254,7 @@ async function applyCategoryTemplate(
...
@@ -252,6 +254,7 @@ async function applyCategoryTemplate(
month
,
month
,
priority
,
priority
,
remainder_scale
,
remainder_scale
,
available_start
,
force
,
force
,
)
{
)
{
let
current_month
=
`
${
month
}
-01`
;
let
current_month
=
`
${
month
}
-01`
;
...
@@ -493,6 +496,8 @@ async function applyCategoryTemplate(
...
@@ -493,6 +496,8 @@ async function applyCategoryTemplate(
let
monthlyIncome
=
0
;
let
monthlyIncome
=
0
;
if
(
template
.
category
.
toLowerCase
()
===
'
all income
'
)
{
if
(
template
.
category
.
toLowerCase
()
===
'
all income
'
)
{
monthlyIncome
=
await
getSheetValue
(
sheetName
,
`total-income`
);
monthlyIncome
=
await
getSheetValue
(
sheetName
,
`total-income`
);
}
else
if
(
template
.
category
.
toLowerCase
()
===
'
available funds
'
)
{
monthlyIncome
=
available_start
;
}
else
{
}
else
{
let
income_category
=
(
await
db
.
getCategories
()).
find
(
let
income_category
=
(
await
db
.
getCategories
()).
find
(
c
=>
c
=>
...
...
This diff is collapsed.
Click to expand it.
upcoming-release-notes/1254.md
0 → 100644
+
6
−
0
View file @
c1b99958
---
category
:
Enhancements
authors
:
[
youngcw
]
---
Goals: Add 'available funds' option to the percentage goal
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