Class CI_CommonTierDistribution

Properties

LOCAL cIsSysDB=isFALSE  
LOCAL tierFIFO$="1"  
LOCAL tierLIFO$="2"  
LOCAL tierLOT$="3"  
LOCAL tierSERIAL$="4"  
PROPERTY Available   * Read Only *

[numeric] Current quantity available for the Lot or SerialNo selected. Comes from IM_ItemCost

PROPERTY Balance   * Read Only *
[numeric] Current balance remaining to be distributed. This is used by the UI for display purposes.
PROPERTY CommitTierQty  
[boolean] Equivalent to UpdateIMItemCost. Defaults to on, whether to commit quantities to Item Cost table
PROPERTY DistReverseQty  
[boolean] To be used instead of DocumentType to determine whether negative quantities should be reflected as positive.
PROPERTY DocumentNo$   * Read Only *
[string] Used to store the value of the document number. This should be equivalent to the line entry detail HeaderKy$ property + current lineKey$
PROPERTY DocumentType$  
[string] Not to be used in new metaphor. Should use new properties 'DistReverseQuantity'
PROPERTY FileHasItemWhse   * Read Only *
[boolean] Flag indicating whether the Tier distribution table has the new Item & Warehouse fields added
PROPERTY FileHasUOMConvFactor   * Read Only *
PROPERTY LineFileChanged   * Read Only *
PROPERTY ItemCode$   * Read Only *
[string] Not to be used in new metaphor. ItemCode and WarehouseCode should be in the appropriate data files now.
PROPERTY RequireExpirationDate   * Read Only *
[boolean] Flag to indicate the current item requires a lot/serial expiration date to be entered
PROPERTY TierOnFile   * Read Only *
[boolean] Flag to indicate that the tier being used exists in the IM_ItemCost table, this is set during the validation of the Lot/Serial No
PROPERTY TotalToDistribute   * Read Only *
[numeric] Total quantity to distribute. This will be set by parent class
PROPERTY TrackLotSerialExpiration   * Read Only *
[boolean] Flag to indicate the lot/serial expiration dates are being tracked for the current item
PROPERTY UnitOfMeasure$   * Read Only *
[string] Should not have to use these values as properties.
PROPERTY UnitOfMeasureConvFactor   * Read Only *
PROPERTY UpdateIMItemCost   * Read Only *
[boolean] Not to be used in new metaphor. To be replaced by 'CommitTierQty'
PROPERTY WarehouseCode$   * Read Only *
[string] Not to be used in new metaphor. ItemCode and WarehouseCode should be in the appropriate data files now.
PROPERTY QtyColumn$   * Read Only *
[string] Returns the quantity column name. Used by VI in conjunction with SY_LineEntryTierDetail'DistributionIOL$ to allow for the proper loading of tier distribution columns on the Data folder.

Methods

FUNCTION AccumulateDistQty(tmpDocVar$, tmpLineKey$, tmpQtyVar$)  

Accumulates the distributed Quantity from tiers for an entry detail line.

ParameterDescription
tmpDocVar$ [input, string] Variable for document number in the detail line from which tiers will be read for accumulation.
tmpLineKey$ [input, string] Line Key in the detail line from which tiers will be read for accumulation.
tmpQtyVar$ [input, string] Variable for Quantity to be accumulated from tiers for a detail line.
Returns [numeric] Accumulated distributed Quantity from tiers for a detail line.
FUNCTION AddDistributionLine(lotSerial$)  
FUNCTION AddDistributionLine(lotSerial$, line$)  

Used to add a new distribution line. This method will do SetKeyValue() with the parts of the key to this table that it knows (Document segments) + LineKey.

ParameterDescription
lotSerial$ lot or serial number to create new distribution line for. This will be the
line$ {optional} the LineKey$ for which the distribution is for. If not provided, will
Returns 0 - if SetKey() failed, 1 - if line exists, 2 - if new line added
FUNCTION Addin()  
FUNCTION BackOut()  
FUNCTION CalcLotSerialDate(out.Date$)  
FUNCTION CalcLotSerialDate(out.Date$, item$, dateType$, refDate$)  

Function to calculate Sell-By, Use-By, Return-by display date or to calculate Expiration date for receipt type functions

ParameterDescription
out.Date$ [output, date] Date that is calculated to be returned
item$ [input, string] Item Code that is currently being distributed
dateType$ [input, string] Type of date to calculated this will be one character. valid values: X - Expiration Date, S - Sell-By, U - Use-by, R - Return By
refDate$ [input, string] Reference date to be used to calculate. This will normally be the expiration date
Returns Returns return value for same named function in IM_LotSerialExpiration
FUNCTION CancelDistribution()  
FUNCTION CancelDistribution(retainMemFile)  
FUNCTION CheckDistributedQuantity(doc$, lkey$, qty)  
FUNCTION CheckForDuplicateSerialNumbers()  
FUNCTION CheckForMissingExpirationDates(firstMissing$)  

Checks through current line distribution for any tiers for an expiration date that is missing that also has a distribution qty. Only returns values if TrackLotSerExpiration is turned on and is required.

ParameterDescription
firstMissing$ [output, string] key to the first row that is missing a date
Returns [integer] count of the number of rows missing dates, to be used for messaging
FUNCTION CheckLotSerDates(expDate$, compareDate$, lotSerNo$)  

Calculates sell-by, use-by, return-by date, using the expiration date and options set for the item. If not using those dates, will use the expiration date of the lot/serial item. It then checks transaction date versus potential sell-by, use-by and return by dates. @prarm expDate$ [input, date] Lot Serial Expiration date to be used in calculation and comparisons

ParameterDescription
compareDate$ [output, date] Date that was used for the compare. Done for calling function to be able to print or use date after
lotSerNo$ [input, string] Lot Serial Number being tested. This is used only in messageing
Returns [boolean]
ValueDescription
retFAILURE(0) If date is outside the range and the user does not have rights to override
retWARNING(-1) If date is outside the range and the user HAS rights to override
retSUCCESS If there are no dates to check against or date is in acceptable range.
FUNCTION CheckQuantity(doc$, lkey$, qty)  
FUNCTION CheckTiersForClearExpDate(linesToClear$)  

Function determines if there are tiers that exist that need to be cleared in the event the document date has changed. It also returns the line keys that need to be removed.

ParameterDescription
linesToClear$ [output, string] SEP separated list of Linekeys that contain tier distributions that need to be removed.
Returns Always returns retSUCCESS
FUNCTION CheckTiersForRecalcExpDate()  

Function will scan through tier distribution work file and determine if there are any expiration dates that were calculated that need to be recalulated due to a document date change. This function will only return whether there are tiers that fit the criteria.

Returns [boolean]
ValueDescription
True - indicates that there are tiers that could be recalculated
False - there are no tiers that can be recalculated or there are no tiers
FUNCTION CleanUpLine()  
FUNCTION ClearLine()  
FUNCTION ClearSetFiles()  
FUNCTION CommitDistributionRows()  
FUNCTION CommitLineDistribution()  
FUNCTION CommitRow()  
FUNCTION DeleteTierLines(value$)  
FUNCTION EditDistributionLine(lotSerial$)  
FUNCTION EditDistributionLine(lotSerial$, line$)  
FUNCTION FromCancel(value)  
FUNCTION FromDelete(value)  
FUNCTION FromTierDistributionCancel(value)  
FUNCTION GenerateFormatMask$(mask$, decimals)  
FUNCTION GetColumnLengths(itmLen, whseLen, lotSerLen, docLen, lkLen)  
FUNCTION GetCurrentExpSettings(lotSerRefDate$, lotSerRefDateDesc$, lotSerUserAllowChangeDate, lotSerUserAllowOverrideDate)  

Retrieves current settings for current item and user for lot/serial expiration dates. This public function primarily used by the UI

ParameterDescription
lotSerRefDate$ [output, date] current transaction date used as a reference for calculations
lotSerRefDateDesc$ [output, string] description of the reference date used. This will be "Sell-by", "Use-By", "Return-by" or empty
lotSerUserAllowChangeDate [output, boolean] Flag to indicate that user can change expiration date
lotSerUserAllowOverrideDate [output, boolean] Flag to indicate whether user can override sell-by, use-by, return-by warnings
Returns Always returns retSUCCESS(1)
FUNCTION GetOrderLineKey(value$)  
FUNCTION GetSerialRecords(startingSerialNo$)  
FUNCTION GetSerialRecords(startingSerialNo$, nextSerialNo$)  
FUNCTION GetSerialRecords(startingSerialNo$, nextSerialNo$, expDate$)  
FUNCTION IgnoreRequiredExpDate(value)  

Sets internal flag cIgnoreRequiredExpDate for purposes of writing records from a list of records that may be missing this date.

ParameterDescription
value [input, boolean] boolean value to set the flag too
Returns Always returns retSUCCESS(1)
FUNCTION IsSerialUsed(item$, whse$, serial$, doc$, line$)  

Checks to see if serial number is currently used else where within the current data entry

ParameterDescription
item$ Item number of serial item
whse$ Warehouse code
serial$ Serial number to check
doc$ Current document being that item in question is being added to
line$ Current LineKey so that if found and is the same line, will be ignored
Returns TRUE if found FALSE if not found
FUNCTION LoadLots()  

Loads Lot Tiers from the IM_ItemCost table into the tier memory table with zero for quantity distributed. These will only be lots that have not expired if using lot/serial expiration date feature.

Returns [integer] Returns the number of rows added, if zero a message will be returned in LastErrorNum/LastErrorMsg$ variables
FUNCTION RecalcBalance(value)  
FUNCTION RecalcExpDates(newDate$)  

Function will recalculate any expiration dates based on the new document reference date given. This function to be used in conjunction with the CheckTiersForRecalcExpDate() function.

ParameterDescription
newDate$ [input, date] Value of the new document date reference to be used to calculate expiration dates.
Returns [numeric] returns the number or tier lines changed.
FUNCTION RemoveTierLines(document$, line$)  
FUNCTION RemoveZeroLots()  
FUNCTION ResetBalance()  
FUNCTION ResetDistributionLine(line$)  
FUNCTION ResetLotSerialDates(resetDate$)  

This function will reset the LotSerialExpirationDate and Reference Date (Sell-by, Use-by) back to the given date.

ParameterDescription
resetDate$ [input, date] Date to reset the LotSerialExpirationDate back to
Returns Always returns retSUCCESS(1)
FUNCTION RestoreDefaults()  

Restores values for ItemCode and WarehouseCode that are potentially obliterated by reading a blank file. This will use the cItemCode/cWarehouseCode values

Returns TRUE
FUNCTION RowResetAllFromMemFile()  
FUNCTION RowResetFromMemFile(key$)  
FUNCTION RowResetFromPhysicalFile()  
FUNCTION RowResetFromPhysicalFile(key$)  
FUNCTION SetCommonInfo(rec$, iol$)  
FUNCTION SetDistributionFilter()  
FUNCTION SetFilterValues(key$, item$, whse$)  
FUNCTION SetUIHandle(uiHandle)  

Sets the UI handle into the business object for use in updating values back into the UI. This is overridden from SY_Service.

ParameterDescription
uiHandle [input] Value of the object handle to set the local variable coUI to in the business object.
Returns retSUCCESS Always returns success.
FUNCTION ValidateGroupExpUseRefDate()  

Validation group method to test whether reference date is to be used.

Returns [boolean]
ValueDescription
retSUCCESS(1) If item uses a reference date for the current transaction type.
retFAILURE(0) If item does not use a reference date for the current transaction type
FUNCTION ValidateGroupTrackExpiration()  

Validation group method to test whether expiration dates are being tracked for this item or at all for the system

Returns [boolean]
ValueDescription
retSUCCESS(1) If item is tracking expiration dates for lot/serial items
retFAILURE(0) If item is not tracking expiration dates or option is turned off in IM_Options
FUNCTION Write()  
FUNCTION LOCAL PostDeleteRec()  
FUNCTION LOCAL PostWriteRec()  
FUNCTION LOCAL ResolveTierKeyLength(docKey$)  
FUNCTION LOCAL SetCurrentKey(key$)  
FUNCTION LOCAL SetDefaults()  
FUNCTION LOCAL SetDistSecurity()  
FUNCTION LOCAL ValidateDistributionQty(value)  
FUNCTION LOCAL ValidateItemCode(value$)  
FUNCTION LOCAL ValidateLineKey(value$)  
FUNCTION LOCAL ValidateLotSerialExpirationDate(value$)  

Function to valdiate the lot/serial expiration date. This will fail if Tracking for expiration dates is turned off, as well as invalid dates, or required dates missing

ParameterDescription
value$ [input, date] Date to be validated
Returns retSUCCESS(1) if date is valid and allowed to be entered retFAILURE(0) if invalid date or not allowed to be entered
FUNCTION LOCAL ValidateLotSerialNo(value$)  
FUNCTION LOCAL ValidateWarehouseCode(value$)  

Properties inherited from: SY_Maint

cActionWrite, cActionDelete, cActivityLogFilePrefix$, DocDateWarnDisplayed, DocDateWarnStatus, EditState, RecordChanged, FirstFailure$, DocumentTotal, ReadOnlyReason$, UDTValidation$, ViewOnly, CurrentPrecision, DocDateWarnForceOff, DocDateWarnObject, ScriptObject, ImportTest

Properties inherited from: SY_MaintSet

FileChanged

Methods inherited from: CI_NextNumber

FormatLotSerialNo$(), IncrementSerialNo(), NextNumber(), FindPrefix(), GetColumnInfo(), IncrementNumber()

Methods inherited from: SY_Maint

ChangedRecordCompare(), ChangedRecordInfo(), Clear(), ClearRecord(), ConfirmDelete(), CopyFrom(), ExportToCSV(), GetColumnInfo(), GetColumnProperties$(), GetDefaults(), GetOrigRecord$(), GetPropertyValue(), GetValidationGroups$(), ResetDocDateWarnState(), SetCopyKeyValue(), SetDocDateWarnDisplayed(), SetDocDateWarnOff(), SetKey(), SetKeyValue(), SetPartialRecord(), SetRecord(), SetToReadOnly(), SetValue(), SetValues(), Write(), ActivityLogCreateFile(), ActivityLogPrepare(), ActivityLogSetMessage$(), ActivityLogWrite(), CallScript(), CheckForAdvancedFieldSettings(), CheckForScripts(), CheckNullRequiredField(), PERFORM ChildValidate(), ClassValidateDate(), ClassValidateTelephoneNo(), ClearSetFiles(), ColInfoInitAll(), ColInfoInitDefaults(), CommitRow(), GetPropertyCommon(), InitColInfo(), InitScriptEngine(), InitWorkTable(), IsColInIOList(), IsValid(), LoadColInfo(), OpenMainTable(), ParseExtField(), RemoveColToSkip(), ResetRow(), RetrieveColInfo(), SetDefaults(), SetFilter(), SetMode(), SetParentHandle(), SetValueNoValidate(), StoreColToSkip(), ValidateAll(), ValidateAllRecord(), ValidateColInfo(), ValidateRule()

Methods inherited from: SY_MaintSet

ClearSetFiles(), CommitRow(), QuickRowLoad(), ResetRow(), SeedDetailRow(), SetFilter(), SetMode()