AS Days ASDAYS 1 none code if "ASDAYS" in inputs: result = inputs["ASDAYS"].amount else: result = payslip._l10n_ch_get_occupation_days() canton, is_code, municipality = payslip.l10n_ch_is_code.split('-') if payslip.l10n_ch_is_code else (False, False, False) payslip._log_is_line( is_canton=canton, municipality=municipality, is_code=is_code, code='ASDAYS', amount=result) Worked Days Total ISWORKEDDAYS 1 none code result = 20 if not payslip.l10n_ch_after_departure_payment else 0 result_rate = (result_rules['ASDAYS']['total'] / 30) * 100 canton, is_code, municipality = payslip.l10n_ch_is_code.split('-') if payslip.l10n_ch_is_code else (False, False, False) payslip._log_is_line( is_canton=canton, municipality=municipality, is_code=is_code, code='ISWORKEDDAYS', amount=result*result_rate/100) Worked Days in CH ISWORKEDDAYSINCH 1 none code if "ISWORKEDDAYSINCH" in inputs: result = inputs["ISWORKEDDAYSINCH"].amount else: result = min(payslip.employee_id.l10n_ch_working_days_in_ch, result_rules['ISWORKEDDAYS']['total']) canton, is_code, municipality = payslip.l10n_ch_is_code.split('-') if payslip.l10n_ch_is_code else (False, False, False) payslip._log_is_line( is_canton=canton, municipality=municipality, is_code=is_code, code='ISWORKEDDAYSINCH', amount=result) Activity Rate ACTIVITYRATE 1 none code if "ACTIVITYRATE" in inputs: result = inputs["ACTIVITYRATE"].amount else: if not version.irregular_working_time and version.l10n_ch_current_occupation_rate: result = version.l10n_ch_current_occupation_rate else: result = 100 Monthly Salary WT_1000 1000 5 python result = ch_wage_components['CH_1000']['total'] > 0 or 'WT_1000' in inputs code if 'WT_1000' in inputs: result = inputs['WT_1000'].amount result_name = inputs['WT_1000'].name else: if ch_wage_components['CH_1000']['base'] and ch_wage_components['CH_1000']['rate']: result = ch_wage_components['CH_1000']['base'] result_rate = ch_wage_components['CH_1000']['rate'] else: result = ch_wage_components['CH_1000']['total'] 1 I Monthly Salary Correction WT_1001 1001 6 python result = 'WT_1001' in inputs code result = inputs['WT_1001'].amount result_name = inputs['WT_1001'].name 1 0 I Hourly Salary BASICHOURLY 1005 5 python result = ch_wage_components['CH_1005']['total'] > 0 or 'WT_1005' in inputs code if 'WT_1005' in inputs: result = inputs['WT_1005'].amount result_name = inputs['WT_1005'].name else: if ch_wage_components['CH_1005']['base'] and ch_wage_components['CH_1005']['rate']: result = ch_wage_components['CH_1005']['base'] result_rate = ch_wage_components['CH_1005']['rate'] else: result = ch_wage_components['CH_1005']['total'] 1 I Lesson Salary BASICLESSON 1006 6 python result = ch_wage_components['CH_1006']['total'] > 0 or 'WT_1006' in inputs code if 'WT_1006' in inputs: result = inputs['WT_1006'].amount result_name = inputs['WT_1006'].name else: if ch_wage_components['CH_1006']['base'] and ch_wage_components['CH_1006']['rate']: result = ch_wage_components['CH_1006']['base'] result_rate = ch_wage_components['CH_1006']['rate'] else: result = ch_wage_components['CH_1006']['total'] 1 0 I Overtime WT_1065 1065 20 python result = ch_wage_components['CH_1065']['total'] > 0 or 'WT_1065' in inputs code if 'WT_1065' in inputs: result = inputs['WT_1065'].amount result_name = inputs['WT_1065'].name else: if ch_wage_components['CH_1065']['base'] and ch_wage_components['CH_1065']['rate']: result = ch_wage_components['CH_1065']['base'] result_rate = ch_wage_components['CH_1065']['rate'] else: result = ch_wage_components['CH_1065']['total'] 1 P Overtime 125% WT_1061 1061 20 python result = ch_wage_components['CH_1061']['total'] > 0 or 'WT_1061' in inputs code if 'WT_1061' in inputs: result = inputs['WT_1061'].amount result_name = inputs['WT_1061'].name else: if ch_wage_components['CH_1061']['base'] and ch_wage_components['CH_1061']['rate']: result = ch_wage_components['CH_1061']['base'] result_rate = ch_wage_components['CH_1061']['rate'] else: result = ch_wage_components['CH_1061']['total'] 1 P Overtime 150% WT_1066 1066 20 python result = ch_wage_components['CH_1066']['total'] > 0 or 'WT_1066' in inputs code if 'WT_1066' in inputs: result = inputs['WT_1066'].amount result_name = inputs['WT_1066'].name else: if ch_wage_components['CH_1066']['base'] and ch_wage_components['CH_1066']['rate']: result = ch_wage_components['CH_1066']['base'] result_rate = ch_wage_components['CH_1066']['rate'] else: result = ch_wage_components['CH_1066']['total'] 1 P Overtime after departure WT_1067 1067 10 python result = 'WT_1067' in inputs code result = inputs['WT_1067'].amount result_name = inputs['WT_1067'].name 3 P Overtime 200% WT_1068 1068 20 python result = ch_wage_components['CH_1068']['total'] > 0 or 'WT_1068' in inputs code if 'WT_1068' in inputs: result = inputs['WT_1068'].amount result_name = inputs['WT_1068'].name else: if ch_wage_components['CH_1068']['base'] and ch_wage_components['CH_1068']['rate']: result = ch_wage_components['CH_1068']['base'] result_rate = ch_wage_components['CH_1068']['rate'] else: result = ch_wage_components['CH_1068']['total'] 1 P Vacation Base VACATION_BASE 21 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_vacation_pay_included) Vacation compensation HOLALW 1160 24 python result = result_rules['VACATION_BASE']['total'] > 0 and version.l10n_ch_contractual_holidays_rate and version.l10n_ch_contractual_vacation_pay code result_rate = version.l10n_ch_contractual_holidays_rate result = result_rules['VACATION_BASE']['total'] 1 I Compensation for public holidays PUBHOLALW 1161 24 python result = result_rules['VACATION_BASE']['total'] > 0 and version.l10n_ch_contractual_public_holidays_rate code result_rate = version.l10n_ch_contractual_public_holidays_rate result = result_rules['VACATION_BASE']['total'] 1 0 I Professional Fees WT_1010 1010 20 python result = 'WT_1010' in inputs code result = inputs['WT_1010'].amount result_name = inputs['WT_1010'].name 1 I Auxiliary wages WT_1015 1015 20 python result = 'WT_1015' in inputs code result = inputs['WT_1015'].amount result_name = inputs['WT_1015'].name 1 I Salary for working from home WT_1016 1016 20 python result = 'WT_1016' in inputs code result = inputs['WT_1016'].amount result_name = inputs['WT_1016'].name 1 I Salary for cleaning WT_1017 1017 20 python result = 'WT_1017' in inputs code result = inputs['WT_1017'].amount result_name = inputs['WT_1017'].name 1 I Salary by task WT_1018 1018 20 python result = 'WT_1018' in inputs code result = inputs['WT_1018'].amount result_name = inputs['WT_1018'].name 1 I Indemnity for absence WT_1020 1020 20 python result = 'WT_1020' in inputs code result = inputs['WT_1020'].amount result_name = inputs['WT_1020'].name 1 I Authorities and commissions WT_1021 1021 20 python result = 'WT_1021' in inputs code result = inputs['WT_1021'].amount result_name = inputs['WT_1021'].name 1 I Length-of-service allowance WT_1030 1030 20 python result = 'WT_1030' in inputs code result = inputs['WT_1030'].amount result_name = inputs['WT_1030'].name 1 I Function allowance WT_1031 1031 20 python result = 'WT_1031' in inputs code result = inputs['WT_1031'].amount result_name = inputs['WT_1031'].name 1 I Compensation for replacement WT_1032 1032 20 python result = 'WT_1032' in inputs code result = inputs['WT_1032'].amount result_name = inputs['WT_1032'].name 1 I Residence allowance WT_1033 1033 20 python result = 'WT_1033' in inputs code result = inputs['WT_1033'].amount result_name = inputs['WT_1033'].name 1 I Cost-of-living allowance WT_1034 1034 20 python result = 'WT_1034' in inputs code result = inputs['WT_1034'].amount result_name = inputs['WT_1034'].name 1 I Family cost-of-living allowance WT_1040 1040 20 python result = 'WT_1040' in inputs code result = inputs['WT_1040'].amount result_name = inputs['WT_1040'].name 1 I Housing allowance WT_1050 1050 20 python result = 'WT_1050' in inputs code result = inputs['WT_1050'].amount result_name = inputs['WT_1050'].name 1 I Travel allowance WT_1055 1055 20 python result = 'WT_1055' in inputs code result = inputs['WT_1055'].amount result_name = inputs['WT_1055'].name 1 I Transfer allowance WT_1056 1056 20 python result = 'WT_1056' in inputs code result = inputs['WT_1056'].amount result_name = inputs['WT_1056'].name 1 I Extra work WT_1060 1060 20 python result = 'WT_1060' in inputs code result = inputs['WT_1060'].amount result_name = inputs['WT_1060'].name 1 P Team Work Allowance WT_1070 1070 20 python result = 'WT_1070' in inputs code result = inputs['WT_1070'].amount result_name = inputs['WT_1070'].name 1 J On-call duty allowance WT_1071 1071 20 python result = ch_wage_components['CH_1071']['total'] > 0 or 'WT_1071' in inputs code if 'WT_1071' in inputs: result = inputs['WT_1071'].amount result_name = inputs['WT_1071'].name else: if ch_wage_components['CH_1071']['base'] and ch_wage_components['CH_1071']['rate']: result = ch_wage_components['CH_1071']['base'] result_rate = ch_wage_components['CH_1071']['rate'] else: result = ch_wage_components['CH_1071']['total'] 1 J Commitment allowance WT_1072 1072 20 python result = 'WT_1072' in inputs code result = inputs['WT_1072'].amount result_name = inputs['WT_1072'].name 1 J Sunday work allowance WT_1073 1073 20 python result = 'WT_1073' in inputs code result = inputs['WT_1073'].amount result_name = inputs['WT_1073'].name 1 J Compensation for inconvenience WT_1074 1074 20 python result = 'WT_1074' in inputs code result = inputs['WT_1074'].amount result_name = inputs['WT_1074'].name 1 J Night shift allowance WT_1075 1075 20 python result = ch_wage_components['CH_1075']['total'] > 0 or 'WT_1075' in inputs code if 'WT_1075' in inputs: result = inputs['WT_1075'].amount result_name = inputs['WT_1075'].name else: if ch_wage_components['CH_1075']['base'] and ch_wage_components['CH_1075']['rate']: result = ch_wage_components['CH_1075']['base'] result_rate = ch_wage_components['CH_1075']['rate'] else: result = ch_wage_components['CH_1075']['total'] 1 J Night work allowance WT_1076 1076 20 python result = 'WT_1076' in inputs code result = inputs['WT_1076'].amount result_name = inputs['WT_1076'].name 1 J Compensation for site inconvenience WT_1100 1100 20 python result = 'WT_1100' in inputs code result = inputs['WT_1100'].amount result_name = inputs['WT_1100'].name 1 J Compensation for arduous work WT_1101 1101 20 python result = 'WT_1101' in inputs code result = inputs['WT_1101'].amount result_name = inputs['WT_1101'].name 1 J Allowance for dirty work WT_1102 1102 20 python result = 'WT_1102' in inputs code result = inputs['WT_1102'].amount result_name = inputs['WT_1102'].name 1 J Dust allowance WT_1103 1103 20 python result = 'WT_1103' in inputs code result = inputs['WT_1103'].amount result_name = inputs['WT_1103'].name 1 J Compensation for underground work WT_1104 1104 20 python result = 'WT_1104' in inputs code result = inputs['WT_1104'].amount result_name = inputs['WT_1104'].name 1 J Advancement WT_1110 1110 20 python result = 'WT_1110' in inputs code result = inputs['WT_1110'].amount result_name = inputs['WT_1110'].name 3 Q Bonus for drilling WT_1111 1111 20 python result = 'WT_1111' in inputs code result = inputs['WT_1111'].amount result_name = inputs['WT_1111'].name 3 Q Tenacity bonus WT_1112 1112 20 python result = 'WT_1112' in inputs code result = inputs['WT_1112'].amount result_name = inputs['WT_1112'].name 3 Q Commitment bonus WT_1130 1130 20 python result = 'WT_1130' in inputs code result = inputs['WT_1130'].amount result_name = inputs['WT_1130'].name 3 Q Non-commitment indemnity WT_1131 1131 20 python result = 'WT_1131' in inputs code result = inputs['WT_1131'].amount result_name = inputs['WT_1131'].name 3 Q Vacation payments WT_1162 1162 20 python result = 'WT_1162' in inputs code result = inputs['WT_1162'].amount result_name = inputs['WT_1162'].name 1 P Vacation payment after departure WT_1163 1163 20 python result = 'WT_1163' in inputs code result = inputs['WT_1163'].amount result_name = inputs['WT_1163'].name 3 P Christmas Gratification WT_1202 1202 20 python result = 'WT_1202' in inputs code result = inputs['WT_1202'].amount result_name = inputs['WT_1202'].name 3 Q Gratification WT_1204 1204 20 python result = 'WT_1204' in inputs code result = inputs['WT_1204'].amount result_name = inputs['WT_1204'].name 3 Q Previous year's bonus payment WT_1209 1209 20 python result = 'WT_1209' in inputs code result = inputs['WT_1209'].amount result_name = inputs['WT_1209'].name 3 Q Bonus WT_1210 1210 20 python result = 'WT_1210' in inputs code result = inputs['WT_1210'].amount result_name = inputs['WT_1210'].name 3 Q Profit sharing WT_1211 1211 20 python result = 'WT_1211' in inputs code result = inputs['WT_1211'].amount result_name = inputs['WT_1211'].name 3 Q Special allowance WT_1212 1212 20 python result = 'WT_1212' in inputs code result = inputs['WT_1212'].amount result_name = inputs['WT_1212'].name 3 Q Success bonus WT_1213 1213 20 python result = 'WT_1213' in inputs code result = inputs['WT_1213'].amount result_name = inputs['WT_1213'].name 3 Q Performance bonus WT_1214 1214 20 python result = 'WT_1214' in inputs code result = inputs['WT_1214'].amount result_name = inputs['WT_1214'].name 3 Q Recognition bonus WT_1215 1215 20 python result = 'WT_1215' in inputs code result = inputs['WT_1215'].amount result_name = inputs['WT_1215'].name 3 Q Incentive for improvement proposals WT_1216 1216 20 python result = 'WT_1216' in inputs code result = inputs['WT_1216'].amount result_name = inputs['WT_1216'].name 3 Q Sales bonus WT_1217 1217 20 python result = 'WT_1217' in inputs code result = inputs['WT_1217'].amount result_name = inputs['WT_1217'].name 3 Q Commission WT_1218 1218 20 python result = 'WT_1218' in inputs code result = inputs['WT_1218'].amount result_name = inputs['WT_1218'].name 1 I Attendance bonus WT_1219 1219 20 python result = 'WT_1219' in inputs code result = inputs['WT_1219'].amount result_name = inputs['WT_1219'].name 3 Q Length of service gift WT_1230 1230 20 python result = 'WT_1230' in inputs code result = inputs['WT_1230'].amount result_name = inputs['WT_1230'].name 3 Q Jubilee gift WT_1231 1231 20 python result = 'WT_1231' in inputs code result = inputs['WT_1231'].amount result_name = inputs['WT_1231'].name 3 Q Loyalty bonus WT_1232 1232 20 python result = 'WT_1232' in inputs code result = inputs['WT_1232'].amount result_name = inputs['WT_1232'].name 3 Q Damage prevention bonus WT_1250 1250 20 python result = 'WT_1250' in inputs code result = inputs['WT_1250'].amount result_name = inputs['WT_1250'].name 3 Q Wages in the event of Maternity/Paternity Leave WT_1299 1299 20 python result = ch_wage_components['CH_MATERNITY']['total'] > 0 or 'WT_1299' in inputs code if 'WT_1299' in inputs: result = inputs['WT_1299'].amount result_name = inputs['WT_1299'].name else: if ch_wage_components['CH_MATERNITY']['base'] and ch_wage_components['CH_MATERNITY']['rate']: result = ch_wage_components['CH_MATERNITY']['base'] result_rate = ch_wage_components['CH_MATERNITY']['rate'] else: result = ch_wage_components['CH_MATERNITY']['total'] 1 I Wages in the event of an accident WT_1300 1300 20 python result = ch_wage_components['CH_ACCIDENT']['total'] > 0 or 'WT_1300' in inputs code if 'WT_1300' in inputs: result = inputs['WT_1300'].amount result_name = inputs['WT_1300'].name else: if ch_wage_components['CH_ACCIDENT']['base'] and ch_wage_components['CH_ACCIDENT']['rate']: result = ch_wage_components['CH_ACCIDENT']['base'] result_rate = ch_wage_components['CH_ACCIDENT']['rate'] else: result = ch_wage_components['CH_ACCIDENT']['total'] 1 I Wages in the event of illness WT_1301 1301 20 python result = ch_wage_components['CH_ILLNESS']['total'] > 0 or 'WT_1301' in inputs code if 'WT_1301' in inputs: result = inputs['WT_1301'].amount result_name = inputs['WT_1301'].name else: if ch_wage_components['CH_ILLNESS']['base'] and ch_wage_components['CH_ILLNESS']['rate']: result = ch_wage_components['CH_ILLNESS']['base'] result_rate = ch_wage_components['CH_ILLNESS']['rate'] else: result = ch_wage_components['CH_ILLNESS']['total'] 1 I Salary for military service/civil defense WT_1302 1302 20 python result = ch_wage_components['CH_MILITARY']['total'] > 0 or 'WT_1302' in inputs code if 'WT_1302' in inputs: result = inputs['WT_1302'].amount result_name = inputs['WT_1302'].name else: if ch_wage_components['CH_MILITARY']['base'] and ch_wage_components['CH_MILITARY']['rate']: result = ch_wage_components['CH_MILITARY']['base'] result_rate = ch_wage_components['CH_MILITARY']['rate'] else: result = ch_wage_components['CH_MILITARY']['total'] 1 I Training and development salary WT_1303 1303 20 python result = 'WT_1303' in inputs code result = inputs['WT_1303'].amount result_name = inputs['WT_1303'].name 1 I Hourly Wages in the event of an accident WT_1304 1304 20 python result = ch_wage_components['CH_ACCIDENT_HOURLY']['total'] > 0 or 'WT_1304' in inputs code if 'WT_1304' in inputs: result = inputs['WT_1304'].amount result_name = inputs['WT_1304'].name else: if ch_wage_components['CH_ACCIDENT_HOURLY']['base'] and ch_wage_components['CH_ACCIDENT_HOURLY']['rate']: result = ch_wage_components['CH_ACCIDENT_HOURLY']['base'] result_rate = ch_wage_components['CH_ACCIDENT_HOURLY']['rate'] else: result = ch_wage_components['CH_ACCIDENT_HOURLY']['total'] 1 I Hourly Wages in the event of illness WT_1305 1305 20 python result = ch_wage_components['CH_ILLNESS_HOURLY']['total'] > 0 or 'WT_1305' in inputs code if 'WT_1305' in inputs: result = inputs['WT_1305'].amount result_name = inputs['WT_1305'].name else: if ch_wage_components['CH_ILLNESS_HOURLY']['base'] and ch_wage_components['CH_ILLNESS_HOURLY']['rate']: result = ch_wage_components['CH_ILLNESS_HOURLY']['base'] result_rate = ch_wage_components['CH_ILLNESS_HOURLY']['rate'] else: result = ch_wage_components['CH_ILLNESS_HOURLY']['total'] 1 I Hourly Salary for military service/civil defense WT_1306 1306 20 python result = ch_wage_components['CH_MILITARY_HOURLY']['total'] > 0 or 'WT_1306' in inputs code if 'WT_1306' in inputs: result = inputs['WT_1306'].amount result_name = inputs['WT_1306'].name else: if ch_wage_components['CH_MILITARY_HOURLY']['base'] and ch_wage_components['CH_MILITARY_HOURLY']['rate']: result = ch_wage_components['CH_MILITARY_HOURLY']['base'] result_rate = ch_wage_components['CH_MILITARY_HOURLY']['rate'] else: result = ch_wage_components['CH_MILITARY_HOURLY']['total'] 1 I Hourly Wages in the event of Maternity/Paternity Leave WT_1307 1307 20 python result = ch_wage_components['CH_MATERNITY_HOURLY']['total'] > 0 or 'WT_1307' in inputs code if 'WT_1307' in inputs: result = inputs['WT_1307'].amount result_name = inputs['WT_1307'].name else: if ch_wage_components['CH_MATERNITY_HOURLY']['base'] and ch_wage_components['CH_MATERNITY_HOURLY']['rate']: result = ch_wage_components['CH_MATERNITY_HOURLY']['base'] result_rate = ch_wage_components['CH_MATERNITY_HOURLY']['rate'] else: result = ch_wage_components['CH_MATERNITY_HOURLY']['total'] 1 I Severance pay (not subject to AHV) WT_1400 1400 20 python result = 'WT_1400' in inputs code result = inputs['WT_1400'].amount result_name = inputs['WT_1400'].name 4 S Severance pay (subject to AHV) WT_1401 1401 20 python result = 'WT_1401' in inputs code result = inputs['WT_1401'].amount result_name = inputs['WT_1401'].name 3 Q Lump-sum retirement benefit WT_1410 1410 20 python result = 'WT_1410' in inputs code result = inputs['WT_1410'].amount result_name = inputs['WT_1410'].name 4 S Lump-sum benefit (subject to AHV) WT_1411 1411 20 python result = 'WT_1411' in inputs code result = inputs['WT_1411'].amount result_name = inputs['WT_1411'].name 3 Q Payment of salary after death WT_1420 1420 20 python result = 'WT_1420' in inputs code result = inputs['WT_1420'].amount result_name = inputs['WT_1420'].name 4 S Board fees WT_1500 1500 20 python result = 'WT_1500' in inputs code result = inputs['WT_1500'].amount result_name = inputs['WT_1500'].name 6 Q Board indemnity WT_1501 1501 20 python result = 'WT_1501' in inputs code result = inputs['WT_1501'].amount result_name = inputs['WT_1501'].name 6 Q Director fees WT_1503 1503 20 python result = 'WT_1503' in inputs code result = inputs['WT_1503'].amount result_name = inputs['WT_1503'].name 6 Q Directors' profit-sharing WT_1510 1510 20 python result = 'WT_1510' in inputs code result = inputs['WT_1510'].amount result_name = inputs['WT_1510'].name 6 Q Free meals WT_1900 1900 20 python result = 'WT_1900' in inputs code result = inputs['WT_1900'].amount result_name = inputs['WT_1900'].name 2.1 R Free room WT_1901 1901 20 python result = 'WT_1901' in inputs code result = inputs['WT_1901'].amount result_name = inputs['WT_1901'].name 2.1 R Free accommodation WT_1902 1902 20 python result = 'WT_1902' in inputs code result = inputs['WT_1902'].amount result_name = inputs['WT_1902'].name 2.3 R Private share of company car WT_1910 1910 20 python result = 'WT_1910' in inputs code result = inputs['WT_1910'].amount result_name = inputs['WT_1910'].name 2.2 R Tips subject to AHV contributions WT_1920 1920 20 python result = 'WT_1920' in inputs code result = inputs['WT_1920'].amount result_name = inputs['WT_1920'].name 1 I Rental housing rent reduction WT_1950 1950 20 python result = 'WT_1950' in inputs code result = inputs['WT_1950'].amount result_name = inputs['WT_1950'].name 2.3 R Expatriate benefits in kind WT_1953 1953 20 python result = 'WT_1953' in inputs code result = inputs['WT_1953'].amount result_name = inputs['WT_1953'].name 2.3 R Cash benefit WT_1955 1955 20 python result = 'WT_1955' in inputs code result = inputs['WT_1955'].amount result_name = inputs['WT_1955'].name 2.3 R Taxable profit-sharing rights WT_1960 1960 20 python result = 'WT_1960' in inputs code result = inputs['WT_1960'].amount result_name = inputs['WT_1960'].name 5 R Employee shares WT_1961 1961 20 python result = 'WT_1961' in inputs code result = inputs['WT_1961'].amount result_name = inputs['WT_1961'].name 5 R Employee options WT_1962 1962 20 python result = 'WT_1962' in inputs code result = inputs['WT_1962'].amount result_name = inputs['WT_1962'].name 5 R Employee portion of KTG assumed by employer WT_1971 1971 20 python result = 'WT_1971' in inputs code result = inputs['WT_1971'].amount result_name = inputs['WT_1971'].name 7 T Employee portion PP assumed by employer WT_1972 1972 20 python result = 'WT_1972' in inputs code result = inputs['WT_1972'].amount result_name = inputs['WT_1972'].name 7 T Employee portion benefits purchase PP assumed by employer WT_1973 1973 20 python result = 'WT_1973' in inputs code result = inputs['WT_1973'].amount result_name = inputs['WT_1973'].name 7 T Employee portion CM assumed by employer WT_1974 1974 20 python result = 'WT_1974' in inputs code result = inputs['WT_1974'].amount result_name = inputs['WT_1974'].name 7 T Optional employer contribution AANP WT_1975 1975 20 python result = 'WT_1975' in inputs code result = inputs['WT_1975'].amount result_name = inputs['WT_1975'].name 7 T Optional employer contribution LAAC WT_1976 1976 20 python result = 'WT_1976' in inputs code result = inputs['WT_1976'].amount result_name = inputs['WT_1976'].name 7 T 3rd pillar B paid by employer WT_1977 1977 20 python result = 'WT_1977' in inputs code result = inputs['WT_1977'].amount result_name = inputs['WT_1977'].name 7 T 3rd pillar A paid by employer WT_1978 1978 20 python result = 'WT_1978' in inputs code result = inputs['WT_1978'].amount result_name = inputs['WT_1978'].name 7 T Source-Tax paid by employer WT_1979 1979 20 python result = 'WT_1979' in inputs code result = inputs['WT_1979'].amount result_name = inputs['WT_1979'].name 7 T Further training (salary certificate) WT_1980 1980 20 python result = 'WT_1980' in inputs code result = inputs['WT_1980'].amount result_name = inputs['WT_1980'].name 13.3 Loss-of-earnings indemnity (APG) WT_2000 2000 20 python result = 'WT_2000' in inputs code result = inputs['WT_2000'].amount result_name = inputs['WT_2000'].name 1 Y Military compensation benefit (CCM) WT_2005 2005 20 python result = 'WT_2005' in inputs code result = inputs['WT_2005'].amount result_name = inputs['WT_2005'].name 1 Y Subsidiary military fund WT_2010 2010 20 python result = 'WT_2010' in inputs code result = inputs['WT_2010'].amount result_name = inputs['WT_2010'].name 1 Y Parifonds WT_2015 2015 20 python result = 'WT_2015' in inputs code result = inputs['WT_2015'].amount result_name = inputs['WT_2015'].name 1 Y Military insurance compensation WT_2020 2020 20 python result = 'WT_2020' in inputs code result = inputs['WT_2020'].amount result_name = inputs['WT_2020'].name 1 Y Military insurance pension WT_2021 2021 20 python result = 'WT_2021' in inputs code result = inputs['WT_2021'].amount result_name = inputs['WT_2021'].name 1 Partial pension military insurance (AM) WT_2022 2022 20 python result = 'WT_2022' in inputs code result = inputs['WT_2022'].amount result_name = inputs['WT_2022'].name 1 DI allowance WT_2025 2025 20 python result = 'WT_2025' in inputs code result = inputs['WT_2025'].amount result_name = inputs['WT_2025'].name 1 Y DI pension WT_2026 2026 20 python result = 'WT_2026' in inputs code result = inputs['WT_2026'].amount result_name = inputs['WT_2026'].name 1 Partial DI pension WT_2027 2027 20 python result = 'WT_2027' in inputs code result = inputs['WT_2027'].amount result_name = inputs['WT_2027'].name 1 Accident - daily allowance WT_2030 2030 20 python result = 'WT_2030' in inputs code result = inputs['WT_2030'].amount result_name = inputs['WT_2030'].name 1 Accident - Pension WT_2031 2031 20 python result = 'WT_2031' in inputs code result = inputs['WT_2031'].amount result_name = inputs['WT_2031'].name 1 Accident - Partial Pension WT_2032 2032 20 python result = 'WT_2032' in inputs code result = inputs['WT_2032'].amount result_name = inputs['WT_2032'].name 1 Daily sickness allowance WT_2035 2035 20 python result = 'WT_2035' in inputs code result = inputs['WT_2035'].amount result_name = inputs['WT_2035'].name 1 Maternity/Paternity allowance WT_2040 2040 20 python result = 'WT_2040' in inputs code result = inputs['WT_2040'].amount result_name = inputs['WT_2040'].name 1 Y Third Party Correction WT_2050 2050 20 python result = 'WT_2050' in inputs or any(wt in inputs for wt in payslip._get_third_party_payment_wage_types()) code if 'WT_2050' in inputs: result = -inputs['WT_2050'].amount result_name = inputs['WT_2050'].name else: result = 0 for wage_type in payslip._get_third_party_payment_wage_types(): if wage_type in inputs: result -= inputs[wage_type].amount 1 Y Short-time work monthly WT_2060 2060 20 python result = 'WT_2060' in inputs code result = -inputs['WT_2060'].amount result_name = inputs['WT_2060'].name 1 Short-time work hourly WT_2065 2065 20 python result = 'WT_2065' in inputs code result = inputs['WT_2065'].amount result_name = inputs['WT_2065'].name Y ALV compensation WT_2070 2070 20 python result = 'WT_2070' in inputs code result = inputs['WT_2070'].amount result_name = inputs['WT_2070'].name 1 Waiting day WT_2075 2075 20 python result = 'WT_2075' in inputs code result = inputs['WT_2075'].amount result_name = inputs['WT_2075'].name 1 Child allowance WT_3000 3000 20 python result = 'WT_3000' in inputs code result = inputs['WT_3000'].amount result_name = inputs['WT_3000'].name 1 1 K Backpayment Child allowance WT_3001 3001 20 python result = 'WT_3001' in inputs code result = inputs['WT_3001'].amount result_name = inputs['WT_3001'].name 1 3 K Child allowance paid by FCF (Geneva) WT_3004 3004 20 python result = 'WT_3004' in inputs code result = inputs['WT_3004'].amount result_name = inputs['WT_3004'].name 1 K Child allowance back payment paid by FCF (Geneva) WT_3005 3005 20 python result = 'WT_3005' in inputs code result = inputs['WT_3005'].amount result_name = inputs['WT_3005'].name 1 K Education allowance WT_3010 3010 20 python result = 'WT_3010' in inputs code result = inputs['WT_3010'].amount result_name = inputs['WT_3010'].name 1 1 K Backpayment Education allowance WT_3011 3011 20 python result = 'WT_3011' in inputs code result = inputs['WT_3011'].amount result_name = inputs['WT_3011'].name 1 3 K Education allowance paid by FCF (Geneva) WT_3014 3014 20 python result = 'WT_3014' in inputs code result = inputs['WT_3014'].amount result_name = inputs['WT_3014'].name 1 K Backpayment Education allowance paid by FCF (Geneva) WT_3015 3015 20 python result = 'WT_3015' in inputs code result = inputs['WT_3015'].amount result_name = inputs['WT_3015'].name 1 K Family allowance WT_3030 3030 20 python result = 'WT_3030' in inputs code result = inputs['WT_3030'].amount result_name = inputs['WT_3030'].name 3 1 K Family allowance Backpayment WT_3031 3031 20 python result = 'WT_3031' in inputs code result = inputs['WT_3031'].amount result_name = inputs['WT_3031'].name 3 3 K Household allowance WT_3032 3032 20 python result = 'WT_3032' in inputs code result = inputs['WT_3032'].amount result_name = inputs['WT_3032'].name 3 1 K Backpayment Household allowance WT_3033 3033 20 python result = 'WT_3033' in inputs code result = inputs['WT_3033'].amount result_name = inputs['WT_3033'].name 3 3 K Childbirth allowance WT_3034 3034 20 python result = 'WT_3034' in inputs code result = inputs['WT_3034'].amount result_name = inputs['WT_3034'].name 2 3 Q Childbirth allowance paid by FCF (Geneva) WT_3038 3038 20 python result = 'WT_3038' in inputs code result = inputs['WT_3038'].amount result_name = inputs['WT_3038'].name 2 Q Wedding allowance WT_3035 3035 20 python result = 'WT_3035' in inputs code result = inputs['WT_3035'].amount result_name = inputs['WT_3035'].name 3 Q Attendant care allowance WT_3036 3036 20 python result = 'WT_3036' in inputs code result = inputs['WT_3036'].amount result_name = inputs['WT_3036'].name 1 K Backpayment Attendant care allowance WT_3037 3037 20 python result = 'WT_3037' in inputs code result = inputs['WT_3037'].amount result_name = inputs['WT_3037'].name 3 K Net/Gross compensation WT_4900 4900 20 python result = 'WT_4900' in inputs code result = inputs['WT_4900'].amount result_name = inputs['WT_4900'].name 7 T Thirteen Month Provision 13THMONTHPROVISION 9005 30 python result = version.l10n_ch_thirteen_month code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_13th_month_included) result_rate = version.l10n_ch_contractual_13th_month_rate Fourteenth Month Provision 14THMONTHPROVISION 9006 30 python result = version.l10n_ch_14th_month code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_13th_month_included) result_rate = version.l10n_ch_contractual_13th_month_rate Thirteen Month Provision (Hourly) 13THMONTHPROVISION_HOURLY 30 python result = version.l10n_ch_thirteen_month code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_13th_month_hourly_included) result_rate = version.l10n_ch_contractual_13th_month_rate Fourteenth Month Provision (Hourly) 14THMONTHPROVISION_HOURLY 30 python result = version.l10n_ch_14th_month code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_13th_month_hourly_included) result_rate = version.l10n_ch_contractual_13th_month_rate Thirteenth Month 13THMONTH 1200 30 python result = (version.l10n_ch_thirteen_month and payslip.l10n_ch_pay_13th_month) or 'WT_1200' in inputs code if 'WT_1200' in inputs: result = inputs["WT_1200"].amount else: line_values = previous_payslips._get_line_values(['13THMONTHPROVISION', '13THMONTH'], compute_sum=True) cumulated_13th_month_provision = line_values['13THMONTHPROVISION']['sum']['total'] + result_rules['13THMONTHPROVISION']['total'] paid_out_13th_month = line_values['13THMONTH']['sum']['total'] result = max(0, cumulated_13th_month_provision - paid_out_13th_month) 1 O Fourteenth Month 14THMONTH 1205 30 python result = (version.l10n_ch_14th_month and payslip.l10n_ch_pay_13th_month) or 'WT_1205' in inputs code if 'WT_1205' in inputs: result = inputs["WT_1205"].amount else: line_values = previous_payslips._get_line_values(['14THMONTHPROVISION', '14THMONTH'], compute_sum=True) cumulated_14th_month_provision = line_values['14THMONTHPROVISION']['sum']['total'] + result_rules['14THMONTHPROVISION']['total'] paid_out_14th_month = line_values['14THMONTH']['sum']['total'] result = max(0, cumulated_14th_month_provision - paid_out_14th_month) 1 O Thirteen Month (Hourly) 13THMONTH_HOURLY 1207 30 python result = result_rules['13THMONTHPROVISION_HOURLY']['total'] > 0 or ('WT_1207' in inputs) code if 'WT_1207' in inputs: result = inputs["WT_1207"].amount else: result = result_rules['13THMONTHPROVISION_HOURLY']['total'] 1 O Fourteenth Month (Hourly) 14THMONTH_HOURLY 1208 30 python result = result_rules['14THMONTHPROVISION_HOURLY']['total'] > 0 or ('WT_1208' in inputs) code if 'WT_1208' in inputs: result = inputs["WT_1208"].amount else: result = result_rules['14THMONTHPROVISION_HOURLY']['total'] 1 O Gross Salary GROSS_SALARY 5000 100 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_gross_included) AVS Base AVSBASE 9010 105 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_ac_included) AVS Franchise AVSFRANCHISE 110 python result = payslip.l10n_ch_avs_status == "retired" code result = payslip.l10n_ch_social_insurance_id._get_retirement_rente(payslip.date_from) AVS Exoneration AVSEXO 115 python result = payslip.l10n_ch_avs_status == "retired" code retired_slips = previous_payslips.filtered(lambda p: p.l10n_ch_avs_status == "retired") current_franchise = result_rules['AVSFRANCHISE']['total'] cum_avs_salary = retired_slips._get_line_values(['AVSSALARY'], compute_sum=True)['AVSSALARY']['sum']['total'] + result_rules['AVSBASE']['total'] cum_franchise = retired_slips._get_line_values(['AVSFRANCHISE'], compute_sum=True)['AVSFRANCHISE']['sum']['total'] + result_rules['AVSFRANCHISE']['total'] cum_exon = retired_slips._get_line_values(['AVSEXO'], compute_sum=True)['AVSEXO']['sum']['total'] available_franchise = cum_franchise - cum_exon if 0 > cum_avs_salary + cum_exon: result = -cum_exon else: result = min(cum_avs_salary, available_franchise) AVS Salary AVSSALARY 9011 120 python result = payslip.l10n_ch_avs_status not in ["exempted", "youth"] code result = result_rules['AVSBASE']['total'] - result_rules['AVSEXO']['total'] AVS OPEN AVSOPEN 9012 125 python result = payslip.l10n_ch_avs_status code result = result_rules['AVSBASE']['total'] - result_rules['AVSSALARY']['total'] AHV/IV/EO contribution AVS 5010 130 python result = payslip.l10n_ch_social_insurance_id code result = result_rules['AVSSALARY']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = - payslip.l10n_ch_social_insurance_id._get_avs_rates(rate_date)[0] Old Age & Survivor's Insurance, Disability Insurance & Loss of Earnings 9 L General AVS Deduction in % AVS.GENERIC 5400 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC'].name result_rate = -inputs['AVS.GENERIC'].amount General AVS Deduction in % Employer AVS.GENERIC.COMP 7400 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP'].name result_rate = inputs['AVS.GENERIC.COMP'].amount General AVS Deduction in % (2) AVS.GENERIC.2 5401 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.2' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.2'].name result_rate = -inputs['AVS.GENERIC.2'].amount General AVS Deduction in % Employer (2) AVS.GENERIC.COMP.2 7401 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.2' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.2'].name result_rate = inputs['AVS.GENERIC.COMP.2'].amount General AVS Deduction in % (3) AVS.GENERIC.3 5402 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.3' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.3'].name result_rate = -inputs['AVS.GENERIC.3'].amount General AVS Deduction in % Employer (3) AVS.GENERIC.COMP.3 7402 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.3' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.3'].name result_rate = inputs['AVS.GENERIC.COMP.3'].amount General AVS Deduction in % (4) AVS.GENERIC.4 5403 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.4' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.4'].name result_rate = -inputs['AVS.GENERIC.4'].amount General AVS Deduction in % Employer (4) AVS.GENERIC.COMP.4 7403 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.4' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.4'].name result_rate = inputs['AVS.GENERIC.COMP.4'].amount General AVS Deduction in % (5) AVS.GENERIC.5 5404 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.5' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.5'].name result_rate = -inputs['AVS.GENERIC.5'].amount General AVS Deduction in % Employer (5) AVS.GENERIC.COMP.5 7404 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.5' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.5'].name result_rate = inputs['AVS.GENERIC.COMP.5'].amount General AVS Deduction in % (6) AVS.GENERIC.6 5405 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.6' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.6'].name result_rate = -inputs['AVS.GENERIC.6'].amount General AVS Deduction in % Employer (6) AVS.GENERIC.COMP.6 7405 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.6' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.6'].name result_rate = inputs['AVS.GENERIC.COMP.6'].amount General AVS Deduction in % (7) AVS.GENERIC.7 5406 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.7' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.7'].name result_rate = -inputs['AVS.GENERIC.7'].amount General AVS Deduction in % Employer (7) AVS.GENERIC.COMP.7 7406 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.7' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.7'].name result_rate = inputs['AVS.GENERIC.COMP.7'].amount General AVS Deduction in % (8) AVS.GENERIC.8 5407 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.8' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.8'].name result_rate = -inputs['AVS.GENERIC.8'].amount General AVS Deduction in % Employer (8) AVS.GENERIC.COMP.8 7407 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.8' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.8'].name result_rate = inputs['AVS.GENERIC.COMP.8'].amount General AVS Deduction in % (9) AVS.GENERIC.9 5408 131 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.9' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.9'].name result_rate = -inputs['AVS.GENERIC.9'].amount General AVS Deduction in % Employer (9) AVS.GENERIC.COMP.9 7408 132 python result = payslip.l10n_ch_social_insurance_id and 'AVS.GENERIC.COMP.9' in inputs code result = result_rules['AVSSALARY']['total'] result_name = inputs['AVS.GENERIC.COMP.9'].name result_rate = inputs['AVS.GENERIC.COMP.9'].amount AHV/IV/EO Employer contribution AVS.COMP 7010 135 python result = payslip.l10n_ch_social_insurance_id code result = result_rules['AVSSALARY']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = payslip.l10n_ch_social_insurance_id._get_avs_rates(rate_date)[1] AHV/IV/EO Administrative Costs AVS.FEES 7011 140 python result = payslip.l10n_ch_social_insurance_id code result = -result_rules['AVS']['total'] + result_rules['AVS.COMP']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = payslip.l10n_ch_social_insurance_id._get_avs_rates(rate_date)[2] Old Age & Survivor's Insurance, Disability Insurance & Loss of Earnings AC Base ACBASE 9020 145 none code result = result_rules['AVSBASE']['total'] AC Salary Threshold ACSALARYMAX 150 python result = payslip.l10n_ch_social_insurance_id and not payslip.l10n_ch_avs_status code result = payslip.l10n_ch_social_insurance_id._get_ac_threshold(payslip.date_from) / 12 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 AC Salary ACSALARY 9021 155 python result = payslip.l10n_ch_social_insurance_id and not payslip.l10n_ch_avs_status code current_solution = payslip.l10n_ch_social_insurance_id current_solution_slips = previous_payslips.filtered(lambda p : p.l10n_ch_social_insurance_id.id == current_solution.id) ac_base = current_solution_slips._get_line_values(['ACBASE'], compute_sum=True)['ACBASE']['sum']['total'] + result_rules['ACBASE']['total'] ac_threshold = current_solution_slips._get_line_values(['ACSALARYMAX'], compute_sum=True)['ACSALARYMAX']['sum']['total'] + result_rules['ACSALARYMAX']['total'] previous_ac_salary = current_solution_slips._get_line_values(['ACSALARY'], compute_sum=True)['ACSALARY']['sum']['total'] result = min(ac_base, ac_threshold) - previous_ac_salary ALV Contributions AC 5020 165 python result = payslip.l10n_ch_social_insurance_id and not payslip.l10n_ch_avs_status code result = result_rules['ACSALARY']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = -payslip.l10n_ch_social_insurance_id._get_ac_rates(rate_date)[0] 9 L ALV Employer Contributions AC.COMP 170 7020 python result = payslip.l10n_ch_social_insurance_id and not payslip.l10n_ch_avs_status code result = result_rules['ACSALARY']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = payslip.l10n_ch_social_insurance_id._get_ac_rates(rate_date)[1] Unemployment Insurance Source: https://www.cvcicaisseavs.ch/en/employer/unemployment-insurance-ac.html ACC Salary Maximum ACCSALARYMAX 9022 171 none code if payslip.l10n_ch_avs_status or payslip.l10n_ch_after_departure_payment: result = 0 else: result = (payslip.l10n_ch_social_insurance_id._get_acc_threshold(payslip.date_from) - payslip.l10n_ch_social_insurance_id._get_ac_threshold(payslip.date_from)) / 12 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 ACC Salary ACCSALARY 172 python result = not payslip.l10n_ch_avs_status code current_solution = payslip.l10n_ch_social_insurance_id current_solution_slips = previous_payslips.filtered(lambda p : p.l10n_ch_social_insurance_id.id == current_solution.id) ac_base = current_solution_slips._get_line_values(['ACBASE'], compute_sum=True)['ACBASE']['sum']['total'] + result_rules['ACBASE']['total'] max_cum_acc_possible = current_solution_slips._get_line_values(['ACCSALARYMAX'], compute_sum=True)['ACCSALARYMAX']['sum']['total'] + result_rules['ACCSALARYMAX']['total'] max_cum_ac_possible = current_solution_slips._get_line_values(['ACSALARYMAX'], compute_sum=True)['ACSALARYMAX']['sum']['total'] + result_rules['ACSALARYMAX']['total'] acc_salary_cum = current_solution_slips._get_line_values(['ACCSALARY'], compute_sum=True)['ACCSALARY']['sum']['total'] ac_salary_cum = current_solution_slips._get_line_values(['ACSALARY'], compute_sum=True)['ACSALARY']['sum']['total'] + result_rules['ACSALARY']['total'] trimmed_base = max(0, ac_base - max_cum_ac_possible) result = max(min(trimmed_base, max_cum_acc_possible), 0) - acc_salary_cum AC OPEN ACOPEN 173 none code result = result_rules['ACBASE']['total'] - result_rules['ACSALARY']['total'] - result_rules['ACCSALARY']['total'] ACC ACC 5030 174 python result = not payslip.l10n_ch_avs_status and payslip.l10n_ch_social_insurance_id and payslip.l10n_ch_social_insurance_id._get_additional_ac_rates(payslip.date_from)[0] code result = result_rules['ACCSALARY']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = -payslip.l10n_ch_social_insurance_id._get_additional_ac_rates(rate_date)[0] Additional Unemployment Insurance L 9 ACC Employer Contributions ACC.COMP 175 7030 python result = not payslip.l10n_ch_avs_status and payslip.l10n_ch_social_insurance_id and payslip.l10n_ch_social_insurance_id._get_additional_ac_rates(payslip.date_from)[1] code result = result_rules['ACCSALARY']['total'] rate_date = payslip.date_from if payslip.l10n_ch_after_departure_payment: previous_non_departure_slips = previous_payslips.filtered(lambda p: not p.l10n_ch_after_departure_payment) if previous_non_departure_slips: rate_date = previous_non_departure_slips[-1].date_from result_rate = payslip.l10n_ch_social_insurance_id._get_additional_ac_rates(rate_date)[1] Additional Unemployment Insurance LAA Base LAABASE 9030 176 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_aanp_included) LAA Salary Maximum LAASALARYMAX 180 python result = payslip.l10n_ch_laa_group and not payslip.l10n_ch_after_departure_payment code laa_t, laa_aap, laa_aanp, laa_comp = payslip.l10n_ch_laa_group.get_rates(payslip.date_from) if payslip.laa_solution_number == '0': result = 0 else: result = laa_t / 12 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 LAA Salary LAASALARY 9031 185 python result = payslip.l10n_ch_laa_group code current_solution = payslip.l10n_ch_laa_group if payslip.laa_solution_number in ['1', '2']: current_solution_slips = previous_payslips.filtered(lambda p : p.laa_solution_number in ['1', '2'] and p.l10n_ch_laa_group.id == current_solution.id) else: current_solution_slips = previous_payslips.filtered(lambda p : p.l10n_ch_laa_group.id == current_solution.id and p.laa_solution_number == payslip.laa_solution_number) previous_laa_salary = current_solution_slips._get_line_values(['LAASALARY'], compute_sum=True)['LAASALARY']['sum']['total'] current_laa_base = current_solution_slips._get_line_values(['LAABASE'], compute_sum=True)['LAABASE']['sum']['total'] + result_rules['LAABASE']['total'] laa_threshold = current_solution_slips._get_line_values(['LAASALARYMAX'], compute_sum=True)['LAASALARYMAX']['sum']['total'] + result_rules['LAASALARYMAX']['total'] result = min(current_laa_base, laa_threshold) - previous_laa_salary Occupational Accident Insurance Employer Contributions AAP.COMP 190 9032 python result = payslip.l10n_ch_laa_group code solution_number = payslip.laa_solution_number laa_t, laa_aap, laa_aanp, laa_comp = payslip.l10n_ch_laa_group.get_rates(payslip.date_from) result_rate = 0 if solution_number in ["1", "2", "3"]: result_rate = laa_aap result = result_rules['LAASALARY']['total'] Non-Occupational Accident Insurance Contribution AANP 5040 195 python result = payslip.l10n_ch_laa_group and payslip.laa_solution_number == "1" code laa_t, laa_aap, laa_aanp, laa_comp = payslip.l10n_ch_laa_group.get_rates(payslip.date_from) result_rate = -laa_aanp * (100 - laa_comp) / 100 result = result_rules['LAASALARY']['total'] Accident Insurance (Non Occupational Rates) L 9 Non-Occupational Accident Insurance Employer Contribution AANP.COMP 200 7040 python result = payslip.l10n_ch_laa_group and payslip.laa_solution_number in ["1", "2"] code laa_t, laa_aap, laa_aanp, laa_comp = payslip.l10n_ch_laa_group.get_rates(payslip.date_from) result_rate = 0 if solution_number == "1": result_rate = laa_aanp * (laa_comp / 100) elif solution_number == "2": result_rate = laa_aanp result = result_rules['LAASALARY']['total'] LAAC Base LAACBASE 9040 210 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_laac_included) LAAC Salary Maximum Main Insurance LAACSALARYMAX1 215 python result = payslip.l10n_ch_additional_accident_insurance_line_ids code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_additional_accident_insurance_line_ids[0] laac_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = laac_wages[1] / 12 else: result = 0 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 LAAC Salary Maximum Second Insurance LAACSALARYMAX2 220 python result = len(payslip.l10n_ch_additional_accident_insurance_line_ids) > 1 code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_additional_accident_insurance_line_ids[1] laac_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = laac_wages[1] / 12 else: result = 0 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 LAAC Salary Minimum Main Insurance LAACSALARYMIN1 225 python result = payslip.l10n_ch_additional_accident_insurance_line_ids code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_additional_accident_insurance_line_ids[0] laac_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = laac_wages[0] / 12 else: result = 0 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 LAAC Salary Minimum Second Insurance LAACSALARYMIN2 230 python result = len(payslip.l10n_ch_additional_accident_insurance_line_ids) > 1 code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_additional_accident_insurance_line_ids[1] laac_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = laac_wages[0] / 12 else: result = 0 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 LAAC Salary Main Insurance LAACSALARY1 9041 235 python result = payslip.l10n_ch_additional_accident_insurance_line_ids code current_solution = payslip.l10n_ch_additional_accident_insurance_line_ids[0] current_solution_slips_position_1 = previous_payslips.filtered(lambda p : p.l10n_ch_additional_accident_insurance_line_ids and p.l10n_ch_additional_accident_insurance_line_ids[0].id == current_solution.id) current_solution_slips_position_2 = previous_payslips.filtered(lambda p : len(p.l10n_ch_additional_accident_insurance_line_ids) > 1 and p.l10n_ch_additional_accident_insurance_line_ids[1].id == current_solution.id) previous_laac_1_salary_1 = current_solution_slips_position_1._get_line_values(['LAACSALARY1'], compute_sum=True)['LAACSALARY1']['sum']['total'] previous_laac_1_salary_2 = current_solution_slips_position_2._get_line_values(['LAACSALARY2'], compute_sum=True)['LAACSALARY2']['sum']['total'] current_laac_1_base_1 = current_solution_slips_position_1._get_line_values(['LAACBASE'], compute_sum=True)['LAACBASE']['sum']['total'] current_laac_2_base_2 = current_solution_slips_position_2._get_line_values(['LAACBASE'], compute_sum=True)['LAACBASE']['sum']['total'] wage_from_cum1 = current_solution_slips_position_1._get_line_values(['LAACSALARYMIN1'], compute_sum=True)['LAACSALARYMIN1']['sum']['total'] wage_from_cum2 = current_solution_slips_position_2._get_line_values(['LAACSALARYMIN2'], compute_sum=True)['LAACSALARYMIN2']['sum']['total'] laac_1_threshold_1 = current_solution_slips_position_1._get_line_values(['LAACSALARYMAX1'], compute_sum=True)['LAACSALARYMAX1']['sum']['total'] laac_1_threshold_2 = current_solution_slips_position_2._get_line_values(['LAACSALARYMAX2'], compute_sum=True)['LAACSALARYMAX2']['sum']['total'] previous_laac_1_salary = previous_laac_1_salary_1 + previous_laac_1_salary_2 current_laac_1_base = current_laac_1_base_1 + current_laac_2_base_2 + result_rules['LAACBASE']['total'] wage_from_cum = wage_from_cum1 + wage_from_cum2 + result_rules['LAACSALARYMIN1']['total'] laac_1_threshold = laac_1_threshold_1 + laac_1_threshold_2 + result_rules['LAACSALARYMAX1']['total'] if wage_from_cum > 0: trimmed_base = max(0, min(current_laac_1_base - wage_from_cum, laac_1_threshold - wage_from_cum)) elif wage_from_cum == 0 and laac_1_threshold > 0: trimmed_base = min(current_laac_1_base - wage_from_cum, laac_1_threshold - wage_from_cum) else: trimmed_base = 0 result = trimmed_base - previous_laac_1_salary LAAC Salary Second Insurance LAACSALARY2 9043 240 python result = len(payslip.l10n_ch_additional_accident_insurance_line_ids) > 1 code current_solution = payslip.l10n_ch_additional_accident_insurance_line_ids[1] current_solution_slips_position_1 = previous_payslips.filtered(lambda p : p.l10n_ch_additional_accident_insurance_line_ids and p.l10n_ch_additional_accident_insurance_line_ids[0].id == current_solution.id) current_solution_slips_position_2 = previous_payslips.filtered(lambda p : len(p.l10n_ch_additional_accident_insurance_line_ids) > 1 and p.l10n_ch_additional_accident_insurance_line_ids[1].id == current_solution.id) previous_laac_1_salary_1 = current_solution_slips_position_1._get_line_values(['LAACSALARY1'], compute_sum=True)['LAACSALARY1']['sum']['total'] previous_laac_1_salary_2 = current_solution_slips_position_2._get_line_values(['LAACSALARY2'], compute_sum=True)['LAACSALARY2']['sum']['total'] current_laac_1_base_1 = current_solution_slips_position_1._get_line_values(['LAACBASE'], compute_sum=True)['LAACBASE']['sum']['total'] current_laac_2_base_2 = current_solution_slips_position_2._get_line_values(['LAACBASE'], compute_sum=True)['LAACBASE']['sum']['total'] wage_from_cum1 = current_solution_slips_position_1._get_line_values(['LAACSALARYMIN1'], compute_sum=True)['LAACSALARYMIN1']['sum']['total'] wage_from_cum2 = current_solution_slips_position_2._get_line_values(['LAACSALARYMIN2'], compute_sum=True)['LAACSALARYMIN2']['sum']['total'] laac_1_threshold_1 = current_solution_slips_position_1._get_line_values(['LAACSALARYMAX1'], compute_sum=True)['LAACSALARYMAX1']['sum']['total'] laac_1_threshold_2 = current_solution_slips_position_2._get_line_values(['LAACSALARYMAX2'], compute_sum=True)['LAACSALARYMAX2']['sum']['total'] previous_laac_1_salary = previous_laac_1_salary_1 + previous_laac_1_salary_2 current_laac_1_base = current_laac_1_base_1 + current_laac_2_base_2 + result_rules['LAACBASE']['total'] wage_from_cum = wage_from_cum1 + wage_from_cum2 + result_rules['LAACSALARYMIN2']['total'] laac_1_threshold = laac_1_threshold_1 + laac_1_threshold_2 + result_rules['LAACSALARYMAX2']['total'] if wage_from_cum > 0: trimmed_base = max(0, min(current_laac_1_base - wage_from_cum, laac_1_threshold - wage_from_cum)) elif wage_from_cum == 0 and laac_1_threshold > 0: trimmed_base = min(current_laac_1_base - wage_from_cum, laac_1_threshold - wage_from_cum) else: trimmed_base = 0 result = trimmed_base - previous_laac_1_salary Additional Accident Insurance 1 LAAC1 5041 245 python result = payslip.l10n_ch_additional_accident_insurance_line_ids code result = result_rules['LAACSALARY1']['total'] wage_from, wage_to, rate, employer_rate = payslip.l10n_ch_additional_accident_insurance_line_ids[0]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = -rate * (100 - employer_rate)/100 Additional Accident Insurance 2 LAAC2 5043 250 python result = len(payslip.l10n_ch_additional_accident_insurance_line_ids) > 1 code result = result_rules['LAACSALARY2']['total'] wage_from, wage_to, rate, employer_rate = payslip.l10n_ch_additional_accident_insurance_line_ids[1]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = -rate * (100 - employer_rate) / 100 Second Additional Accident Insurance (LAAC) Additional Accident Insurance 1 Employer Contributions LAAC1.COMP 255 7041 python result = payslip.l10n_ch_additional_accident_insurance_line_ids code result = result_rules['LAACSALARY1']['total'] wage_from, wage_to, rate, employer_rate = payslip.l10n_ch_additional_accident_insurance_line_ids[0]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = rate * (employer_rate) / 100 Additional Accident Insurance (LAAC) Additional Accident Insurance 2 Employer Contributions LAAC2.COMP 260 7043 python result = len(payslip.l10n_ch_additional_accident_insurance_line_ids) > 1 code result = result_rules['LAACSALARY2']['total'] wage_from, wage_to, rate, employer_rate = payslip.l10n_ch_additional_accident_insurance_line_ids[1]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = rate * (employer_rate) / 100 Additional Accident Insurance (LAAC) IJM Base IJMBASE 9050 270 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_ijm_included) IJM Salary Maximum Main Insurance IJMSALARYMAX1 275 python result = payslip.l10n_ch_sickness_insurance_line_ids code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_sickness_insurance_line_ids[0] ijm_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = ijm_wages[1] / 12 else: result = 0 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 IJM Salary Maximum Second Insurance IJMSALARYMAX2 280 python result = len(payslip.l10n_ch_sickness_insurance_line_ids) > 1 code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_sickness_insurance_line_ids[1] ijm_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = ijm_wages[1] / 12 else: result = 0 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 IJM Salary Minimum Main Insurance IJMSALARYMIN1 285 python result = payslip.l10n_ch_sickness_insurance_line_ids code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_sickness_insurance_line_ids[0] ijm_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = ijm_wages[0] / 12 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 else: result = 0 IJM Salary Maximum Second Insurance IJMSALARYMIN2 290 python result = len(payslip.l10n_ch_sickness_insurance_line_ids) > 1 code if not payslip.l10n_ch_after_departure_payment: current_solution = payslip.l10n_ch_sickness_insurance_line_ids[1] ijm_wages = current_solution._get_rates(payslip.date_from, version.employee_id.sex) result = ijm_wages[0] / 12 result_rate = result_rules['ASDAYS']['total'] / 30.0 * 100.0 else: result = 0 IJM Salary Main Insurance IJMSALARY1 9051 295 python result = payslip.l10n_ch_sickness_insurance_line_ids code current_solution = payslip.l10n_ch_sickness_insurance_line_ids[0] current_solution_slips_position_1 = previous_payslips.filtered(lambda p : p.l10n_ch_sickness_insurance_line_ids and p.l10n_ch_sickness_insurance_line_ids[0].id == current_solution.id) current_solution_slips_position_2 = previous_payslips.filtered(lambda p : len(p.l10n_ch_sickness_insurance_line_ids) > 1 and p.l10n_ch_sickness_insurance_line_ids[1].id == current_solution.id) previous_ijm_1_salary_1 = current_solution_slips_position_1._get_line_values(['IJMSALARY1'], compute_sum=True)['IJMSALARY1']['sum']['total'] previous_ijm_1_salary_2 = current_solution_slips_position_2._get_line_values(['IJMSALARY2'], compute_sum=True)['IJMSALARY2']['sum']['total'] current_ijm_1_base_1 = current_solution_slips_position_1._get_line_values(['IJMBASE'], compute_sum=True)['IJMBASE']['sum']['total'] current_ijm_2_base_2 = current_solution_slips_position_2._get_line_values(['IJMBASE'], compute_sum=True)['IJMBASE']['sum']['total'] wage_from_cum1 = current_solution_slips_position_1._get_line_values(['IJMSALARYMIN1'], compute_sum=True)['IJMSALARYMIN1']['sum']['total'] wage_from_cum2 = current_solution_slips_position_2._get_line_values(['IJMSALARYMIN2'], compute_sum=True)['IJMSALARYMIN2']['sum']['total'] ijm_1_threshold_1 = current_solution_slips_position_1._get_line_values(['IJMSALARYMAX1'], compute_sum=True)['IJMSALARYMAX1']['sum']['total'] ijm_1_threshold_2 = current_solution_slips_position_2._get_line_values(['IJMSALARYMAX2'], compute_sum=True)['IJMSALARYMAX2']['sum']['total'] previous_ijm_1_salary = previous_ijm_1_salary_1 + previous_ijm_1_salary_2 current_ijm_1_base = current_ijm_1_base_1 + current_ijm_2_base_2 + result_rules['IJMBASE']['total'] wage_from_cum = wage_from_cum1 + wage_from_cum2 + result_rules['IJMSALARYMIN1']['total'] ijm_1_threshold = ijm_1_threshold_1 + ijm_1_threshold_2 + result_rules['IJMSALARYMAX1']['total'] if wage_from_cum > 0: trimmed_base = max(0, min(current_ijm_1_base - wage_from_cum, ijm_1_threshold - wage_from_cum)) elif wage_from_cum == 0 and ijm_1_threshold > 0: trimmed_base = min(current_ijm_1_base - wage_from_cum, ijm_1_threshold - wage_from_cum) else: trimmed_base = 0 result = trimmed_base - previous_ijm_1_salary IJM Salary Second Insurance IJMSALARY2 9053 300 python result = len(payslip.l10n_ch_sickness_insurance_line_ids) > 1 code current_solution = payslip.l10n_ch_sickness_insurance_line_ids[1] current_solution_slips_position_1 = previous_payslips.filtered(lambda p : p.l10n_ch_sickness_insurance_line_ids and p.l10n_ch_sickness_insurance_line_ids[0].id == current_solution.id) current_solution_slips_position_2 = previous_payslips.filtered(lambda p : len(p.l10n_ch_sickness_insurance_line_ids) > 1 and p.l10n_ch_sickness_insurance_line_ids[1].id == current_solution.id) previous_ijm_1_salary_1 = current_solution_slips_position_1._get_line_values(['IJMSALARY1'], compute_sum=True)['IJMSALARY1']['sum']['total'] previous_ijm_1_salary_2 = current_solution_slips_position_2._get_line_values(['IJMSALARY2'], compute_sum=True)['IJMSALARY2']['sum']['total'] current_ijm_1_base_1 = current_solution_slips_position_1._get_line_values(['IJMBASE'], compute_sum=True)['IJMBASE']['sum']['total'] current_ijm_2_base_2 = current_solution_slips_position_2._get_line_values(['IJMBASE'], compute_sum=True)['IJMBASE']['sum']['total'] wage_from_cum1 = current_solution_slips_position_1._get_line_values(['IJMSALARYMIN1'], compute_sum=True)['IJMSALARYMIN1']['sum']['total'] wage_from_cum2 = current_solution_slips_position_2._get_line_values(['IJMSALARYMIN2'], compute_sum=True)['IJMSALARYMIN2']['sum']['total'] ijm_1_threshold_1 = current_solution_slips_position_1._get_line_values(['IJMSALARYMAX1'], compute_sum=True)['IJMSALARYMAX1']['sum']['total'] ijm_1_threshold_2 = current_solution_slips_position_2._get_line_values(['IJMSALARYMAX2'], compute_sum=True)['IJMSALARYMAX2']['sum']['total'] previous_ijm_1_salary = previous_ijm_1_salary_1 + previous_ijm_1_salary_2 current_ijm_1_base = current_ijm_1_base_1 + current_ijm_2_base_2 + result_rules['IJMBASE']['total'] wage_from_cum = wage_from_cum1 + wage_from_cum2 + result_rules['IJMSALARYMIN2']['total'] ijm_1_threshold = ijm_1_threshold_1 + ijm_1_threshold_2 + result_rules['IJMSALARYMAX2']['total'] if wage_from_cum > 0: trimmed_base = max(0, min(current_ijm_1_base - wage_from_cum, ijm_1_threshold - wage_from_cum)) elif wage_from_cum == 0 and ijm_1_threshold > 0: trimmed_base = min(current_ijm_1_base - wage_from_cum, ijm_1_threshold - wage_from_cum) else: trimmed_base = 0 result = trimmed_base - previous_ijm_1_salary Daily Sickness Insurance 1 IJM1 5045 305 python result = payslip.l10n_ch_sickness_insurance_line_ids code result = result_rules['IJMSALARY1']['total'] wage_to, wage_from, rate, employer_part = payslip.l10n_ch_sickness_insurance_line_ids[0]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = -rate * (100 - employer_part) / 100 Daily Sickness Insurance Daily Sickness Insurance 2 IJM2 5047 310 python result = len(payslip.l10n_ch_sickness_insurance_line_ids) > 1 code result = result_rules['IJMSALARY2']['total'] wage_to, wage_from, rate, employer_part = payslip.l10n_ch_sickness_insurance_line_ids[1]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = -rate * (100 - employer_part) / 100 Daily Sickness Insurance Daily Sickness Insurance 1 Employer IJM1.COMP 315 7045 python result = payslip.l10n_ch_sickness_insurance_line_ids code result = result_rules['IJMSALARY1']['total'] wage_to, wage_from, rate, employer_part = payslip.l10n_ch_sickness_insurance_line_ids[0]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = rate * (employer_part / 100) Daily Sickness Insurance Daily Sickness Insurance 2 Employer IJM2.COMP 320 7046 python result = len(payslip.l10n_ch_sickness_insurance_line_ids) > 1 code result = result_rules['IJMSALARY2']['total'] wage_to, wage_from, rate, employer_part = payslip.l10n_ch_sickness_insurance_line_ids[1]._get_rates(payslip.date_from, version.employee_id.sex) result_rate = rate * (employer_part / 100) Daily Sickness Insurance PP Contributions LPP 5050 350 python result = "LPP" in inputs code result = -inputs['LPP'].amount result_name = inputs['LPP'].name 10.1 M PP Complementary Contributions LPP.COMPL 5052 350 python result = "LPP.COMPL" in inputs code result = -inputs['LPP.COMPL'].amount result_name = inputs['LPP.COMPL'].name 10.1 PP Employer Contributions Compensation LPP.COMP.CONT 5111 355 python result = "LPP.COMP.CONT" in inputs code result = -inputs['LPP.COMP.CONT'].amount result_name = inputs['LPP.COMP.CONT'].name 10.1 PP Benefits Purchase Employer Contributions Compensation LPP.P.COMP.CONT 5112 360 python result = "LPP.P.COMP.CONT" in inputs code result = -inputs['LPP.P.COMP.CONT'].amount result_name = inputs['LPP.P.COMP.CONT'].name 10.2 PP Benefits Purchase LPP.RACHAT 5051 365 python result = "LPP.RACHAT" in inputs code result = -inputs['LPP.RACHAT'].amount result_name = inputs['LPP.RACHAT'].name 10.2 PP Employer Contributions LPP.COMP 7050 370 python result = "LPP.COMP" in inputs code result = inputs['LPP.COMP'].amount result_name = inputs['LPP.COMP'].name PP Complementary Employer Contributions LPP.COMP.COMPL 7052 355 python result = "LPP.COMP.COMPL" in inputs code result = inputs['LPP.COMP.COMPL'].amount result_name = inputs['LPP.COMP.COMPL'].name PP Benefits Purchase Employer Contributions LPP.RACHAT.COMP 7051 370 python result = "LPP.RACHAT.COMP" in inputs code result = inputs['LPP.RACHAT.COMP'].amount result_name = inputs['LPP.RACHAT.COMP'].name Source-Tax Adjustment ISCOR 5061 400 python result = payslip.l10n_ch_is_correction and payslip.l10n_ch_is_code code canton, is_code, municipality = payslip.l10n_ch_is_code.split('-') total_compensation = 0 if payslip.l10n_ch_is_correction.correction_method == 'manual': for correction in payslip.l10n_ch_is_correction.manual_correction_ids: total_compensation += payslip._reverse_log_lines(correction.payslip_id, correction) else: for slip in payslip.l10n_ch_is_correction.payslips_to_correct: total_compensation += payslip._reverse_log_lines(slip) result = total_compensation 12 Source Tax Base ISBASE 9065 400 none code result = sum(result_rules[rule.code]['total'] for rule in payslip.struct_id.rule_ids if rule.l10n_ch_source_tax_included) Source-Tax Determinant Periodic Salary ISSALARYDTP 405 none code periodic_rules = [rule for rule in payslip.struct_id.rule_ids if rule.l10n_ch_source_tax_included and rule.l10n_ch_is_periodic] result = sum(result_rules[rule.code]['total'] for rule in periodic_rules) Source-Tax Determinant Aperiodic Salary ISSALARYDTAP 410 none code periodic_rules = [rule for rule in payslip.struct_id.rule_ids if rule.l10n_ch_source_tax_included and not rule.l10n_ch_is_periodic] result = sum(result_rules[rule.code]['total'] for rule in periodic_rules) Source-Tax Salary ISSALARY 9070 415 python result = payslip.l10n_ch_is_code and not payslip.l10n_ch_is_code.split('-')[1].startswith('NO') code canton, code, municipality = payslip.l10n_ch_is_code.split('-') if not payslip.l10n_ch_after_departure_payment: log_lines = (previous_payslips + payslip)._get_is_log_lines(compute_total=True)["total"][canton] year_days = log_lines['ISWORKEDDAYS'] year_days_ch = log_lines['ISWORKEDDAYSINCH'] thirteen_m = result_rules['13THMONTH']['total'] + result_rules['13THMONTH_HOURLY']['total'] + result_rules['14THMONTH']['total'] + result_rules['14THMONTH_HOURLY']['total'] salary_month = (result_rules['ISSALARYDTP']['total'] - thirteen_m) * result_rules['ISWORKEDDAYSINCH']['total'] / result_rules['ISWORKEDDAYS']['total'] salary_year = (result_rules['ISSALARYDTAP']['total'] + thirteen_m) * year_days_ch / year_days result = salary_month + salary_year payslip._log_is_line( is_canton=canton, municipality=municipality, is_code=code, code='ISSALARY', amount=result) else: last_slip_lines = reference_is_slip._get_is_log_lines(compute_total=True)["total"] right_canton = False for canton in last_slip_lines: if last_slip_lines[canton]['ISWORKEDDAYS'] > 0: right_canton = canton if right_canton: last_days = last_slip_lines[right_canton]['ISWORKEDDAYS'] last_days_in_ch = last_slip_lines[right_canton]['ISWORKEDDAYSINCH'] log_lines = (previous_payslips + payslip)._get_is_log_lines(compute_total=True)["total"][right_canton] year_days = log_lines['ISWORKEDDAYS'] year_days_ch = log_lines['ISWORKEDDAYSINCH'] salary_month = result_rules['ISSALARYDTP']['total'] * (last_days_in_ch / last_days) salary_year = result_rules['ISSALARYDTAP']['total'] * (year_days_ch / year_days) else: salary_month = result_rules['ISSALARYDTP']['total'] salary_year = result_rules['ISSALARYDTAP']['total'] result = salary_month + salary_year canton, code, municipality = payslip.l10n_ch_is_code.split('-') if not payslip.l10n_ch_after_departure_payment == "NK": payslip._log_is_line( is_canton=canton, municipality=municipality, is_code=code, code='ISSALARY', amount=result) Source-Tax Determinant Aperiodic Salary ISDTSALARYAPERIODIC 9072 420 python result = payslip.l10n_ch_is_code and not payslip.l10n_ch_is_code.split('-')[1].startswith('NO') code result = result_rules['ISSALARYDTAP']['total'] if not payslip.l10n_ch_after_departure_payment == "NK": canton, code, municipality = payslip.l10n_ch_is_code.split('-') payslip._log_is_line(is_canton=canton, municipality=municipality, is_code=code, code='ISDTSALARYAPERIODIC', amount=result) Activity Rate Total ACTIVITYRATETOTAL 423 none code if "ACTIVITYRATETOTAL" in inputs: result = inputs["ACTIVITYRATETOTAL"].amount else: if payslip.version_id.l10n_ch_other_employment: if payslip.version_id.l10n_ch_total_activity_type == 'gross': result = (payslip.version_id.l10n_ch_other_activity_gross / result_rules['ISSALARYDTP']['total'] * result_rules['ACTIVITYRATE']['total']) + result_rules['ACTIVITYRATE']['total'] elif payslip.version_id.l10n_ch_total_activity_type == 'percentage': result = result_rules['ACTIVITYRATE']['total'] + payslip.version_id.l10n_ch_other_activity_percentage else: result = 100 else: result = result_rules['ACTIVITYRATE']['total'] Source-Tax Determinant Periodic Salary ISDTSALARYPERIODIC 9071 425 python result = payslip.l10n_ch_is_code and not payslip.l10n_ch_is_code.split('-')[1].startswith('NO') code result = result_rules['ISSALARYDTP']['total'] / (result_rules['ACTIVITYRATE']['total']/100) * (result_rules['ACTIVITYRATETOTAL']['total']/100) canton, code, municipality = payslip.l10n_ch_is_code.split('-') payslip._log_is_line(is_canton=canton, municipality=municipality, is_code=code, code='ISDTSALARYPERIODIC', amount=result) Source-Tax Rate Determinant Salary ISDTSALARY 9073 430 python result = payslip.l10n_ch_is_code and not payslip.l10n_ch_is_code.split('-')[1].startswith('NO') code canton, is_code, municipality = payslip.l10n_ch_is_code.split('-') if payslip.l10n_ch_is_model == "monthly": is_dt_periodic = result_rules['ISDTSALARYPERIODIC']['total'] is_dt_aperiodic = result_rules['ISDTSALARYAPERIODIC']['total'] if payslip.l10n_ch_after_departure_payment: log_lines = reference_is_slip._get_is_log_lines(compute_total=True)["total"][canton] if log_lines['ASDAYS'] > 0: as_days = log_lines['ASDAYS'] is_dt_periodic += log_lines['ISDTSALARYPERIODIC'] else: as_days = 30 else : as_days = result_rules['ASDAYS']['total'] result = is_dt_periodic / as_days * 30 + is_dt_aperiodic elif payslip.l10n_ch_is_model == "yearly": is_line_values = (previous_payslips + payslip)._get_is_log_lines(compute_total=True)["total"][canton] total_is_dt_periodic = is_line_values['ISDTSALARYPERIODIC'] total_is_dt_aperiodic = is_line_values['ISDTSALARYAPERIODIC'] if payslip.l10n_ch_after_departure_payment == "NK": total_is_dt_aperiodic += result_rules["ISDTSALARYAPERIODIC"]["total"] total_as_days = is_line_values['ASDAYS'] yearly_is_dt_salary = total_is_dt_periodic / total_as_days * 360 + total_is_dt_aperiodic result = yearly_is_dt_salary / 12.0 else: result = 0 if not payslip.l10n_ch_after_departure_payment == "NK": payslip._log_is_line(is_canton=canton, municipality=municipality, is_code=code, code='ISDTSALARY', amount=result) Source-Tax Adjustment after departure ISCORDEP 5062 435 python result = payslip.l10n_ch_after_departure_payment == 'NK' and payslip.l10n_ch_is_code and reference_is_slip code total_compensation = 0 reference_canton, reference_is_code, reference_municipality, = reference_is_slip.l10n_ch_is_code.split('-') ref_line_values = reference_is_slip._get_is_log_lines()[reference_canton][reference_is_code] current_line_values = payslip._get_is_log_lines()[reference_canton][reference_is_code] previous_is_dt_salary = ref_line_values['ISDTSALARY'] previous_is_amount = ref_line_values['IS'] previous_is_salary = ref_line_values['ISSALARY'] previous_sporadic_benefits = ref_line_values['ISDTSALARYAPERIODIC'] new_is_dt_salary = result_rules['ISDTSALARY']['total'] new_is_salary = result_rules['ISSALARY']['total'] + previous_is_salary new_sporadic_benefits = result_rules['ISDTSALARYAPERIODIC']['total'] + previous_sporadic_benefits payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='ISDTSALARY', amount=-previous_is_dt_salary, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='old') payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='IS', amount=-previous_is_amount, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='old') payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='ISSALARY', amount=-previous_is_salary, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='old') payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='ISDTSALARYAPERIODIC', amount=-previous_sporadic_benefits, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='old') payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='ISDTSALARY', amount=new_is_dt_salary, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='new') payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='ISSALARY', amount=new_is_salary, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='new') payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='ISDTSALARYAPERIODIC', amount=new_sporadic_benefits, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='new') if payslip.l10n_ch_is_model == 'monthly': min_amount, rate = payslip._find_rate(reference_is_slip.l10n_ch_is_code, new_is_dt_salary, reference_is_slip.date_from) new_is_amount = max(min_amount, new_is_salary*rate/100) payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='IS', amount=new_is_amount, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='new') elif payslip.l10n_ch_is_model == 'yearly': combined_slips = (previous_payslips + payslip)._get_is_log_lines()[canton][reference_is_code] yearly_is_salary = combined_slips["ISSALARY"] yearly_paid_is = combined_slips["IS"] new_min, new_is_rate = payslip._find_rate(reference_is_slip.l10n_ch_is_code, new_is_dt_salary, reference_is_slip.date_from) new_is_amount = (yearly_is_salary*new_is_rate/100) - yearly_paid_is if new_is_amount >= 0: new_is_amount = max(new_min, new_is_amount) payslip._log_is_line(is_canton=reference_canton, municipality=reference_municipality, is_code=reference_is_code, code='IS', amount=new_is_amount, corrected_payslip_id=reference_is_slip.id, is_correction=True, correction_type='new') total_compensation = previous_is_amount - new_is_amount result = total_compensation 12 Source-Tax Rate ISRATE 9075 435 python result = payslip.l10n_ch_is_code and not payslip.l10n_ch_is_code.split('-')[1].startswith('NO') code def find_rates(x, rates): x = float_round(x, precision_rounding=1, rounding_method='DOWN') for low, high, min_amount, rate in rates: if low <= x <= high: return min_amount, rate return 0, 0 if not payslip.l10n_ch_is_code: result = 0 else: is_code = payslip.l10n_ch_is_code if payslip.l10n_ch_is_code[3:5] in ['HE', 'ME', 'NO', 'SF']: canton, tax_code, municipality = payslip.l10n_ch_is_code.split("-") category_code = tax_code[0:2] church_tax = tax_code[2] parameter_code = f"l10n_ch_withholding_tax_rates_{canton}_{category_code}_{church_tax}" else: canton, (tax_scale, child_count, church_tax), municipality = payslip.l10n_ch_is_code.split("-") parameter_code = f"l10n_ch_withholding_tax_rates_{canton}_{church_tax}_{tax_scale}_{child_count}" if payslip.l10n_ch_after_departure_payment == "NK": rates = payslip._rule_parameter(parameter_code, reference_is_slip.date_to) else: rates = payslip._rule_parameter(parameter_code) is_dt_salary = result_rules['ISDTSALARY']['total'] min_amount, rate = find_rates(is_dt_salary, rates) result = rate result_rules["ISMIN"]['total'] = min_amount # Yes this is a trick Source-Tax IS 5060 445 python result = payslip.l10n_ch_is_code code canton, code, municipality = payslip.l10n_ch_is_code.split('-') if payslip.l10n_ch_is_code and not payslip.l10n_ch_after_departure_payment == 'NK': if payslip.l10n_ch_after_departure_payment == 'N' or payslip.l10n_ch_is_model== "monthly": is_salary = result_rules['ISSALARY']['total'] is_dt_salary = result_rules['ISDTSALARY']['total'] min_is, rate = payslip._find_rate(payslip.l10n_ch_is_code, is_dt_salary) is_amount = max(is_salary * rate / 100, 0, min_is) result = -is_amount payslip._log_is_line(is_canton=canton, municipality=municipality, is_code=code, code='IS', amount=is_amount) else: total_is = 0 is_log_lines = (previous_payslips + payslip)._get_is_log_lines()[canton] is_dt_salary = result_rules['ISDTSALARY']['total'] for st_code in is_log_lines: is_code = f"{canton}-{st_code}-{municipality}" code_is_salary, code_total_is = is_log_lines[st_code]['ISSALARY'], is_log_lines[st_code]['IS'] min_is, rate = payslip._find_rate(is_code, is_dt_salary) is_amount = code_is_salary * rate / 100 - code_total_is if is_amount >= 0: is_amount = max(min_is, is_amount) total_is -= is_amount payslip._log_is_line(is_canton=canton, municipality=municipality, is_code=st_code, code='IS', amount=is_amount) result = total_is else: result = 0 12 Source-Tax : Manual Correction IS_MANUAL_CORR 5061 446 python result = payslip.l10n_ch_is_code and 'IS_MANUAL_CORR' in inputs code canton, code, municipality = payslip.l10n_ch_is_code.split('-') source_tax_amount = inputs['IS_MANUAL_CORR'].amount result = -source_tax_amount payslip._log_is_line(is_canton=canton, municipality=municipality, is_code=code, code='IS', amount=source_tax_amount) 12 FCF Contribution CAF 5070 450 python result = payslip.l10n_ch_compensation_fund_id and payslip.l10n_ch_compensation_fund_id._get_caf_rates(payslip.date_from, 'employee_rate') > 0 code result = result_rules['AVSSALARY']['total'] result_rate = - payslip.l10n_ch_compensation_fund_id._get_caf_rates(payslip.date_from, 'employee_rate') FCF Employer Contribution CAF.COMP 7070 455 python result = payslip.l10n_ch_compensation_fund_id and payslip.l10n_ch_compensation_fund_id._get_caf_rates(payslip.date_from, 'company_rate') > 0 code result = result_rules['AVSSALARY']['total'] result_rate = - payslip.l10n_ch_compensation_fund_id._get_caf_rates(payslip.date_from, 'company_rate') Deduction Private portion of company car WT_5080 5080 500 python result = 'WT_5080' in inputs code result = -inputs['WT_5080'].amount result_name = inputs['WT_5080'].name Deduction for Prosecution Office WT_5081 5081 500 python result = 'WT_5081' in inputs code result = -inputs['WT_5081'].amount result_name = inputs['WT_5081'].name Alimony Deduction WT_5082 5082 500 python result = 'WT_5082' in inputs code result = -inputs['WT_5082'].amount result_name = inputs['WT_5082'].name Correction benefits in kind WT_5100 5100 500 python result = 'WT_5100' in inputs code result = -inputs['WT_5100'].amount result_name = inputs['WT_5100'].name Cash Advantage Correction CASHCORRECTION 5110 500 python result = 'WT_5110' in inputs code result = -inputs['WT_5110'].amount result_name = inputs['WT_5110'].name Joint National Commission WT_5310 5310 500 python result = 'WT_5310' in inputs code result = -inputs['WT_5310'].amount result_name = inputs['WT_5310'].name Joint National Commission Employer WT_7310 7310 500 python result = 'WT_7310' in inputs code result = -inputs['WT_7310'].amount result_name = inputs['WT_7310'].name Joint Commission WT_5300 5300 500 python result = 'WT_5300' in inputs code result = -inputs['WT_5300'].amount result_name = inputs['WT_5300'].name Joint Commission Employer WT_7300 7300 500 python result = 'WT_7300' in inputs code result = -inputs['WT_7300'].amount result_name = inputs['WT_7300'].name Expenses travel, car, overnight accommodation EXP6000 6000 700 python result = "EXP6000" in inputs code result = inputs['EXP6000'].amount result_name = inputs['EXP6000'].name 13.1.1 Effective expenses expatriates EXP6020 6020 705 python result = "EXP6020" in inputs code result = inputs['EXP6020'].amount result_name = inputs['EXP6020'].name 13.1.2 Other Effective Expenses EXP6030 6030 710 python result = "EXP6030" in inputs code result = inputs['EXP6030'].amount result_name = inputs['EXP6030'].name 13.1.2 Lump sum professional expenses expatriates EXP6035 6035 715 python result = "EXP6035" in inputs code result = inputs['EXP6035'].amount result_name = inputs['EXP6035'].name 2.3 Lump-sum representation expenses EXP6040 6040 720 python result = "EXP6040" in inputs code result = inputs['EXP6040'].amount result_name = inputs['EXP6040'].name 13.2.1 Lump sum car expenses EXP6050 6050 725 python result = "EXP6050" in inputs code result = inputs['EXP6050'].amount result_name = inputs['EXP6050'].name 13.2.2 Other lump sum expenses EXP6070 6070 730 python result = "EXP6070" in inputs code result = inputs['EXP6070'].amount result_name = inputs['EXP6070'].name 13.2.3 Net Salary Net_Salary 6500 1000 none code result = categories['BASIC'] + categories['ALW'] + categories['DED'] Salary Advance Already Paid WT_6510 6510 1100 python result = "WT_6510" in inputs code result = -inputs['WT_6510'].amount result_name = inputs['WT_6510'].name Net Paid NET 6600 1200 none code result = result_rules['Net_Salary']['total'] + result_rules['WT_6510']['total'] Vacation pay Provision HOLALWPROV 9000 1500 python result = result = result_rules['VACATION_BASE']['total'] > 0 and version.l10n_ch_contractual_holidays_rate and not version.l10n_ch_contractual_vacation_pay code result_rate = version.l10n_ch_contractual_holidays_rate result = result = result_rules['VACATION_BASE']['total'] Vacation pay Balance HOLALWTOT 9001 1500 none code line_values = previous_payslips._get_line_values(['HOLALWPROV', 'WT_1162', 'WT_1163'], compute_sum=True) total_provision = line_values['HOLALWPROV']['sum']['total'] + result_rules['HOLALWPROV']['total'] total_paid = line_values['WT_1162']['sum']['total'] + line_values['WT_1163']['sum']['total'] + result_rules['WT_1162']['total'] + result_rules['WT_1163']['total'] result = total_provision - total_paid