project QadFinancials > class BERSLine > method AddErsLines

Description

Add ERS Line records


Parameters


tERSLineRefinputtemp-table
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BERSProcessor.ERSProcessFinishERSLine


program code (program6/bersline.p)

/* =================================================================================================== */
/* Method      : AddErsLines                                                                           */
/* Desc        : Add ersline records                                                                   */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (I)  tERSLineRef          Temporary table with list of ERSLine records to be created       */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* Validate input parameters                                                                           */
/* =================================================================================================== */
if not can-find(first tERSLineRef)
then do:
    assign oiReturnStatus = 0.
    return.
end.

/* =================================================================================================== */
/* Create new records                                                                                  */
/* =================================================================================================== */
for each tERSLineRef:
    <M-1 run AddDetailLine
       (input  'ERSLine':U (icTable), 
        input  '':U (icParentRowid), 
        output viFcReturnSuper (oiReturnStatus)) in BERSLine>
    assign tERSLine.ERS_ID          = tERSLineRef.tiERSId
           tERSLine.APMatchingLn_ID = tERSLineRef.tiAPMatchingLnId
           tERSLine.PvodLineID      = tERSLineRef.tiPvodLineId.
end.

/* =================================================================================================== */
/* Return                                                                                              */
/* =================================================================================================== */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.