diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-08-17 11:41:48 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-08-17 11:41:48 +0200 |
| commit | 3d25fdc99fd37f3b5e37f25b7a38804a02130426 (patch) | |
| tree | 8cd4eb086492dfacdcd288dba0f1f025f3f66daa /lib/shift.dart | |
| parent | 9649d80a2b0a0c46a8ae68606d3e0cfe6f49faee (diff) | |
money calculation working
Diffstat (limited to 'lib/shift.dart')
| -rw-r--r-- | lib/shift.dart | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/shift.dart b/lib/shift.dart index fd32cf7..eecf4cc 100644 --- a/lib/shift.dart +++ b/lib/shift.dart @@ -45,7 +45,7 @@ class Shift { case ShiftStatus.Active: return Padding( child: CircularProgressIndicator( - strokeWidth: 1, + strokeWidth: 2, color: Colors.white, ), padding: @@ -111,6 +111,18 @@ class Shift { !DateUtilities.DateUtils.isSameDay(start, DateTime.now()); } + double getEarnedMoney() { + DateTime? endToCalculate = end; + endToCalculate ??= expectedEndTime(); + + if (start.weekday == 6) { + return endToCalculate.difference(start).inMinutes * + getMinutePayRate() * + 1.35; + } + return endToCalculate.difference(start).inMinutes * getMinutePayRate(); + } + double getMoneyForActiveSession() { if (getIsActive()) { Duration elapsed = DateTime.now().difference(start); |
