Commit 675474cb authored by Julien Muchembled's avatar Julien Muchembled

Forbid Pay Sheet Model (Ratio) Line on Pay Sheet Transaction

(same as 37672, but for payroll)

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@39294 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5bfec569
...@@ -25,11 +25,9 @@ ...@@ -25,11 +25,9 @@
<item>Pay Sheet Model</item> <item>Pay Sheet Model</item>
</portal_type> </portal_type>
<portal_type id="Pay Sheet Transaction"> <portal_type id="Pay Sheet Transaction">
<item>Pay Sheet Transaction Line</item>
<item>Pay Sheet Line</item>
<item>Pay Sheet Model Line</item>
<item>Annotation Line</item> <item>Annotation Line</item>
<item>Pay Sheet Model Ratio Line</item> <item>Pay Sheet Line</item>
<item>Pay Sheet Transaction Line</item>
<item>Payment Condition</item> <item>Payment Condition</item>
</portal_type> </portal_type>
<portal_type id="Preference"> <portal_type id="Preference">
......
...@@ -11,8 +11,6 @@ Pay Sheet Model | Pay Sheet Model Slice ...@@ -11,8 +11,6 @@ Pay Sheet Model | Pay Sheet Model Slice
Pay Sheet Model | Payment Condition Pay Sheet Model | Payment Condition
Pay Sheet Transaction | Annotation Line Pay Sheet Transaction | Annotation Line
Pay Sheet Transaction | Pay Sheet Line Pay Sheet Transaction | Pay Sheet Line
Pay Sheet Transaction | Pay Sheet Model Line
Pay Sheet Transaction | Pay Sheet Model Ratio Line
Pay Sheet Transaction | Pay Sheet Transaction Line Pay Sheet Transaction | Pay Sheet Transaction Line
Pay Sheet Transaction | Payment Condition Pay Sheet Transaction | Payment Condition
Preference | Pay Sheet Transaction Preference | Pay Sheet Transaction
\ No newline at end of file
...@@ -1207,75 +1207,6 @@ class TestPayrollMixin(TestTradeModelLineMixin): ...@@ -1207,75 +1207,6 @@ class TestPayrollMixin(TestTradeModelLineMixin):
else: else:
self.fail("Unknown service for line %s" % paysheet_line.getTitle()) self.fail("Unknown service for line %s" % paysheet_line.getTitle())
def stepPaysheetCreateModelLine(self, sequence=None, **kw):
paysheet = sequence.get('paysheet')
model_line = self.createModelLine(paysheet)
model_line.edit(title='model line in the paysheet',
trade_phase='payroll/france/urssaf',
resource_value=sequence.get('old_age_insurance_service'),
reference='model_line_in_the_payesheet',
variation_category_list=['contribution_share/employee',
'contribution_share/employer'],
base_application_list=[ 'base_amount/payroll/base/contribution'],
base_contribution_list=['base_amount/payroll/base/income_tax'])
sequence.edit(model_line_on_paysheet = model_line)
def stepPaysheetModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('model_line_on_paysheet')
cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell',
base_id='movement',
quantity = None,
mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.5, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell',
base_id='movement',
quantity = None,
mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.8, contribution_share='employer')
def stepCheckUpdateAggregatedAmountListReturnWithModelLineOnPaysheet(self,
sequence=None, **kw):
paysheet = sequence.get('paysheet')
self.checkUpdateAggregatedAmountListReturn(paysheet, 0, 4)
def stepCheckPaysheetLineAreCreatedWithModelLineOnPaysheet(self,
sequence=None, **kw):
paysheet = sequence.get('paysheet')
paysheet_line_list = paysheet.contentValues(portal_type='Pay Sheet Line')
self.assertEqual(len(paysheet_line_list), 3)
self.assertEqual(len(paysheet.getMovementList(portal_type=\
'Pay Sheet Cell')), 4) # 2 from the urssaf paysheet line
# 2 from the line create with the paysheet model
# line
self.assertEqual(len(paysheet.contentValues(portal_type=\
'Pay Sheet Model Line')), 1)
def stepCheckPaysheetLineFromModelLineAmounts(self, sequence=None, **kw):
paysheet = sequence.get('paysheet')
paysheet_line_list = paysheet.contentValues(portal_type='Pay Sheet Line')
for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle()
if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour':
self.assertEqual(paysheet_line.getTotalPrice(), 3000.0)
elif service == 'Old Age Insurance':
cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.5)
cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.8)
else:
self.fail("Unknown service for line %s" % paysheet_line.getTitle())
def stepModelModifyUrssafModelLine(self, sequence=None, **kw): def stepModelModifyUrssafModelLine(self, sequence=None, **kw):
model_line = sequence.get('urssaf_model_line') model_line = sequence.get('urssaf_model_line')
# modify price on movements : # modify price on movements :
...@@ -1320,23 +1251,6 @@ class TestPayrollMixin(TestTradeModelLineMixin): ...@@ -1320,23 +1251,6 @@ class TestPayrollMixin(TestTradeModelLineMixin):
else: else:
self.fail("Unknown service for line %s" % paysheet_line.getTitle()) self.fail("Unknown service for line %s" % paysheet_line.getTitle())
def stepCheckPaysheetModelLineOverLoadAmounts(self, sequence=None, **kw):
paysheet = sequence.get('paysheet')
paysheet_line_list = paysheet.contentValues(portal_type='Pay Sheet Line')
for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle()
if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.3)
cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.7)
elif service == 'Labour':
self.assertEqual(paysheet_line.getTotalPrice(), 3000.0)
else:
self.fail("Unknown service for line %s" % paysheet_line.getTitle())
def stepCheckPaysheetConsistency(self, sequence=None, **kw): def stepCheckPaysheetConsistency(self, sequence=None, **kw):
paysheet = sequence.get('paysheet') paysheet = sequence.get('paysheet')
self.assertEquals([], paysheet.checkConsistency()) self.assertEquals([], paysheet.checkConsistency())
...@@ -2075,27 +1989,6 @@ class TestPayroll(TestPayrollMixin): ...@@ -2075,27 +1989,6 @@ class TestPayroll(TestPayrollMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_modelLineInPaysheet(self):
'''
Put a Pay Sheet Model Line in Pay Sheet Transaction. This line will
be like editable line
'''
sequence_list = SequenceList()
sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """
CreateOldAgeInsuranaceService
PaysheetCreateModelLine
PaysheetModelLineCreateMovements
Tic
CheckUpdateAggregatedAmountListReturnWithModelLineOnPaysheet
PaysheetApplyTransformation
Tic
CheckPaysheetLineAreCreatedWithModelLineOnPaysheet
CheckPaysheetLineFromModelLineAmounts
CheckUpdateAggregatedAmountListReturnNothing
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_updateModifyMovements(self): def test_updateModifyMovements(self):
''' '''
Calculate the paySheet using a model, modify one value in the model and Calculate the paySheet using a model, modify one value in the model and
...@@ -2176,25 +2069,6 @@ class TestPayroll(TestPayrollMixin): ...@@ -2176,25 +2069,6 @@ class TestPayroll(TestPayrollMixin):
sequence_list.addSequenceString(sequence_string) sequence_list.addSequenceString(sequence_string)
sequence_list.play(self) sequence_list.play(self)
def test_modelLineOverLoad(self):
'''
Check it's possible to overload a model line from the model tree by
having a model line with the same reference in the paysheet.
'''
sequence_list = SequenceList()
sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """
PaysheetCreateUrssafModelLine
PaysheetUrssafModelLineCreateMovements
CheckUpdateAggregatedAmountListReturn
PaysheetApplyTransformation
Tic
CheckPaysheetLineAreCreated
CheckPaysheetModelLineOverLoadAmounts
CheckUpdateAggregatedAmountListReturnNothing
"""
sequence_list.addSequenceString(sequence_string)
sequence_list.play(self)
def test_sourceSectionIsSetOnMovements(self): def test_sourceSectionIsSetOnMovements(self):
''' '''
check that after apply transformation, source section is set on movment check that after apply transformation, source section is set on movment
......
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