2016-06-11 31 views
0

我在我的共享主机帐户上安装了InvoicePlane v1.4.6。 能够执行常规任务,例如制作行情并将其转换为发票以及几乎所有的功能。
现在,我的发票需要显示针对此特定发票发生的交易,例如。预收到的额外预收金额。
我们正在将收到的每笔付款注册到应用程序的付款部分。
下面是我已经采取的步骤,并试图看看我是否可以得到此选项的工作。
添加的行的几个代码如下文件application/helpers/pdf_helper.php在:InvoicePlane:在发票上列出付款交易

$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

回答

0

我能找到大量尝试选项之后,要解决这个。
应用了一个foreach循环,并得到它的工作。

相关问题