project QadFinancials > class BJournalEntry > method UpdateManualPostingGL

Description

Update the GL code on a posting line that was created by manual input.


Parameters


itPostingDateinputdateposting date
icProjectCodeinputcharacter
icCostCentreCodeinputcharacter
icComponentListinputcharacterChr(2) separated list of extra components to check during SAF defaulting.
icComponentValueListinputcharacterChr(2) separated list of extra component values to check during SAF defaulting.
icLayerTypeCodeinputcharacter
tUpdatePostingLineinput-outputtemp-tableposting line
tUpdatePostingSafinput-outputtemp-tablesaf
tUpdatePostingLineEnablingoutputtemp-tableenabling
tPostingLineSafStructuresoutputtemp-tableSAF Structures
iiBusinessRelation_IDinputintegerBusiness Relation ID
icCurrencyCodeinputcharacter
icDivisionCodeinputcharacterSub-Account Code
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program6/bjournalentry.p)

assign oiReturnStatus = -98.
/* For defect 10259-0087: When modify the postinline record tUpdatePostingLine should get record first */
for each tUpdatePostingLine:
    if tUpdatePostingLine.tcGLCode <> '':U
    then do:
        <Q-6 run GLBeginsUnitOnGLChange (all) (Read) (NoCache)
           (input tUpdatePostingLine.Company_ID, (CompanyID)
            input tUpdatePostingLine.tcGLCode, (GLCode)
            output dataset tqGLBeginsUnitOnGLChange) in BGL >

        find first tqGLBeginsUnitOnGLChange
             where tqGLBeginsUnitOnGLChange.tcGLCode = tUpdatePostingLine.tcGLCode no-error.
        if not available tqGLBeginsUnitOnGLChange
           then do:
               find tqGLBeginsUnitOnGLChange
                    where tqGLBeginsUnitOnGLChange.tcGLCode BEGINS tUpdatePostingLine.tcGLCode no-error.
                /* if there's only one record */
               if available tqGLBeginsUnitOnGLChange 
               then assign tUpdatePostingLine.tcGLCode = tqGLBeginsUnitOnGLChange.tcGLCode.
               /* Ambiguous records will not be found and available will be false */
               else do:
                    oiReturnStatus = -4.
                    return.                  
               end. 
        end.
    
    if available tqGLBeginsUnitOnGLChange
       then do:
            assign tUpdatePostingLine.tcUnitCode = tqGLBeginsUnitOnGLChange.tcUnitCode.
            <M-3 run PostingLineGLUpdate
               (input  itPostingDate (itPostingDate), 
                input  icProjectCode (icProjectCode), 
                input  icCostCentreCode (icCostCentreCode), 
                input  icComponentList (icComponentList), 
                input  icComponentValueList (icComponentValueList), 
                input  icLayerTypeCode (icLayerTypeCode), 
                input  iiBusinessRelation_ID (iiBusinessRelation_ID), 
                input  icCurrencyCode (icCurrencyCode), 
                input  icDivisionCode (icDivisionCode), 
                output oiReturnStatus (oiReturnStatus)) in BJournalEntry>
       end. /* if available tqGLForUnitOnGLChange */
       else tUpdatePostingLine.tcUnitCode = "":U.
    end. /*  if tUpdatePostingLine.tcGLCode <> '':U */
    leave.
end. /* for each tUpdatePostingLine: */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.