diff --git a/src/Schedule.hs b/src/Schedule.hs index 84d6879..9a64ebc 100644 --- a/src/Schedule.hs +++ b/src/Schedule.hs @@ -56,7 +56,7 @@ scheduleByMedicine pharmacy day medicineName stockLeft rate = where (Medicine {minStock, content}) = pharmacy ! medicineName truncateF = fromInteger . truncate - leftInBox = content - (truncateF (content / stockLeft) * stockLeft) + leftInBox = stockLeft - (truncateF (stockLeft / content) * content) typeAndAmount :: Float -> Float -> Float -> (ScheduleType, Float) typeAndAmount stockLeft minStock leftInBox =