Hello.
We made a custom report which uses the UNIFORM_PAYMENT_ADVICE_REP table to make the report, and we have a report rule to send the report to suppliers, but sometimes, the report is well generated, sometimes, the report is empty.
On the report rule screen, we defined the following condition :
select NVL(sum(payment_amount), 0)
from UNIFORM_PAYMENT_ADVICE_REP
where result_key==#ResultKey] <> 0
To generate the report, we have this main sql query :
SELECT
RESULT_KEY,
SUPPLIER_INFO_API.Get_Name(LEDGER_TRANSACTION_SU_QRY.SUPPLIER_ID) AS SUPPLIER_NAME,
SUPPLIER_INFO_ADDRESS_API.Get_Address(LEDGER_TRANSACTION_SU_QRY.SUPPLIER_ID, 'ADD_DEL_FR_0001') AS SUPPLIER_ADDRESS,
COMM_METHOD_API.Get_Value('Supplier', LEDGER_TRANSACTION_SU_QRY.SUPPLIER_ID, 2) AS SUPPLIER_EMAIL,
UNIFORM_PAYMENT_ADVICE_REP.Payment_Address AS SUPPLIER_IBAN,
LEDGER_TRANSACTION_SU_QRY.COMPANY,
LEDGER_TRANSACTION_SU_QRY.PAYMENT_ID,
LEDGER_TRANSACTION_SU_QRY.LEDGER_ITEM_ID,
LEDGER_TRANSACTION_SU_QRY.PAID_AMOUNT,
LEDGER_TRANSACTION_SU_QRY.INVOICE_CURRENCY,
CASE WHEN LEDGER_TRANSACTION_SU_QRY.USED_DISCOUNT IS NULL THEN 0 ELSE LEDGER_TRANSACTION_SU_QRY.USED_DISCOUNT END AS USED_DISCOUNT,
MAN_SUPP_INVOICE.DUE_DATE,
CASE WHEN MAN_SUPP_INVOICE.INV_GROSS_CURR_AMT IS NULL THEN 1 ELSE MAN_SUPP_INVOICE.INV_GROSS_CURR_AMT END AS INV_GROSS_CURR_AMT,
PAYMENT_PER_CURRENCY_SU_QRY.CURR_AMOUNT,
PAYMENT_PER_CURRENCY_SU_QRY.CURRENCY
from UNIFORM_PAYMENT_ADVICE_REP
left join SUPPLIER_INFO_GENERAL On UNIFORM_PAYMENT_ADVICE_REP.PAYEE_IDENTITY = SUPPLIER_INFO_GENERAL.SUPPLIER_ID
left join LEDGER_TRANSACTION_SU_QRY On UNIFORM_PAYMENT_ADVICE_REP.INVOICE_NO = LEDGER_ITEM_SERIES_ID || LEDGER_TRANSACTION_SU_QRY.LEDGER_ITEM_ID AND UNIFORM_PAYMENT_ADVICE_REP.PAYEE_IDENTITY = LEDGER_TRANSACTION_SU_QRY.IDENTITY
left join MAN_SUPP_INVOICE On LEDGER_ITEM_ID = MAN_SUPP_INVOICE.INVOICE_NO
left join PAYMENT_PER_CURRENCY_SU_QRY On PAYMENT_PER_CURRENCY_SU_QRY.PAYMENT_ID = LEDGER_TRANSACTION_SU_QRY.PAYMENT_ID AND PAYMENT_PER_CURRENCY_SU_QRY.COMPANY = LEDGER_TRANSACTION_SU_QRY.COMPANY
where RESULT_KEY = the result key value
When the empty report is sent to the supplier, each time I run the sql query with its result key value, the report is complete...
Can you tell me what’s wrong with the report / report rule?
Thanks
IFS APP 10; UPD 5