aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Jacobs2021-10-25 22:35:43 +0200
committerSan Jacobs2021-10-25 22:35:43 +0200
commit48714ca13fe61b0dc56458840bb73eca4f689386 (patch)
tree7ac2e60e1324e5e3ab3ec4c09a53585e7b77c633
parentc5c15bcd1086090a25d51ca96295220fbe1ac9d2 (diff)
downloadsatscalc-48714ca13fe61b0dc56458840bb73eca4f689386.tar.gz
satscalc-48714ca13fe61b0dc56458840bb73eca4f689386.tar.bz2
satscalc-48714ca13fe61b0dc56458840bb73eca4f689386.zip
Considering adding date to the input prompt
-rwxr-xr-xsatscalc.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/satscalc.py b/satscalc.py
index f118fbe..2e71d3f 100755
--- a/satscalc.py
+++ b/satscalc.py
@@ -1,6 +1,12 @@
#!/usr/bin/env python3
import datetime
+# NOTE: Maybe the whole thing should be re-thought to actually prompt for date.
+# That way you can easily fill in a calendar of sorts, which is much easier to loop through and calculate what hours were overtime etc.
+# This can probably be done with some smarts, which assume that if you start at 08:00, 07:00 doesn't mean the same day.
+# Meaning you only need to prompt for the date of the call time, not the date of the wrap time.
+# This will also automatically let you know if it was a weekend and stuff like that.
+
# TODO: Prompt user for base rate, call time, wrap time, whether overtime was warned, and if it was a weekend.
# This should be enough to calculate the pay for a single day's work.
@@ -48,9 +54,24 @@ while True:
weekend = "y" in input("Was this a weekend? [y/n]: ").lower()
- if hours_worked > 8:
+ overtime = hours_worked > 8
+ if overtime:
+ overtime_hours = hours_worked-8
print("Overtime detected.")
warned_overtime = "y" in input("Was this overtime warned about before 12 o'clock the day before? [y/n]: ").lower()
+
+# --- Price calculation ---
+
+# Notes:
+# First two hours of warned overtime are 50%, unwarned is 100%
+# Any work after 20:00 is overtime
+#
+
+# Extremely naive calculation
+sum = 0
+if overtime:
+ sum += overtime_hours*(hourly_rate*1.5)
+
print("\nDifference:", difference)
print("Hours worked:", hours_worked)