Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
242 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Penulis Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
4
Okt 16
30727
1
Sep 15
3517
1
Jun 15
455
0
Apr 15
360
2
Apr 15
497