project QadFinancials > class BDInvoice > method ValidateComponentAllPostOrigiNotNeg
validation procedure
Description
This method is a submethod of ValidateComponentAllPost.
This method validates that the original amounts can not be or must be negative
Parameters
idTargetField | input | decimal | Value of the business field to validate. |
icTargetFieldName | input | character | Name of the business field to validate. |
icRowid | input | character | Contents of field tc_Rowid, if the target field is a field of a component temp-table. |
icDInvoiceType | input | character | Invoice Type |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program5/bdinvoice.p)
assign vcMessage = "":U.
if idTargetField < 0
then do:
case icTargetFieldName:
when "tDInvoice.DInvoiceOriginalCreditTC":U
then assign vcMessage = if icDInvoiceType = {&INVOICETYPE-CREDITNOTE}
then trim(#T-3'The invoice amount in the transaction currency must be greater than or equal to zero.':150(64377)t-3#)
else vcMessage.
when "tDInvoice.DInvoiceOriginalCreditlC":U
then assign vcMessage = if icDInvoiceType = {&INVOICETYPE-CREDITNOTE}
then trim(#T-5'The invoice amount in the base currency must be greater than or equal to zero.':150(64378)t-5#)
else vcMessage.
end case.
end.
if idTargetField >= 0
then do:
case icTargetFieldName:
when "tDInvoice.DInvoiceOriginalDebitTC":U
then assign vcMessage = if icDInvoiceType = {&INVOICETYPE-INVOICECORRECTION}
then trim(#T-6'The TC invoice amount must be negative.':150(14064)t-6#)
else vcMessage.
when "tDInvoice.DInvoiceOriginalCreditTC":U
then assign vcMessage = if icDInvoiceType = {&INVOICETYPE-CREDITNOTECORRECTION}
then trim(#T-7'The TC invoice amount must be negative.':150(14064)t-7#)
else vcMessage.
when "tDInvoice.DInvoiceOriginalDebitlC":U
then assign vcMessage = if icDInvoiceType = {&INVOICETYPE-INVOICECORRECTION}
then trim(#T-8'The invoice amount in the base currency must be negative.':150(14065)t-8#)
else vcMessage.
when "tDInvoice.DInvoiceOriginalCreditlC":U
then assign vcMessage = if icDInvoiceType = {&INVOICETYPE-CREDITNOTECORRECTION}
then trim(#T-9'The invoice amount in the base currency must be negative.':150(14065)t-9#)
else vcMessage.
end case.
end.
if vcMessage <> "":U
then do:
assign oiReturnStatus = -1.
<M-1 run SetMessage (input vcMessage (icMessage),
input '':U (icArguments),
input icTargetFieldName (icFieldName),
input string(idTargetField) (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input icRowid (icRowid),
input 'QADFIN-420':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
end.