Class PM_LaborEntry_bus

Properties

LOCAL cMainTable$="PM_LaborEntry"  

[string] Table name being maintained by this business object

LOCAL cIsSysDB=isFALSE  

[boolean] Flag to indicate whether table is located in the MAS_SYSTEM directory

LOCAL cBatchFormat$="NONE"  

[string] Format Type to use to format Batch Number. Initially set to "NONE"

LOCAL timMIDNIGHT$="00.00000"  

[string] Constant time to represent midnight

LOCAL cBatchModule$  
LOCAL cBatchType$  
PROPERTY CI_QtyMask$  

[string] Mask for quantity fields

PROPERTY CrewRecsExploded  

[numeric] Counter for number of records exploded from crew entry. When a crew record is written, the write will remove the original crew record and replace with individual labor records for each employee on the crew.

PROPERTY IsMachine  

[boolean] Flag to indicate that employee is a machine employee

PROPERTY PM_AllowEntryPunchInOutTime$  

[string] Yes/No flag for whether to allow entry of punch in/out time. Source is PM_Options

PROPERTY PM_AllowRegularTimeEntryToHistWT$  

[string] Yes/No flag for whether time entry can be applied to work tickets in history. Source is PM_Options

PROPERTY PM_CaptureTimeInLaborEntry$  

[string] Yes/No flag for whether to capture time in labor entry. Source is PM_Options

PROPERTY PM_CaptureWorkPerformed$  

[string] Yes/No flag for whether to capture work performed. Source is PM_Options

PROPERTY PM_DynamicLabor$  

[string] Yes/No flag for whether dynamic labor is being used. Source is PM_Options

PROPERTY PM_IntegratePayroll$  

[string] Flag indicating Production Management level of integration with Payroll. Values Y-Yes Full Integration, N-No Integration, E-Employees linked only

PROPERTY PM_MinHourlyCostIncrement  

[numeric] Minimum increment for hours worked. Used when calculating hours worked. Source is PM_Options

PROPERTY PR_DepartmentsAllowed$  

[string] Comma separated string of departments that are allowed to be accessed by the current user

PROPERTY SE_AllowMiscTime  

[boolean] Flag for security event to allow entry of miscellaneous time.

PROPERTY SE_EarningsCode  

[boolean] Flag for security event to allow override of earnings code

PROPERTY SE_LaborAdmin  

[boolean] Flag for security event to indicate labor administrator privileges

PROPERTY SplitRecord  

[boolean] Flag to indicate that during the write of the record the time was split into 2 records for different days.

Methods

FUNCTION BatchPendingTransfer()  

Function is called from UI when Batch Transfer is done, this will dirty the cFileChanged flag, so that if this was the only change that the save of the batch will still occur.

Returns Always returns retSUCCESS(1)
FUNCTION BatchTransfers(memFH)  

Function that receives memory file handle for batch transfers to be done as part of the CommitRow()

ParameterDescription
[input, fileHandle] Memory file handle from the UI, with the transactions that need to be transferred to another batch.
Returns Alwyas returns retSUCCESS(1)
FUNCTION Clear()  

Function overridden from SY_Maint, overridden to clean up lock file for the record.

Returns value from the call to the base class.
FUNCTION ClearSetFiles()  

Function overridden from SY_Maint to clean up lock file for the records associated with the Batch + Date

Returns Returns the value from the call to the base class in SY_Maint
FUNCTION CommitRow()  

Function overridden from SY_Maint. Overridden to handle batch transfers after CommitRow() from the base class has finished.

Returns [boolean]
ValueDescription
retSUCCESS(1) If committing of rows was successful and any batch transfers were successful
retFAILURE(0) If an error occurred in the committing of the rows to the physical table or any batch transfers had errors.
FUNCTION Delete(key$)  

Function will delete the current labor entry record. This routine will verify the work ticket & step number aren't in use before allowing delete. Also, the lock file record will be cleaned up.

ParameterDescription
key$ [input, string] key to be deleted from the PM_LaborEntry table.
Returns [boolean]
ValueDescription
retSUCCESS(1) If record was successfully deleted
retFAILURE(0) If record could not be deleted
FUNCTION DeleteAllRows()  

Function will delete all records currently being worked on in the data sheet. This function will not work unless in "SET" mode.

Returns [boolean]
ValueDescription
retSUCCESS(1) If all rows were successfully deleted
retFAILURE(0) If not in "SET" mode.
FUNCTION DeleteBatch(batch$)  

Function overridden from base class SY_BatchMaintSet to set a flag (cInBatchDelete) indicating that a delete batch is in progress.

ParameterDescription
batch$ [input, string] Batch number to be deleted.
Returns [boolean] returns value returned form call to base class SY_BatchMaintSet
FUNCTION GetCrewExplosionFile()  

Retrieves the memory file handle created when a labor crew record is exploded into individual employee records. This should only be called if the property CrewRecsExploded is greater than zero and following a write of a crew record.

Returns [filehandle] Returns the cCrewExpFH filehandle, that is created during the PostWrite() of a crew type transaction.
FUNCTION GetDatesWithEntries()  

Populates a memory table with one record for each date, and a total of regular hours, overtime hours, miscellaneous hours, and and a total labor cost. This will be restricted to the current batch only.

Returns [filehandle] Filehandle to a memory table with data for the entries. One record per date.
FUNCTION GetEmployeeEntries(transDate$, empKey$)  

Populates a memory table with entries for the given employee for the given transaction date. The transactions returned will need to be in the current batch. The file handle to this memory table will be returned to the calling function.

ParameterDescription
transDate$ [input, date] Transaction Date to inquire on
empKey$ [input, string] Employee Key to inquire on.
Returns [filehandle] Filehandle to a memory table with data for the entries.
FUNCTION GetNextSequenceNo$(transDate$, transType$, empKey$, workTicket$, stepKey$)  

Function will search the PM_LaborEntry table and return the next sequence number for a transaction.

ParameterDescription
transDate$ [input, date] Transaction Date for the current record
transType$ [input, string] Transaction Type for the current record
empKey$ [input, string] Employee Key for the current record
workTicket$ [input, string] Work Ticket number for the current record
stepKey$ [input, string] Step line key of the Step number for the current record
Returns [string] returns a zero-padded sequence number, to be used for creating new keys.
FUNCTION GetNextTransferBatch(nextBatch$)  

Function will get the next batch number. This function is used in the UI in the Transfer Batch dialogue.

ParameterDescription
nextBatch$ [output, string] Next batch number is returned.
Returns Always returns retSUCCESS(1)
FUNCTION GetOpenEntries$(opType$, transDate$, transType$, empKey$)  
FUNCTION GetOpenEntries$(opType$, transDate$, transType$, empKey$, workTicket$, stepKey$)  

Function to query the PM_LaborEntry table for transactions that match the given arguments.

ParameterDescription
opType$ [input, string] operation type, this has 2 valid values. "C" for check, to indicate that records exist that match and "E" for Entries, which will retrieve all entries that match.
transDate$ [input, date] Transaction date to search for
transType$ [input, string] Transaction Type to search for
empKey$ [input, string] Employee key to search for
workTicket$ [input, string] {optional} Work Ticket to search for
stepKey$ [input, string] {optional} Step number line key to search for
Returns [string]
ValueDescription
if opType="C" returns either "" for no records found or "FOUND" if an entry was found that matches the criteria
if opType="E" returns concatenated list of keys that match.
FUNCTION GetStepLineKey$(workTicket$, step$)  

Function returns the step line key for the given work ticket and step number

ParameterDescription
workTicket$ [input, string] work ticket number that the step belongs to
step$ [input, string] step number on the work ticket.
Returns [string] returns the StepLineKey$ for the given work ticket and step number.
FUNCTION GetStepLookup$(workTicket$)  

Function returns the lookup name to be used within the UI. This will be determined by whether the work ticket is only found in history.

ParameterDescription
workTicket$ [input, string] work ticket number that the step belongs to
stepKey$ [input, string] step line key of the step on the work ticket.
Returns [string] returns the StepNo$ for the given work ticket and step line key.
FUNCTION GetStepNo$(workTicket$, stepKey$)  

Function returns the step number for the given step line key

ParameterDescription
workTicket$ [input, string] work ticket number that the step belongs to
stepKey$ [input, string] step line key for the step on the work ticket.
Returns [string] returns the StepNo$ for the given work ticket and step line key
FUNCTION IsEmployeeClockedIn(transDate$, empKey$)  

Function determines whether employee has been clocked in for the given date.

ParameterDescription
transDate$ [input, date] date to be queried
empKey$ [input, string] employee key to be used to look up.
Returns [boolean]
ValueDescription
True if employee is clocked in for the given day.
False if employee has not clocked in for the given day
FUNCTION PieceRate()  

Checks if activity code/work center in the current record has piece rate set up

Returns [boolean]
ValueDescription
True if piece rate is set up
False if piece rate is not set up
FUNCTION SetBatchTotalVars(vars$)  

Function to return the batch total variables. This class maintains no batch totals.

ParameterDescription
vars$ [input, string] list of variables to set.
Returns Always returns retSUCCESS(1)
FUNCTION SetFilter(whereClause$)  
FUNCTION SetFilter(whereClause$, restrictKey$)  

Override to base class function found in SY_BatchMaintSet. This is overridden to create a lock file for the current set of data. The name of the lock file will be Company Code + Batch Number + Transaction Date

ParameterDescription
whereClause$ [input, string] Where clause that is applied to select of the physical table into the memory tables
restrictKey$ [input, string] {optional} This value is applied to the select as part of the begin/end, this value should be padded appropriately.
Returns [boolean] Returns the value from the call to the base class
FUNCTION TrackingQtyCompleted$(workTicket$)  

Function reads the work ticket class table with the work ticket class used on the given work ticket, and retrieves the flag TrackCompletedQuantity and returns it. If a record cannot be found then "N" will be returned.

ParameterDescription
workTicket$ [input, string] Work Ticket Key to lookup in history and Work Ticket Class tables
Returns [string] Value of TrackCompletedQuantity from PM_WorkTicketClass or "N" if not found.
FUNCTION ValidateGroupAllowPunchInOut()  

Function is used in conjunction with hiding of groups of fields in the UI grid. This hides the AllowPunchInOut group of fields if Allow Entry of Punch In/Out Time in P/M Options is equal to "Yes"

Returns [boolean]
ValueDescription
retSUCCESS(1) if P/M Option for Set Punch In/Out from Work Ticket Time is equal to "Y"
retFAILURE(0) if P/M Option for Set Punch In/Out from Work Ticket Time is not equal to "Y"
FUNCTION ValidateGroupCaptureTime()  

Function is used in conjunction with hiding of groups of fields in the UI grid. This hides the CaptureTime group of fields if Capture Time in Labor Entry in P/M Options is not equal to "No"

Returns [boolean]
ValueDescription
retSUCCESS(1) if P/M Option for Capture Time in Labor Entry is not equal to "N"
retFAILURE(0) if P/M Option for Capture Time in Labor Entry is equal to "N"
FUNCTION ValidateGroupCaptureTimeNoEdit()  
FUNCTION ValidateGroupCaptureWorkPerformed()  

Function is used in conjunction with hiding of groups of fields in the UI grid. This hides the CaptureWorkPerformed group of fields if Capture Description of Work Performed in P/M Options is equal to "No"

Returns [boolean]
ValueDescription
retSUCCESS(1) if P/M Option for Capture Description of Work Performed is equal to "Y"
retFAILURE(0) if P/M Option for Capture Description of Work Performed is not equal to "Y"
FUNCTION ValidateGroupTypeRequired()  

Function to ensure fields in this group cannot be set until the Transaction Type is set.

Returns [boolean]
ValueDescription
retSUCCESS(1) If Transaction Type has been set.
retFAILURE(0) If Transaction Type has not been set.
FUNCTION ValidateStepNo(value$)  

Function will take the given value for step and format it, and ensure it exists and then translate that to a step line key. It will then use SetValue() to validate the line key.

ParameterDescription
value$ [input, string] Step number value to be validated.
Returns [boolean]
ValueDescription
retSUCCESS(1) if step successfully validated and StepLineKey successfully validated
retFAILURE(0) if step not found or validation of StepLineKey fails.
FUNCTION ValidateTransferBatch(value$)  

Function will take the given value for Transfer Batch # and validate it using the GL_CompanyActiveBatch_svc object.

ParameterDescription
value$ [input, string] Value to be validated.
Returns [boolean]
ValueDescription
retSUCCESS(1) Validation for this batch number passed, and the user is allowed to use this batch.
retFAILURE(0) Validation for this batch number failed, due to being in-use, invalid number, or an existing private batch
FUNCTION Write()  

Function writes the current record into the PM_LaborEntry table.

Returns [boolean] retSUCCESS(1) if record written successfully, retFAILURE(0) if record is not written successfully

Properties inherited from: CI_MFGEarningsCode_val

cEarningMustExistInPayroll, cEarningPayrollIntegrated, EarningMustExistInPayroll

Properties inherited from: PM_Constant

actClassEMPLOYEE$, actClassGENERAL$, actClassMACHINE$, actClassOUTSIDESVC$, capTimeNO$, capTimeNOEDIT$, capTimeYES$, earnTypeALLOCTIPS$, earnTypeEXCLUDETIPCALC$, earnTypeEXEMPTTIPS$, earnTypeFRINGE$, earnTypeMISC$, earnTypeOVERTIME$, earnTypeREGULAR$, earnTypeTAXABLETIPS$, earnTypeTIMEOFF1$, earnTypeTIMEOFF2$, earnTypeTIMEOFF3$, cAllEarningsTypes$, earnMethodADDAMOUNT$, earnMethodFIXED$, earnMethodSTANDARD$, cAllEarnMethods$, lttLABOR$, lttCREW$, lttMISC$, lttINOUT$, lttCOST$, dpcSTANDARD$, dpcAVERAGE$, dpcLAST$, overheadTypeAMOUNT$, overheadTypePERCENT$, prtPickNONE$, prtPickBYWHSE$, prtPickBYTICK$, tcmCodeACTUAL$, tcmCodeBUDGET$, tcmCodeSTANDARD$, tcmCodeLOWER$, tcmDescACTUAL$, tcmDescBUDGET$, tcmDescSTANDARD$, tcmDescLOWER$, trnLABOR$, trnMATERIALS$, trnCLOSE$, trnCOMPLETION$, trcSTATUS$, trcLABOR$, trcINVENTORY$, trcDIRECTCHARGE$, trcINVOICE$, trcCLOSE$, trcSCRAP$, udiSTRING$, udiNUMBER$, udiYESNO$, udiCODE$, udiDATE$, mftCodeSALESORDER$, mftCodeSALESORDERLINE$, mftCodeWORKTICKET$, mftCodeINVENTORY$, mftDescSALESORDER$, mftDescSALESORDERLINE$, mftDescWORKTICKET$, mftDescINVENTORY$, wtsOPEN$, wtsQUOTE$, wtsRELEASED$, wtsCLOSED$, wtsDELETED$, lbrIssMethodAUTOISSUE$, lbrIssMethodBACKFLUSH$, lbrIssMethodMANUAL$, matIssMethodAUTOISSUE$, matIssMethodBACKFLUSH$, matIssMethodMANUAL$, prtWORKTICKET$, prtOPERATIONTICKET$, prtCOMPLETEMISSINGCOST$, prtCOMPLETEVARFROMSTD$, prtCLOSEMISSINGCOST$, prtCLOSEVARFROMSTD$, prtCLOSECOSTLEDGER$, prtPICKSHEET$, drtBACKOUT$, drtADDIN$, drsNEW$, drsUPDATED$, drsCOMPLETED$, schFIXED$, schACTSPERHOUR$, schHOURSPERACT$, scaleNOSCALING$, scalePRODUCTIONRUN$, scalePARENTSPERTEMPLATE$, scaleTEMPLATESPERPARENT$, stepZERO$, dfltClosureWorkCenter$

Properties inherited from: SY_BatchMaintSet

BatchEnabled, ErrorBatchNo$

Properties inherited from: SY_Customization

cDummyIol$

Methods inherited from: CI_Account_val

ClassOverrideAccount(), ClassValidateAccount(), ResetAccountIndex()

Methods inherited from: CI_ActivityCode_val

ClassValidateActivityCode()

Methods inherited from: CI_LaborCrew_val

ClassValidateLaborCrew()

Methods inherited from: CI_MFGDepartment_val

ClassValidateMFG_Department()

Methods inherited from: CI_MFGEarningsCode_val

ClassValidateMFG_EarningsCode(), ValidateEarningInPayroll()

Methods inherited from: CI_MFGEmployee_val

ClassValidateMFG_Employee()

Methods inherited from: CI_StatusCode_val

ClassValidateStatusCode()

Methods inherited from: CI_Time_val

FormatTimeString(), ClassValidateTime(), ConvertDecimalTime()

Methods inherited from: CI_WorkCenter_val

ClassValidateWorkCenter()

Methods inherited from: CI_WorkTicket_val

ClassValidateWorkTicket()

Methods inherited from: PM_Constant

BuildAlternateIOL$(), BuildMemoryFile(), ConvertCalendarToJulian(), ConvertJulianToCalendar$(), FormatTime$(), HHMMToMinutes(), HHMMToNum(), LoadCustomLabelConstants(), NumToHHMM$(), TimeToHHMM()

Methods inherited from: SY_BatchMaintSet

CommitRow(), Delete(), DeleteBatch(), DeleteBatchNo(), DeleteBatchTransaction(), GetBatchHandle(), GetBatchTotalVars(), IsBatchActive(), ResetBatchSubType(), SelectBatch(), SelectNewBatch(), SetBatchTotalVars(), SetCurrentKey(), SetFilter(), VerifyBatch(), WriteBatchTransaction(), ClassValidateBatchNo$(), PostDeleteRec(), RaiseErrors()

Methods inherited from: SY_Customization

GetCustomizations(), PostTableRead(), PreNextRecord(), PreTableWrite()