Commit ab9eea5a authored by Fabien Morin's avatar Fabien Morin

change Payroll Service to service


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27490 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1add56dd
...@@ -112,34 +112,34 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -112,34 +112,34 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
return ('erp5_base', 'erp5_pdm', 'erp5_trade', 'erp5_accounting', return ('erp5_base', 'erp5_pdm', 'erp5_trade', 'erp5_accounting',
'erp5_invoicing', 'erp5_mrp', 'erp5_bpm', 'erp5_payroll') 'erp5_invoicing', 'erp5_mrp', 'erp5_bpm', 'erp5_payroll')
def createPayrollService(self): def createService(self):
module = self.portal.getDefaultModule(portal_type='Payroll Service') module = self.portal.getDefaultModule(portal_type='Service')
return module.newContent(portal_type='Payroll Service') return module.newContent(portal_type='Service')
def stepCreateUrssafPayrollService(self, sequence=None, **kw): def stepCreateUrssafService(self, sequence=None, **kw):
node = self.createPayrollService() node = self.createService()
node.edit(title='Urssaf', node.edit(title='Urssaf',
product_line='state_insurance', quantity_unit='time/month', product_line='state_insurance', quantity_unit='time/month',
variation_base_category_list=['tax_category', 'salary_range'], variation_base_category_list=['tax_category', 'salary_range'],
use='payroll/tax') use='payroll/tax')
node.setVariationCategoryList(['tax_category/employee_share', node.setVariationCategoryList(['tax_category/employee_share',
'tax_category/employer_share']) 'tax_category/employer_share'])
sequence.edit(urssaf_payroll_service = node) sequence.edit(urssaf_service = node)
def stepCreateLabourPayrollService(self, sequence=None, **kw): def stepCreateLabourService(self, sequence=None, **kw):
node = self.createPayrollService() node = self.createService()
node.edit(title='Labour', quantity_unit='time/month', node.edit(title='Labour', quantity_unit='time/month',
product_line='labour', use='payroll/base_salary') product_line='labour', use='payroll/base_salary')
sequence.edit(labour_payroll_service = node) sequence.edit(labour_service = node)
def stepCreateOldAgeInsuranacePayrollService(self, sequence=None, **kw): def stepCreateOldAgeInsuranaceService(self, sequence=None, **kw):
node = self.createPayrollService() node = self.createService()
node.edit(title='Oldage Insurance', quantity_unit='time/month', node.edit(title='Oldage Insurance', quantity_unit='time/month',
variation_base_category_list=['tax_category', 'salary_range'], variation_base_category_list=['tax_category', 'salary_range'],
product_line='state_insurance', use='payroll/tax') product_line='state_insurance', use='payroll/tax')
node.setVariationCategoryList(['tax_category/employee_share', node.setVariationCategoryList(['tax_category/employee_share',
'tax_category/employer_share']) 'tax_category/employer_share'])
sequence.edit(oldage_insurance_payroll_service = node) sequence.edit(oldage_insurance_service = node)
def createModel(self): def createModel(self):
module = self.portal.getDefaultModule(portal_type='Pay Sheet Model') module = self.portal.getDefaultModule(portal_type='Pay Sheet Model')
...@@ -205,7 +205,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -205,7 +205,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
int_index=2, int_index=2,
reference='urssaf_model_line', reference='urssaf_model_line',
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('urssaf_payroll_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share'], 'tax_category/employer_share'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
...@@ -219,7 +219,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -219,7 +219,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
int_index=2, int_index=2,
reference='urssaf_model_line_2', reference='urssaf_model_line_2',
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('urssaf_payroll_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share', 'tax_category/employer_share',
'salary_range/france/slice_0_to_200', 'salary_range/france/slice_0_to_200',
...@@ -236,7 +236,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -236,7 +236,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
int_index=2, int_index=2,
reference='urssaf_model_line_3', reference='urssaf_model_line_3',
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('urssaf_payroll_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share', 'tax_category/employer_share',
'salary_range/france/slice_200_to_400', 'salary_range/france/slice_200_to_400',
...@@ -255,7 +255,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -255,7 +255,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
int_index=2, int_index=2,
reference='urssaf_model_line', reference='urssaf_model_line',
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('urssaf_payroll_service'), resource_value=sequence.get('urssaf_service'),
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share'], 'tax_category/employer_share'],
base_application_list=[ 'base_amount/base_salary'], base_application_list=[ 'base_amount/base_salary'],
...@@ -401,7 +401,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -401,7 +401,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
int_index=1, int_index=1,
price=20, price=20,
quantity=150, quantity=150,
resource_value=sequence.get('labour_payroll_service'), resource_value=sequence.get('labour_service'),
base_contribution_list=[ 'base_amount/base_salary']) base_contribution_list=[ 'base_amount/base_salary'])
sequence.edit(labour_paysheet_line = paysheet_line) sequence.edit(labour_paysheet_line = paysheet_line)
...@@ -749,7 +749,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -749,7 +749,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
model_line.edit(title='intermediate line', model_line.edit(title='intermediate line',
int_index=2, int_index=2,
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('urssaf_payroll_service'), resource_value=sequence.get('urssaf_service'),
reference='intermediate_line', reference='intermediate_line',
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share'], 'tax_category/employer_share'],
...@@ -767,7 +767,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -767,7 +767,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
model_line.edit(title='line applied on intermediate line', model_line.edit(title='line applied on intermediate line',
int_index=3, int_index=3,
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('urssaf_payroll_service'), resource_value=sequence.get('urssaf_service'),
reference='line_applied_on_intermediate_line', reference='line_applied_on_intermediate_line',
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share'], 'tax_category/employer_share'],
...@@ -834,7 +834,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -834,7 +834,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
model_line.edit(title='model line in the paysheet', model_line.edit(title='model line in the paysheet',
int_index=2, int_index=2,
trade_phase='trade_phase/payroll/france/urssaf', trade_phase='trade_phase/payroll/france/urssaf',
resource_value=sequence.get('oldage_insurance_payroll_service'), resource_value=sequence.get('oldage_insurance_service'),
reference='model_line_in_the_payesheet', reference='model_line_in_the_payesheet',
variation_category_list=['tax_category/employee_share', variation_category_list=['tax_category/employee_share',
'tax_category/employer_share'], 'tax_category/employer_share'],
...@@ -954,7 +954,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin): ...@@ -954,7 +954,7 @@ class TestNewPayrollMixin(ERP5ReportTestCase, TestBPMMixin):
self.assertEquals([], model.checkConsistency()) self.assertEquals([], model.checkConsistency())
def stepCheckServiceConsistency(self, sequence=None, **kw): def stepCheckServiceConsistency(self, sequence=None, **kw):
service = sequence.get('urssaf_payroll_service') service = sequence.get('urssaf_service')
self.assertEquals([], service.checkConsistency()) self.assertEquals([], service.checkConsistency())
class TestNewPayroll(TestNewPayrollMixin): class TestNewPayroll(TestNewPayrollMixin):
...@@ -968,8 +968,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -968,8 +968,8 @@ class TestNewPayroll(TestNewPayrollMixin):
Tic Tic
""" """
COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING = """ COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING = """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreatePriceCurrency CreatePriceCurrency
...@@ -1010,8 +1010,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1010,8 +1010,8 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = """ sequence_string = """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreateBasicModel CreateBasicModel
...@@ -1030,8 +1030,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1030,8 +1030,8 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = """ sequence_string = """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreateBasicModel CreateBasicModel
...@@ -1089,8 +1089,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1089,8 +1089,8 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = """ sequence_string = """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreateBasicModel CreateBasicModel
...@@ -1115,7 +1115,7 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1115,7 +1115,7 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """ sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """
CreateOldAgeInsuranacePayrollService CreateOldAgeInsuranaceService
PaysheetCreateModelLine PaysheetCreateModelLine
PaysheetModelLineCreateMovements PaysheetModelLineCreateMovements
CheckUpdateAggregatedAmountListReturnWithModelLineOnPaysheet CheckUpdateAggregatedAmountListReturnWithModelLineOnPaysheet
...@@ -1194,8 +1194,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1194,8 +1194,8 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """ sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreateModelWithSlices CreateModelWithSlices
...@@ -1224,8 +1224,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1224,8 +1224,8 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """ sequence_string = self.COMMON_BASIC_DOCUMENT_CREATION_SEQUENCE_STRING + """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreateModelWithSlices CreateModelWithSlices
...@@ -1254,8 +1254,8 @@ class TestNewPayroll(TestNewPayrollMixin): ...@@ -1254,8 +1254,8 @@ class TestNewPayroll(TestNewPayrollMixin):
''' '''
sequence_list = SequenceList() sequence_list = SequenceList()
sequence_string = """ sequence_string = """
CreateUrssafPayrollService CreateUrssafService
CreateLabourPayrollService CreateLabourService
CreateEmployer CreateEmployer
CreateEmployee CreateEmployee
CreatePriceCurrency CreatePriceCurrency
......
...@@ -58,7 +58,7 @@ class TestPayrollMixin(ERP5ReportTestCase): ...@@ -58,7 +58,7 @@ class TestPayrollMixin(ERP5ReportTestCase):
paysheet_model_line_portal_type = 'Pay Sheet Model Line' paysheet_model_line_portal_type = 'Pay Sheet Model Line'
paysheet_transaction_portal_type = 'Pay Sheet Transaction' paysheet_transaction_portal_type = 'Pay Sheet Transaction'
paysheet_line_portal_type = 'Pay Sheet Line' paysheet_line_portal_type = 'Pay Sheet Line'
payroll_service_portal_type = 'Payroll Service' service_portal_type = 'Service'
currency_portal_type = 'Currency' currency_portal_type = 'Currency'
person_portal_type = 'Person' person_portal_type = 'Person'
organisation_portal_type = 'Organisation' organisation_portal_type = 'Organisation'
...@@ -99,7 +99,7 @@ class TestPayrollMixin(ERP5ReportTestCase): ...@@ -99,7 +99,7 @@ class TestPayrollMixin(ERP5ReportTestCase):
self.portal = self.getPortal() self.portal = self.getPortal()
self.organisation_module = self.portal.organisation_module self.organisation_module = self.portal.organisation_module
self.person_module = self.portal.person_module self.person_module = self.portal.person_module
self.payroll_service_module = self.portal.payroll_service_module self.service_module = self.portal.service_module
self.paysheet_model_module = self.portal.paysheet_model_module self.paysheet_model_module = self.portal.paysheet_model_module
self.validateRules() self.validateRules()
self.createCategories() self.createCategories()
...@@ -112,7 +112,7 @@ class TestPayrollMixin(ERP5ReportTestCase): ...@@ -112,7 +112,7 @@ class TestPayrollMixin(ERP5ReportTestCase):
self.login() self.login()
# creation of payroll services # creation of services
self.urssaf_id = 'sickness_insurance' self.urssaf_id = 'sickness_insurance'
self.labour_id = 'labour' self.labour_id = 'labour'
...@@ -127,16 +127,16 @@ class TestPayrollMixin(ERP5ReportTestCase): ...@@ -127,16 +127,16 @@ class TestPayrollMixin(ERP5ReportTestCase):
self.salary_share_list = ['tax_category/'+self.tax_category_employee_share,] self.salary_share_list = ['tax_category/'+self.tax_category_employee_share,]
self.payroll_service_organisation = self.createOrganisation( self.service_organisation = self.createOrganisation(
id='urssaf', title='URSSAF') id='urssaf', title='URSSAF')
self.urssaf = self.createPayrollService(id=self.urssaf_id, self.urssaf = self.createService(id=self.urssaf_id,
title='State Insurance', title='State Insurance',
product_line='state_insurance', product_line='state_insurance',
variation_base_category_list=['tax_category', 'salary_range'], variation_base_category_list=['tax_category', 'salary_range'],
variation_category_list=self.urssaf_slice_list + \ variation_category_list=self.urssaf_slice_list + \
self.urssaf_share_list) self.urssaf_share_list)
self.labour = self.createPayrollService(id=self.labour_id, self.labour = self.createService(id=self.labour_id,
title='Labour', title='Labour',
product_line='labour', product_line='labour',
variation_base_category_list=['tax_category', 'salary_range'], variation_base_category_list=['tax_category', 'salary_range'],
...@@ -157,7 +157,7 @@ class TestPayrollMixin(ERP5ReportTestCase): ...@@ -157,7 +157,7 @@ class TestPayrollMixin(ERP5ReportTestCase):
for module in [ 'organisation_module', for module in [ 'organisation_module',
'person_module', 'person_module',
'currency_module', 'currency_module',
'payroll_service_module', 'service_module',
'paysheet_model_module', 'paysheet_model_module',
'accounting_module']: 'accounting_module']:
folder = getattr(self.getPortal(), module, None) folder = getattr(self.getPortal(), module, None)
...@@ -292,32 +292,32 @@ class TestPayrollMixin(ERP5ReportTestCase): ...@@ -292,32 +292,32 @@ class TestPayrollMixin(ERP5ReportTestCase):
self.tic() self.tic()
return organisation return organisation
def createPayrollService(self, id='', title='', def createService(self, id='', title='',
variation_base_category_list=None, variation_base_category_list=None,
variation_category_list=None, product_line=None, **kw): variation_category_list=None, product_line=None, **kw):
payroll_service_portal_type = 'Payroll Service' service_portal_type = 'Service'
payroll_service_module = self.portal.getDefaultModule(\ service_module = self.portal.getDefaultModule(\
portal_type=payroll_service_portal_type) portal_type=service_portal_type)
if variation_category_list == None: if variation_category_list == None:
variation_category_list=[] variation_category_list=[]
if variation_base_category_list == None: if variation_base_category_list == None:
variation_category_list=[] variation_category_list=[]
if hasattr(payroll_service_module, id): if hasattr(service_module, id):
payroll_service_module.manage_delObjects([id]) service_module.manage_delObjects([id])
payroll_service = payroll_service_module.newContent( service = service_module.newContent(
title=title, title=title,
portal_type=self.payroll_service_portal_type, portal_type=self.service_portal_type,
id=id, id=id,
quantity_unit='time/month', quantity_unit='time/month',
product_line=product_line) product_line=product_line)
payroll_service.setVariationBaseCategoryList(variation_base_category_list) service.setVariationBaseCategoryList(variation_base_category_list)
payroll_service.setVariationCategoryList(variation_category_list) service.setVariationCategoryList(variation_category_list)
transaction.commit() transaction.commit()
self.tic() self.tic()
return payroll_service return service
def createModel(self, id, title='', person_id='', def createModel(self, id, title='', person_id='',
person_title='', person_career_grade='', person_title='', person_career_grade='',
...@@ -945,8 +945,8 @@ class TestPayroll(TestPayrollMixin): ...@@ -945,8 +945,8 @@ class TestPayroll(TestPayrollMixin):
def test_PayrollTaxesReport(self): def test_PayrollTaxesReport(self):
eur = self.portal.currency_module.EUR eur = self.portal.currency_module.EUR
payroll_service = self.portal.payroll_service_module.newContent( service = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='PS1', title='PS1',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
...@@ -968,10 +968,10 @@ class TestPayroll(TestPayrollMixin): ...@@ -968,10 +968,10 @@ class TestPayroll(TestPayrollMixin):
career_subordination_value=employer) career_subordination_value=employer)
provider = self.portal.organisation_module.newContent( provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Payroll Service Provider') title='Service Provider')
other_provider = self.portal.organisation_module.newContent( other_provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Another Payroll Service Provider') title='Another Service Provider')
ps1 = self.portal.accounting_module.newContent( ps1 = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction', portal_type='Pay Sheet Transaction',
title='Employee 1', title='Employee 1',
...@@ -979,7 +979,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -979,7 +979,7 @@ class TestPayroll(TestPayrollMixin):
source_section_value=employee1, source_section_value=employee1,
start_date=DateTime(2006, 1, 1),) start_date=DateTime(2006, 1, 1),)
line = ps1.newContent(portal_type='Pay Sheet Line', line = ps1.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_service, resource_value=service,
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,
...@@ -1006,7 +1006,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1006,7 +1006,7 @@ class TestPayroll(TestPayrollMixin):
source_section_value=employee2, source_section_value=employee2,
start_date=DateTime(2006, 1, 1),) start_date=DateTime(2006, 1, 1),)
line = ps2.newContent(portal_type='Pay Sheet Line', line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee2, destination_value=employee2,
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
...@@ -1025,7 +1025,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1025,7 +1025,7 @@ class TestPayroll(TestPayrollMixin):
cell_employer.edit(price=-.40, quantity=3000, tax_category='employer_share') cell_employer.edit(price=-.40, quantity=3000, tax_category='employer_share')
other_line = ps2.newContent(portal_type='Pay Sheet Line', other_line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_service, resource_value=service,
destination_value=employee2, destination_value=employee2,
source_section_value=other_provider, source_section_value=other_provider,
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
...@@ -1060,7 +1060,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1060,7 +1060,7 @@ class TestPayroll(TestPayrollMixin):
request_form['at_date'] = DateTime(2006, 2, 2) request_form['at_date'] = DateTime(2006, 2, 2)
request_form['section_category'] = 'group/demo_group' request_form['section_category'] = 'group/demo_group'
request_form['simulation_state'] = ['draft', 'planned'] request_form['simulation_state'] = ['draft', 'planned']
request_form['resource'] = payroll_service.getRelativeUrl() request_form['resource'] = service.getRelativeUrl()
request_form['mirror_section'] = provider.getRelativeUrl() request_form['mirror_section'] = provider.getRelativeUrl()
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -1102,8 +1102,8 @@ class TestPayroll(TestPayrollMixin): ...@@ -1102,8 +1102,8 @@ class TestPayroll(TestPayrollMixin):
def test_PayrollTaxesReportDifferentSalaryRange(self): def test_PayrollTaxesReportDifferentSalaryRange(self):
eur = self.portal.currency_module.EUR eur = self.portal.currency_module.EUR
payroll_service = self.portal.payroll_service_module.newContent( service = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='PS1', title='PS1',
variation_base_category_list=('tax_category', variation_base_category_list=('tax_category',
'salary_range'), 'salary_range'),
...@@ -1128,10 +1128,10 @@ class TestPayroll(TestPayrollMixin): ...@@ -1128,10 +1128,10 @@ class TestPayroll(TestPayrollMixin):
career_subordination_value=employer) career_subordination_value=employer)
provider = self.portal.organisation_module.newContent( provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Payroll Service Provider') title='Service Provider')
other_provider = self.portal.organisation_module.newContent( other_provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Another Payroll Service Provider') title='Another Service Provider')
ps1 = self.portal.accounting_module.newContent( ps1 = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction', portal_type='Pay Sheet Transaction',
title='Employee 1', title='Employee 1',
...@@ -1139,7 +1139,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1139,7 +1139,7 @@ class TestPayroll(TestPayrollMixin):
source_section_value=employee1, source_section_value=employee1,
start_date=DateTime(2006, 1, 1),) start_date=DateTime(2006, 1, 1),)
line = ps1.newContent(portal_type='Pay Sheet Line', line = ps1.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_service, resource_value=service,
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,
...@@ -1194,7 +1194,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1194,7 +1194,7 @@ class TestPayroll(TestPayrollMixin):
source_section_value=employee2, source_section_value=employee2,
start_date=DateTime(2006, 1, 1),) start_date=DateTime(2006, 1, 1),)
line = ps2.newContent(portal_type='Pay Sheet Line', line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_service, resource_value=service,
source_section_value=provider, source_section_value=provider,
destination_value=employee2, destination_value=employee2,
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
...@@ -1246,7 +1246,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1246,7 +1246,7 @@ class TestPayroll(TestPayrollMixin):
request_form['at_date'] = DateTime(2006, 2, 2) request_form['at_date'] = DateTime(2006, 2, 2)
request_form['section_category'] = 'group/demo_group' request_form['section_category'] = 'group/demo_group'
request_form['simulation_state'] = ['draft', 'planned'] request_form['simulation_state'] = ['draft', 'planned']
request_form['resource'] = payroll_service.getRelativeUrl() request_form['resource'] = service.getRelativeUrl()
request_form['mirror_section'] = provider.getRelativeUrl() request_form['mirror_section'] = provider.getRelativeUrl()
report_section_list = self.getReportSectionList( report_section_list = self.getReportSectionList(
...@@ -1316,14 +1316,14 @@ class TestPayroll(TestPayrollMixin): ...@@ -1316,14 +1316,14 @@ class TestPayroll(TestPayrollMixin):
def test_NetSalaryReport(self): def test_NetSalaryReport(self):
eur = self.portal.currency_module.EUR eur = self.portal.currency_module.EUR
salary_service = self.portal.payroll_service_module.newContent( salary_service = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='Gross Salary', title='Gross Salary',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
'tax_category/employer_share')) 'tax_category/employer_share'))
payroll_service = self.portal.payroll_service_module.newContent( service = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='PS1', title='PS1',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
...@@ -1349,10 +1349,10 @@ class TestPayroll(TestPayrollMixin): ...@@ -1349,10 +1349,10 @@ class TestPayroll(TestPayrollMixin):
title='Bank 2') title='Bank 2')
provider = self.portal.organisation_module.newContent( provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Payroll Service Provider') title='Service Provider')
other_provider = self.portal.organisation_module.newContent( other_provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Another Payroll Service Provider') title='Another Service Provider')
ps1 = self.portal.accounting_module.newContent( ps1 = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction', portal_type='Pay Sheet Transaction',
title='Employee 1', title='Employee 1',
...@@ -1373,7 +1373,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1373,7 +1373,7 @@ class TestPayroll(TestPayrollMixin):
'quantity'),) 'quantity'),)
cell_employee.edit(price=1, quantity=2000, tax_category='employee_share') cell_employee.edit(price=1, quantity=2000, tax_category='employee_share')
line = ps1.newContent(portal_type='Pay Sheet Line', line = ps1.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_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',],
...@@ -1413,7 +1413,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1413,7 +1413,7 @@ class TestPayroll(TestPayrollMixin):
'quantity'),) 'quantity'),)
cell_employee.edit(price=1, quantity=3000, tax_category='employee_share') cell_employee.edit(price=1, quantity=3000, tax_category='employee_share')
line = ps2.newContent(portal_type='Pay Sheet Line', line = ps2.newContent(portal_type='Pay Sheet Line',
resource_value=payroll_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',],
...@@ -1471,30 +1471,30 @@ class TestPayroll(TestPayrollMixin): ...@@ -1471,30 +1471,30 @@ class TestPayroll(TestPayrollMixin):
total_price=3000 + 2000 - (2000 * .5) - (3000 * .5)) total_price=3000 + 2000 - (2000 * .5) - (3000 * .5))
def test_AccountingLineGeneration(self): def test_AccountingLineGeneration(self):
# create payroll services # create services
base_salary = self.portal.payroll_service_module.newContent( base_salary = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='Base Salary', title='Base Salary',
product_line='base_salary', product_line='base_salary',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
'tax_category/employer_share')) 'tax_category/employer_share'))
bonus = self.portal.payroll_service_module.newContent( bonus = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='Bonus', title='Bonus',
product_line='base_salary', product_line='base_salary',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
'tax_category/employer_share')) 'tax_category/employer_share'))
deductions = self.portal.payroll_service_module.newContent( deductions = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='Deductions', title='Deductions',
product_line='base_salary', product_line='base_salary',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
variation_category_list=('tax_category/employee_share', variation_category_list=('tax_category/employee_share',
'tax_category/employer_share')) 'tax_category/employer_share'))
tax1 = self.portal.payroll_service_module.newContent( tax1 = self.portal.service_module.newContent(
portal_type='Payroll Service', portal_type='Service',
title='Tax1', title='Tax1',
product_line='payroll_tax_1', product_line='payroll_tax_1',
variation_base_category_list=('tax_category',), variation_base_category_list=('tax_category',),
...@@ -1541,13 +1541,13 @@ class TestPayroll(TestPayrollMixin): ...@@ -1541,13 +1541,13 @@ class TestPayroll(TestPayrollMixin):
rule.newContent(portal_type='Predicate', rule.newContent(portal_type='Predicate',
title='Base Salary', title='Base Salary',
string_index='payroll_service', string_index='service',
int_index=1, int_index=1,
membership_criterion_base_category_list=('product_line',), membership_criterion_base_category_list=('product_line',),
membership_criterion_category_list=('product_line/base_salary',)) membership_criterion_category_list=('product_line/base_salary',))
rule.newContent(portal_type='Predicate', rule.newContent(portal_type='Predicate',
title='Payroll Tax 1', title='Payroll Tax 1',
string_index='payroll_service', string_index='service',
int_index=2, int_index=2,
membership_criterion_base_category_list=('product_line',), membership_criterion_base_category_list=('product_line',),
membership_criterion_category_list=('product_line/payroll_tax_1',)) membership_criterion_category_list=('product_line/payroll_tax_1',))
...@@ -1611,7 +1611,7 @@ class TestPayroll(TestPayrollMixin): ...@@ -1611,7 +1611,7 @@ class TestPayroll(TestPayrollMixin):
career_subordination_value=employer) career_subordination_value=employer)
provider = self.portal.organisation_module.newContent( provider = self.portal.organisation_module.newContent(
portal_type='Organisation', portal_type='Organisation',
title='Payroll Service Provider') title='Service Provider')
ps = self.portal.accounting_module.newContent( ps = self.portal.accounting_module.newContent(
portal_type='Pay Sheet Transaction', portal_type='Pay Sheet Transaction',
......
...@@ -92,7 +92,7 @@ class TestPayroll_l10n_fr(TestPayrollMixin): ...@@ -92,7 +92,7 @@ class TestPayroll_l10n_fr(TestPayrollMixin):
share_list=urssaf_share_list, share_list=urssaf_share_list,
slice_list=urssaf_slice_list, slice_list=urssaf_slice_list,
values=[[[None, 0.8]],], values=[[[None, 0.8]],],
source_value=self.payroll_service_organisation, source_value=self.service_organisation,
base_application_list=[ 'base_amount/base_salary',], base_application_list=[ 'base_amount/base_salary',],
base_contribution_list=['base_amount/net_salary',]) base_contribution_list=['base_amount/net_salary',])
model_line_2.setIntIndex(2) model_line_2.setIntIndex(2)
...@@ -104,7 +104,7 @@ class TestPayroll_l10n_fr(TestPayrollMixin): ...@@ -104,7 +104,7 @@ class TestPayroll_l10n_fr(TestPayrollMixin):
share_list=urssaf_share_list, share_list=urssaf_share_list,
slice_list=urssaf_slice_list, slice_list=urssaf_slice_list,
values=[[[None, -0.1]],], values=[[[None, -0.1]],],
source_value=self.payroll_service_organisation, source_value=self.service_organisation,
base_application_list=[ 'base_amount/net_salary',], base_application_list=[ 'base_amount/net_salary',],
base_contribution_list=['base_amount/deductible_tax',]) base_contribution_list=['base_amount/deductible_tax',])
model_line_3.setIntIndex(3) model_line_3.setIntIndex(3)
......
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