project QadFinancials > class BPosting > method GetPostingTemplateBasedCode

Description

This method returns informatin about posting template based on template code


Parameters


bcPostingTemplateCodeinput-outputcharacter
ocDescriptionoutputcharacter
ocDivisionCodeoutputcharacter
ocProjectCodeoutputcharacter
ocCostCentreCodeoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program6/bposting.p)

/* =================================================================================================== */
/* Method      : GetPostingTemplateBasedCode                                                           */
/* Desc        : This method returns details about posting template selected based code                */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (B) PostingTemplateCode  Code of posting template                                          */
/*          (O) Description          Description of posting                                            */
/*          (O) DivisionCode         Code of division                                                  */
/*          (O) ProjectCode          Code of project                                                   */
/*          (0) CostCentreCode       Code of cost centre                                               */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* Default output values                                                                               */
/* =================================================================================================== */
assign ocDescription    = ""
       ocDivisionCode   = ""
       ocProjectCode    = ""
       ocCostCentreCode = "".

/* =================================================================================================== */
/* Normalize input parameters                                                                          */
/* =================================================================================================== */
if bcPostingTemplateCode = "":U then assign bcPostingTemplateCode = ?.

/* =================================================================================================== */
/* Validate input parameters                                                                           */
/* =================================================================================================== */
if bcPostingTemplateCode = ?
then do:
    assign oiReturnStatus = 0.
    return.
end.

/* =================================================================================================== */
/* Get details about posting teamplate                                                                 */
/* =================================================================================================== */
<Q-1 run PostingTemplateByCode (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input bcPostingTemplateCode, (PostingTemplateCode)
    output dataset tqPostingTemplateByCode) in BPostingTemplate >

find first tqPostingTemplateByCode no-error.
if not available(tqPostingTemplateByCode)
then do:
   /* <M-3 run SetMessage
       (input  #T-3'The posting template code does not exist.':255(69451)t-3# (icMessage), 
        input  '':U (icArguments), 
        input  'tPosting.tcTemplateCode':U (icFieldName), 
        input  bcPostingTemplateCode (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'QadFin-8095':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BPosting> */
    assign bcPostingTemplateCode = "":U
           oiReturnStatus        = 0.
    return.
end.

assign bcPostingTemplateCode = tqPostingTemplateByCode.tcPostingTemplateCode
       ocDivisionCode        = tqPostingTemplateByCode.tcPostingTemplateDivCode
       ocProjectCode         = tqPostingTemplateByCode.tcPostingTemplateProjectCode
       ocCostCentreCode      = tqPostingTemplateByCode.tcPostingTemplateCostCtrCode.

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