aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorSan Jacobs2022-08-07 21:08:27 +0200
committerSan Jacobs2022-08-07 21:23:25 +0200
commit8ee3309484ae12ec1abb72b097499c79656da657 (patch)
tree15f3e3a28f26afd418ae028f1a01c163c7eae19f /src/main.cpp
parent05984f9d790c8218ed2cc7758e272e70c35e9c31 (diff)
downloadsatscalc-8ee3309484ae12ec1abb72b097499c79656da657.tar.gz
satscalc-8ee3309484ae12ec1abb72b097499c79656da657.tar.bz2
satscalc-8ee3309484ae12ec1abb72b097499c79656da657.zip
Added reasons to overtime rates, implemented §6.12
Diffstat (limited to 'src/main.cpp')
-rwxr-xr-xsrc/main.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ac5c7e0..f02a046 100755
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -205,9 +205,36 @@ done:
for(int jj=0; jj < each_day.total_timeblocks; jj++) {
timeblock& each_block = each_day.blocks[jj];
double block_price = each_block.hourcount() * hourly_rate * each_block.valuefactor;
- std::cout << timeprint(each_block, true) << ", " << each_block.hourcount() << "h\t+" << (each_block.valuefactor-1)*100 << "%\t= " << block_price << "\n";
+
+ std::cout << timeprint(each_block, true) << ", "
+ << each_block.hourcount() << "h\t+"
+ << (each_block.valuefactor-1)*100 << "%\t= "
+ << block_price;
+ //if(each_block.price_reason != "Norm") {
+ std::cout << " \t[" << each_block.price_reason << "]";
+ //}
+ std::cout << "\n";
+
day_price += block_price;
}
+
+ double day_length = (timeblock){each_day.call, each_day.wrap}.hourcount();
+
+ if((each_day.call.hours < 6 || each_day.call.hours >= 22) &&
+ (each_day.wrap.hours < 6 || each_day.wrap.hours >= 22) &&
+ day_length < 9)
+ {
+ std::cout << "Day set entirely between 22:00 and 06:00.\nPrice is dayrate plus 100% for hours worked. [§6.12B]\n";
+ day_price = dayrate + (day_length * hourly_rate);
+
+ } else if((each_day.call.hours < 6 || each_day.call.hours >= 10) &&
+ (each_day.wrap.hours >= 22 || each_day.wrap.hours <= 10)){
+ if(day_price < dayrate){
+ day_price = dayrate;
+
+ std::cout << "Offset day at least partially set between 22:00 and 06:00.\nMinimum price is full dayrate. [§6.12A]\n";
+ }
+ }
std::cout << "Price of day " << ii+1 << ": " << day_price << std::endl;
total_sum += day_price;
}