コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
4321 ビュー

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.

アバター
破棄
著作者 最善の回答

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.


アバター
破棄
関連投稿 返信 ビュー 活動
0
4月 19
3390
1
10月 25
11513
0
5月 25
1383
1
4月 25
1495
2
7月 24
3234