fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -8,7 +8,9 @@ use Illuminate\Support\Facades\DB;
class InvoicePaymentService
{
public function __construct(private InvoiceConfigService $config) {}
public function __construct(private InvoiceConfigService $config)
{
}
public function getParentInvoiceSummary(int $parentId, ?string $schoolYear): array
{
@@ -24,9 +26,9 @@ class InvoicePaymentService
->all();
$selectedYear = $schoolYear ?: null;
if (! $selectedYear) {
if (!$selectedYear) {
$hasCurrentYear = in_array($currentSchoolYear, array_column($schoolYears, 'school_year'), true);
$selectedYear = $hasCurrentYear ? $currentSchoolYear : (! empty($schoolYears) ? $schoolYears[0]['school_year'] : null);
$selectedYear = $hasCurrentYear ? $currentSchoolYear : (!empty($schoolYears) ? $schoolYears[0]['school_year'] : null);
}
$invoices = [];
@@ -36,7 +38,7 @@ class InvoicePaymentService
$invoiceIds = array_column($invoices, 'id');
$refunds = [];
if (! empty($invoiceIds)) {
if (!empty($invoiceIds)) {
$refundResults = DB::table('refunds')
->selectRaw('invoice_id, COALESCE(SUM(refund_paid_amount),0) as refund_paid_amount')
->whereIn('invoice_id', $invoiceIds)
@@ -52,7 +54,7 @@ class InvoicePaymentService
}
$lastPayments = [];
if (! empty($invoiceIds)) {
if (!empty($invoiceIds)) {
$paymentResults = Payment::getPaymentsByInvoice($invoiceIds);
foreach ($paymentResults as $payment) {
$lastPayments[$payment['invoice_id']] = [