project QadFinancials > class BDebtor > method ApiLoadDebtorCalcPaymentGroupCode

function returns character


Parameters


iiPaymentGroupIDinputinteger


Internal usage


QadFinancials
method BDebtor.ApiLoadDebtor


program code (program9/bdebtor.p)

define variable oiReturnStatus as integer no-undo.

if iiPaymentGroupID = ? or
   iiPaymentGroupID = 0
then return "":U.

<Q-2 run PaymentGroupPrim (all) (Read) (Cache)
   (input iiPaymentGroupID, (PaymentGroupId)
    input ?, (PaymentGroupCode)
    output dataset tqPaymentGroupPrim) in BPaymentGroup >

find first tqPaymentGroupPrim where
           tqPaymentGroupPrim.tiPaymentGroup_ID = iiPaymentGroupID
           no-error.

return if available tqPaymentGroupPrim
       then tqPaymentGroupPrim.tcPaymentGroupCode
       else "":U.