0, 'total_amount' => 0, 'completed_payments' => 0, 'pending_payments' => 0, 'failed_payments' => 0 ], $stats); // Site-wide figures come from the controller (one query each); the page's own // twenty rows used to be added on top of them, which inflated "Completed" and // "Awaiting confirmation" and made "Total amount" the page's sum. $amounts_by_currency = $amounts_by_currency ?? []; if (empty($amounts_by_currency) && !empty($stats['total_amount'])) { $ei_code = strtoupper((string) get_option('easy_invoice_currency_code', 'USD')); $amounts_by_currency[$ei_code] = [ 'amount' => (float) $stats['total_amount'], 'symbol' => \EasyInvoice\Helpers\CurrencyHelper::getCurrencySymbol($ei_code), ]; } // Check for bulk action notifications $notification = false; if (isset($_GET['bulk_trashed']) && $_GET['bulk_trashed'] > 0) { $count = intval($_GET['bulk_trashed']); /* translators: %s: number of items. */ easy_invoice_display_notification('success', sprintf(_n('%s payment moved to trash.', '%s payments moved to trash.', $count, 'easy-invoice'), $count)); $notification = true; } if (isset($_GET['bulk_restored']) && $_GET['bulk_restored'] > 0) { $count = intval($_GET['bulk_restored']); /* translators: %s: number of items. */ easy_invoice_display_notification('success', sprintf(_n('%s payment restored from trash.', '%s payments restored from trash.', $count, 'easy-invoice'), $count)); $notification = true; } if (isset($_GET['bulk_deleted']) && $_GET['bulk_deleted'] > 0) { $count = intval($_GET['bulk_deleted']); /* translators: %s: number of items. */ easy_invoice_display_notification('success', sprintf(_n('%s payment permanently deleted.', '%s payments permanently deleted.', $count, 'easy-invoice'), $count)); $notification = true; } if (isset($_GET['bulk_error'])) { $error = sanitize_text_field($_GET['bulk_error']); $error_message = 'An error occurred while processing the bulk action.'; if ($error === 'no_selection') { $error_message = 'Please select at least one payment to perform this action.'; } elseif ($error === 'invalid_action') { $error_message = 'Please select a valid bulk action.'; } easy_invoice_display_notification('error', $error_message); $notification = true; } ?>

$data): ?>

0): ?>
Showing to of results
1): ?>
Page of add_query_arg('paged', '%#%'), 'format' => '', 'current' => $current_page, 'total' => $total_pages, 'prev_text' => '‹ Previous', 'next_text' => 'Next ›', 'type' => 'array', 'end_size' => 1, 'mid_size' => 2, 'add_args' => array( 'page' => 'easy-invoice-payments', 'view' => $current_view, 'status' => $status_filter ) ); $top_pagination_links = paginate_links($top_pagination_args); if ($top_pagination_links) { echo '
'; foreach ($top_pagination_links as $link) { // Add null check to prevent passing null to easy_invoice_str_replace if ($link === null) { continue; } // Convert WordPress pagination to our styling $link = easy_invoice_str_replace('page-numbers', 'px-3 py-2 text-sm font-medium border border-gray-300 rounded-md', $link); $link = easy_invoice_str_replace('current', 'bg-indigo-50 border-indigo-500 text-indigo-600', $link); $link = easy_invoice_str_replace('prev', 'bg-white text-gray-500 hover:bg-gray-50', $link); $link = easy_invoice_str_replace('next', 'bg-white text-gray-500 hover:bg-gray-50', $link); $link = easy_invoice_str_replace('dots', 'bg-white text-gray-700', $link); // Add default styling for regular page numbers if ($link && strpos($link, 'bg-indigo-50') === false && strpos($link, 'bg-white') === false) { $link = easy_invoice_str_replace('border-gray-300', 'border-gray-300 bg-white text-gray-500 hover:bg-gray-50', $link); } echo wp_kses_post($link); } echo '
'; } ?>
0 payments selected
getInvoiceId(); // Temporarily show all payments regardless of invoice ?> ' . esc_html__('Record your first payment', 'easy-invoice') . ''; ?>
Actions
#getId(); ?> post_type === 'easy_invoice'): $invoice = new \EasyInvoice\Models\Invoice($invoice_id); ?>
getNumber()); ?>
getTitle() ?: __('Untitled Invoice', 'easy-invoice')); ?>

ID: (Type: post_type : 'null'); ?>)
getCurrencySymbol() . number_format((float) $payment->getAmount(), 2)); ?> getPaymentMethod(); $gateway_manager = \EasyInvoice\EasyInvoice::getInstance()->getGatewayManager(); $gateways = $gateway_manager->getGateways(); // Try to get the gateway title from registered gateways $method_label = ucfirst(easy_invoice_str_replace('_', ' ', $payment_method)); // Default fallback foreach ($gateways as $gateway) { if ($gateway->getName() === $payment_method) { $method_label = $gateway_manager->getGatewayDisplayName($gateway->getName()); break; } } // Special case for manual payments if ($payment_method === 'manual') { $method_label = __('Manual', 'easy-invoice'); } echo esc_html($method_label); $ei_reference = (string) get_post_meta((int) $payment->getId(), \EasyInvoice\Services\OfflinePayments::META_REFERENCE, true); if ('' !== $ei_reference) : /* translators: %s: reference the client gave. */ echo '' . esc_html(sprintf(__('Ref: %s', 'easy-invoice'), $ei_reference)) . ''; endif; if (\EasyInvoice\Services\OfflinePayments::hasProof((int) $payment->getId())) : echo '' . esc_html__('View receipt', 'easy-invoice') . ''; endif; ?> getStatus(); $status_class = ''; $status_text = ''; switch ($status) { case 'completed': $status_class = 'bg-green-100 text-green-800'; $status_text = __('Completed', 'easy-invoice'); break; case 'pending': case 'pending-bank': case 'pending-cheque': case 'pending_verification': $status_class = 'bg-yellow-100 text-yellow-800'; $status_text = __('Awaiting confirmation', 'easy-invoice'); break; case 'rejected': $status_class = 'bg-gray-200 text-gray-700'; $status_text = __('Rejected', 'easy-invoice'); break; case 'failed': $status_class = 'bg-red-100 text-red-800'; $status_text = __('Failed', 'easy-invoice'); break; default: $status_class = 'bg-gray-100 text-gray-800'; $status_text = ucfirst($status); } ?> getPaymentDate() ? gmdate('M j, Y', strtotime($payment->getPaymentDate())) : gmdate('M j, Y', strtotime((string) get_post_field('post_date', $payment->getId())) ?: time())); ?>
0): ?>
Showing to of results
1): ?>
Page of add_query_arg('paged', '%#%'), 'format' => '', 'current' => $current_page, 'total' => $total_pages, 'prev_text' => '‹ Previous', 'next_text' => 'Next ›', 'type' => 'array', 'end_size' => 1, 'mid_size' => 2, 'add_args' => array( 'page' => 'easy-invoice-payments', 'view' => $current_view, 'status' => $status_filter ) ); $bottom_pagination_links = paginate_links($bottom_pagination_args); if ($bottom_pagination_links) { echo '
'; foreach ($bottom_pagination_links as $link) { // Add null check to prevent passing null to easy_invoice_str_replace if ($link === null) { continue; } // Convert WordPress pagination to our styling $link = easy_invoice_str_replace('page-numbers', 'px-3 py-2 text-sm font-medium border border-gray-300 rounded-md', $link); $link = easy_invoice_str_replace('current', 'bg-indigo-50 border-indigo-500 text-indigo-600', $link); $link = easy_invoice_str_replace('prev', 'bg-white text-gray-500 hover:bg-gray-50', $link); $link = easy_invoice_str_replace('next', 'bg-white text-gray-500 hover:bg-gray-50', $link); $link = easy_invoice_str_replace('dots', 'bg-white text-gray-700', $link); // Add default styling for regular page numbers if ($link && strpos($link, 'bg-indigo-50') === false && strpos($link, 'bg-white') === false) { $link = easy_invoice_str_replace('border-gray-300', 'border-gray-300 bg-white text-gray-500 hover:bg-gray-50', $link); } echo wp_kses_post($link); } echo '
'; } ?>