fix logic and tests, update docker CI file
This commit is contained in:
@@ -97,7 +97,7 @@ class FinancialSummaryService
|
||||
$query = DB::table('additional_charges as ac')
|
||||
->selectRaw('COALESCE(SUM(ac.amount), 0) AS amount')
|
||||
->where('ac.school_year', $schoolYear)
|
||||
->where('ac.status !=', 'void');
|
||||
->where('ac.status', '!=', 'void');
|
||||
|
||||
if (!empty($dateFrom)) {
|
||||
$query->whereRaw('DATE(ac.due_date) >= ?', [$dateFrom]);
|
||||
@@ -115,11 +115,11 @@ class FinancialSummaryService
|
||||
$query = DB::table('additional_charges as ac')
|
||||
->selectRaw('ac.parent_id, COALESCE(SUM(ac.amount), 0) AS amount')
|
||||
->where('ac.school_year', $schoolYear)
|
||||
->where('ac.status !=', 'void')
|
||||
->where('ac.status', '!=', 'void')
|
||||
->where(function ($q) {
|
||||
$q->whereNull('ac.invoice_id')
|
||||
->orWhere('ac.invoice_id', 0)
|
||||
->orWhere('ac.status !=', 'applied');
|
||||
->orWhere('ac.status', '!=', 'applied');
|
||||
})
|
||||
->groupBy('ac.parent_id');
|
||||
|
||||
|
||||
@@ -96,17 +96,14 @@ class FinancialUnpaidParentsService
|
||||
}
|
||||
|
||||
$extraRows = DB::table('additional_charges as ac')
|
||||
->selectRaw(
|
||||
"ac.parent_id, u.firstname, u.lastname, u.email, COALESCE(SUM(ac.amount), 0) AS total_extra",
|
||||
false
|
||||
)
|
||||
->selectRaw("ac.parent_id, u.firstname, u.lastname, u.email, COALESCE(SUM(ac.amount), 0) AS total_extra")
|
||||
->leftJoin('users as u', 'u.id', '=', 'ac.parent_id')
|
||||
->where('ac.school_year', $schoolYear)
|
||||
->where('ac.status !=', 'void')
|
||||
->where('ac.status', '!=', 'void')
|
||||
->where(function ($q) {
|
||||
$q->whereNull('ac.invoice_id')
|
||||
->orWhere('ac.invoice_id', 0)
|
||||
->orWhere('ac.status !=', 'applied');
|
||||
->orWhere('ac.status', '!=', 'applied');
|
||||
})
|
||||
->groupBy('ac.parent_id')
|
||||
->get()
|
||||
|
||||
Reference in New Issue
Block a user