diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dcbe6a513950e32b1e3c53691a4c9712136806b..18b73b14ffe16a60acf7f0db4a87e1088d338729 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 1.3.2 - 2018-06-20 +### Changed +- Fixed math error in classroom count at total classroom needed expression + ## 1.3.1 - 2018-06-19 ### Changed - Fixed bug with Federal District and missing cities in classroom count diff --git a/src/libs/routes/classroomCount.js b/src/libs/routes/classroomCount.js index 3b519e335642a1a7461024acd540c052a07f3542..e3144507debb9c080a9893304bd50fd05eb68aa0 100644 --- a/src/libs/routes/classroomCount.js +++ b/src/libs/routes/classroomCount.js @@ -391,10 +391,12 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => { educationLevel.enrollment.night_classes = Math.ceil((educationLevel.enrollment.total_enrollment_night / enrollmentEducationLevel.numberStudentClass)); // Total de salas - educationLevel.enrollment.total_classrooms_needed = (educationLevel.enrollment.full_period_classes + educationLevel.enrollment.day_classes); + educationLevel.enrollment.total_classrooms_needed = (educationLevel.enrollment.full_period_classes + educationLevel.enrollment.day_classes/2); if(educationLevel.enrollment.night_classes > educationLevel.enrollment.day_classes) educationLevel.enrollment.total_classrooms_needed += (educationLevel.enrollment.night_classes - educationLevel.enrollment.day_classes); + educationLevel.enrollment.total_classrooms_needed = Math.ceil(educationLevel.enrollment.total_classrooms_needed); + enrollment = enrollments[j]; }