project QadFinancials > class BDDocument > method DefaultValuesPrepayment
Description
This method provides default values needed for creation of Prepayment
Parameters
icRowId | input | character | Row Id of DDocument, for which prepayment is beeing created |
ocCostCentreCode | output | character | Default Cost Centre based on Customer definition |
ocProjectCode | output | character | Default Project code based on Customer definition |
ocDivisionCode | output | character | Default Sub-account based on Customer definition |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
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.