Fix: GetDurationFromCost() -> set inputDate if next valid working time-range
in on another day and break the loop iterating through next days.
This commit is contained in:
		@@ -320,12 +320,11 @@ std::string Calculator::GetDurationFromCost(Configuration* cfg,
 | 
				
			|||||||
                                                    }
 | 
					                                                    }
 | 
				
			||||||
                                                }
 | 
					                                                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                            }
 | 
					                                                QDateTime upper = inputDate.addDays(days);
 | 
				
			||||||
                                            QDateTime upper = inputDate.addDays(days);
 | 
					                                                upper.setTime(next_working_time_from);
 | 
				
			||||||
                                            upper.setTime(next_working_time_from);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                            QDateTime lower = inputDate;
 | 
					                                                QDateTime lower = inputDate;
 | 
				
			||||||
                                            lower.setTime(current_working_time_to);
 | 
					                                                lower.setTime(current_working_time_to);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                                inputDate = inputDate.addSecs(lower.secsTo(upper) + durationInSecs);
 | 
					                                                inputDate = inputDate.addSecs(lower.secsTo(upper) + durationInSecs);
 | 
				
			||||||
#if DEBUG_GET_DURATION_FROM_COST==1
 | 
					#if DEBUG_GET_DURATION_FROM_COST==1
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user