File tree Expand file tree Collapse file tree 4 files changed +12
-3
lines changed
Expand file tree Collapse file tree 4 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class ExpenseController(
4747 pageable : Pageable
4848 ) = when {
4949 authentication.isAdmin() -> expenseService.findAllByPersonCode(personCode, pageable)
50- else -> expenseService.findAllByPersonCode (authentication.name, pageable)
50+ else -> expenseService.findAllByPersonUserCode (authentication.name, pageable)
5151 }
5252 .toResponse()
5353
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import java.util.UUID
1717@Repository
1818interface ExpenseRepository : PagingAndSortingRepository <Expense , UUID >{
1919 fun findAllByPersonCode (personCode : String , pageable : Pageable ): Page <Expense >
20+ fun findAllByPersonUserCode (personCode : String , pageable : Pageable ): Page <Expense >
2021 fun findAllByStatus (status : Status ):Iterable <Expense >
2122}
2223
Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ class ExpenseService(
3535 fun findAllByPersonCode (personCode : String , pageable : Pageable ): Page <Expense > = expenseRepository
3636 .findAllByPersonCode(personCode, pageable)
3737
38+ fun findAllByPersonUserCode (personCode : String , pageable : Pageable ): Page <Expense > = expenseRepository
39+ .findAllByPersonUserCode(personCode, pageable)
40+
3841 fun findAllByStatus (status : Status ) = expenseRepository.findAllByStatus(status)
3942
4043 @Transactional
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export function MonthFeature() {
5555 . map ( it => ( {
5656 ...it ,
5757 missing : Math . max (
58- it . total - ( it . workDays + it . holiDays + it . sickDays + it . event ) ,
58+ it . total - ( it . workDays + it . holiDayUsed + it . sickDays + it . event ) ,
5959 0
6060 ) ,
6161 } ) )
@@ -74,7 +74,12 @@ export function MonthFeature() {
7474 < Tooltip formatter = { value => new Intl . NumberFormat ( ) . format ( value ) } />
7575 < Legend />
7676 < Bar stackId = "days" dataKey = "workDays" name = "worked hours" fill = "#1de8b5" />
77- < Bar stackId = "days" dataKey = "holiDays" name = "holiday hours" fill = "#42a5f5" />
77+ < Bar
78+ stackId = "days"
79+ dataKey = "holiDayUsed"
80+ name = "holiday hours"
81+ fill = "#42a5f5"
82+ />
7883 < Bar stackId = "days" dataKey = "sickDays" name = "sick hours" fill = "#ef5350" />
7984 < Bar stackId = "days" dataKey = "event" name = "event hours" fill = "#fed766" />
8085 < Bar stackId = "days" dataKey = "missing" name = "missing hours" fill = "#9e9e9e" />
You can’t perform that action at this time.
0 commit comments