Skip to Content
Menu
This question has been flagged
2 Replies
236 Views

Hi everybody!!

Please can anyone help me to see the mistakes in this code python:

mois = tools['int'](payslip.date_from[5:7])

if mois==1:

   result = categories.IRPPTM/12-categories.IRPPTM + categories.IRPPRM

elif

 brut_imp_reel != cumul_brut_imp_reel_n_1 :

irpp_reel_n_1= irpp_reel

  result = categories.IRPPTM-payslip.cumul_retenue_source_n_1

   result = result/(12-mois+1)+categories.IRPPRM -payslip.irpp_reel_n

Else

   result = categories.IRPPTM-payslip.cumul_retenue_source_n_1

   result = result/(12-mois+1)+categories.IRPPRM -payslip.irpp_reel_n_1

result = result < 0 and result or 0.0

result_rate = 100

result_quantity = 1

Thanks a lot.

Avatar
Discard
Best Answer

Hi,,

If you need to get help,, show the code with proper indentation. It will help to understand the code...

By the way,, you can try this script to get month from the date field.

date = datetime.strptime(date_field, DEFAULT_SERVER_DATE_FORMAT)

month = date.month

  • I am not sure about the your  expressions (please try to check it and use parentheses if needed)

Hope this helps....

Avatar
Discard
Author Best Answer

Thanks a lot for your answer.

But can you tell me please 

mois = tools['int'](payslip.date_from[5:7])

It does mean what exactly??

 

Avatar
Discard
Related Posts Replies Views Activity
4
Oct 16
30684
1
Sep 15
3477
1
Jun 15
427
0
Apr 15
336
2
Apr 15
471