CoreBOSBB
Problem with webservice methods and inventory modules - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+--- Thread: Problem with webservice methods and inventory modules (/showthread.php?tid=480)

Pages: 1 2


RE: Problem with webservice methods and inventory modules - Guido1982 - 11-29-2016

So basically before invoking the webservice methods always run 'CurrencyField::convertToUserFormat()' on any currency field you want to save?


RE: Problem with webservice methods and inventory modules - joebordes - 11-29-2016

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.


RE: Problem with webservice methods and inventory modules - Guido1982 - 11-29-2016

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?


RE: Problem with webservice methods and inventory modules - joebordes - 11-29-2016

I'd say, leave them empty and use Revise
test it


RE: Problem with webservice methods and inventory modules - Guido1982 - 11-29-2016

Will do


RE: Problem with webservice methods and inventory modules - Guido1982 - 12-22-2016

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?


RE: Problem with webservice methods and inventory modules - joebordes - 12-22-2016

You can use invoke and also the latest version of the PHP library:

https://github.com/tsolucio/coreBOSwsLibrary/blob/master/php/WSClient.php#L256

Let me know how it goes


RE: Problem with webservice methods and inventory modules - Guido1982 - 12-22-2016

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.


RE: Problem with webservice methods and inventory modules - joebordes - 12-22-2016

I remember testing this use case. I will test it again and get back to you.


RE: Problem with webservice methods and inventory modules - joebordes - 06-13-2017

I think I got this one:

https://github.com/tsolucio/corebos/commit/567d15b9a52b9a485d99c0ff2a3c73e834ac7c0e

sorry for taking so long

please try it when you can and let me know how it goes.