Invoices > Paid online), when * card payments are on. The button opens a page that needs no sign-in: the client agrees, adds a card through * Stripe, and each invoice from then on is charged on its due date. * recurring_invoices.recurring_invoice_offer_autopay - the same for one recurring invoice (1), turned off on its * page for a client who pays another way. * * Both start on. Re-runnable: each column is made only where it isn't there. */ defined('FROM_DB_UPDATER') || die("Direct file access is not allowed"); $itflow_offer_columns = [ 'settings' => ['config_invoice_offer_autopay', 'config_invoice_paid_lead_to_client'], 'recurring_invoices' => ['recurring_invoice_offer_autopay', 'recurring_invoice_email_notify'], ]; foreach ($itflow_offer_columns as $itflow_table => [$itflow_column, $itflow_after]) { $itflow_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '$itflow_table' AND COLUMN_NAME = '$itflow_column' LIMIT 1"); if (!$itflow_exists || mysqli_num_rows($itflow_exists) === 0) { $itflow_after_exists = mysqli_query($mysqli, "SELECT 1 FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '$itflow_table' AND COLUMN_NAME = '$itflow_after' LIMIT 1"); $itflow_place = $itflow_after_exists && mysqli_num_rows($itflow_after_exists) > 0 ? " AFTER `$itflow_after`" : ''; mysqli_query($mysqli, "ALTER TABLE `$itflow_table` ADD `$itflow_column` tinyint(1) NOT NULL DEFAULT 1$itflow_place"); } }