Some Prepayment Invoice amount showing double
Summary:
Content (required):
Dear All
We have an query which will fetch the Prepayment Invoice details , the query is working fine , but it is noticed that some of the invoice amount is showing as double can any one help what could be the problem , code is attached
Version (include the version you are using, if applicable):
Code Snippet (add any code snippets that support your topic, if applicable):
SELECT
'1' source,
ai.invoice_num,
ai.invoice_id,
ai.invoice_date invoice_date,
prepay.payment_currency_code,
sum(DECODE(pay.PAYMENT_CURRENCY_CODE,'SAR',pay.amount,pay.PAYMENT_BASE_AMOUNT)) as invoice_amount,
0