# easy-invoice/2.4.1/templates/document/fallback.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.4.1. 101 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.4.1/code/templates/document/fallback.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.4.1/raw/templates/document/fallback.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.1/code/templates/document/fallback.php#L10-L20`.

```php
<?php
/**
 * Plain rendering used when no design template can be found.
 *
 * Receives: $document, $document_type, $formatter, $invoice, $quote
 *
 * @package Easy_Invoice
 * @subpackage Templates
 */

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

$is_quote     = ( 'quote' === $document_type );
$status       = (string) $document->getStatus() ?: 'draft';
$show_adjust  = \EasyInvoice\Controllers\SettingsController::shouldShowQuoteAdjustField();
$second_date  = $is_quote ? $document->getExpiryDate() : $document->getDueDate();
$second_label = $is_quote ? __( 'Valid until', 'easy-invoice' ) : __( 'Due', 'easy-invoice' );
?>
<div class="ei-fallback">
    <div class="ei-fallback__notice">
        <?php
        printf(
            /* translators: %s: design name. */
            esc_html__( 'The design "%s" is not installed; showing the document plainly.', 'easy-invoice' ),
            esc_html( (string) $document->getTemplate() )
        );
        ?>
    </div>

    <header class="ei-fallback__header">
        <h1>
            <?php echo esc_html( $document->getTitle() ?: ( $is_quote ? __( 'Quote', 'easy-invoice' ) : __( 'Invoice', 'easy-invoice' ) ) ); ?>
            <span class="ei-fallback__status status-<?php echo esc_attr( $status ); ?>"><?php echo esc_html( ucfirst( $status ) ); ?></span>
        </h1>
        <div>
            <?php echo esc_html( (string) $document->getNumber() ); ?>
            &bull; <?php echo esc_html( \EasyInvoice\Controllers\SettingsController::formatDate( (string) $document->getIssueDate() ) ); ?>
            <?php if ( $second_date ) : ?>
                &bull; <?php echo esc_html( $second_label ); ?> <?php echo esc_html( \EasyInvoice\Controllers\SettingsController::formatDate( (string) $second_date ) ); ?>
            <?php endif; ?>
        </div>
        <?php if ( $document->getCustomerName() ) : ?>
            <address>
                <strong><?php echo esc_html( (string) $document->getCustomerName() ); ?></strong><br>
                <?php echo esc_html( (string) $document->getCustomerEmail() ); ?><br>
                <?php echo nl2br( esc_html( (string) $document->getCustomerAddress() ) ); ?>
            </address>
        <?php endif; ?>
    </header>

    <?php if ( $document->getNotes() ) : ?>
        <p class="ei-fallback__notes"><?php echo nl2br( esc_html( (string) $document->getNotes() ) ); ?></p>
    <?php endif; ?>

    <table class="ei-fallback__items">
        <thead>
            <tr>
                <th><?php esc_html_e( 'Item', 'easy-invoice' ); ?></th>
                <th><?php esc_html_e( 'Description', 'easy-invoice' ); ?></th>
                <th><?php esc_html_e( 'Qty', 'easy-invoice' ); ?></th>
                <th><?php esc_html_e( 'Unit Price', 'easy-invoice' ); ?></th>
                <?php if ( $show_adjust ) : ?><th><?php esc_html_e( 'Adjust (%)', 'easy-invoice' ); ?></th><?php endif; ?>
                <th><?php esc_html_e( 'Total', 'easy-invoice' ); ?></th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ( (array) $document->getItems() as $item ) : ?>
                <tr>
                    <td><?php echo esc_html( (string) $item->getName() ); ?></td>
                    <td><?php echo esc_html( (string) $item->getDescription() ); ?></td>
                    <td><?php echo esc_html( (string) $item->getQuantity() ); ?></td>
                    <td><?php echo esc_html( $formatter->format( $item->getPrice() ) ); ?></td>
                    <?php if ( $show_adjust ) : ?>
                        <td>
                            <?php
                            $adjust = (float) $item->getAdjustPercentage();
                            echo 0.0 !== $adjust ? esc_html( ( $adjust > 0 ? '+' : '' ) . $adjust . '%' ) : '&mdash;';
                            ?>
                        </td>
                    <?php endif; ?>
                    <td><?php echo esc_html( $formatter->format( $item->getAmount() ) ); ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

    <div class="ei-fallback__summary">
        <div><strong><?php esc_html_e( 'Subtotal', 'easy-invoice' ); ?>:</strong> <?php echo esc_html( $formatter->format( $document->getSubtotal() ) ); ?></div>
        <?php if ( (float) $document->getDiscountAmount() > 0 ) : ?>
            <div><strong><?php esc_html_e( 'Discount', 'easy-invoice' ); ?>:</strong> -<?php echo esc_html( $formatter->format( $document->getDiscountAmount() ) ); ?></div>
        <?php endif; ?>
        <?php if ( (float) $document->getTaxAmount() > 0 ) : ?>
            <div><strong><?php esc_html_e( 'Tax', 'easy-invoice' ); ?>:</strong> <?php echo esc_html( $formatter->format( $document->getTaxAmount() ) ); ?></div>
        <?php endif; ?>
        <?php do_action( $is_quote ? 'easy_invoice_quote_totals_after_tax' : 'easy_invoice_invoice_totals_after_tax', $document ); ?>
        <div class="ei-fallback__total"><strong><?php esc_html_e( 'Total', 'easy-invoice' ); ?>:</strong> <?php echo esc_html( $formatter->format( $document->getTotal() ) ); ?></div>
    </div>
</div>

```
