InvoicePlane:列出发票上的付款交易

时间:2016-06-11 18:06:23

标签: php mysql transactions invoice

我在共享主机帐户上安装了InvoicePlane v1.4.6。 能够执行常规任务,例如制作报价并将其转换为发票以及几乎所有的功能。
现在,我的发票要求显示此特定发票的交易,例如。收到预付款,收到额外预付金额。
我们将收到的每笔付款与注释一起注册到申请的“付款”部分 以下是我采取的步骤,并试图看看我是否可以使这个选项工作 在文件application/helpers/pdf_helper.php中添加了几行代码,如下所示:

$CI->load->model('quotes/mdl_quotes');
$quote = $CI->mdl_quotes->where('ip_quotes.invoice_id', $invoice_id)->get()->result();
$CI->load->model('payments/mdl_payments');
$payment = $CI->mdl_payments->where('ip_payments.invoice_id', $invoice_id)->get()->result();
$data = array(
    'invoice' => $invoice,
    'invoice_tax_rates' => $CI->mdl_invoice_tax_rates->where('invoice_id', $invoice_id)->get()->result(),
    'quote' => (isset($quote[0]) ? $quote[0] : null),
    'payment' => (isset($payment[0]) ? $payment[0] : null),
    'items' => $items,
    'payment_method' => $payment_method,
    'output_type' => 'pdf',
    'show_discounts' => $show_discounts,
);

然后我将几个代码作为表格格式添加到发票PDF模板文件application/views/invoice_templates/pdf/InvoicePlane.php中,如下所示:

<table class="item-table">
    <thead>
        <tr>
            <th>Date of Payment</th>
            <th>Payment Method</th>
            <th>Amount Paid</th>
            <th>Payment Journal</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><?php echo $payment->payment_date; ?></td>
            <td><?php echo $payment->payment_method_name; ?></td>
            <td><?php echo $payment->payment_amount; ?></td>
            <td><?php echo $payment->payment_note; ?></td>
        </tr>
    </tbody>
</table>

现在,它出现了付款细节开始显示在发票上的情况,但它只显示收到的第一笔付款交易。
我想我错过了一些循环迭代来获得这个特定发票的所有支付交易行项目 我会请求帮助和指导,看看我们如何能够显示该特定发票的所有付款收据交易。

PS:我也在InvoicePlane论坛上问过这个问题,但没有回复 - https://community.invoiceplane.com/t/topic/2771
我也确实使用了他们的维基 - https://wiki.invoiceplane.com/en/1.0/templates/using-templateshttps://wiki.invoiceplane.com/en/1.0/templates/customize-templates

1 个答案:

答案 0 :(得分:0)

在尝试了很多选项后,我找到了解决方法 应用foreach循环并使其工作。

相关问题