# easy-invoice/2.3.1/includes/Helpers/QuoteInvoiceHelper.php

Easy Invoice – Invoice Generator, PDF Quotes &amp; Payments, version 2.3.1. 64 lines.

- Page: https://pluginprobe.com/plugins/easy-invoice/2.3.1/code/includes/Helpers/QuoteInvoiceHelper.php
- Raw: https://pluginprobe.com/plugins/easy-invoice/2.3.1/raw/includes/Helpers/QuoteInvoiceHelper.php
- Modified: 2025-09-17T11:27:10+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.3.1/code/includes/Helpers/QuoteInvoiceHelper.php#L10-L20`.

```php
<?php

namespace EasyInvoice\Helpers;

/**
 * Helper class for managing quote-invoice relationships
 */
class QuoteInvoiceHelper
{
    /**
     * Check if an invoice was converted from a quote
     *
     * @param int $invoice_id
     * @return bool
     */
    public static function isInvoiceConvertedFromQuote($invoice_id)
    {
        // Check if this invoice was converted from a quote
        $quote_id = get_post_meta($invoice_id, '_converted_from_quote', true);
        return !empty($quote_id);
    }

    /**
     * Get quote information for an invoice
     *
     * @param int $invoice_id
     * @return array|false Quote information or false if not found
     */
    public static function getQuoteInfoFromInvoice($invoice_id)
    {
        // Check if this invoice was converted from a quote
        $quote_id = get_post_meta($invoice_id, '_converted_from_quote', true);

        if (!$quote_id) {
            return false;
        }

        // Get quote post
        $quote_post = get_post($quote_id);
        if (!$quote_post || $quote_post->post_type !== 'easy_invoice_quote') {
            return false;
        }

        // Get quote number
        $quote_number = get_post_meta($quote_id, '_quote_number', true);

        // Get quote title
        $quote_title = $quote_post->post_title;

        // Determine icon and tooltip
        $icon_class = 'fas fa-exchange-alt';
        $tooltip_text = sprintf(__('Converted from Quote %s', 'easy-invoice'), $quote_number ?: $quote_title);

        return [
            'id' => $quote_id,
            'number' => $quote_number,
            'title' => $quote_title,
            'icon_class' => $icon_class,
            'tooltip_text' => $tooltip_text,
            'url' => admin_url('admin.php?page=easy-invoice-quote-builder&id=' . $quote_id)
        ];
    }
}

```
