Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4322 Visualizzazioni

When I input time in timesheet in decimal format it gets converted into hour and minutes format on save. While exporting to quickbook timesheet, value of decimal format goes.

For e.g: If i enter 1.20 on save it gets displayed as 01:12 --- this gets properly exported.

     But if i enter 1.33 on save it gets displayed as 01:20 ---- it gives following error.

Error code from quickbook:

Message: Request has invalid or unsupported property

Code: 2010

Detail: Property Name:Can not construct instance of java.lang.Integer from String value ("33333333333333"): Overflow: numeric value (33333333333333) out of range of Integer (-2147483648 - 2147483647)

specified is unsupported or invalid


I thought of spliting it by using delimiter as ' : ', hours get exported properly but it throws errors while exporting minutes. If I use delimiter as ' . ' decimal format values gets exported properly but for above case of recurring it doesnt.

Code:

"Hours": str(arguments[1].unit_amount).split('.')[0],

"Minutes": str(arguments[1].unit_amount).split('.')[1],

Could anyone suggest me or help me regarding this.

Avatar
Abbandona
Autore Risposta migliore

This got resolved by using function of math library.

math.ceil((arguments[1].unit_amount * 60)%60)

Here we can enter type in any format like decimal or hour and minutes format. Quickbook accepts it as hours and minutes format whether you enter it in decimal or hours and minutes format by importing math library in the file.


Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
apr 19
3390
1
ott 25
11513
0
mag 25
1383
1
apr 25
1495
2
lug 24
3234