project QadFinancials > class BPosting > method SetPostingLineLegalDocNumber
Description
Method can be used for the assignment of the Legal document number for Posting Line
Parameters
icPostingLineTcRowID | input | character | Posting Row ID |
iiPostingLineID | input | integer | Posting ID |
icLegalDocumentNumber | input | character | Vlaue to set for PostingInvoiceReferenceTxt |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program6/bposting.p)
/* Normalization of input parameters */
if iiPostingLineID = 0 then assign iiPostingLineID = 0.
if icPostingLineTcRowID = "":U then assign icPostingLineTcRowID = ?.
/* Are all parameters entered */
if iiPostingLineID = ? and
icPostingLineTcRowID = ?
then return.
/* Find the Posting Line in the instance */
if icPostingLineTcRowID <> ?
then find tPostingLine where
tPostingLine.tc_Rowid = icPostingLineTcRowID and
tPostingLine.tc_Status <> "D":U
no-error.
else find tPostingLine where
tPostingLine.PostingLine_ID = iiPostingLineID and
tPostingLine.tc_Status <> "D":U
no-error.
if not available tPostingLine
then do:
assign vcMessage = #T-79'Cannot find definition of Posting Line in instance of business.':255(999890634)T-79#
vcContext = "iiPostingLineID=&1|icPostingLineTcRowID=&2":U
vcContext = substitute(vcContext, iiPostingLineID, icPostingLineTcRowID)
vcContext = replace(vcContext, "|":U, chr(2))
oiReturnStatus = -3.
<M-2 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-9700':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input vcContext (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPosting>
return.
end. /* if not available tPosting */
/* update the value */
if tPostingLine.PostingLineLegalDocNbr <> icLegalDocumentNumber
then assign tPostingLine.PostingLineLegalDocNbr = icLegalDocumentNumber
tPostingLine.tc_Status = if tPostingLine.tc_Status = "":U
then "C":U
else tPostingLine.tc_Status.