11-29-2016, 08:08 AM
So basically before invoking the webservice methods always run 'CurrencyField::convertToUserFormat()' on any currency field you want to save?
Problem with webservice methods and inventory modules
|
11-29-2016, 08:08 AM
So basically before invoking the webservice methods always run 'CurrencyField::convertToUserFormat()' on any currency field you want to save?
11-29-2016, 08:49 AM
If you are calling from inside the application: yes,
If you are creating your own external application it will/should have it's own mechanisms to format the numbers for the user depending on his settings there.
Joe
TSolucio
Great, thanks!
One thing though: I remember the workflow I had this problem with. It updated the salesorder status and duedate, and left the rest alone. How should I input the user's currency prefs if I'm not updating any fields that are in currency format?
11-29-2016, 04:58 PM
Will do
I can confirm this works as you said. I need to convert the amounts to the user's format before sending them in. This does mean that when I want to only update a salesorder status, I have to retrieve the amounts, save them somewhere, convert them to the user's format and send them back in, even though I didn't want to change them at all. Is there any way we could get the user's currency format from the webservice API? I've now hardcoded this, but this makes it not-so-flexible.
This means another thing as well: my portal users don't have access to the amount fields. I have to grant them this permission (even though I store the amounts out of sight) to retrieve them, so I can send them back in the correct format. EDIT I remember now we can use revise. Let me see how to implement this in the client. Could I do this through the Invoke?
12-22-2016, 03:03 PM
You can use invoke and also the latest version of the PHP library:
https://github.com/tsolucio/coreBOSwsLib...t.php#L256 Let me know how it goes
Joe
TSolucio
Thanks again. Will work on this.
Just did a test invoking the revise method from my portal, only sending the updated status and the ID. The status update worked, but the total and subtotal are still multiplied by a million. I really need to retrieve the currency fields, reset them to user format before sending in and send them in either the update or revise to prevent this from happening. Even the revise method does not leave the total fields alone.
12-22-2016, 06:13 PM
I remember testing this use case. I will test it again and get back to you.
Joe
TSolucio
06-13-2017, 09:54 PM
I think I got this one:
https://github.com/tsolucio/corebos/comm...e834ac7c0e sorry for taking so long please try it when you can and let me know how it goes.
Joe
TSolucio |
« Next Oldest | Next Newest »
|