Payment Methods - how money comes in and goes out: Cash, Check, * ACH, the company card. Each row says what it is for (money in, money out * or both - the pickers offer only the ones that fit), what it has been used * on and when last, and whether it is the default for payments or expenses. * Methods that records were paid by but that aren't in the list - from an * import or an older version - are offered for adding. Archived ones leave * the pickers and keep their records. The work is in * functions/payment_method.php; the handlers are admin/post/payment_method.php. */ // Default Column Sortby Filter $sort = "payment_method_name"; $order = "ASC"; require_once "includes/inc_all_admin.php"; $views = [ '' => ['label' => 'In use', 'icon' => 'fa-credit-card', 'title' => 'Offered in the pickers'], 'archived' => ['label' => 'Archived', 'icon' => 'fa-archive', 'title' => 'Kept for the records that used them, but not offered'], ]; $show = (string) ($_GET['show'] ?? ''); $show = isset($views[$show]) ? $show : ''; // Every method that matches, then sorted and paged here - their use is counted across several tables $search = mb_strtolower(trim(stripslashes((string) ($q ?? '')))); $usage = paymentMethodUsage(); $defaults = paymentMethodDefaults(); $rows = []; $view_counts = ['' => 0, 'archived' => 0]; foreach (paymentMethodsAll() as $id => $row) { if ($search !== '' && mb_strpos(mb_strtolower($row['payment_method_name'] . ' ' . $row['payment_method_description']), $search) === false) { continue; } $view = empty($row['payment_method_archived_at']) ? '' : 'archived'; $view_counts[$view]++; if ($view !== $show) { continue; } $row['usage'] = paymentMethodUsageFor($row['payment_method_name']); $rows[] = $row; } $sortable_columns = [ 'payment_method_name' => function ($row) { return mb_strtolower($row['payment_method_name']); }, 'payment_method_use' => function ($row) { return intval($row['payment_method_use']) . mb_strtolower($row['payment_method_name']); }, 'used' => function ($row) { return $row['usage']['total']; }, 'last_used' => function ($row) { return (string) $row['usage']['last']; }, ]; if (!isset($sortable_columns[$sort])) { $sort = 'payment_method_name'; } $key = $sortable_columns[$sort]; usort($rows, function ($a, $b) use ($key, $order) { $cmp = $key($a) <=> $key($b); if ($cmp === 0) { $cmp = strcasecmp($a['payment_method_name'], $b['payment_method_name']); } return $order === 'DESC' ? -$cmp : $cmp; }); $num_rows = [count($rows)]; $rows = array_slice($rows, $record_from, $record_to); $missing = $show === '' && $search === '' ? paymentMethodsNotSetUp() : []; $sort_link = function ($column, $label) use ($url_query_strings_sort, $sort, $disp, $order_icon) { return '' . $label . ($sort === $column ? " $order_icon" : '') . ''; }; $pill_url = function ($view) { return '?' . http_build_query(array_filter(['q' => $_GET['q'] ?? '', 'show' => $view])); }; $csrf = $_SESSION['csrf_token']; ?>

Payment Methods

Used, but not in the list: ' . escapeHtml($name) . ' (' . number_format($missing_usage['total']) . ')'; }, array_keys($missing), $missing)) ?>
Records say they were paid this way - from an import or an older version - but offered in the pickers. Add to pick , and to merge or rename here.
"> $row['payment_method_name']]); $edit_url = "modals/payment_method/payment_method_edit.php?id=$payment_method_id"; $use_html = '' . escapeHtml($use_info['short']) . ''; $used_html = $used['total'] ? '' . escapeHtml($used_text) . '' : 'Not used yet'; ?>
Default for Online payments
Archived
'payment methods', 'icon' => 'fa-credit-card', 'filtered' => $q !== '', 'archived' => $show === 'archived', 'views' => ['show'], 'text' => 'How clients pay you and how you pay for things - Check, ACH, Cash, the company card.', 'actions' => [['label' => 'New Method', 'modal' => 'modals/payment_method/payment_method_add.php']], ]; require_once "../includes/filter_footer.php"; ?>