Aid To Understanding Why Debit Notes Are Not Generated by Receiving Returns

(Doc ID 1376433.1)

Last updated on JUNE 01, 2016

Applies to:

Oracle Inventory Management - Version 11.5.10.CU2 to 12.1.3 [Release 11.5.10 to 12.1]
Information in this document applies to any platform.
RCVTXERE.frm
RCVTXERE.pld

rvtuqdebitmemo (rvtuq.lpc)

AP_AUTO_DM_CREATION_PKG (apcrtdmb.pls)
AP_RECT_MATCH_PKG (aprcvmtb.pls)
AP_TAX_CONTROL_PKG (aptxctlb.pls)
AP_TAX_DEFAULT_PKG (aptxdefb.pls)


Goal

The aim of this document is to assist in understanding why a Debit Memo is not automatically generated when a Return To Supplier is performed in the Receiving module.

When a Return To Supplier is entered on the Receiving Return form (RCVTXERE), the Receiving Transaction Processor (RTP) is called.
The RTP is constructed of libraries, one of which is rvtuq.lpc.
The library contains the function rvtuqdebitmemo which then calls the AP API AP_AUTO_DM_CREATION_PKG

It is this API that is responsible for generating the Debit Memo.

There are seven conditions that must be meet for a Debit Memo to be generated:

1. The supplier site has to be marked to allow RTS transactions.
2. There must be an original invoice already in AP for the item being returned.
3. The PO and the original Invoice must be to the same Supplier Site.
4. The Supplier Site must be marked as BOTH a Pay Site and a Purchasing Site.
5. The return quantity cannot cause the quantity invoiced to go negative and the return quantity must be equal to or less than the quantity invoiced.
6. The Create Debit Memo check-box must also be turned on in the Receipt form.
7. The return must be to the Supplier, and not to Receiving.

To assist in checking some of these conditions, the following SQL may be used which will prompt for the Purchase Order number in question:

select poh.org_id "Org ID"
,poh.segment1 "PO#"
,POH.PO_HEADER_ID "PO.ID"
,POR.RELEASE_NUM "Rel Num"
,por.po_release_id "POR.ID"
,poh.pay_on_code "PO.Paid Upon"
,pv.vendor_name "PV.Vendor"
,pvs.vendor_site_code "PVS.Vend Site"
,pvs.pay_on_code "PVS.Paid Upon"
,pvs.pay_on_receipt_summary_code "PVS.Invoice Summary @"
,pvs.create_debit_memo_flag "PVS.Create Debit"
,pvs.pay_site_flag "PVS.Is a Pay Site"
,pvs.purchasing_site_flag "PVS.Is a Purchasing Site"
,pod.Po_Distribution_Id "POD.ID"
,rsh.receipt_num "Receipt#"
,rcv.transaction_id "RT.ID"
,rcv.transaction_type "RT.Type"
,rcv.invoice_status_code "RT.Invoice Status"
,ai.Invoice_Num "AP.Invoice Num"
,aid.Distribution_Line_Number "AP.Dist Num"
,aid.Invoice_Distribution_Id "AID.ID"
,aid.line_type_lookup_code "AID.Type"
from PO_HEADERS_ALL POH
,po_releases_all por
,PO_DISTRIBUTIONS_ALL pod
,po_vendors pv
,po_vendor_sites_all pvs
,rcv_transactions rcv
,rcv_shipment_headers rsh
,AP_INVOICES_ALL ai
,AP_INVOICE_DISTRIBUTIONS_ALL AID
where POH.SEGMENT1='&PO_NUM'
--and POR.RELEASE_NUM='&rel_num'  -- Uncomment for specific Po Release Number
and pod.po_header_id = poh.po_header_id
and RCV.PO_HEADER_ID = POH.PO_HEADER_ID
and RCV.PO_RELEASE_ID = POR.PO_RELEASE_ID (+)
and nvl(rcv.Po_Distribution_Id,pod.po_distribution_id) =  pod.po_distribution_id
and rcv.transaction_type ='RECEIVE'
and rsh.shipment_header_id = rcv.shipment_header_id
and pod.po_distribution_id = aid.po_distribution_id (+)
and ai.Invoice_Id (+) = aid.Invoice_Id
and poh.vendor_id = pv.vendor_id
and POH.VENDOR_SITE_ID = PVS.VENDOR_SITE_ID
order by pod.Po_Distribution_Id,ai.Invoice_Num, aid.line_type_lookup_code, aid.Invoice_Distribution_Id ;


The SQL will return values for three of the seven conditions:

1. The supplier site has to be marked to allow RTS transactions (PVS.Create Debit)
2. There must be an original invoice already in AP for the item being returned. (AP.Invoice Num)
4. The Supplier Site must be marked as BOTH a Pay Site and a Purchasing Site (PVS.Is a Pay Site & PVS.Is a Purchasing Site)

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms