Hi,
Anyone knows that how to create Credit Memo automatically (semi-automatically) like normal AP Invoice that in Invoice(Vendor) window, create from lines.. , then create from one receipt? I explorer the code and found below part in MInOutConfirm.java:
if (confirm.getDifferenceQty().signum() != 0
&& !inout.isSOTrx() && inout.getRef_InOut_ID() != 0)
{
log.info("Difference=" + confirm.getDifferenceQty());
if (m_creditMemo == null)
{
m_creditMemo = new MInvoice (inout, null);
m_creditMemo.setDescription(Msg.translate(getCtx(), "M_InOutConfirm_ID") + " " + getDocumentNo());
m_creditMemo.setC_DocTypeTarget_ID(MDocType.DOCBASETYPE_APCreditMemo);
m_creditMemo.saveEx();
setC_Invoice_ID(m_creditMemo.getC_Invoice_ID());
}
MInvoiceLine line = new MInvoiceLine (m_creditMemo);
line.setShipLine(confirm.getLine());
But I don't know how to make condition "inout.getRef_InOut_ID!=0" true, anyone can tell what is that Ref_InOut_ID and when I can get into creditMemo code block inside?
BTW: I read material about Compiere, it seems it works correctly as I supposed to be (credit memo should be created automatically by confirm 0 quality).
http://wiki.compiere.com/display/docs/Purchasing Also I read compiere's user manual, snapshot shows the same thing.
BR,
Jack