fix installment for carry over balance parent account
This commit is contained in:
@@ -168,10 +168,11 @@ class StudentModel extends Model
|
||||
->join('emergency_contacts ec', 'ec.parent_id = students.parent_id', 'left');
|
||||
|
||||
if ($useYearScopedIsNew) {
|
||||
$statusJoinType = ($filterByYear || $isNew === 0 || $isNew === 1) ? 'inner' : 'left';
|
||||
$builder->join(
|
||||
'student_year_status sys',
|
||||
'sys.student_id = students.id AND sys.school_year = ' . $this->db->escape($statusYear),
|
||||
'left'
|
||||
$statusJoinType
|
||||
);
|
||||
}
|
||||
|
||||
@@ -182,7 +183,7 @@ class StudentModel extends Model
|
||||
$builder->where('COALESCE(sys.is_new, 1)', $isNew, false);
|
||||
}
|
||||
|
||||
if ($filterByYear) {
|
||||
if ($filterByYear && ! $useYearScopedIsNew) {
|
||||
$builder
|
||||
->join('student_class sc_filter', 'sc_filter.student_id = students.id', 'inner')
|
||||
->where('sc_filter.school_year', $schoolYear);
|
||||
|
||||
Reference in New Issue
Block a user