Beas - Not Allow WO Goods Receipt
Hi everybody,
I would like to know if there is any way to not allow to add Goods Receipt in Work Orders without have issued the BOM (raw materials).
Thank you,
Kind Regards.
-
Hi,
Best place always userevents.
Here an example for checking material issues in time receipt process.
Time receipts are possible in many different areas: TimeReceipt, LogOff in Desktop Terminal, Desktop Application and WEB Application or directly over Beas Service Layer.
It take too many time, to change all windows. For this we've the possibility to insert own scripts directly in the function self - not user front end based: The userevents. More details how to use it, see this videoHow to work with userevent
https://www.youtube.com/watch?v=Rw_6Oq5Xefc
See documentation
http://help.beascloud.com/script/index.html?userevent.htmI created an example, which will be inside in script documentation 2021.08 with all additional information and links.
here the script:
(you need beas 2021.03 or newer)workordermanagement.src
function TimeRecording
// check count of entries which not booked completely
// we use beas service layer
instance datastore d
d.bsl=WorkorderBom?$select=ItemCode,QuantityWhsUoM,UoMWarehouseId,QuantityBooked&$filter=DocEntry eq <e_WoDocEntry> and LineNumber eq <e_WoLineNumber> and QuantityWhsUoM gt QuantityBooked and Closed eq false
// if no entry found, then all is ok and we can continue
if <d.rowcount> n= 0 then
// don't forget to destroy the created datastore
destroy=d
return success
end if
// if server mode (example Beas service layer or WEB App, we return only an error message
if <system.servermodus> = true then
messagebox=error$$Not all lines booked completely!
destroy=d
return failure
end if
// we create a messagebox with all lines, which not booked as html message
setvar=ls_html=<html><body>Follow lines not booked completely:</br></br><table><tr><td>Item Number</td><td>Planned Quantity</td><td>Booked Quantity</td></tr>
// create the lines
// Note: All field names must be lower case.
for ll_line=1 to <d.rowcount>
d.setrow=<ll_line>
addvar=ls_html=<tr><td><d.itemcode></td><td><d.quantitywhsuom> <d.uomwarehouseid></td><td><d.quantitybooked> <d.uomwarehouseid></td></tr>
next
// don't forget to destroy the created datastore
destroy=d
addvar=ls_html=</table></br>It is not possible to create a time receipt before complete material is booked!</body></html>
// Display the message
messagebox=info$popup=true<tab>text=<ls_html>
// Cancel the process
return failure
end functionFor checking only receipts (manual, as part of time receipts and so on) you can use the userevent
workordermanagement.src - receiptStart
But (!!) this can be too late. in backflush process you must check this in time receipt too, otherwise the system create the BoM Issues and block the receipt process and don't make an rollback. -
Hi Martin,
Thank you for your answer.
I've tried the script with the userevent and it runs OK!
However, this scenario is not exactly what we need, I'll explain below:

The time receipt in the first operation should always cause the Good Material Issue and the time receipt in the last operation always causes the Good Material Receipt.
Maybe, the best way to control it could be "not allow to close the first operation if the good material has not been issued through the time receipt".
Right now, in the WEB APP, when our customer uses "Stop WO" or "WO Time Receipt", they add the quantity of finished item and then "Issue Good Material Screen" is displayed. However, they can select "Save Button" and the operation is completed without having issued the good material.
Is there any validation to not allow it?
Thanks,
Kind Regards.
Sergio Fernández
-
Hi,
You can make an copy of the current WEB APP and can change it directly inside the JavaScript source code.
Or you can block it on backend side in workordermanagement. In this case it's allowed to click on "Save", but the system will return an error.regards
-
Hi Martin,
Perfect, we will try to do it.
Thank you,
Kind Regards.
Iniciar sesión para dejar un comentario.
Comentarios
4 comentarios