Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with webservice methods and inventory modules
#1
Since the update I did last weekend I noticed a problem with webservice methods. Whenever one is used on inventory modules, the number multiply by a million. So € 3.500,- becomes € 3.500.000.000,-. My user settings are:
  • Decimals separator: ","
  • Thousands separator: "."
  • No. of decimals: 2
Reply
#2
We will check this and get back to you.
Joe
TSolucio
Reply
#3
Great, thanks. I tried updating through the ->save() method, but that created a new SO. Tried setting the focus->mode to "edit" but no luck.
Reply
#4
Try also

$_REQUEST['mode']='edit';

although I'd say that with the ->mode should be enough
Joe
TSolucio
Reply
#5
Thanks, will try and get back here if I have something....
Reply
#6
Okay, I'm kind of an idiot here... I tried setting the mode as if it was a method. So focus->mode("edit"). Should have been $focus->mode = "edit"...
Reply
#7
:-)
Joe
TSolucio
Reply
#8
I tried this and it seems to have worked correctly for me.
I did a retrieve of an invoice record, then I sent the information back in with an update.

- I updated only the subject and it respected all the values
- I changed the list price and saw that the price wasn't being updated. I fixed this error we introduced a few weeks ago: https://github.com/tsolucio/corebos/commit/98e6367e6661eb82b28ff45937867003f8638165 this is not related to your problem
- once fixed, the list price on the line was updated correctly and all the totals also
That was done with admin user with english settings: point as decimal separator and comma as thousands, the numbers were formatted in that way

Now I changed to a user who has the settings reveresed, comma as decimal and point as thousands separator.

- with the english number settings all the numbers were broken. this is expected because the user is saying that he works with comma as decimal and point as thousands, so if you send in a number with that reversed the number is read incorrectly.
- I set the numbers to the format of the user and try again. All numbers are updated correctly, except the product lines. I see that product line currency has not been updated to work with the connected user format so I change that: https://github.com/tsolucio/corebos/commit/6e6edf23c611e608208d189b2880bda31ec26b7b

In short: I think it is working correctly, which means: you must send the currency numbers in the format of the user that is connected. This is exactly like the application, On screen you introduce the numbers in the format you have selected, if it is incorrect, the application will give you an error and not let you save. The webservice interface does the same, but with no validation, it expects you to do the validations.

Reached this point I have to say that this is a complex issue which that we have dedicated a lot of time to. I would really like to make sure we have it nailed down and working correctly, so if you think it isn't working right I would like you to use the coreBOS webservice development tool against the coreBOS demo and share with us a couple ot test scripts to reproduce where it isn't working so we can fix it.

Thanks!
Joe
TSolucio
Reply
#9
Will set this on my to-do list. But really, shouldn't we say that any developer would need to make sure he sets the currencies to system format before sending them into the webservice methods?

I'll get doing some tests on my to-do lists, will report back if I have anything.
Reply
#10
You must send the currency formatted in the settngs of the user you have connected with.
Joe
TSolucio
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)