#-----------------------------------------------------------------------------------------
# Company: Certus Solutions
# Name: FLD.SRVRECTRANS.POLINENUM.ACTN
# Description: Service Receipt Purchase Order Line Number Action
#
# Information:
# ------------
# Toggles the details section of service receipt table
# if one of the commodity group or code fields is empty
# after selection of ordered line item so commodity details
# can be entered.
#
# Launch Point(s):
# ----------------
# Object: SERVRECTRANS
# Attribute: POLINENUM
# Event: Action
#
# Revision History:
# -----------------
# 11-APR-2023 - JPAVLESKI - Initial creation.
#
# @author Jamie Pavleski
#-----------------------------------------------------------------------------------------
service.log("!!! ==================== " + launchPoint + ": START =====================")
#-----------------------------------------------------------------------------------------
# Toggle the details section of the service receipts table for required attributes
#
# @param open (Boolean) - True open detail section, false close detail section.
#-----------------------------------------------------------------------------------------
def toggleServiceReceiptDetail(open):
# Get web client session
uiContext = service.webclientsession()
if (uiContext is not None):
# Application instance
appInstance = uiContext.getCurrentApp()
if (appInstance is not None
and appInstance.getApp() is not None
and appInstance.getApp() == "receipts"):
# Service receipt table bean
matlReceiptTable = appInstance.getDataBean("servreceipts_servreceipts_table")
if (matlReceiptTable is not None):
matlReceiptTable.toggledetailstate(open)
if (mbo.isNew()
and mbo.getPOLine() is not None
and mbo.getPOLine().getBoolean("issue")
and (mbo.getPOLine().isNull("commoditygroup") or mbo.getPOLine().isNull("commodity"))):
toggleServiceReceiptDetail(True)
service.log("!!! ==================== " + launchPoint + ": END =======================")