Parameters
ocCredBusRelationCode | output | character | |
olCredIsIndividualPayment | output | logical | |
ocCredAddressLanguage | output | character | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program1/bpaymentselection.p)
if tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-INVOICE} or
tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-INVOICECORR} or
tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-CREDITNOTE} or
tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-CREDITNOTECORR} or
tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-PREPAYMENTINV} or
tPaySelLine.PaySelLineObjectType = {&PAYMENTSELECTIONTYPE-ADJUSTMENT}
then do:
<Q-14 run CreditorByPaysel (all) (Read) (NoCache)
(input viCompanyId, (CompanyId)
input ?, (Creditor_ID)
input tPaySelLine.tcCreditorCode, (CreditorCode)
input ?, (Employee_ID)
output dataset tqCreditorByPaysel) in BCreditor >
find first tqCreditorByPaysel no-error.
if not available tqCreditorByPaysel
then do:
<M-2 run SetMessage
(input #T-15'Supplier ($1) is not defined in the system.':80(2960)t-15# (icMessage),
input tPaySelLine.tcCreditorCode (icArguments),
input '':U (icFieldName),
input tPaySelLine.tcCreditorCode (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input ? (icRowid),
input 'QADFIN-1209':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
/* Get the Address of the Creditor */
<Q-3 run AddressByAddressBusRelType (all) (Read) (NoCache)
(input ?, (AddressTypeId)
input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressTypeCode)
input tqCreditorByPaySel.tiBusinessRelation_ID, (BusinessRelationId)
input tqCreditorByPaySel.tcBusinessRelationCode, (BusinessRelationCode)
input ?, (AddressId)
output dataset tqAddressByAddressBusRelType) in BBusinessRelation >
find first tqAddressByAddressBusRelType no-error.
if not available tqAddressByAddressBusRelType
then do:
<M-4 run SetMessage
(input #T-16'No address ($1) is defined for the supplier ($2).':80(2961)t-16# (icMessage),
input tqCreditorByPaySel.tcBusinessRelationCode + chr(2) + tqCreditorByPaySel.tcCreditorCode (icArguments),
input '':U (icFieldName),
input tqCreditorByPaySel.tcBusinessRelationCode (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input ? (icRowid),
input 'QADFIN-1210':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
/* Get the language of the businessrelation */
<Q-5 run LanguageByCodeID (all) (Read) (NoCache)
(input '':U, (LngCode)
input tqAddressByAddressBusRelType.tiLng_ID, (LngID)
input ?, (Installed)
output dataset tqLanguageByCodeID) in BLanguage >
find first tqLanguageByCodeID no-error.
if not available tqLanguageByCodeID
then do:
<M-7 run SetMessage
(input #T-17'No language was defined for business relation '$1'.':80(2991)t-17# (icMessage),
input tqCreditorByPaySel.tcBusinessRelationCode + chr(2) + tqCreditorByPaySel.tcCreditorCode (icArguments),
input '':U (icFieldName),
input tqCreditorByPaySel.tcBusinessRelationCode (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input ? (icRowid),
input 'QADFIN-1211':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
assign ocCredBusRelationCode = tqCreditorByPaySel.tcBusinessRelationCode
olCredIsIndividualPayment = tqCreditorByPaySel.tlCreditorIsIndividualPaymnt
ocCredAddressLanguage = tqLanguageByCodeID.tcLngCode.
end.
else do:
<Q-8 run DebtorByDebtor (all) (Read) (NoCache)
(input viCompanyId, (CompanyId)
input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressType)
input ?, (DebtorId)
input tPaySelLine.tcCreditorCode, (DebtorCode)
output dataset tqDebtorByDebtor) in BDebtor>
find first tqDebtorByDebtor no-error.
if not available tqDebtorByDebtor
then do:
<M-9 run SetMessage
(input #T-18'Customer ($1) is not defined in the system.':80(2963)t-18# (icMessage),
input tPaySelLine.tcCreditorCode (icArguments),
input '':U (icFieldName),
input tPaySelLine.tcCreditorCode (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input ? (icRowid),
input 'QADFIN-1212':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
/* Get the Address of the Debtor */
<Q-10 run AddressByAddressBusRelType (all) (Read) (NoCache)
(input ?, (AddressTypeId)
input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressTypeCode)
input tqDebtorByDebtor.tiBusinessRelation_ID, (BusinessRelationId)
input tqDebtorByDebtor.tcBusinessRelationCode, (BusinessRelationCode)
input ?, (AddressId)
output dataset tqAddressByAddressBusRelType) in BBusinessRelation >
find first tqAddressByAddressBusRelType no-error.
if not available tqAddressByAddressBusRelType
then do:
<M-11 run SetMessage
(input #T-19'No address ($1) was defined for customer ($2).':80(2964)t-19# (icMessage),
input tqDebtorByDebtor.tcBusinessRelationCode + chr(2) + tqDebtorByDebtor.tcDebtorCode (icArguments),
input '':U (icFieldName),
input tqDebtorByDebtor.tcBusinessRelationCode (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input ? (icRowid),
input 'QADFIN-1207':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
<Q-12 run LanguageByCodeID (all) (Read) (NoCache)
(input '':U, (LngCode)
input tqAddressByAddressBusRelType.tiLng_ID, (LngID)
input ?, (Installed)
output dataset tqLanguageByCodeID) in BLanguage >
find first tqLanguageByCodeID no-error.
if not available tqLanguageByCodeID
then do:
<M-13 run SetMessage
(input #T-20'No language was defined for business relation '$1'.':80(2991)t-20# (icMessage),
input tqDebtorByDebtor.tcBusinessRelationCode + chr(2) + tqDebtorByDebtor.tcDebtorCode (icArguments),
input '':U (icFieldName),
input tqDebtorByDebtor.tcBusinessRelationCode (icFieldValue),
input 'D':U (icType),
input 3 (iiSeverity),
input ? (icRowid),
input 'QADFIN-1208':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
assign ocCredBusRelationCode = tqDebtorByDebtor.tcBusinessRelationCode
olCredIsIndividualPayment = true
ocCredAddressLanguage = tqLanguageByCodeID.tcLngCode.
end.