project QadFinancials > class BBankEntry > method GetPossibleCollAllocations
Description
GetPossibleCollAllocations; this method returns a temp-table containing all collections for allocation possibilities that fit the input criteria of this method.
called by UI when pressing Apply on the search criteria window for collections
Parameters
iiCompanyID | input | integer | Entity ID |
iiBankStateLineID | input | integer | BankStateLineID wherefor the allocations need to be proposed |
icBankStateLineTcRowid | input | character | BankStateLine TcRowid wherefor the allocations need to be proposed |
itFromRequestedDate | input | date | FromRequestedDate |
idTotalCollectionAmountTC | input | decimal | CollectionOriginalAmountTC (Credit or Debit) |
ilIncludeDebtor | input | logical | InlcudeDebtor |
ilIncludeCreditor | input | logical | InlcudeCreditor |
icBankCurrencyCode | input | character | Bank Currency Code |
icGLCode | input | character | GL code |
itBankStateLineValueDate | input | date | Bank State Line Value Date |
iiDocumentYear | input | integer | Document Year |
icDocumentType | input | character | document type |
iiDocumentNumber | input | integer | Document Number |
iiCDocumentPrePrintedNumber | input | integer | |
icDocumentReference | input | character | |
icSelectionCode | input | character | |
tPossibleBankStateAlloc | output | temp-table | Possible records for BankStateAlloc |
tPossibleBankStateCollAlloc | output | temp-table | Possible records for BankStateAllocColl |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program6/bbankentry.p)
/*JBA BTS 4906 use the correct exchange rate type*/
assign vcExchangeRateType = <M-36 GetExchangeRateType () in BBankEntry>.
if icBankCurrencyCode = ? then assign icBankCurrencyCode = "":U.
if icDocumentReference = ? then assign icDocumentReference = "":U.
if icDocumentType = ? then assign icDocumentType = "":U.
if icSelectionCode = ? then assign icSelectionCode = "":U.
if idTotalCollectionAmountTC = ? then assign idTotalCollectionAmountTC = 0.
if iiCDocumentPrePrintedNumber = ? then assign iiCDocumentPrePrintedNumber = 0.
if iiCompanyID = ? then assign iiCompanyID = 0.
if iiDocumentNumber = ? then assign iiDocumentNumber = 0.
if iiDocumentYear = ? then assign iiDocumentYear = 0.
if ilIncludeCreditor = ? then assign ilIncludeCreditor = false.
if ilIncludeDebtor = ? then assign ilIncludeDebtor = false.
if not ilIncludeCreditor and
not ilIncludeDebtor
then do:
<M-1 run SetMessage
(input trim(#T-35'You must select at least one of the following options: Supplier or Customer.':200(321)T-35#) (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input 'E':U (icType),
input 3 (iiSeverity),
input '':U (icRowid),
input 'QADFIN-628':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
assign oiReturnStatus = -3.
return.
end.
/* Fill the bankrate so it can be used on UI to calculate lc amounts */
if icBankCurrencyCode = vcCompanyLC
then assign vdBankRate = 1
vdBankRateScale = 1.
else do:
<M-76 run GetExchangeRate
(input iiCompanyID (iiCompanyID),
input ? (iiFromCurrencyID),
input icBankCurrencyCode (icFromCurrencyCode),
input viCompanyLCId (iiToCurrencyID),
input ? (icToCurrencyCode),
input ? (iiExchangeRateTypeID),
input vcExchangeRateType (icExchangeRateTypeCode),
input itBankStateLineValueDate (itValidityDate),
output vdBankRate (odExchangeRate),
output vdBankRateScale (odExchangeScaleFactor),
output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
end.
empty temp-table tPossibleBankStateAlloc.
empty temp-table tPossibleBankStateCollAlloc.
/* Creditor Document / Collection */
if ilIncludeCreditor
then do:
<M-33 run GetPossibleCollAllocationsCreditor
(input iiCompanyID (iiCompanyID),
input iiBankStateLineID (iiBankStateLineID),
input icBankStateLineTcRowid (icBankStateLineTcRowid),
input itFromRequestedDate (itFromRequestedDate),
input idTotalCollectionAmountTC (idTotalCollectionAmountTC),
input ilIncludeDebtor (ilIncludeDebtor),
input ilIncludeCreditor (ilIncludeCreditor),
input icBankCurrencyCode (icBankCurrencyCode),
input icGLCode (icGLCode),
input itBankStateLineValueDate (itBankStateLineValueDate),
input iiDocumentYear (iiDocumentYear),
input icDocumentType (icDocumentType),
input iiDocumentNumber (iiDocumentNumber),
input vdBankRate (idBankRate),
input vdBankRateScale (idBankRateScale),
input iiCDocumentPrePrintedNumber (iiCDocumentPrePrintedNumber),
input icDocumentReference (icDocumentReference),
input icSelectionCode (icSelectionCode),
output tPossibleBankStateAlloc (tPossibleBankStateAlloc),
output tPossibleBankStateCollAlloc (tPossibleBankStateCollAlloc),
output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
end.
/* Debtor Document / Collection */
if ilIncludeDebtor
then do:
<M-34 run GetPossibleCollAllocationsDebtor
(input iiCompanyID (iiCompanyID),
input iiBankStateLineID (iiBankStateLineID),
input icBankStateLineTcRowid (icBankStateLineTcRowid),
input itFromRequestedDate (itFromRequestedDate),
input idTotalCollectionAmountTC (idTotalCollectionAmountTC),
input ilIncludeDebtor (ilIncludeDebtor),
input ilIncludeCreditor (ilIncludeCreditor),
input icBankCurrencyCode (icBankCurrencyCode),
input icGLCode (icGLCode),
input itBankStateLineValueDate (itBankStateLineValueDate),
input iiDocumentYear (iiDocumentYear),
input icDocumentType (icDocumentType),
input iiDocumentNumber (iiDocumentNumber),
input vdBankRate (idBankRate),
input vdBankRateScale (idBankRateScale),
input icDocumentReference (icDocumentReference),
input icSelectionCode (icSelectionCode),
output tPossibleBankStateAlloc (tPossibleBankStateAlloc),
output tPossibleBankStateCollAlloc (tPossibleBankStateCollAlloc),
output viFcReturnSuper (oiReturnStatus)) in BBankEntry>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
end.