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 @@ ...@@ -29,6 +29,7 @@
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
from Products.ERP5.Document.AccountingTransaction import AccountingTransaction from Products.ERP5.Document.AccountingTransaction import AccountingTransaction
from Products.ERP5.Document.Delivery import Delivery
from zLOG import LOG from zLOG import LOG
class Invoice(AccountingTransaction): class Invoice(AccountingTransaction):
...@@ -65,19 +66,22 @@ class Invoice(AccountingTransaction): ...@@ -65,19 +66,22 @@ class Invoice(AccountingTransaction):
Permissions.AccessContentsInformation, 'getTotalPrice') Permissions.AccessContentsInformation, 'getTotalPrice')
def getTotalPrice(self): def getTotalPrice(self):
""" Returns the total price for this invoice """ """ Returns the total price for this invoice """
aggregate = self.Invoice_zGetTotal()[0] return Delivery.getTotalPrice(self,
return aggregate.total_price portal_type = self.getPortalObject()\
.getPortalInvoiceMovementTypeList())
security.declareProtected( security.declareProtected(
Permissions.AccessContentsInformation, 'getTotalQuantity') Permissions.AccessContentsInformation, 'getTotalQuantity')
def getTotalQuantity(self): def getTotalQuantity(self):
""" Returns the total quantity for this invoice """ """ Returns the total quantity for this invoice """
aggregate = self.Invoice_zGetTotal()[0] return Delivery.getTotalQuantity(self,
return aggregate.total_quantity portal_type = self.getPortalObject()\
.getPortalInvoiceMovementTypeList())
security.declareProtected( security.declareProtected(
Permissions.AccessContentsInformation, 'getTotalNetPrice') Permissions.AccessContentsInformation, 'getTotalNetPrice')
def getTotalNetPrice(self): def getTotalNetPrice(self):
""" Returns the total net price for this invoice """ """ Returns the total net price for this invoice """
raise NotImplemented
return self.Invoice_zGetTotalNetPrice() 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