project QadFinancials > class BAPMatching > method AdditionalUpdatesAllLinesPLVarUsageSub1
Description
AdditionalUpdatesAllLinesPLVarUsageSub1; submethod of AdditionalUpdatesAllLinesPLVarUsage that is located in the same segment and that takes care of the validation of the input for that method
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program6/bapmatching.p)
/* ======================== */
/* Set default ReturnStatus */
/* ======================== */
assign oiReturnStatus = -98.
/* ============================================================================ */
/* Elementary check to avoid mis-usage of this method */
/* First check whether everything is availablable what is supposed to be avail */
/* ============================================================================ */
assign vcMsgAPMatching = "":U.
if not available tqCInvoiceByMatchingInfo or
not available tAPMatching or
not available tAPMatchingLn or
not available tqPendingVoucherForMatchingAcc
then assign oiReturnStatus = -3
vcMsgAPMatching = trim(substitute(#T-93'Internal error: information is missing.':255(49818)t-93#)) + chr(10) +
trim(substitute(#T-94'Available supplier invoice: &1.':234(53332)T-94#,available (tqCInvoiceByMatchingInfo))) + chr(10) +
trim(substitute(#T-95'Available matching header: &1.':234(49819)T-95#,available (tAPMatching))) + chr(10) +
trim(substitute(#T-96'Available matching details: &1.':234(49820)T-96#,available (tAPMatchingLn))) + chr(10) +
trim(substitute(#T-97'Available pending invoice details: &1.':234(49821)T-97#,available (tqPendingVoucherForMatchingAcc))) + chr(10) +
trim(substitute(#T-98'Technical details: &1.':222(55526)T-98#,"UsageVar/1":U)).
if vcMsgAPMatching = "":U and
(tAPMatchingLn.APMatchingLnIsPvodFinished <> true or
tAPMatchingLn.APMatchingLnPvodIsLgCharge <> false or
tAPMatchingLn.APMatchingLnVarUsageTC = 0 or
tAPMatchingLn.APMatchingLnVarUsageTC = ?)
then assign oiReturnStatus = -3
vcMsgAPMatching = trim(substitute(#T-81'Internal error: invalid call to the method that creates the posting line on the usage variances for the finished pending invoices.':255(53331)T-81#)) + chr(10) +
trim(substitute(#T-82'Pending invoice that includes logistic charges: &1.':234(53219)T-82#,string(tAPMatchingLn.APMatchingLnPvodIsLgCharg))) + chr(10) +
trim(substitute(#T-83'Finished pending invoice: &1':234(53220)T-83#,string(tAPMatchingLn.APMatchingLnIsPvodFinished))) + chr(10) +
trim(substitute(#T-84'Variance amount: &1':234(53221)T-84#,string(tAPMatchingLn.APMatchingLnVarUsageTC))) + chr(10) +
trim(substitute(#T-99'Technical details: &1.':222(55526)T-99#,"UsageVar/2":U)).
if vcMsgAPMatching <> "":U
then do :
<M-50 run SetMessage (input vcMsgAPMatching (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'QadFin-5499':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
Return.
end. /* if vcMsgAPMatching <> "":U */
/* ======================== */
/* Set ReturnStatus = OK */
/* ======================== */
if oiReturnStatus = -98
then assign oiReturnStatus = 0.