Just like in the desktop or web application, you can use the Recalculate Fulfillment Percentage function for received orders. This function is used to update the "% fulfillment" column based on the price of the ordered item and the current stock status. This column tells you what percentage of the order you are currently able to fulfill.
For items with a 100% discount, the fulfillment % will not be calculated. This value works with the item price, not the quantity.
Note: At the moment, this can be worked around by saving the order with a unit price, calculating the fulfillment %, returning to the order, and changing the unit price to 0. After recalculating the fulfillment %, the correct % will remain even for orders with a zero price.
This function is only available for the received orders agenda.
How to Call the Service
You can use the HTTP method: PUT or POST; the supported output formats are XML or JSON.
The endpoint for calling the service includes the received orders agenda and the service name prepocitat-realizovatelnost:
https://localhost:5434/c/{ID frimy}/objednavka-prijata/prepocitat-realizovatelnost.xml (.json).
URL Parameters
The service supports the dry-run parameter. This parameter can be used to check whether the recalculation has completed. If it has, an HTTP status 200 is returned. If not, an HTTP status 409 is returned with information about when and by whom the recalculation was started.
Usage Examples
1. XML call
POST https://localhost:5434/c/firma_s_r_o_/objednavka-prijata/prepocitat-realizovatelnost.xml
2. JSON call including test mode dry-run:
PUT https://localhost:5434/c/firma_s_r_o_/objednavka-prijata/prepocitat-realizovatelnost.json?dry-run=true
Failed Requests
1. In the event that another recalculation is already running, for example one started by a user in the application
"message": "Aktuálně běžící operace 'Přepočítat procenta realizovatelnosti' špuštěná uživatelem dba v 16.10.2022, 18:21:59 nedovoluje současně spustit 'Přepočítat procenta realizovatelnosti'."
FAQ
How is the percentage calculated?
The percentage is determined as the ratio of the ordered quantity to the current stock level — in other words, what percentage of the order can be fulfilled based on available inventory.
Is it possible to calculate the fulfillment % for a specific order or orders?
This option is not available. The service always calculates the fulfillment percentage for all incomplete orders.
How can I check the current fulfillment %?
Changes to the fulfillment % can be tracked using a web hook. Alternatively, the current value can be read from the procReal property on the received order.
Need help?
If you have any questions about the application, please contact us at podporaflexi@abra.eu or via the chat window in the bottom right corner.
