Commit b5154bc7 authored by Fabien Morin's avatar Fabien Morin

- move 2 methods to PaySheetTransaction

- clean imports
- change inheritance


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17675 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d6b444d0
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
# #
############################################################################## ##############################################################################
from Globals import InitializeClass, PersistentMapping
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface from Products.ERP5Type import Permissions, PropertySheet
from Products.ERP5.Document.TradeCondition import TradeCondition from Products.ERP5.Document.TradeCondition import TradeCondition
from Products.ERP5.Document.DeliveryLine import DeliveryLine from Products.ERP5Type.XMLMatrix import XMLMatrix
class PaySheetModel(TradeCondition, DeliveryLine):
class PaySheetModel(TradeCondition, XMLMatrix):
""" """
PaySheetModel are used to define calculating rules specific to a PaySheetModel are used to define calculating rules specific to a
date, a convention, a enmployees group... date, a convention, a enmployees group...
...@@ -65,30 +65,3 @@ class PaySheetModel(TradeCondition, DeliveryLine): ...@@ -65,30 +65,3 @@ class PaySheetModel(TradeCondition, DeliveryLine):
, PropertySheet.DefaultAnnotationLine , PropertySheet.DefaultAnnotationLine
) )
def getRatioQuantityFromReference(self, ratio_reference=None):
"""
return the ratio value correponding to the ratio_reference,
or description if ratio value is empty,
None if ratio_reference not found
"""
object_ratio_list = self.contentValues(portal_type=\
'Pay Sheet Model Ratio Line')
for object in object_ratio_list:
if object.getReference() == ratio_reference:
if not object.getQuantity():
return object.getDescription()
else:
return object.getQuantity()
return None
def getRatioQuantityList(self, ratio_reference_list):
"""
Return a list of reference_ratio_list correponding values.
reference_ratio_list is a list of references to the ratio lines
we want to get.
"""
if type(ratio_reference_list) != type([]):
return None
return [self.getRatioQuantityFromReference(reference) \
for reference in ratio_reference_list]
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