Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Luc Didry
kresus
Commits
cc114ce5
Commit
cc114ce5
authored
Jun 01, 2021
by
Benjamin Bouvier
Committed by
Nicolas Frandeboeuf
Jun 02, 2021
Browse files
Fixes #1110: use the budget date when filtering transactions in in-out-charts
parent
7e6d0bce
Pipeline
#420049
passed with stage
in 3 minutes and 59 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/components/charts/in-out-chart.tsx
View file @
cc114ce5
...
...
@@ -238,13 +238,13 @@ interface InitialProps {
// `initialCurrency` is either set to ALL_CURRENCIES or the first currency seen
// in transactions, or it is undefined if there were no transactions.
function
useInOutExtraProps
(
props
:
InitialProps
)
{
let
dateFilter
:
(
transaction
:
Operation
)
=>
boolean
;
let
dateFilter
:
(
date
:
Date
)
=>
boolean
;
if
(
props
.
fromDate
&&
props
.
toDate
)
{
dateFilter
=
t
=>
t
.
date
>=
(
props
as
any
).
fromDate
&&
t
.
date
<=
(
props
as
any
).
toDate
;
dateFilter
=
d
=>
d
>=
(
props
as
any
).
fromDate
&&
d
<=
(
props
as
any
).
toDate
;
}
else
if
(
props
.
fromDate
)
{
dateFilter
=
t
=>
t
.
date
>=
(
props
as
any
).
fromDate
;
dateFilter
=
d
=>
d
>=
(
props
as
any
).
fromDate
;
}
else
if
(
props
.
toDate
)
{
dateFilter
=
t
=>
t
.
date
<=
(
props
as
any
).
toDate
;
dateFilter
=
d
=>
d
<=
(
props
as
any
).
toDate
;
}
else
{
dateFilter
=
()
=>
true
;
}
...
...
@@ -265,7 +265,7 @@ function useInOutExtraProps(props: InitialProps) {
}
const
transactions
=
get
.
operationsByAccountId
(
state
,
accId
)
.
filter
(
t
=>
t
.
type
!==
INTERNAL_TRANSFER_TYPE
.
name
&&
dateFilter
(
t
));
.
filter
(
t
=>
t
.
type
!==
INTERNAL_TRANSFER_TYPE
.
name
&&
dateFilter
(
t
.
budgetDate
));
const
entry
=
ret
.
get
(
currency
);
assert
(
typeof
entry
!==
'
undefined
'
,
'
just created
'
);
entry
.
push
(...
transactions
);
...
...
client/components/dashboard/access.tsx
View file @
cc114ce5
...
...
@@ -31,7 +31,7 @@ const Access = (props: { accessId: number }) => {
const
toDate
=
new
Date
();
toDate
.
setMonth
(
toDate
.
getMonth
()
+
1
);
toDate
.
setDate
(
-
1
);
from
Date
.
setHours
(
23
,
59
,
59
,
999
);
to
Date
.
setHours
(
23
,
59
,
59
,
999
);
return
(
<
li
className
=
"dashboard-access"
>
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment