From 5a4bc8086755ce9115c8bfe201a2d2dca5d9a873 Mon Sep 17 00:00:00 2001 From: aFolletete Date: Fri, 16 Dec 2011 15:00:43 +0000 Subject: [PATCH] // improve invoice and order payment git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11306 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/order/OrderInvoice.php | 11 +++++++++++ themes/default/pdf/invoice.tpl | 20 +++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/classes/order/OrderInvoice.php b/classes/order/OrderInvoice.php index 861a10132..41701ba58 100644 --- a/classes/order/OrderInvoice.php +++ b/classes/order/OrderInvoice.php @@ -488,4 +488,15 @@ class OrderInvoiceCore extends ObjectModel { return $this->getTotalPaid() == $this->total_paid_tax_incl; } + + /** + * @since 1.5.0.2 + * @return Collection of Order payment + */ + public function getOrderPaymentCollection() + { + $order_payments = new Collection('OrderPayment'); + $order_payments->where('id_order_invoice = '.(int)$this->id); + return $order_payments; + } } \ No newline at end of file diff --git a/themes/default/pdf/invoice.tpl b/themes/default/pdf/invoice.tpl index 26f7fd6e6..6b4fde503 100755 --- a/themes/default/pdf/invoice.tpl +++ b/themes/default/pdf/invoice.tpl @@ -79,7 +79,18 @@ {$order->date_add|date_format:"%d-%m-%Y %H:%M"}

{l s='Payment Method:' pdf='true'}
- {$order->payment}
+ + {foreach from=$order_invoice->getOrderPaymentCollection() item=payment} + + + + + {foreachelse} + + + + {/foreach} +
{$payment->payment_method}{displayPrice price=$payment->amount currency=$order->id_currency}
{l s='No payment'}

@@ -216,6 +227,13 @@ {l s='Total' pdf='true'} {displayPrice currency=$order->id_currency price=$order_invoice->total_paid_tax_incl} + + {if $order_invoice->getRestPaid()} + + {l s='Total rest paid' pdf='true'} + {displayPrice currency=$order->id_currency price=$order_invoice->getRestPaid()} + + {/if}