2016-06-11 80 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循環,並得到它的工作。

相關問題