project QadFinancials > class BBankEntry > method AdditionalUpdatesGetDeductionJournalCode


Parameters


icBankGLAccountinputcharacter
ocDeductionJournalCodeoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBankEntry.AdditionalUpdatesInvDeductions


program code (program5/bbankentry.p)

assign ocDeductionJournalCode =''.
/*get the customer deduction daybook profile id*/
<Q-58 run GLByGLForDeductionInfo (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input icBankGLAccount, (GLCode)
    input ?, (GLId)
    output dataset tqGLByGLForDeductionInfo) in BGL>

find first tqGLByGLForDeductionInfo where
               tqGLByGLForDeductionInfo.tcGLCode = icBankGLAccount
               no-error.
if not available tqGLByGLForDeductionInfo then
do:
        assign oiReturnStatus = -1
               vcMessage = trim(#T-2'The Bank GL Account $1 is not defined in the system.':255(905872258)T-2#).
          <M-18 run SetMessage
             (input  vcMessage (icMessage), 
              input  icBankGLAccount (icArguments), 
              input  '':U (icFieldName), 
              input  '':U (icFieldValue), 
              input  'E':U (icType), 
              input  3 (iiSeverity), 
              input  '':U (icRowid), 
              input  'qadfin-293902':U (icFcMsgNumber), 
              input  '':U (icFcExplanation), 
              input  '':U (icFcIdentification), 
              input  '':U (icFcContext), 
              output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        return.        
end. 

if tqGLByGLForDeductionInfo.tiDeductionJournalProfile_ID = 0 
   or tqGLByGLForDeductionInfo.tiDeductionJournalProfile_ID = ?
then 
do:
        assign oiReturnStatus = -1
               vcMessage = trim(#T-4'The deduction daybook profile of the bank account $1 is not specified.':255(860067454)T-4#).
        <M-77 run SetMessage
           (input  vcMessage (icMessage), 
            input  icBankGLAccount (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'qadfin-150808':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
        return. 
end.
/*check the profile is active*/
<Q-23 run ProfileById (all) (Read) (NoCache)
   (input tqGLByGLForDeductionInfo.tiDeductionJournalProfile_ID, (Profile_ID)
    output dataset tqProfileById) in BProfile>
find first tqProfileById no-error.
if not available tqProfileById
then do:
    assign oiReturnStatus = -1
           vcMessage = trim(#T-57'The deduction daybook profile of the bank account $1 is not defined in the system.':255(617726517)T-57#).
    <M-75 run SetMessage
       (input  vcMessage (icMessage), 
        input  icBankGLAccount (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-153693':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
    return.
end.

if tqProfileById.tlProfileIsActive <> true
then do:
    assign oiReturnStatus = -1
           vcMessage = trim(#T-91'The deduction daybook profile of the bank account $1 is not active.':255(102601651)T-91#).
    <M-63 run SetMessage
       (input  vcMessage (icMessage), 
        input  icBankGLAccount (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-901261':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
    return.
end.

/*get customer deduction daybook */


<Q-53 run JournalForProfile (all) (Read) (NoCache)
   (input tqGLByGLForDeductionInfo.tiDeductionJournalProfile_ID, (JournalProfileId)
    input viCompanyId, (CompanyId)
    input ?, (JournalControl)
    output dataset tqJournalForProfile) in BProfile>
find first tqJournalForProfile no-error.

if not available tqJournalForProfile then 
do:
      assign oiReturnStatus = -1
             vcMessage = trim(#T-67'The deduction daybook of the bank account $1 is not defined in the system.':255(339912918)T-67#).
      <M-47 run SetMessage
         (input  vcMessage (icMessage), 
          input  icBankGLAccount (icArguments), 
          input  '':U (icFieldName), 
          input  '':U (icFieldValue), 
          input  'E':U (icType), 
          input  3 (iiSeverity), 
          input  '':U (icRowid), 
          input  'qadfin-264483':U (icFcMsgNumber), 
          input  '':U (icFcExplanation), 
          input  '':U (icFcIdentification), 
          input  '':U (icFcContext), 
          output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
      return. 
end.
 


assign ocDeductionJournalCode = tqJournalForProfile.tcJournalCode.