Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
4316 Visninger

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
Kassér
Forfatter Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
apr. 19
3390
1
okt. 25
11513
0
maj 25
1383
1
apr. 25
1495
2
jul. 24
3234