project QadFinancials > class BPaymentSelection > method GetDebitCreditAbbreviation


Parameters


icTransactionObjectTypeinputcharacter
idOpenBalInvoiceAmountinputdecimal
ocOriginalInvoiceAmountSignoutputcharacter
ocOriginalInvAmntDebitCreditAbbroutputcharacter
ocOpenBalInvAmntDebitCreditAbbroutputcharacter
ocPaymentAmntDebitCreditAbbroutputcharacter
ocDiscountAmntDebitCreditAbbroutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BPaymentSelection.GetToPayObjectsInitLoadFromInst


program code (program3/bpaymentselection.p)


if idOpenBalInvoiceAmount  = ? then assign idOpenBalInvoiceAmount  = 0.

case icTransactionObjectType:

    when {&PAYMENTSELECTIONTYPE-INVOICE}          or 
    when {&PAYMENTSELECTIONTYPE-CREDITNOTECORR}   or
    when {&PAYMENTSELECTIONTYPE-DEBTORCREDITNOTE} or
    when {&PAYMENTSELECTIONTYPE-PREPAYMENT}
    then assign ocOriginalInvAmntDebitCreditAbbr = if icTransactionObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENT} and 
                                                      idOpenBalInvoiceAmount < 0
                                                   then vcDebitTR 
                                                   else vcCreditTR
                ocOriginalInvoiceAmountSign      = if icTransactionObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENT} and
                                                      idOpenBalInvoiceAmount  < 0
                                                   then "":U
                                                   else "-":U
                ocPaymentAmntDebitCreditAbbr     = if icTransactionObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENT} and
                                                      idOpenBalInvoiceAmount < 0
                                                   then vcCreditTR
                                                   else vcDebitTR.
    when {&PAYMENTSELECTIONTYPE-CREDITNOTE} or
    when {&PAYMENTSELECTIONTYPE-INVOICECORR} or
    when {&PAYMENTSELECTIONTYPE-DEBTORCNCORR} or
    when {&PAYMENTSELECTIONTYPE-PREPAYMENTINV}
    then assign ocOriginalInvAmntDebitCreditAbbr = if icTransactionObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENTINV} and
                                                      idOpenBalInvoiceAmount  < 0
                                                   then vcCreditTR
                                                   else vcDebitTR 
                ocOriginalInvoiceAmountSign      = if icTransactionObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENTINV} and
                                                      idOpenBalInvoiceAmount  < 0
                                                   then "-":U
                                                   else "":U
                ocPaymentAmntDebitCreditAbbr     = if icTransactionObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENTINV} and
                                                      idOpenBalInvoiceAmount  < 0
                                                   then vcDebitTR 
                                                   else vcCreditTR.
    when {&PAYMENTSELECTIONTYPE-ADJUSTMENT}
    then assign ocOriginalInvAmntDebitCreditAbbr = if idOpenBalInvoiceAmount < 0
                                                   then vcCreditTR
                                                   else vcDebitTR 
                ocOriginalInvoiceAmountSign      = if idOpenBalInvoiceAmount < 0
                                                   then "-":U
                                                   else "":U
                ocPaymentAmntDebitCreditAbbr     = if ocOriginalInvAmntDebitCreditAbbr = vcDebitTR
                                                   then vcCreditTR
                                                   else vcDebitTR .
    otherwise assign ocOriginalInvAmntDebitCreditAbbr = vcDebitTR 
                     ocOriginalInvoiceAmountSign      = "":U
                     ocPaymentAmntDebitCreditAbbr     = vcCreditTR.
end case.

assign ocOpenBalInvAmntDebitCreditAbbr  = ocOriginalInvAmntDebitCreditAbbr
       ocDiscountAmntDebitCreditAbbr    = ocOriginalInvAmntDebitCreditAbbr.