Skip to Content
Menu
This question has been flagged
1 Reply
3072 Views

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
Discard
Author Best Answer

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
Discard
Related Posts Replies Views Activity
0
Apr 19
2547
2
Jul 24
939
1
Jun 24
3560
1
Feb 24
953
1
Oct 23
8579