// improve invoice and order payment

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11306 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
aFolletete
2011-12-16 15:00:43 +00:00
parent eb14c43722
commit 5a4bc80867
2 changed files with 30 additions and 1 deletions
+11
View File
@@ -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;
}
}
+19 -1
View File
@@ -79,7 +79,18 @@
{$order->date_add|date_format:"%d-%m-%Y %H:%M"}<br />
<br />
<b>{l s='Payment Method:' pdf='true'}</b><br />
{$order->payment}<br />
<table style="width: 100%;">
{foreach from=$order_invoice->getOrderPaymentCollection() item=payment}
<tr>
<td style="width: 50%">{$payment->payment_method}</td>
<td style="width: 50%">{displayPrice price=$payment->amount currency=$order->id_currency}</td>
</tr>
{foreachelse}
<tr>
<td>{l s='No payment'}</td>
</tr>
{/foreach}
</table>
<br />
<!-- / CUSTOMER INFORMATIONS -->
</td>
@@ -216,6 +227,13 @@
<td style="text-align: right; font-weight: bold">{l s='Total' pdf='true'}</td>
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->total_paid_tax_incl}</td>
</tr>
{if $order_invoice->getRestPaid()}
<tr style="line-height:5px;color:red;">
<td style="text-align: right; font-weight: bold">{l s='Total rest paid' pdf='true'}</td>
<td style="width: 15%; text-align: right;">{displayPrice currency=$order->id_currency price=$order_invoice->getRestPaid()}</td>
</tr>
{/if}
</table>
</td>