Sample Purchase Return + Auto Credit Memo


This document can be create under

Procurement → Transactions → Purchase Return

Procurement → Transactions → Purchase Return by GRN


Giving example , the Purchase Return number is PR1001

select * from supp_purchase_return_index where pkid = 1001;

select * from supp_purchase_return_item where index_id = 1001;


To trace movement in / out of the item (Stock Movement)

select * from inv_stock_delta where doc_table = 'supp_purchase_return_item' and doc_key in (select pkid from supp_purchase_return_item where index_id = 1001);


To trace movement in / out of the serial number or batch and expiry (Trace Stock)

select * from inv_serial_number_delta where doc_table = 'supp_purchase_return_item' and doc_key in (select pkid from supp_purchase_return_item where index_id = 1001);


Giving example , the CM auto created from Purchase Return is CM1003

If you don't have the CM number and only have the PR and PR number is PR1001,

select * from acc_credit_memo_index where doc_table = 'supp_purchase_return_index' and doc_key = 1001; (smile)


if you have the CM number , can proceed to check base on CM pkid

select * from acc_credit_memo_index where pkid = 1003;

select * from acc_credit_memo_item where index_id = 1003;


Record in Financial Report (Balance Sheet / Trial Balance / P&L / GL Listing

select * from acc_journal_transaction where doc_ref = 'acc_credit_memo_index' and doc_key = 1003;

select * from acc_journal_entry where journaltxnid in (select pkid from acc_journal_transaction where doc_ref = 'acc_credit_memo_index' and doc_key = 1003);


Record in AR / AP Transaction / Billing Statement / Historical AR / AP Balance

select * from acc_nominal_account_txn where foreign_table  = 'acc_credit_memo_index' and foreign_key = 1003;


Settlement / Supplier Historical Transaction Aging Analysis

select * from acc_doclink where src_docref = 'acc_credit_memo_index' and src_docid = 1003;

select * from acc_doclink where tgt_docref = 'acc_credit_memo_index' and tgt_docid = 1003;


Private & Confidential