'Pick what to do with them.'])); } // The ones the agent can reach - billingRow() is scoped to their clients $rows = []; foreach (array_unique(array_filter(array_map('intval', (array) ($_GET['recurring_invoice_ids'] ?? [])))) as $recurring_invoice_id) { $row = billingRow('recurring', $recurring_invoice_id); if ($row && empty($row['recurring_invoice_archived_at'])) { $rows[$recurring_invoice_id] = $row; } } if (!$rows) { exit(json_encode(['error' => 'Tick the recurring invoices first.'])); } $one = count($rows) === 1 ? reset($rows) : null; $what = $one ? escapeHtml(billingNumber('recurring', $one)) . ' · ' . escapeHtml($one['client_name']) : count($rows) . ' recurring invoices'; $title = ['pause' => 'Pause', 'next_date' => 'Next Date', 'frequency' => 'Billed'][$action]; $icon = ['pause' => 'fa-pause', 'next_date' => 'fa-calendar-alt', 'frequency' => 'fa-sync-alt'][$action]; $pause_ends = recurringPauseReady(); ob_start(); ?>