# easy-invoice/2.4.0/templates/admin/statement-page.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.4.0. 149 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.4.0/code/templates/admin/statement-page.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.4.0/raw/templates/admin/statement-page.php
- Modified: 2026-09-15T12:31:20+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/easy-invoice/2.4.0/code/templates/admin/statement-page.php#L10-L20`.

```php
<?php
/**
 * Statement of account for one client.
 *
 * Receives from StatementController::maybeRenderPage():
 *   $client (WP_User), $client_id, $statement, $from, $to
 *
 * @package Easy_Invoice
 */

use EasyInvoice\Controllers\StatementController;

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

$clients_url = admin_url( 'admin.php?page=easy-invoice-clients' );
$name        = $client->display_name ?: $client->user_login;
$ei_rec  = \EasyInvoice\Providers\ClientServiceProvider::getClientRepository()->find( (int) $client_id );
if ( $ei_rec ) {
    $ei_person = trim( (string) $ei_rec->getFirstName() . ' ' . (string) $ei_rec->getLastName() );
    $name      = (string) $ei_rec->getBusinessClientName() ?: ( $ei_person ?: $name );
}
$ei_sym  = \EasyInvoice\Helpers\CurrencyHelper::getCurrencySymbol( (string) get_option( 'easy_invoice_currency_code', 'USD' ) );
$owes        = $statement['balance'] > 0.001;
?>

<div class="p-8">

    <div class="ei-app-page-header bg-white border-b border-gray-200 px-6 easy-invoice-admin-page-header">
        <div class="flex items-center justify-between flex-wrap gap-4">
            <div>
                <h1 class="text-2xl font-bold text-gray-900">
                    <?php
                    printf(
                        /* translators: %s: client name. */
                        esc_html__( 'Statement — %s', 'easy-invoice' ),
                        esc_html( $name )
                    );
                    ?>
                </h1>
                <p class="mt-1 text-sm text-gray-500">
                    <?php esc_html_e( 'Every invoice, payment and credit note that moved this balance, in date order.', 'easy-invoice' ); ?>
                </p>
            </div>
            <div class="flex items-center gap-3">
                <a href="<?php echo esc_url( StatementController::pdfUrl( (int) $client_id, $from, $to ) ); ?>"
                   class="inline-flex items-center px-3 py-1.5 text-sm font-medium rounded-md bg-indigo-600 text-white hover:bg-indigo-700">
                    <?php esc_html_e( 'Download PDF', 'easy-invoice' ); ?>
                </a>
                <a href="<?php echo esc_url( $clients_url ); ?>" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">
                    <?php esc_html_e( 'Back to clients', 'easy-invoice' ); ?>
                </a>
            </div>
        </div>
    </div>

    <form method="get" class="mt-6 bg-white rounded-lg border border-gray-200 p-4 flex flex-wrap items-end gap-4">
        <input type="hidden" name="page" value="<?php echo esc_attr( StatementController::PAGE_SLUG ); ?>">
        <input type="hidden" name="client_id" value="<?php echo esc_attr( (string) $client_id ); ?>">
        <div>
            <label for="ei-st-from" class="block text-xs font-semibold uppercase tracking-wide text-gray-500"><?php esc_html_e( 'From', 'easy-invoice' ); ?></label>
            <input type="date" id="ei-st-from" name="from" value="<?php echo esc_attr( $from ); ?>" class="mt-1 rounded-md border-gray-300 shadow-sm text-sm">
        </div>
        <div>
            <label for="ei-st-to" class="block text-xs font-semibold uppercase tracking-wide text-gray-500"><?php esc_html_e( 'To', 'easy-invoice' ); ?></label>
            <input type="date" id="ei-st-to" name="to" value="<?php echo esc_attr( $to ); ?>" class="mt-1 rounded-md border-gray-300 shadow-sm text-sm">
        </div>
        <button type="submit" class="px-3 py-1.5 text-sm font-medium rounded-md border border-gray-300 bg-white hover:bg-gray-50">
            <?php esc_html_e( 'Apply', 'easy-invoice' ); ?>
        </button>
        <p class="text-xs text-gray-500 basis-full sm:basis-auto">
            <?php esc_html_e( 'Leave both empty for the whole relationship.', 'easy-invoice' ); ?>
        </p>
    </form>

    <div class="mt-6 grid grid-cols-2 lg:grid-cols-4 gap-4">
        <?php
        $tiles = [
            [ __( 'Invoiced', 'easy-invoice' ), $statement['invoiced'], 'text-gray-900' ],
            [ __( 'Paid', 'easy-invoice' ), $statement['paid'], 'text-green-700' ],
            [ __( 'Credited', 'easy-invoice' ), $statement['credited'], 'text-gray-900' ],
            [ __( 'Balance due', 'easy-invoice' ), $statement['balance'], $owes ? 'text-red-700' : 'text-green-700' ],
        ];
        foreach ( $tiles as $tile ) :
            ?>
            <div class="bg-white rounded-lg border border-gray-200 p-4">
                <div class="text-xs font-semibold uppercase tracking-wide text-gray-500"><?php echo esc_html( $tile[0] ); ?></div>
                <div class="mt-1 text-xl font-bold <?php echo esc_attr( $tile[2] ); ?>" style="font-variant-numeric: tabular-nums;">
                    <?php echo esc_html( easy_invoice_format_money( (float) $tile[1] ) ); ?>
                </div>
            </div>
        <?php endforeach; ?>
    </div>

    <div class="mt-6 bg-white rounded-lg border border-gray-200 p-6">
        <?php if ( empty( $statement['rows'] ) ) : ?>
            <p class="text-sm text-gray-600"><?php esc_html_e( 'Nothing on this account in that period.', 'easy-invoice' ); ?></p>
        <?php else : ?>
            <div class="overflow-x-auto">
                <table class="min-w-full divide-y divide-gray-200 text-sm">
                    <thead>
                        <tr class="text-left text-xs uppercase tracking-wide text-gray-500">
                            <th class="py-2 pr-4 font-semibold"><?php esc_html_e( 'Date', 'easy-invoice' ); ?></th>
                            <th class="py-2 px-4 font-semibold"><?php esc_html_e( 'Document', 'easy-invoice' ); ?></th>
                            <th class="py-2 px-4 font-semibold text-right"><?php esc_html_e( 'Charge', 'easy-invoice' ); ?></th>
                            <th class="py-2 px-4 font-semibold text-right"><?php esc_html_e( 'Credit', 'easy-invoice' ); ?></th>
                            <th class="py-2 pl-4 font-semibold text-right"><?php esc_html_e( 'Balance', 'easy-invoice' ); ?></th>
                        </tr>
                    </thead>
                    <tbody class="divide-y divide-gray-100">
                        <?php if ( abs( (float) $statement['opening'] ) > 0.001 ) : ?>
                            <tr class="text-gray-500">
                                <td class="py-2.5 pr-4">&mdash;</td>
                                <td class="py-2.5 px-4 italic"><?php esc_html_e( 'Brought forward', 'easy-invoice' ); ?></td>
                                <td class="py-2.5 px-4"></td>
                                <td class="py-2.5 px-4"></td>
                                <td class="py-2.5 pl-4 text-right" style="font-variant-numeric: tabular-nums;">
                                    <?php echo esc_html( easy_invoice_format_money( (float) $statement['opening'] ) ); ?>
                                </td>
                            </tr>
                        <?php endif; ?>
                        <?php foreach ( $statement['rows'] as $row ) : ?>
                            <tr>
                                <td class="py-2.5 pr-4 text-gray-700"><?php echo esc_html( $row['date'] ); ?></td>
                                <td class="py-2.5 px-4">
                                    <span class="font-medium text-gray-900"><?php echo esc_html( $row['label'] ); ?></span>
                                    <?php if ( '' !== $row['number'] ) : ?>
                                        <span class="text-gray-500"><?php echo esc_html( $row['number'] ); ?></span>
                                    <?php endif; ?>
                                </td>
                                <td class="py-2.5 px-4 text-right text-gray-900" style="font-variant-numeric: tabular-nums;">
                                    <?php echo $row['charge'] > 0 ? esc_html( easy_invoice_format_money( (float) $row['charge'] ) ) : ''; ?>
                                </td>
                                <td class="py-2.5 px-4 text-right text-green-700" style="font-variant-numeric: tabular-nums;">
                                    <?php echo $row['credit'] > 0 ? esc_html( easy_invoice_format_money( (float) $row['credit'] ) ) : ''; ?>
                                </td>
                                <td class="py-2.5 pl-4 text-right font-medium text-gray-900" style="font-variant-numeric: tabular-nums;">
                                    <?php echo esc_html( easy_invoice_format_money( (float) $row['balance'] ) ); ?>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        <?php endif; ?>
    </div>
</div>

```
