Commit 9df631f2 authored by Jérome Perrin's avatar Jérome Perrin

use total price & quantity method from Delivery


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4057 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent df37a3d8
......@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.AccountingTransaction import AccountingTransaction
from Products.ERP5.Document.Delivery import Delivery
from zLOG import LOG
class Invoice(AccountingTransaction):
......@@ -65,19 +66,22 @@ class Invoice(AccountingTransaction):
Permissions.AccessContentsInformation, 'getTotalPrice')
def getTotalPrice(self):
""" Returns the total price for this invoice """
aggregate = self.Invoice_zGetTotal()[0]
return aggregate.total_price
return Delivery.getTotalPrice(self,
portal_type = self.getPortalObject()\
.getPortalInvoiceMovementTypeList())
security.declareProtected(
Permissions.AccessContentsInformation, 'getTotalQuantity')
def getTotalQuantity(self):
""" Returns the total quantity for this invoice """
aggregate = self.Invoice_zGetTotal()[0]
return aggregate.total_quantity
return Delivery.getTotalQuantity(self,
portal_type = self.getPortalObject()\
.getPortalInvoiceMovementTypeList())
security.declareProtected(
Permissions.AccessContentsInformation, 'getTotalNetPrice')
def getTotalNetPrice(self):
""" Returns the total net price for this invoice """
raise NotImplemented
return self.Invoice_zGetTotalNetPrice()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment