E: TimeReceipt rules

In the following example we do not allow the creation of a time receipt if no material is booked.

exampletimereceipt

 

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 takes extensive time to change all windows. For this it is possible to insert your own scripts directly in the function itself - it is not user front end-based: The userevents.

For more details on how to use it, see this video:

 

The best user event is in this case the "TimeRecording" Event

 

 

Order:

Allow to create time receipt only if material is booked completely (part receipts not supported)

In server mode it returns only an error message and cancels the process.

In desktop mode (for example Terminal) we display all lines which are not booked in an HTML message box and cancel the process.

 

NOTE: This script is for the following workflow:

BEFORE you create the first time receipt, you must create the complete issue of Bill of Materials manually.

This does not check manual receipts. Additionally, you can check if this is the last position (see bsl.workorderrouting) or you can check this in the assembly receipt event.

 

beasscript-logo-small

We use datastorevalues, beas service layer, bsl and Beas Script,

 

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 function

 

help-hinweis Example Notes