= 2; $can_delete = lookupUserPermission('module_sales') >= 3; $csrf = $_SESSION['csrf_token']; // What it costs us - the recurring expenses it covers (functions/expenses.php) $can_see_costs = lookupUserPermission('module_financial') >= 1; $can_add_costs = lookupUserPermission('module_financial') >= 2; $costs = $can_see_costs ? recurringInvoiceCosts($recurring_invoice_id) : null; // Cards on file the client could be charged on $saved_methods = []; $sql = mysqli_query($mysqli, "SELECT saved_payment_id, saved_payment_description, payment_provider_name, payment_provider_active FROM client_saved_payment_methods LEFT JOIN payment_providers ON payment_provider_id = saved_payment_provider_id WHERE saved_payment_client_id = $client_id ORDER BY saved_payment_description ASC"); while ($row = mysqli_fetch_assoc($sql)) { $saved_methods[intval($row['saved_payment_id'])] = $row; } $autopay_id = intval($recurring['recurring_payment_saved_payment_id'] ?? 0); // Override Tab Title // No Sanitizing needed as this var will only be used in the tab title $tab_title = $recurring['client_name']; $page_title = $number; $paper = [ 'type' => 'recurring', 'row' => $recurring, 'items' => $items, 'totals' => $totals, 'edit' => $can_edit, 'notes_edit' => $can_edit, 'taxes' => $can_edit ? billingTaxes($recurring['recurring_invoice_created_at']) : [], 'logo_url' => billingCompany()['logo_url'], 'csrf' => $csrf, ]; ?>