# easy-invoice/2.4.0/templates/pdf/statement.php

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

- Page: https://pluginprobe.com/plugins/easy-invoice/2.4.0/code/templates/pdf/statement.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.4.0/raw/templates/pdf/statement.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/pdf/statement.php#L10-L20`.

```php
<?php
/**
 * Statement of account, laid out for the server-side PDF renderer.
 *
 * Receives from StatementController::handlePdf():
 *   $client (WP_User), $client_id, $statement
 *
 * Tables, not flexbox — dompdf implements CSS 2.1 and ignores `display: flex`.
 *
 * @package Easy_Invoice
 */

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

$company  = \EasyInvoice\Helpers\TemplateTextHelper::getCompanyInfo();
$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' ) );
$period   = '';

if ( '' !== $statement['from'] || '' !== $statement['to'] ) {
    $period = sprintf(
        /* translators: 1: start date, 2: end date. */
        __( '%1$s to %2$s', 'easy-invoice' ),
        $statement['from'] !== '' ? $statement['from'] : __( 'the beginning', 'easy-invoice' ),
        $statement['to'] !== '' ? $statement['to'] : __( 'today', 'easy-invoice' )
    );
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
    @page { margin: 18mm 15mm; }
    body { font-family: "DejaVu Sans", sans-serif; font-size: 10pt; color: #1f2937; }
    .head { width: 100%; border-collapse: collapse; margin-bottom: 14pt; }
    .head td { vertical-align: top; }
    .company { font-size: 13pt; font-weight: bold; }
    .muted { color: #6b7280; font-size: 9pt; }
    .doc-type { font-size: 20pt; font-weight: bold; letter-spacing: 1pt; text-align: right; }
    .rule { border-bottom: 1pt solid #e5e7eb; margin: 10pt 0 12pt; }
    table.rows { width: 100%; border-collapse: collapse; }
    table.rows th {
        text-align: left; font-size: 8pt; text-transform: uppercase;
        letter-spacing: 0.5pt; color: #6b7280; border-bottom: 1pt solid #e5e7eb;
        padding: 5pt 4pt;
    }
    table.rows td { padding: 5pt 4pt; border-bottom: 0.5pt solid #f3f4f6; }
    .num { text-align: right; }
    .totals { width: 45%; border-collapse: collapse; margin-top: 12pt; }
    .totals td { padding: 4pt 4pt; }
    .totals .label { color: #6b7280; }
    .grand td { border-top: 1pt solid #e5e7eb; font-weight: bold; font-size: 11pt; }
</style>
</head>
<body>

<table class="head">
    <tr>
        <td style="width:55%">
            <div class="company"><?php echo esc_html( $company['name'] ?? '' ); ?></div>
            <?php
            // getCompanyInfo() returns the address as one string, newlines and
            // all, so it is split here rather than assumed to be a list.
            $address_lines = array_filter( array_map( 'trim', preg_split( '/\r\n|\r|\n/', (string) ( $company['address'] ?? '' ) ) ?: [] ), 'strlen' );
            foreach ( $address_lines as $line ) :
                ?>
                <div class="muted"><?php echo esc_html( $line ); ?></div>
            <?php endforeach; ?>
        </td>
        <td style="width:45%">
            <div class="doc-type"><?php esc_html_e( 'STATEMENT', 'easy-invoice' ); ?></div>
            <div class="muted" style="text-align:right">
                <div><?php echo esc_html( $name ); ?></div>
                <?php if ( '' !== $period ) : ?>
                    <div><?php echo esc_html( $period ); ?></div>
                <?php endif; ?>
                <div><?php echo esc_html( date_i18n( get_option( 'date_format' ) ) ); ?></div>
            </div>
        </td>
    </tr>
</table>

<div class="rule"></div>

<table class="rows">
    <tr>
        <th><?php esc_html_e( 'Date', 'easy-invoice' ); ?></th>
        <th><?php esc_html_e( 'Document', 'easy-invoice' ); ?></th>
        <th class="num"><?php esc_html_e( 'Charge', 'easy-invoice' ); ?></th>
        <th class="num"><?php esc_html_e( 'Credit', 'easy-invoice' ); ?></th>
        <th class="num"><?php esc_html_e( 'Balance', 'easy-invoice' ); ?></th>
    </tr>

    <?php if ( abs( (float) $statement['opening'] ) > 0.001 ) : ?>
        <tr>
            <td>&mdash;</td>
            <td class="muted"><?php esc_html_e( 'Brought forward', 'easy-invoice' ); ?></td>
            <td></td>
            <td></td>
            <td class="num"><?php echo esc_html( easy_invoice_format_money( (float) $statement['opening'] ) ); ?></td>
        </tr>
    <?php endif; ?>

    <?php if ( empty( $statement['rows'] ) ) : ?>
        <tr><td colspan="5" class="muted"><?php esc_html_e( 'Nothing on this account in this period.', 'easy-invoice' ); ?></td></tr>
    <?php else : ?>
        <?php foreach ( $statement['rows'] as $row ) : ?>
            <tr>
                <td><?php echo esc_html( $row['date'] ); ?></td>
                <td>
                    <?php echo esc_html( $row['label'] ); ?>
                    <?php if ( '' !== $row['number'] ) : ?>
                        <span class="muted"><?php echo esc_html( $row['number'] ); ?></span>
                    <?php endif; ?>
                </td>
                <td class="num"><?php echo $row['charge'] > 0 ? esc_html( easy_invoice_format_money( (float) $row['charge'] ) ) : ''; ?></td>
                <td class="num"><?php echo $row['credit'] > 0 ? esc_html( easy_invoice_format_money( (float) $row['credit'] ) ) : ''; ?></td>
                <td class="num"><?php echo esc_html( easy_invoice_format_money( (float) $row['balance'] ) ); ?></td>
            </tr>
        <?php endforeach; ?>
    <?php endif; ?>
</table>

<table class="totals" align="right">
    <tr><td class="label"><?php esc_html_e( 'Invoiced', 'easy-invoice' ); ?></td><td class="num"><?php echo esc_html( easy_invoice_format_money( (float) $statement['invoiced'] ) ); ?></td></tr>
    <tr><td class="label"><?php esc_html_e( 'Paid', 'easy-invoice' ); ?></td><td class="num"><?php echo esc_html( easy_invoice_format_money( (float) $statement['paid'] ) ); ?></td></tr>
    <tr><td class="label"><?php esc_html_e( 'Credited', 'easy-invoice' ); ?></td><td class="num"><?php echo esc_html( easy_invoice_format_money( (float) $statement['credited'] ) ); ?></td></tr>
    <tr class="grand"><td><?php esc_html_e( 'Balance due', 'easy-invoice' ); ?></td><td class="num"><?php echo esc_html( easy_invoice_format_money( (float) $statement['balance'] ) ); ?></td></tr>
</table>

</body>
</html>

```
