project QadFinancials > class BDDocument > method DefaultValuesPrepayment

Description

This method provides default values needed for creation of Prepayment


Parameters


icRowIdinputcharacterRow Id of DDocument, for which prepayment is beeing created
ocCostCentreCodeoutputcharacterDefault Cost Centre based on Customer definition
ocProjectCodeoutputcharacterDefault Project code based on Customer definition
ocDivisionCodeoutputcharacterDefault Sub-account based on Customer definition
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDDocument.AllocateInvoices


program code (program3/bddocument.p)

/* ============================================================================================ *
 * Method:          DefaultValuesPrepayment                                                     *
 * Description:     This method provides default values needed for creation of Prepayment       *
 * -------------------------------------------------------------------------------------------- *
 * Input:  icRowId           RowId of DDocument                                                 *
 * Output: ocCostCentreCode  Default cost center code                                           *
 *         ocProjectCode     Default Project code                                               *
 *         ocDivisionCode    Default Division code                                              *
 * ============================================================================================ */
 
assign oiReturnStatus = -98.

/* Default output values */
assign ocCostCentreCode = ?
       ocProjectCode    = ?
       ocDivisionCode   = ?.

/* Input parameters */
if icRowId = "":U then assign icRowId = ?.
 
find tDDocument where
     tDDocument.tc_Rowid = icRowId no-error.

if icRowId = ? or
    not available tDDocument
then do:
    assign vcMessage = #T-1'Cannot find Customer Payment record based on passed input parameters.':255(999890323)T-1#
           vcContext = "icRowId=" + icRowId.

    <M-4 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'S':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'QadFin-9014':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  vcContext (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BDDocument>

    assign oiReturnStatus = -1.
    return.
end.

/* Get default analytical information for debtor */
assign vhFcComponent = ?.
<M-3 run GetDefaultCCProjDivForPrePay
   (input  tDDocument.Debtor_ID (iiId), 
    input  tDDocument.tcDebtorCode (icCode), 
    input  {&INVOICEORIGIN-DEBTOR} (icInvoiceOrigin), 
    output ocCostCentreCode (ocCostCentreCode), 
    output ocProjectCode (ocProjectCode), 
    output ocDivisionCode (ocDivisionCode), 
    output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper <  0 then return.

/* Error handling */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.