Commit cecead52 authored by Yusuke Muraoka's avatar Yusuke Muraoka

fix duplicated suffix of the category names

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28710 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e7e26d7c
...@@ -143,8 +143,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -143,8 +143,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
def getNeededCategoryList(self): def getNeededCategoryList(self):
"""return a list of categories that should be created.""" """return a list of categories that should be created."""
return ('contribution_share/employer_share', return ('contribution_share/employer',
'contribution_share/employee_share', 'contribution_share/employee',
'base_amount/deductible_tax', 'base_amount/deductible_tax',
'base_amount/base_salary', 'base_amount/base_salary',
'base_amount/net_salary', 'base_amount/net_salary',
...@@ -186,8 +186,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -186,8 +186,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
product_line='state_insurance', quantity_unit='time/month', product_line='state_insurance', quantity_unit='time/month',
variation_base_category_list=['contribution_share', 'salary_range'], variation_base_category_list=['contribution_share', 'salary_range'],
use='payroll/tax') use='payroll/tax')
node.setVariationCategoryList(['contribution_share/employee_share', node.setVariationCategoryList(['contribution_share/employee',
'contribution_share/employer_share', 'contribution_share/employer',
'salary_range/france/slice_0_to_200', 'salary_range/france/slice_0_to_200',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
'salary_range/france/slice_400_to_5000', 'salary_range/france/slice_400_to_5000',
...@@ -215,8 +215,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -215,8 +215,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
node.edit(title='Bonus', quantity_unit='time/month', node.edit(title='Bonus', quantity_unit='time/month',
variation_base_category_list=['contribution_share'], variation_base_category_list=['contribution_share'],
product_line='labour', use='payroll/base_salary') product_line='labour', use='payroll/base_salary')
node.setVariationCategoryList(['contribution_share/employee_share', node.setVariationCategoryList(['contribution_share/employee',
'contribution_share/employer_share']) 'contribution_share/employer'])
sequence.edit(bonus_service = node) sequence.edit(bonus_service = node)
def stepCreateOldAgeInsuranaceService(self, sequence=None, **kw): def stepCreateOldAgeInsuranaceService(self, sequence=None, **kw):
...@@ -224,8 +224,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -224,8 +224,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
node.edit(title='Old Age Insurance', quantity_unit='time/month', node.edit(title='Old Age Insurance', quantity_unit='time/month',
variation_base_category_list=['contribution_share', 'salary_range'], variation_base_category_list=['contribution_share', 'salary_range'],
product_line='state_insurance', use='payroll/tax') product_line='state_insurance', use='payroll/tax')
node.setVariationCategoryList(['contribution_share/employee_share', node.setVariationCategoryList(['contribution_share/employee',
'contribution_share/employer_share']) 'contribution_share/employer'])
sequence.edit(old_age_insurance_service = node) sequence.edit(old_age_insurance_service = node)
def stepCreateSicknessInsuranceService(self, sequence=None, **kw): def stepCreateSicknessInsuranceService(self, sequence=None, **kw):
...@@ -233,8 +233,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -233,8 +233,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
node.edit(title='Sickness Insurance', quantity_unit='time/month', node.edit(title='Sickness Insurance', quantity_unit='time/month',
variation_base_category_list=['contribution_share', 'salary_range'], variation_base_category_list=['contribution_share', 'salary_range'],
product_line='state_insurance', use='payroll/tax') product_line='state_insurance', use='payroll/tax')
node.setVariationCategoryList(['contribution_share/employee_share', node.setVariationCategoryList(['contribution_share/employee',
'contribution_share/employer_share']) 'contribution_share/employer'])
sequence.edit(sickness_insurance_service = node) sequence.edit(sickness_insurance_service = node)
def createModel(self): def createModel(self):
...@@ -311,8 +311,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -311,8 +311,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='urssaf_model_line', reference='urssaf_model_line',
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/deductible_tax'])
sequence.edit(urssaf_model_line = model_line) sequence.edit(urssaf_model_line = model_line)
...@@ -324,8 +324,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -324,8 +324,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='urssaf_model_line_2', reference='urssaf_model_line_2',
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share', 'contribution_share/employer',
'salary_range/france/slice_0_to_200', 'salary_range/france/slice_0_to_200',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
'salary_range/france/slice_400_to_5000'], 'salary_range/france/slice_400_to_5000'],
...@@ -340,8 +340,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -340,8 +340,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='urssaf_model_line_3', reference='urssaf_model_line_3',
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share', 'contribution_share/employer',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
'salary_range/france/slice_600_to_800'], 'salary_range/france/slice_600_to_800'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
...@@ -358,127 +358,127 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -358,127 +358,127 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
reference='urssaf_model_line', reference='urssaf_model_line',
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/deductible_tax'])
sequence.edit(urssaf_model_line = model_line) sequence.edit(urssaf_model_line = model_line)
def stepUrssafModelLineCreateMovements(self, sequence=None, **kw): def stepUrssafModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('urssaf_model_line') model_line = sequence.get('urssaf_model_line')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.1, contribution_share='employee_share') cell1.edit(price=0.1, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.5, contribution_share='employer_share') cell2.edit(price=0.5, contribution_share='employer')
def stepUrssafModelLineCreateMovementsWithQuantityOnly(self, sequence=None, **kw): def stepUrssafModelLineCreateMovementsWithQuantityOnly(self, sequence=None, **kw):
model_line = sequence.get('urssaf_model_line') model_line = sequence.get('urssaf_model_line')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(quantity=-100, contribution_share='employee_share') cell1.edit(quantity=-100, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(quantity=-200, contribution_share='employer_share') cell2.edit(quantity=-200, contribution_share='employer')
def stepUrssafModelLineWithSlicesCreateMovements(self, sequence=None, **kw): def stepUrssafModelLineWithSlicesCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('urssaf_model_line_with_slices') model_line = sequence.get('urssaf_model_line_with_slices')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
'salary_range/france/slice_0_to_200', 'salary_range/france/slice_0_to_200',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.1, contribution_share='employee_share', cell1.edit(price=0.1, contribution_share='employee',
salary_range='france/slice_0_to_200') salary_range='france/slice_0_to_200')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
'salary_range/france/slice_0_to_200', 'salary_range/france/slice_0_to_200',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.2, contribution_share='employer_share', cell2.edit(price=0.2, contribution_share='employer',
salary_range='france/slice_0_to_200') salary_range='france/slice_0_to_200')
cell3 = model_line.newCell('contribution_share/employee_share', cell3 = model_line.newCell('contribution_share/employee',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell3.edit(price=0.3, contribution_share='employee_share', cell3.edit(price=0.3, contribution_share='employee',
salary_range='france/slice_200_to_400') salary_range='france/slice_200_to_400')
cell4 = model_line.newCell('contribution_share/employer_share', cell4 = model_line.newCell('contribution_share/employer',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell4.edit(price=0.4, contribution_share='employer_share', cell4.edit(price=0.4, contribution_share='employer',
salary_range='france/slice_200_to_400') salary_range='france/slice_200_to_400')
cell5 = model_line.newCell('contribution_share/employee_share', cell5 = model_line.newCell('contribution_share/employee',
'salary_range/france/slice_400_to_5000', 'salary_range/france/slice_400_to_5000',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell5.edit(price=0.5, contribution_share='employee_share', cell5.edit(price=0.5, contribution_share='employee',
salary_range='france/slice_400_to_5000') salary_range='france/slice_400_to_5000')
cell6 = model_line.newCell('contribution_share/employer_share', cell6 = model_line.newCell('contribution_share/employer',
'salary_range/france/slice_400_to_5000', 'salary_range/france/slice_400_to_5000',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell6.edit(price=0.6, contribution_share='employer_share', cell6.edit(price=0.6, contribution_share='employer',
salary_range='france/slice_400_to_5000') salary_range='france/slice_400_to_5000')
def stepUrssafModelLineWithComplexSlicesCreateMovements(self, def stepUrssafModelLineWithComplexSlicesCreateMovements(self,
sequence=None, **kw): sequence=None, **kw):
model_line = sequence.get('urssaf_model_line_with_slices') model_line = sequence.get('urssaf_model_line_with_slices')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.1, contribution_share='employee_share', cell1.edit(price=0.1, contribution_share='employee',
salary_range='france/slice_200_to_400') salary_range='france/slice_200_to_400')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.2, contribution_share='employer_share', cell2.edit(price=0.2, contribution_share='employer',
salary_range='france/slice_200_to_400') salary_range='france/slice_200_to_400')
cell3 = model_line.newCell('contribution_share/employee_share', cell3 = model_line.newCell('contribution_share/employee',
'salary_range/france/slice_600_to_800', 'salary_range/france/slice_600_to_800',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell3.edit(price=0.3, contribution_share='employee_share', cell3.edit(price=0.3, contribution_share='employee',
salary_range='france/slice_600_to_800') salary_range='france/slice_600_to_800')
cell4 = model_line.newCell('contribution_share/employer_share', cell4 = model_line.newCell('contribution_share/employer',
'salary_range/france/slice_600_to_800', 'salary_range/france/slice_600_to_800',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell4.edit(price=0.4, contribution_share='employer_share', cell4.edit(price=0.4, contribution_share='employer',
salary_range='france/slice_600_to_800') salary_range='france/slice_600_to_800')
def stepPaysheetUrssafModelLineCreateMovements(self, sequence=None, **kw): def stepPaysheetUrssafModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('urssaf_model_line') model_line = sequence.get('urssaf_model_line')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.3, contribution_share='employee_share') cell1.edit(price=0.3, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.7, contribution_share='employer_share') cell2.edit(price=0.7, contribution_share='employer')
def createPaysheet(self, sequence=None, **kw): def createPaysheet(self, sequence=None, **kw):
module = self.portal.getDefaultModule(portal_type='Pay Sheet Transaction') module = self.portal.getDefaultModule(portal_type='Pay Sheet Transaction')
...@@ -514,23 +514,23 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -514,23 +514,23 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
paysheet_line = self.createPaysheetLine(paysheet) paysheet_line = self.createPaysheetLine(paysheet)
paysheet_line.edit(title='Bonus', paysheet_line.edit(title='Bonus',
resource_value=sequence.get('bonus_service'), resource_value=sequence.get('bonus_service'),
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_contribution_list=[ 'base_amount/base_salary']) base_contribution_list=[ 'base_amount/base_salary'])
sequence.edit(bonus_paysheet_line = paysheet_line) sequence.edit(bonus_paysheet_line = paysheet_line)
def stepPaysheetCreateBonusPaySheetLineMovements(self, sequence=None, **kw): def stepPaysheetCreateBonusPaySheetLineMovements(self, sequence=None, **kw):
paysheet_line = sequence.get('bonus_paysheet_line') paysheet_line = sequence.get('bonus_paysheet_line')
cell1 = paysheet_line.newCell('contribution_share/employee_share', cell1 = paysheet_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(quantity=1000, price=1, contribution_share='employee_share') cell1.edit(quantity=1000, price=1, contribution_share='employee')
cell2 = paysheet_line.newCell('contribution_share/employer_share', cell2 = paysheet_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(quantity=1000, price=1, contribution_share='employer_share') cell2.edit(quantity=1000, price=1, contribution_share='employer')
def checkUpdateAggregatedAmountListReturn(self, model, paysheet, def checkUpdateAggregatedAmountListReturn(self, model, paysheet,
expected_movement_to_delete_count, expected_movement_to_add_count): expected_movement_to_delete_count, expected_movement_to_add_count):
...@@ -654,10 +654,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -654,10 +654,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour': elif service == 'Labour':
...@@ -671,18 +671,18 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -671,18 +671,18 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 4000) self.assertEquals(cell1.getQuantity(), 4000)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 4000) self.assertEquals(cell2.getQuantity(), 4000)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour': elif service == 'Labour':
self.assertEqual(paysheet_line.getTotalPrice(), 3000.0) self.assertEqual(paysheet_line.getTotalPrice(), 3000.0)
elif service == 'Bonus': elif service == 'Bonus':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getTotalPrice(), 1000) self.assertEquals(cell1.getTotalPrice(), 1000)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getTotalPrice(), 1000) self.assertEquals(cell2.getTotalPrice(), 1000)
else: else:
self.fail("Unknown service for line %s" % paysheet_line.getTitle()) self.fail("Unknown service for line %s" % paysheet_line.getTitle())
...@@ -693,10 +693,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -693,10 +693,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), -100) self.assertEquals(cell1.getQuantity(), -100)
self.assertEquals(cell1.getPrice(), 1) self.assertEquals(cell1.getPrice(), 1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), -200) self.assertEquals(cell2.getQuantity(), -200)
self.assertEquals(cell2.getPrice(), 1) self.assertEquals(cell2.getPrice(), 1)
elif service == 'Labour': elif service == 'Labour':
...@@ -710,27 +710,27 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -710,27 +710,27 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share', cell1 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_0_to_200') 'salary_range/france/slice_0_to_200')
self.assertEquals(cell1.getQuantity(), 200) self.assertEquals(cell1.getQuantity(), 200)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share', cell2 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_0_to_200') 'salary_range/france/slice_0_to_200')
self.assertEquals(cell2.getQuantity(), 200) self.assertEquals(cell2.getQuantity(), 200)
self.assertEquals(cell2.getPrice(), 0.2) self.assertEquals(cell2.getPrice(), 0.2)
cell3 = paysheet_line.getCell('contribution_share/employee_share', cell3 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_200_to_400') 'salary_range/france/slice_200_to_400')
self.assertEquals(cell3.getQuantity(), 200) self.assertEquals(cell3.getQuantity(), 200)
self.assertEquals(cell3.getPrice(), 0.3) self.assertEquals(cell3.getPrice(), 0.3)
cell4 = paysheet_line.getCell('contribution_share/employer_share', cell4 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_200_to_400') 'salary_range/france/slice_200_to_400')
self.assertEquals(cell4.getQuantity(), 200) self.assertEquals(cell4.getQuantity(), 200)
self.assertEquals(cell4.getPrice(), 0.4) self.assertEquals(cell4.getPrice(), 0.4)
cell5 = paysheet_line.getCell('contribution_share/employee_share', cell5 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_400_to_5000') 'salary_range/france/slice_400_to_5000')
self.assertEquals(cell5.getQuantity(), 2600) self.assertEquals(cell5.getQuantity(), 2600)
self.assertEquals(cell5.getPrice(), 0.5) self.assertEquals(cell5.getPrice(), 0.5)
cell6 = paysheet_line.getCell('contribution_share/employer_share', cell6 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_400_to_5000') 'salary_range/france/slice_400_to_5000')
self.assertEquals(cell6.getQuantity(), 2600) self.assertEquals(cell6.getQuantity(), 2600)
self.assertEquals(cell6.getPrice(), 0.6) self.assertEquals(cell6.getPrice(), 0.6)
...@@ -745,19 +745,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -745,19 +745,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share', cell1 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_200_to_400') 'salary_range/france/slice_200_to_400')
self.assertEquals(cell1.getQuantity(), 200) self.assertEquals(cell1.getQuantity(), 200)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share', cell2 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_200_to_400') 'salary_range/france/slice_200_to_400')
self.assertEquals(cell2.getQuantity(), 200) self.assertEquals(cell2.getQuantity(), 200)
self.assertEquals(cell2.getPrice(), 0.2) self.assertEquals(cell2.getPrice(), 0.2)
cell3 = paysheet_line.getCell('contribution_share/employee_share', cell3 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_600_to_800') 'salary_range/france/slice_600_to_800')
self.assertEquals(cell3.getQuantity(), 200) self.assertEquals(cell3.getQuantity(), 200)
self.assertEquals(cell3.getPrice(), 0.3) self.assertEquals(cell3.getPrice(), 0.3)
cell4 = paysheet_line.getCell('contribution_share/employer_share', cell4 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_600_to_800') 'salary_range/france/slice_600_to_800')
self.assertEquals(cell4.getQuantity(), 200) self.assertEquals(cell4.getQuantity(), 200)
self.assertEquals(cell4.getPrice(), 0.4) self.assertEquals(cell4.getPrice(), 0.4)
...@@ -776,35 +776,35 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -776,35 +776,35 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
if len(paysheet_line.contentValues(portal_type='Pay Sheet Cell')) == 6: if len(paysheet_line.contentValues(portal_type='Pay Sheet Cell')) == 6:
# there is two lines with the same resource, one with slice and one # there is two lines with the same resource, one with slice and one
# without # without
cell1 = paysheet_line.getCell('contribution_share/employee_share', cell1 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_0_to_200') 'salary_range/france/slice_0_to_200')
self.assertEquals(cell1.getQuantity(), 200) self.assertEquals(cell1.getQuantity(), 200)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share', cell2 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_0_to_200') 'salary_range/france/slice_0_to_200')
self.assertEquals(cell2.getQuantity(), 200) self.assertEquals(cell2.getQuantity(), 200)
self.assertEquals(cell2.getPrice(), 0.2) self.assertEquals(cell2.getPrice(), 0.2)
cell3 = paysheet_line.getCell('contribution_share/employee_share', cell3 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_200_to_400') 'salary_range/france/slice_200_to_400')
self.assertEquals(cell3.getQuantity(), 200) self.assertEquals(cell3.getQuantity(), 200)
self.assertEquals(cell3.getPrice(), 0.3) self.assertEquals(cell3.getPrice(), 0.3)
cell4 = paysheet_line.getCell('contribution_share/employer_share', cell4 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_200_to_400') 'salary_range/france/slice_200_to_400')
self.assertEquals(cell4.getQuantity(), 200) self.assertEquals(cell4.getQuantity(), 200)
self.assertEquals(cell4.getPrice(), 0.4) self.assertEquals(cell4.getPrice(), 0.4)
cell5 = paysheet_line.getCell('contribution_share/employee_share', cell5 = paysheet_line.getCell('contribution_share/employee',
'salary_range/france/slice_400_to_5000') 'salary_range/france/slice_400_to_5000')
self.assertEquals(cell5.getQuantity(), 2600) self.assertEquals(cell5.getQuantity(), 2600)
self.assertEquals(cell5.getPrice(), 0.5) self.assertEquals(cell5.getPrice(), 0.5)
cell6 = paysheet_line.getCell('contribution_share/employer_share', cell6 = paysheet_line.getCell('contribution_share/employer',
'salary_range/france/slice_400_to_5000') 'salary_range/france/slice_400_to_5000')
self.assertEquals(cell6.getQuantity(), 2600) self.assertEquals(cell6.getQuantity(), 2600)
self.assertEquals(cell6.getPrice(), 0.6) self.assertEquals(cell6.getPrice(), 0.6)
else: else:
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour': elif service == 'Labour':
...@@ -818,19 +818,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -818,19 +818,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour': elif service == 'Labour':
self.assertEqual(paysheet_line.getTotalPrice(), 3000.0) self.assertEqual(paysheet_line.getTotalPrice(), 3000.0)
elif service == 'Sickness Insurance': elif service == 'Sickness Insurance':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.4) self.assertEquals(cell1.getPrice(), 0.4)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.3) self.assertEquals(cell2.getPrice(), 0.3)
else: else:
...@@ -842,19 +842,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -842,19 +842,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour': elif service == 'Labour':
self.assertEqual(paysheet_line.getTotalPrice(), 3000.0) self.assertEqual(paysheet_line.getTotalPrice(), 3000.0)
elif service == 'Old Age Insurance': elif service == 'Old Age Insurance':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.5) self.assertEquals(cell1.getPrice(), 0.5)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.8) self.assertEquals(cell2.getPrice(), 0.8)
else: else:
...@@ -898,9 +898,9 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -898,9 +898,9 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getSourceSectionValue(), urssaf_roubaix) self.assertEquals(cell1.getSourceSectionValue(), urssaf_roubaix)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getSourceSectionValue(), urssaf_roubaix) self.assertEquals(cell2.getSourceSectionValue(), urssaf_roubaix)
elif service == 'Labour': elif service == 'Labour':
pass pass
...@@ -1077,8 +1077,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1077,8 +1077,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
reference='intermediate_line', reference='intermediate_line',
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_contribution_list=['base_amount/deductible_tax'], base_contribution_list=['base_amount/deductible_tax'],
base_application_list=['base_amount/base_salary'], base_application_list=['base_amount/base_salary'],
create_line=False,) create_line=False,)
...@@ -1094,8 +1094,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1094,8 +1094,8 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('urssaf_service'), resource_value=sequence.get('urssaf_service'),
reference='line_applied_on_intermediate_line', reference='line_applied_on_intermediate_line',
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_contribution_list=['base_amount/net_salary'], base_contribution_list=['base_amount/net_salary'],
base_application_list=['base_amount/deductible_tax']) base_application_list=['base_amount/deductible_tax'])
sequence.edit(model_line_applied_on_tax = model_line) sequence.edit(model_line_applied_on_tax = model_line)
...@@ -1103,29 +1103,29 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1103,29 +1103,29 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
def stepIntermediateModelLineCreateMovements(self, sequence=None, def stepIntermediateModelLineCreateMovements(self, sequence=None,
**kw): **kw):
model_line = sequence.get('intermediate_model_line') model_line = sequence.get('intermediate_model_line')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.2, contribution_share='employee_share') cell1.edit(price=0.2, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.2, contribution_share='employer_share') cell2.edit(price=0.2, contribution_share='employer')
def stepAppliedOnTaxModelLineCreateMovements(self, sequence=None, **kw): def stepAppliedOnTaxModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('model_line_applied_on_tax') model_line = sequence.get('model_line_applied_on_tax')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.1, contribution_share='employee_share') cell1.edit(price=0.1, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.5, contribution_share='employer_share') cell2.edit(price=0.5, contribution_share='employer')
def stepModelCreateOldAgeInsuranceModelLine(self, sequence=None, **kw): def stepModelCreateOldAgeInsuranceModelLine(self, sequence=None, **kw):
model = sequence.get('model') model = sequence.get('model')
...@@ -1134,24 +1134,24 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1134,24 +1134,24 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('old_age_insurance_service'), resource_value=sequence.get('old_age_insurance_service'),
reference='old_age_insurance', reference='old_age_insurance',
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/deductible_tax'])
sequence.edit(old_age_insurance = model_line) sequence.edit(old_age_insurance = model_line)
def stepOldAgeInsuranceModelLineCreateMovements(self, sequence=None, **kw): def stepOldAgeInsuranceModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('old_age_insurance') model_line = sequence.get('old_age_insurance')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.5, contribution_share='employee_share') cell1.edit(price=0.5, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.8, contribution_share='employer_share') cell2.edit(price=0.8, contribution_share='employer')
def stepModelCreateSicknessInsuranceModelLine(self, sequence=None, **kw): def stepModelCreateSicknessInsuranceModelLine(self, sequence=None, **kw):
model = sequence.get('model') model = sequence.get('model')
...@@ -1160,24 +1160,24 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1160,24 +1160,24 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('sickness_insurance_service'), resource_value=sequence.get('sickness_insurance_service'),
reference='sickness_insurance', reference='sickness_insurance',
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/deductible_tax'])
sequence.edit(sickness_insurance = model_line) sequence.edit(sickness_insurance = model_line)
def stepSicknessInsuranceModelLineCreateMovements(self, sequence=None, **kw): def stepSicknessInsuranceModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('sickness_insurance') model_line = sequence.get('sickness_insurance')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.4, contribution_share='employee_share') cell1.edit(price=0.4, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.3, contribution_share='employer_share') cell2.edit(price=0.3, contribution_share='employer')
def stepCheckPaysheetIntermediateLines(self, sequence=None, **kw): def stepCheckPaysheetIntermediateLines(self, sequence=None, **kw):
paysheet = sequence.get('paysheet') paysheet = sequence.get('paysheet')
...@@ -1192,11 +1192,11 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1192,11 +1192,11 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 600) # here it's 600 of tax self.assertEquals(cell1.getQuantity(), 600) # here it's 600 of tax
# because of the intermediate line (3000*0.2) # because of the intermediate line (3000*0.2)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 600) # here it's 600 of tax self.assertEquals(cell2.getQuantity(), 600) # here it's 600 of tax
# because of the intermediate line (3000*0.2) # because of the intermediate line (3000*0.2)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
...@@ -1212,24 +1212,24 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1212,24 +1212,24 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
trade_phase='payroll/france/urssaf', trade_phase='payroll/france/urssaf',
resource_value=sequence.get('old_age_insurance_service'), resource_value=sequence.get('old_age_insurance_service'),
reference='model_line_in_the_payesheet', reference='model_line_in_the_payesheet',
variation_category_list=['contribution_share/employee_share', variation_category_list=['contribution_share/employee',
'contribution_share/employer_share'], 'contribution_share/employer'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
base_contribution_list=['base_amount/deductible_tax']) base_contribution_list=['base_amount/deductible_tax'])
sequence.edit(model_line_on_paysheet = model_line) sequence.edit(model_line_on_paysheet = model_line)
def stepPaysheetModelLineCreateMovements(self, sequence=None, **kw): def stepPaysheetModelLineCreateMovements(self, sequence=None, **kw):
model_line = sequence.get('model_line_on_paysheet') model_line = sequence.get('model_line_on_paysheet')
cell1 = model_line.newCell('contribution_share/employee_share', cell1 = model_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell1.edit(price=0.5, contribution_share='employee_share') cell1.edit(price=0.5, contribution_share='employee')
cell2 = model_line.newCell('contribution_share/employer_share', cell2 = model_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Model Cell', portal_type='Pay Sheet Model Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('quantity', 'price')) mapped_value_property_list=('quantity', 'price'))
cell2.edit(price=0.8, contribution_share='employer_share') cell2.edit(price=0.8, contribution_share='employer')
def stepCheckUpdateAggregatedAmountListReturnWithModelLineOnPaysheet(self, def stepCheckUpdateAggregatedAmountListReturnWithModelLineOnPaysheet(self,
sequence=None, **kw): sequence=None, **kw):
...@@ -1255,19 +1255,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1255,19 +1255,19 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.1) self.assertEquals(cell1.getPrice(), 0.1)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.5) self.assertEquals(cell2.getPrice(), 0.5)
elif service == 'Labour': elif service == 'Labour':
self.assertEqual(paysheet_line.getTotalPrice(), 3000.0) self.assertEqual(paysheet_line.getTotalPrice(), 3000.0)
elif service == 'Old Age Insurance': elif service == 'Old Age Insurance':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.5) self.assertEquals(cell1.getPrice(), 0.5)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.8) self.assertEquals(cell2.getPrice(), 0.8)
else: else:
...@@ -1276,11 +1276,11 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1276,11 +1276,11 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
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 :
cell_1 = model_line.getCell('contribution_share/employee_share', cell_1 = model_line.getCell('contribution_share/employee',
base_id='movement') base_id='movement')
self.assertNotEquals(cell_1, None) self.assertNotEquals(cell_1, None)
cell_1.edit(price=0.2) cell_1.edit(price=0.2)
cell_2 = model_line.getCell('contribution_share/employer_share', cell_2 = model_line.getCell('contribution_share/employer',
base_id='movement') base_id='movement')
self.assertNotEquals(cell_2, None) self.assertNotEquals(cell_2, None)
cell_2.edit(price=0.6) cell_2.edit(price=0.6)
...@@ -1296,10 +1296,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1296,10 +1296,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.2) self.assertEquals(cell1.getPrice(), 0.2)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.6) self.assertEquals(cell2.getPrice(), 0.6)
elif service == 'Labour': elif service == 'Labour':
...@@ -1323,10 +1323,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1323,10 +1323,10 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
for paysheet_line in paysheet_line_list: for paysheet_line in paysheet_line_list:
service = paysheet_line.getResourceTitle() service = paysheet_line.getResourceTitle()
if service == 'Urssaf': if service == 'Urssaf':
cell1 = paysheet_line.getCell('contribution_share/employee_share') cell1 = paysheet_line.getCell('contribution_share/employee')
self.assertEquals(cell1.getQuantity(), 3000) self.assertEquals(cell1.getQuantity(), 3000)
self.assertEquals(cell1.getPrice(), 0.3) self.assertEquals(cell1.getPrice(), 0.3)
cell2 = paysheet_line.getCell('contribution_share/employer_share') cell2 = paysheet_line.getCell('contribution_share/employer')
self.assertEquals(cell2.getQuantity(), 3000) self.assertEquals(cell2.getQuantity(), 3000)
self.assertEquals(cell2.getPrice(), 0.7) self.assertEquals(cell2.getPrice(), 0.7)
elif service == 'Labour': elif service == 'Labour':
...@@ -1455,30 +1455,30 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin): ...@@ -1455,30 +1455,30 @@ class TestPayrollMixin(ERP5ReportTestCase, TestTradeModelLineMixin):
# added to this line. # added to this line.
urssaf_service = sequence.get('urssaf_service') urssaf_service = sequence.get('urssaf_service')
line.setResourceValue(urssaf_service) line.setResourceValue(urssaf_service)
line.setVariationCategoryList(['contribution_share/employee_share', line.setVariationCategoryList(['contribution_share/employee',
'contribution_share/employer_share']) 'contribution_share/employer'])
cell0 = line.newCell('contribution_share/employee_share', cell0 = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', base_id='movement') portal_type='Pay Sheet Cell', base_id='movement')
cell0.setMappedValuePropertyList(['quantity', 'price']) cell0.setMappedValuePropertyList(['quantity', 'price'])
cell0.setVariationCategoryList(('contribution_share/employee_share',)) cell0.setVariationCategoryList(('contribution_share/employee',))
cell0.setPrice(2) cell0.setPrice(2)
cell0.setQuantity(3) cell0.setQuantity(3)
cell1 = line.newCell('contribution_share/employer_share', cell1 = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', base_id='movement') portal_type='Pay Sheet Cell', base_id='movement')
cell1.setMappedValuePropertyList(['quantity', 'price']) cell1.setMappedValuePropertyList(['quantity', 'price'])
cell1.setVariationCategoryList(('contribution_share/employer_share',)) cell1.setVariationCategoryList(('contribution_share/employer',))
cell1.setPrice(4) cell1.setPrice(4)
cell1.setQuantity(5) cell1.setQuantity(5)
movement_list = paysheet.PaySheetTransaction_getMovementList() movement_list = paysheet.PaySheetTransaction_getMovementList()
self.assertEquals(1, len(movement_list)) self.assertEquals(1, len(movement_list))
movement = movement_list[0] movement = movement_list[0]
self.assertEquals(2, movement.employee_share_price) self.assertEquals(2, movement.employee_price)
self.assertEquals(3, movement.employee_share_quantity) self.assertEquals(3, movement.employee_quantity)
self.assertEquals(2*3, movement.employee_share_total_price) self.assertEquals(2*3, movement.employee_total_price)
self.assertEquals(4, movement.employer_share_price) self.assertEquals(4, movement.employer_price)
self.assertEquals(5, movement.employer_share_quantity) self.assertEquals(5, movement.employer_quantity)
self.assertEquals(4*5, movement.employer_share_total_price) self.assertEquals(4*5, movement.employer_total_price)
def stepCheckModelWithoutRefValidity(self, sequence=None, **kw): def stepCheckModelWithoutRefValidity(self, sequence=None, **kw):
''' '''
...@@ -2439,8 +2439,8 @@ class TestPayroll(TestPayrollMixin): ...@@ -2439,8 +2439,8 @@ class TestPayroll(TestPayrollMixin):
portal_type='Service', portal_type='Service',
title='PS1', title='PS1',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
employer = self.portal.organisation_module.newContent( employer = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Employer', title='Employer',
...@@ -2473,20 +2473,20 @@ class TestPayroll(TestPayrollMixin): ...@@ -2473,20 +2473,20 @@ class TestPayroll(TestPayrollMixin):
source_section_value=provider, source_section_value=provider,
# (destination is set by PaySheetTransaction.createPaySheetLine) # (destination is set by PaySheetTransaction.createPaySheetLine)
destination_value=employee1, destination_value=employee1,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-.50, quantity=2000, contribution_share='employee_share') cell_employee.edit(price=-.50, quantity=2000, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-.40, quantity=2000, contribution_share='employer_share') cell_employer.edit(price=-.40, quantity=2000, contribution_share='employer')
ps1.plan() ps1.plan()
ps2 = self.portal.accounting_module.newContent( ps2 = self.portal.accounting_module.newContent(
...@@ -2499,39 +2499,39 @@ class TestPayroll(TestPayrollMixin): ...@@ -2499,39 +2499,39 @@ class TestPayroll(TestPayrollMixin):
resource_value=service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee2, destination_value=employee2,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-.50, quantity=3000, contribution_share='employee_share') cell_employee.edit(price=-.50, quantity=3000, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-.40, quantity=3000, contribution_share='employer_share') cell_employer.edit(price=-.40, quantity=3000, contribution_share='employer')
other_line = ps2.newContent(portal_type='Pay Sheet Line', other_line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=service, resource_value=service,
destination_value=employee2, destination_value=employee2,
source_section_value=other_provider, source_section_value=other_provider,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = other_line.newCell('contribution_share/employee_share', cell_employee = other_line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-.46, quantity=2998, contribution_share='employee_share') cell_employee.edit(price=-.46, quantity=2998, contribution_share='employee')
cell_employer = other_line.newCell('contribution_share/employer_share', cell_employer = other_line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-.42, quantity=2998, contribution_share='employer_share') cell_employer.edit(price=-.42, quantity=2998, contribution_share='employer')
self.stepTic() self.stepTic()
# AccountingTransactionModule_getPaySheetMovementMirrorSectionItemList is # AccountingTransactionModule_getPaySheetMovementMirrorSectionItemList is
...@@ -2569,22 +2569,22 @@ class TestPayroll(TestPayrollMixin): ...@@ -2569,22 +2569,22 @@ class TestPayroll(TestPayrollMixin):
employee_career_reference='E1', employee_career_reference='E1',
employee_title='Employee One', employee_title='Employee One',
base=2000, base=2000,
employee_share=2000 * .50, employee=2000 * .50,
employer_share=2000 * .40, employer=2000 * .40,
total=(2000 * .50 + 2000 * .40)) total=(2000 * .50 + 2000 * .40))
self.checkLineProperties(data_line_list[1], self.checkLineProperties(data_line_list[1],
id=2, id=2,
employee_career_reference='E2', employee_career_reference='E2',
employee_title='Employee Two', employee_title='Employee Two',
base=3000, base=3000,
employee_share=3000 * .50, employee=3000 * .50,
employer_share=3000 * .40, employer=3000 * .40,
total=(3000 * .50 + 3000 * .40)) total=(3000 * .50 + 3000 * .40))
# stat line # stat line
self.checkLineProperties(line_list[-1], self.checkLineProperties(line_list[-1],
base=3000 + 2000, base=3000 + 2000,
employee_share=(3000 + 2000) * .50, employee=(3000 + 2000) * .50,
employer_share=(3000 + 2000) * .40, employer=(3000 + 2000) * .40,
total=((3000 + 2000) * .50 + (3000 + 2000) * .40)) total=((3000 + 2000) * .50 + (3000 + 2000) * .40))
def test_PayrollTaxesReportDifferentSalaryRange(self): def test_PayrollTaxesReportDifferentSalaryRange(self):
...@@ -2599,8 +2599,8 @@ class TestPayroll(TestPayrollMixin): ...@@ -2599,8 +2599,8 @@ class TestPayroll(TestPayrollMixin):
title='PS1', title='PS1',
variation_base_category_list=('contribution_share', variation_base_category_list=('contribution_share',
'salary_range'), 'salary_range'),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share', 'contribution_share/employer',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
'salary_range/france/slice_b')) 'salary_range/france/slice_b'))
employer = self.portal.organisation_module.newContent( employer = self.portal.organisation_module.newContent(
...@@ -2635,46 +2635,46 @@ class TestPayroll(TestPayrollMixin): ...@@ -2635,46 +2635,46 @@ class TestPayroll(TestPayrollMixin):
source_section_value=provider, source_section_value=provider,
# (destination is set by PaySheetTransaction.createPaySheetLine) # (destination is set by PaySheetTransaction.createPaySheetLine)
destination_value=employee1, destination_value=employee1,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share', 'contribution_share/employer',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
'salary_range/france/slice_b')) 'salary_range/france/slice_b'))
cell_employee_a = line.newCell('contribution_share/employee_share', cell_employee_a = line.newCell('contribution_share/employee',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee_a.edit(price=-.50, quantity=1000, cell_employee_a.edit(price=-.50, quantity=1000,
contribution_share='employee_share', contribution_share='employee',
salary_range='france/slice_a') salary_range='france/slice_a')
cell_employee_b = line.newCell('contribution_share/employee_share', cell_employee_b = line.newCell('contribution_share/employee',
'salary_range/france/slice_b', 'salary_range/france/slice_b',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee_b.edit(price=-.20, quantity=500, cell_employee_b.edit(price=-.20, quantity=500,
contribution_share='employee_share', contribution_share='employee',
salary_range='france/slice_b') salary_range='france/slice_b')
cell_employer_a = line.newCell('contribution_share/employer_share', cell_employer_a = line.newCell('contribution_share/employer',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer_a.edit(price=-.40, quantity=1000, cell_employer_a.edit(price=-.40, quantity=1000,
contribution_share='employer_share', contribution_share='employer',
salary_range='france/slice_a') salary_range='france/slice_a')
cell_employer_b = line.newCell('contribution_share/employer_share', cell_employer_b = line.newCell('contribution_share/employer',
'salary_range/france/slice_b', 'salary_range/france/slice_b',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer_b.edit(price=-.32, quantity=500, cell_employer_b.edit(price=-.32, quantity=500,
contribution_share='employer_share', contribution_share='employer',
salary_range='france/slice_b') salary_range='france/slice_b')
ps1.plan() ps1.plan()
...@@ -2689,11 +2689,11 @@ class TestPayroll(TestPayrollMixin): ...@@ -2689,11 +2689,11 @@ class TestPayroll(TestPayrollMixin):
resource_value=service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee2, destination_value=employee2,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share', 'contribution_share/employer',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
'salary_range/france/slice_b')) 'salary_range/france/slice_b'))
cell_employee_a = line.newCell('contribution_share/employee_share', cell_employee_a = line.newCell('contribution_share/employee',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
...@@ -2701,8 +2701,8 @@ class TestPayroll(TestPayrollMixin): ...@@ -2701,8 +2701,8 @@ class TestPayroll(TestPayrollMixin):
'quantity'),) 'quantity'),)
cell_employee_a.edit(price=-.50, quantity=1000, cell_employee_a.edit(price=-.50, quantity=1000,
salary_range='france/slice_a', salary_range='france/slice_a',
contribution_share='employee_share') contribution_share='employee')
cell_employee_b = line.newCell('contribution_share/employee_share', cell_employee_b = line.newCell('contribution_share/employee',
'salary_range/france/slice_b', 'salary_range/france/slice_b',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
...@@ -2710,9 +2710,9 @@ class TestPayroll(TestPayrollMixin): ...@@ -2710,9 +2710,9 @@ class TestPayroll(TestPayrollMixin):
'quantity'),) 'quantity'),)
cell_employee_b.edit(price=-.20, quantity=3000, cell_employee_b.edit(price=-.20, quantity=3000,
salary_range='france/slice_b', salary_range='france/slice_b',
contribution_share='employee_share') contribution_share='employee')
cell_employer_a = line.newCell('contribution_share/employer_share', cell_employer_a = line.newCell('contribution_share/employer',
'salary_range/france/slice_a', 'salary_range/france/slice_a',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
...@@ -2720,8 +2720,8 @@ class TestPayroll(TestPayrollMixin): ...@@ -2720,8 +2720,8 @@ class TestPayroll(TestPayrollMixin):
'quantity'),) 'quantity'),)
cell_employer_a.edit(price=-.40, quantity=1000, cell_employer_a.edit(price=-.40, quantity=1000,
salary_range='france/slice_a', salary_range='france/slice_a',
contribution_share='employer_share') contribution_share='employer')
cell_employer_b = line.newCell('contribution_share/employer_share', cell_employer_b = line.newCell('contribution_share/employer',
'salary_range/france/slice_b', 'salary_range/france/slice_b',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
...@@ -2729,7 +2729,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -2729,7 +2729,7 @@ class TestPayroll(TestPayrollMixin):
'quantity'),) 'quantity'),)
cell_employer_b.edit(price=-.32, quantity=3000, cell_employer_b.edit(price=-.32, quantity=3000,
salary_range='france/slice_b', salary_range='france/slice_b',
contribution_share='employer_share') contribution_share='employer')
self.stepTic() self.stepTic()
# set request variables and render # set request variables and render
...@@ -2754,22 +2754,22 @@ class TestPayroll(TestPayrollMixin): ...@@ -2754,22 +2754,22 @@ class TestPayroll(TestPayrollMixin):
employee_career_reference='E1', employee_career_reference='E1',
employee_title='Employee One', employee_title='Employee One',
base=1000, base=1000,
employee_share=1000 * .50, employee=1000 * .50,
employer_share=1000 * .40, employer=1000 * .40,
total=(1000 * .50 + 1000 * .40)) total=(1000 * .50 + 1000 * .40))
self.checkLineProperties(data_line_list[1], self.checkLineProperties(data_line_list[1],
id=2, id=2,
employee_career_reference='E2', employee_career_reference='E2',
employee_title='Employee Two', employee_title='Employee Two',
base=1000, base=1000,
employee_share=1000 * .50, employee=1000 * .50,
employer_share=1000 * .40, employer=1000 * .40,
total=(1000 * .50 + 1000 * .40)) total=(1000 * .50 + 1000 * .40))
self.checkLineProperties(data_line_list[2], self.checkLineProperties(data_line_list[2],
employee_title='Total Slice A', employee_title='Total Slice A',
base=2000, base=2000,
employee_share=2000 * .50, employee=2000 * .50,
employer_share=2000 * .40, employer=2000 * .40,
#total=(2000 * .50 + 2000 * .40) #total=(2000 * .50 + 2000 * .40)
) )
...@@ -2778,30 +2778,30 @@ class TestPayroll(TestPayrollMixin): ...@@ -2778,30 +2778,30 @@ class TestPayroll(TestPayrollMixin):
employee_career_reference='E1', employee_career_reference='E1',
employee_title='Employee One', employee_title='Employee One',
base=500, base=500,
employee_share=500 * .20, employee=500 * .20,
employer_share=500 * .32, employer=500 * .32,
total=(500 * .20 + 500 * .32)) total=(500 * .20 + 500 * .32))
self.checkLineProperties(data_line_list[4], self.checkLineProperties(data_line_list[4],
id=4, id=4,
employee_career_reference='E2', employee_career_reference='E2',
employee_title='Employee Two', employee_title='Employee Two',
base=3000, base=3000,
employee_share=3000 * .20, employee=3000 * .20,
employer_share=3000 * .32, employer=3000 * .32,
total=(3000 * .20 + 3000 * .32)) total=(3000 * .20 + 3000 * .32))
self.checkLineProperties(data_line_list[5], self.checkLineProperties(data_line_list[5],
employee_title='Total Slice B', employee_title='Total Slice B',
base=3500, base=3500,
employee_share=3500 * .20, employee=3500 * .20,
employer_share=3500 * .32, employer=3500 * .32,
#total=(3500 * .20 + 3500 * .32), #total=(3500 * .20 + 3500 * .32),
) )
# stat line # stat line
self.checkLineProperties(line_list[-1], self.checkLineProperties(line_list[-1],
base=2000 + 3500, base=2000 + 3500,
employee_share=(2000 * .50 + 3500 * .20), employee=(2000 * .50 + 3500 * .20),
employer_share=(2000 * .40 + 3500 * .32), employer=(2000 * .40 + 3500 * .32),
total=((2000 * .50 + 3500 * .20) + total=((2000 * .50 + 3500 * .20) +
(2000 * .40 + 3500 * .32))) (2000 * .40 + 3500 * .32)))
...@@ -2816,14 +2816,14 @@ class TestPayroll(TestPayrollMixin): ...@@ -2816,14 +2816,14 @@ class TestPayroll(TestPayrollMixin):
portal_type='Service', portal_type='Service',
title='Gross Salary', title='Gross Salary',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
service = self.portal.service_module.newContent( service = self.portal.service_module.newContent(
portal_type='Service', portal_type='Service',
title='PS1', title='PS1',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
employer = self.portal.organisation_module.newContent( employer = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Employer', title='Employer',
...@@ -2860,33 +2860,33 @@ class TestPayroll(TestPayrollMixin): ...@@ -2860,33 +2860,33 @@ class TestPayroll(TestPayrollMixin):
resource_value=salary_service, resource_value=salary_service,
destination_value=employee1, destination_value=employee1,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/net_salary',],
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=1, quantity=2000, contribution_share='employee_share') cell_employee.edit(price=1, quantity=2000, contribution_share='employee')
line = ps1.newContent(portal_type='Pay Sheet Line', line = ps1.newContent(portal_type='Pay Sheet Line',
resource_value=service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee1, destination_value=employee1,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/net_salary',],
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-.50, quantity=2000, contribution_share='employee_share') cell_employee.edit(price=-.50, quantity=2000, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-.40, quantity=2000, contribution_share='employer_share') cell_employer.edit(price=-.40, quantity=2000, contribution_share='employer')
ps1.plan() ps1.plan()
ps2 = self.portal.accounting_module.newContent( ps2 = self.portal.accounting_module.newContent(
...@@ -2900,33 +2900,33 @@ class TestPayroll(TestPayrollMixin): ...@@ -2900,33 +2900,33 @@ class TestPayroll(TestPayrollMixin):
resource_value=salary_service, resource_value=salary_service,
destination_value=employee2, destination_value=employee2,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/net_salary',],
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=1, quantity=3000, contribution_share='employee_share') cell_employee.edit(price=1, quantity=3000, contribution_share='employee')
line = ps2.newContent(portal_type='Pay Sheet Line', line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee2, destination_value=employee2,
base_contribution_list=['base_amount/net_salary',], base_contribution_list=['base_amount/net_salary',],
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-.50, quantity=3000, contribution_share='employee_share') cell_employee.edit(price=-.50, quantity=3000, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-.40, quantity=3000, contribution_share='employer_share') cell_employer.edit(price=-.40, quantity=3000, contribution_share='employer')
self.stepTic() self.stepTic()
# set request variables and render # set request variables and render
...@@ -2975,29 +2975,29 @@ class TestPayroll(TestPayrollMixin): ...@@ -2975,29 +2975,29 @@ class TestPayroll(TestPayrollMixin):
title='Base Salary', title='Base Salary',
product_line='base_salary', product_line='base_salary',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
bonus = self.portal.service_module.newContent( bonus = self.portal.service_module.newContent(
portal_type='Service', portal_type='Service',
title='Bonus', title='Bonus',
product_line='base_salary', product_line='base_salary',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
deductions = self.portal.service_module.newContent( deductions = self.portal.service_module.newContent(
portal_type='Service', portal_type='Service',
title='Deductions', title='Deductions',
product_line='base_salary', product_line='base_salary',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
tax1 = self.portal.service_module.newContent( tax1 = self.portal.service_module.newContent(
portal_type='Service', portal_type='Service',
title='Tax1', title='Tax1',
product_line='payroll_tax_1', product_line='payroll_tax_1',
variation_base_category_list=('contribution_share',), variation_base_category_list=('contribution_share',),
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
# create accounts # create accounts
account_payroll_wages_expense = self.portal.account_module.newContent( account_payroll_wages_expense = self.portal.account_module.newContent(
...@@ -3028,13 +3028,13 @@ class TestPayroll(TestPayrollMixin): ...@@ -3028,13 +3028,13 @@ class TestPayroll(TestPayrollMixin):
string_index='contribution_share', string_index='contribution_share',
int_index=1, int_index=1,
membership_criterion_base_category_list=('contribution_share',), membership_criterion_base_category_list=('contribution_share',),
membership_criterion_category_list=('contribution_share/employee_share',)) membership_criterion_category_list=('contribution_share/employee',))
rule.newContent(portal_type='Predicate', rule.newContent(portal_type='Predicate',
title='Employer Share', title='Employer Share',
string_index='contribution_share', string_index='contribution_share',
int_index=2, int_index=2,
membership_criterion_base_category_list=('contribution_share',), membership_criterion_base_category_list=('contribution_share',),
membership_criterion_category_list=('contribution_share/employer_share',)) membership_criterion_category_list=('contribution_share/employer',))
rule.newContent(portal_type='Predicate', rule.newContent(portal_type='Predicate',
title='Base Salary', title='Base Salary',
...@@ -3122,60 +3122,60 @@ class TestPayroll(TestPayrollMixin): ...@@ -3122,60 +3122,60 @@ class TestPayroll(TestPayrollMixin):
title='Base salary', title='Base salary',
resource_value=base_salary, resource_value=base_salary,
destination_value=employee, destination_value=employee,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=1, quantity=2000, contribution_share='employee_share') cell_employee.edit(price=1, quantity=2000, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=1, quantity=2000, contribution_share='employer_share') cell_employer.edit(price=1, quantity=2000, contribution_share='employer')
# base_salary += 100 (bonus) # base_salary += 100 (bonus)
line = ps.newContent(portal_type='Pay Sheet Line', line = ps.newContent(portal_type='Pay Sheet Line',
title='Bonus', title='Bonus',
resource_value=bonus, resource_value=bonus,
destination_value=employee, destination_value=employee,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=1, quantity=100, contribution_share='employee_share') cell_employee.edit(price=1, quantity=100, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=1, quantity=100, contribution_share='employer_share') cell_employer.edit(price=1, quantity=100, contribution_share='employer')
# base_salary -= 50 (deductions) => base_salary == 2050 # base_salary -= 50 (deductions) => base_salary == 2050
line = ps.newContent(portal_type='Pay Sheet Line', line = ps.newContent(portal_type='Pay Sheet Line',
title='Deduction', title='Deduction',
resource_value=deductions, resource_value=deductions,
destination_value=employee, destination_value=employee,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-1, quantity=50, contribution_share='employee_share') cell_employee.edit(price=-1, quantity=50, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-1, quantity=50, contribution_share='employer_share') cell_employer.edit(price=-1, quantity=50, contribution_share='employer')
# tax1 = 10% for employee ( 205 ) # tax1 = 10% for employee ( 205 )
# 20% for employer ( 410 ) # 20% for employer ( 410 )
...@@ -3184,20 +3184,20 @@ class TestPayroll(TestPayrollMixin): ...@@ -3184,20 +3184,20 @@ class TestPayroll(TestPayrollMixin):
resource_value=tax1, resource_value=tax1,
source_section_value=provider, source_section_value=provider,
destination_value=employee, destination_value=employee,
variation_category_list=('contribution_share/employee_share', variation_category_list=('contribution_share/employee',
'contribution_share/employer_share')) 'contribution_share/employer'))
cell_employee = line.newCell('contribution_share/employee_share', cell_employee = line.newCell('contribution_share/employee',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employee.edit(price=-.1, quantity=2050, contribution_share='employee_share') cell_employee.edit(price=-.1, quantity=2050, contribution_share='employee')
cell_employer = line.newCell('contribution_share/employer_share', cell_employer = line.newCell('contribution_share/employer',
portal_type='Pay Sheet Cell', portal_type='Pay Sheet Cell',
base_id='movement', base_id='movement',
mapped_value_property_list=('price', mapped_value_property_list=('price',
'quantity'),) 'quantity'),)
cell_employer.edit(price=-.2, quantity=2050, contribution_share='employer_share') cell_employer.edit(price=-.2, quantity=2050, contribution_share='employer')
ps.plan() ps.plan()
self.stepTic() self.stepTic()
......
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