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; } ?>
|
|
|
|
|
|
|
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())); ?> | |||