- Implemented missing counter document support for RMA
- Fixed CreateFromInvoice implementation for RMA
- Vendor Return is captured in Shipment window
- Customer Return is captured in Material Receipt window
This commit is contained in:
Heng Sin Low 2009-06-01 05:23:43 +00:00
parent 41e9ce441d
commit a3d3c92dc7
14 changed files with 1505 additions and 840 deletions

View File

@ -142,6 +142,8 @@ public class CalloutInOut extends CalloutEngine
else
mTab.setValue("MovementType", "V+"); // Vendor Receipts
}
if (!(trxFlag.equals(mTab.getValue("IsSOTrx"))))
mTab.setValue("IsSOTrx", trxFlag);
/**END vpj-cd e-evolution */
// DocumentNo

View File

@ -279,19 +279,6 @@ public interface I_M_RMA
*/
public boolean isSOTrx();
/** Column name M_RMA_ID */
public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID";
/** Set RMA.
* Return Material Authorization
*/
public void setM_RMA_ID (int M_RMA_ID);
/** Get RMA.
* Return Material Authorization
*/
public int getM_RMA_ID();
/** Column name M_RMAType_ID */
public static final String COLUMNNAME_M_RMAType_ID = "M_RMAType_ID";
@ -307,6 +294,19 @@ public interface I_M_RMA
public I_M_RMAType getM_RMAType() throws RuntimeException;
/** Column name M_RMA_ID */
public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID";
/** Set RMA.
* Return Material Authorization
*/
public void setM_RMA_ID (int M_RMA_ID);
/** Get RMA.
* Return Material Authorization
*/
public int getM_RMA_ID();
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
@ -342,6 +342,15 @@ public interface I_M_RMA
/** Get Process Now */
public boolean isProcessing();
/** Column name Ref_RMA_ID */
public static final String COLUMNNAME_Ref_RMA_ID = "Ref_RMA_ID";
/** Set Referenced RMA */
public void setRef_RMA_ID (int Ref_RMA_ID);
/** Get Referenced RMA */
public int getRef_RMA_ID();
/** Column name SalesRep_ID */
public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID";

View File

@ -173,6 +173,19 @@ public interface I_M_RMALine
public I_M_InOutLine getM_InOutLine() throws RuntimeException;
/** Column name M_RMALine_ID */
public static final String COLUMNNAME_M_RMALine_ID = "M_RMALine_ID";
/** Set RMA Line.
* Return Material Authorization Line
*/
public void setM_RMALine_ID (int M_RMALine_ID);
/** Get RMA Line.
* Return Material Authorization Line
*/
public int getM_RMALine_ID();
/** Column name M_RMA_ID */
public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID";
@ -188,19 +201,6 @@ public interface I_M_RMALine
public I_M_RMA getM_RMA() throws RuntimeException;
/** Column name M_RMALine_ID */
public static final String COLUMNNAME_M_RMALine_ID = "M_RMALine_ID";
/** Set RMA Line.
* Return Material Authorization Line
*/
public void setM_RMALine_ID (int M_RMALine_ID);
/** Get RMA Line.
* Return Material Authorization Line
*/
public int getM_RMALine_ID();
/** Column name Processed */
public static final String COLUMNNAME_Processed = "Processed";
@ -240,6 +240,28 @@ public interface I_M_RMALine
*/
public BigDecimal getQtyDelivered();
/** Column name QtyInvoiced */
public static final String COLUMNNAME_QtyInvoiced = "QtyInvoiced";
/** Set Quantity Invoiced.
* Invoiced Quantity
*/
public void setQtyInvoiced (BigDecimal QtyInvoiced);
/** Get Quantity Invoiced.
* Invoiced Quantity
*/
public BigDecimal getQtyInvoiced();
/** Column name Ref_RMALine_ID */
public static final String COLUMNNAME_Ref_RMALine_ID = "Ref_RMALine_ID";
/** Set Referenced RMA Line */
public void setRef_RMALine_ID (int Ref_RMALine_ID);
/** Get Referenced RMA Line */
public int getRef_RMALine_ID();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";

View File

@ -184,7 +184,16 @@ public class MInOut extends X_M_InOut implements DocAction
to.setC_DocType_ID (C_DocType_ID);
to.setIsSOTrx(isSOTrx);
if (counter)
to.setMovementType (isSOTrx ? MOVEMENTTYPE_CustomerShipment : MOVEMENTTYPE_VendorReceipts);
{
MDocType docType = new MDocType(from.getCtx(), C_DocType_ID, trxName);
if (docType.getDocBaseType().equals("MMS")) {
to.setMovementType (isSOTrx ? MOVEMENTTYPE_CustomerShipment : MOVEMENTTYPE_VendorReturns);
}
else if (docType.getDocBaseType().equals("MMR")) {
to.setMovementType (isSOTrx ? MOVEMENTTYPE_CustomerReturns : MOVEMENTTYPE_VendorReceipts);
}
}
//
to.setDateOrdered (dateDoc);
to.setDateAcct (dateDoc);
@ -225,6 +234,13 @@ public class MInOut extends X_M_InOut implements DocAction
if (peer.getRef_Invoice_ID() != 0)
to.setC_Invoice_ID(peer.getRef_Invoice_ID());
}
//find RMA link
if (from.getM_RMA_ID() != 0)
{
MRMA peer = new MRMA (from.getCtx(), from.getM_RMA_ID(), from.get_TrxName());
if (peer.getRef_RMA_ID() > 0)
to.setM_RMA_ID(peer.getRef_RMA_ID());
}
}
else
{
@ -721,6 +737,13 @@ public class MInOut extends X_M_InOut implements DocAction
if (peer.getRef_OrderLine_ID() != 0)
line.setC_OrderLine_ID(peer.getRef_OrderLine_ID());
}
//RMALine link
if (fromLine.getM_RMALine_ID() != 0)
{
MRMALine peer = new MRMALine (getCtx(), fromLine.getM_RMALine_ID(), get_TrxName());
if (peer.getRef_RMALine_ID() > 0)
line.setM_RMALine_ID(peer.getRef_RMALine_ID());
}
}
//
line.setProcessed(false);

View File

@ -43,7 +43,7 @@ public class MInOutLine extends X_M_InOutLine
/**
*
*/
private static final long serialVersionUID = -1196352601949381166L;
private static final long serialVersionUID = 8630611882798722864L;
/**
* Get Ship lines Of Order Line
@ -63,6 +63,24 @@ public class MInOutLine extends X_M_InOutLine
return list.toArray (new MInOutLine[list.size()]);
} // getOfOrderLine
/**
* Get Ship lines Of RMA Line
* @param ctx context
* @param M_RMALine_ID line
* @param where optional addition where clause
* @param trxName transaction
* @return array of receipt lines
*/
public static MInOutLine[] getOfRMALine (Properties ctx,
int M_RMALine_ID, String where, String trxName)
{
String whereClause = "M_RMALine_ID=? " + (!Util.isEmpty(where, true) ? " AND "+where : "");
List<MRMALine> list = new Query(ctx, Table_Name, whereClause, trxName)
.setParameters(new Object[]{M_RMALine_ID})
.list();
return list.toArray (new MInOutLine[list.size()]);
} // getOfRMALine
/**
* Get Ship lines Of Order Line
* @param ctx context

View File

@ -58,6 +58,7 @@ import org.eevolution.model.MPPProductBOMLine;
*/
public class MInvoice extends X_C_Invoice implements DocAction
{
/**
*
*/
@ -141,6 +142,14 @@ public class MInvoice extends X_C_Invoice implements DocAction
if (peer.getRef_Order_ID() != 0)
to.setC_Order_ID(peer.getRef_Order_ID());
}
// Try to find RMA link
if (from.getM_RMA_ID() != 0)
{
MRMA peer = new MRMA (from.getCtx(), from.getM_RMA_ID(), from.get_TrxName());
if (peer.getRef_RMA_ID() > 0)
to.setM_RMA_ID(peer.getRef_RMA_ID());
}
//
}
else
to.setRef_Invoice_ID(0);
@ -1647,6 +1656,22 @@ public class MInvoice extends X_C_Invoice implements DocAction
}
}
//Update QtyInvoiced RMA Line
if (line.getM_RMALine_ID() != 0)
{
MRMALine rmaLine = new MRMALine (getCtx(),line.getM_RMALine_ID(), get_TrxName());
if (rmaLine.getQtyInvoiced() != null)
rmaLine.setQtyInvoiced(rmaLine.getQtyInvoiced().add(line.getQtyInvoiced()));
else
rmaLine.setQtyInvoiced(line.getQtyInvoiced());
if (!rmaLine.save(get_TrxName()))
{
m_processMsg = "Could not update RMA Line";
return DocAction.STATUS_Invalid;
}
}
//
// Matching - Inv-Shipment
if (!isSOTrx()
&& line.getM_InOutLine_ID() != 0

View File

@ -38,6 +38,7 @@ import org.compiere.util.Msg;
*/
public class MInvoiceLine extends X_C_InvoiceLine
{
/**
*
*/
@ -1212,7 +1213,6 @@ public class MInvoiceLine extends X_C_InvoiceLine
setC_UOM_ID(rmaLine.getC_UOM_ID());
setC_Tax_ID(rmaLine.getC_Tax_ID());
setPrice(rmaLine.getAmt());
setQty(rmaLine.getQty());
setLineNetAmt();
setTaxAmt();
setLineTotalAmt(rmaLine.getLineNetAmt());

View File

@ -43,7 +43,7 @@ public class MRMA extends X_M_RMA implements DocAction
/**
*
*/
private static final long serialVersionUID = -2967208431264929454L;
private static final long serialVersionUID = -3310525910645254261L;
/**
* Standard Constructor
@ -335,7 +335,6 @@ public class MRMA extends X_M_RMA implements DocAction
if (m_processMsg != null)
return DocAction.STATUS_Invalid;
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
MRMALine[] lines = getLines(false);
if (lines.length == 0)
{
@ -407,6 +406,12 @@ public class MRMA extends X_M_RMA implements DocAction
return DocAction.STATUS_InProgress;
}
*/
// Counter Documents
MRMA counter = createCounterDoc();
if (counter != null)
m_processMsg = "@CounterDoc@: RMA=" + counter.getDocumentNo();
// User Validation
String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE);
if (valid != null)
@ -441,6 +446,186 @@ public class MRMA extends X_M_RMA implements DocAction
}
}
/**************************************************************************
* Create Counter Document
* @return InOut
*/
private MRMA createCounterDoc()
{
// Is this a counter doc ?
if (getRef_RMA_ID() > 0)
return null;
// Org Must be linked to BPartner
MOrg org = MOrg.get(getCtx(), getAD_Org_ID());
int counterC_BPartner_ID = org.getLinkedC_BPartner_ID(get_TrxName());
if (counterC_BPartner_ID == 0)
return null;
// Business Partner needs to be linked to Org
MBPartner bp = new MBPartner (getCtx(), getC_BPartner_ID(), get_TrxName());
int counterAD_Org_ID = bp.getAD_OrgBP_ID_Int();
if (counterAD_Org_ID == 0)
return null;
// Document Type
int C_DocTypeTarget_ID = 0;
MDocTypeCounter counterDT = MDocTypeCounter.getCounterDocType(getCtx(), getC_DocType_ID());
if (counterDT != null)
{
log.fine(counterDT.toString());
if (!counterDT.isCreateCounter() || !counterDT.isValid())
return null;
C_DocTypeTarget_ID = counterDT.getCounter_C_DocType_ID();
}
else // indirect
{
C_DocTypeTarget_ID = MDocTypeCounter.getCounterDocType_ID(getCtx(), getC_DocType_ID());
log.fine("Indirect C_DocTypeTarget_ID=" + C_DocTypeTarget_ID);
if (C_DocTypeTarget_ID <= 0)
return null;
}
// Deep Copy
MRMA counter = copyFrom(this, C_DocTypeTarget_ID, !isSOTrx(), true, get_TrxName());
//
counter.setAD_Org_ID(counterAD_Org_ID);
counter.setC_BPartner_ID(counterC_BPartner_ID);
counter.save(get_TrxName());
// Update copied lines
MRMALine[] counterLines = counter.getLines(true);
for (int i = 0; i < counterLines.length; i++)
{
MRMALine counterLine = counterLines[i];
counterLine.setClientOrg(counter);
//
counterLine.save(get_TrxName());
}
log.fine(counter.toString());
// Document Action
if (counterDT != null)
{
if (counterDT.getDocAction() != null)
{
counter.setDocAction(counterDT.getDocAction());
counter.processIt(counterDT.getDocAction());
counter.save(get_TrxName());
}
}
return counter;
} // createCounterDoc
/**
* Create new RMA by copying
* @param from RMA
* @param C_DocType_ID doc type
* @param isSOTrx sales order
* @param counter create counter links
* @param trxName trx
* @return MRMA
*/
public static MRMA copyFrom (MRMA from, int C_DocType_ID, boolean isSOTrx, boolean counter, String trxName)
{
MRMA to = new MRMA (from.getCtx(), 0, null);
to.set_TrxName(trxName);
copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID());
to.set_ValueNoCheck ("M_RMA_ID", I_ZERO);
to.set_ValueNoCheck ("DocumentNo", null);
to.setDocStatus (DOCSTATUS_Drafted); // Draft
to.setDocAction(DOCACTION_Complete);
to.setC_DocType_ID (C_DocType_ID);
to.setIsSOTrx(isSOTrx);
to.setIsApproved (false);
to.setProcessed (false);
to.setProcessing(false);
to.setName(from.getName());
to.setDescription(from.getDescription());
to.setSalesRep_ID(from.getSalesRep_ID());
to.setHelp(from.getHelp());
to.setM_RMAType_ID(from.getM_RMAType_ID());
to.setAmt(from.getAmt());
to.setC_Order_ID(0);
// Try to find Order/Shipment/Receipt link
if (from.getC_Order_ID() != 0)
{
MOrder peer = new MOrder (from.getCtx(), from.getC_Order_ID(), from.get_TrxName());
if (peer.getRef_Order_ID() != 0)
to.setC_Order_ID(peer.getRef_Order_ID());
}
if (from.getInOut_ID() != 0)
{
MInOut peer = new MInOut (from.getCtx(), from.getInOut_ID(), from.get_TrxName());
if (peer.getRef_InOut_ID() != 0)
to.setInOut_ID(peer.getRef_InOut_ID());
}
to.set_Value("Ref_RMA_ID", from.getM_RMA_ID());
if (!to.save(trxName))
throw new IllegalStateException("Could not create RMA");
if (counter)
from.set_Value("Ref_RMA_ID", to.getM_RMA_ID());
if (to.copyLinesFrom(from, counter) == 0)
throw new IllegalStateException("Could not create RMA Lines");
return to;
} // copyFrom
/**
* Copy Lines From other RMA
* @param otherRMA
* @param counter set counter info
* @param setOrder set order link
* @return number of lines copied
*/
public int copyLinesFrom (MRMA otherRMA, boolean counter)
{
if (isProcessed() || otherRMA == null)
return 0;
MRMALine[] fromLines = otherRMA.getLines(false);
int count = 0;
for (int i = 0; i < fromLines.length; i++)
{
MRMALine line = new MRMALine(getCtx(), 0, null);
MRMALine fromLine = fromLines[i];
line.set_TrxName(get_TrxName());
if (counter) // header
PO.copyValues(fromLine, line, getAD_Client_ID(), getAD_Org_ID());
else
PO.copyValues(fromLine, line, fromLine.getAD_Client_ID(), fromLine.getAD_Org_ID());
line.setM_RMA_ID(getM_RMA_ID());
line.set_ValueNoCheck ("M_RMALine_ID", I_ZERO); // new
if (counter)
{
line.set_Value("Ref_RMALine_ID", fromLine.getM_RMALine_ID());
if (fromLine.getM_InOutLine_ID() != 0)
{
MInOutLine peer = new MInOutLine (getCtx(), fromLine.getM_InOutLine_ID(), get_TrxName());
if (peer.getRef_InOutLine_ID() != 0)
line.setM_InOutLine_ID(peer.getRef_InOutLine_ID());
}
}
//
line.setProcessed(false);
if (line.save(get_TrxName()))
count++;
// Cross Link
if (counter)
{
fromLine.set_Value("Ref_RMALine_ID", line.getM_RMALine_ID());
fromLine.save(get_TrxName());
}
}
if (fromLines.length != count)
log.log(Level.SEVERE, "Line difference - From=" + fromLines.length + " <> Saved=" + count);
return count;
} // copyLinesFrom
/**
* Void Document.
* @return true if success

View File

@ -34,7 +34,7 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20081221L;
private static final long serialVersionUID = 20090601L;
/** Standard Constructor */
public X_M_RMA (Properties ctx, int M_RMA_ID, String trxName)
@ -52,8 +52,8 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
setIsApproved (false);
setIsSOTrx (false);
// @IsSOTrx@
setM_RMA_ID (0);
setM_RMAType_ID (0);
setM_RMA_ID (0);
setName (null);
setProcessed (false);
setSalesRep_ID (0);
@ -193,7 +193,8 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
public void setC_DocType_ID (int C_DocType_ID)
{
if (C_DocType_ID < 0)
throw new IllegalArgumentException ("C_DocType_ID is mandatory.");
set_Value (COLUMNNAME_C_DocType_ID, null);
else
set_Value (COLUMNNAME_C_DocType_ID, Integer.valueOf(C_DocType_ID));
}
@ -300,7 +301,7 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
*/
public void setDocAction (String DocAction)
{
if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory");
set_Value (COLUMNNAME_DocAction, DocAction);
}
@ -344,7 +345,7 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
*/
public void setDocStatus (String DocStatus)
{
if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory");
set_Value (COLUMNNAME_DocStatus, DocStatus);
}
@ -362,8 +363,6 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
*/
public void setDocumentNo (String DocumentNo)
{
if (DocumentNo == null)
throw new IllegalArgumentException ("DocumentNo is mandatory.");
set_Value (COLUMNNAME_DocumentNo, DocumentNo);
}
@ -424,7 +423,8 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
public void setInOut_ID (int InOut_ID)
{
if (InOut_ID < 1)
throw new IllegalArgumentException ("InOut_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_InOut_ID, null);
else
set_ValueNoCheck (COLUMNNAME_InOut_ID, Integer.valueOf(InOut_ID));
}
@ -487,28 +487,6 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
return false;
}
/** Set RMA.
@param M_RMA_ID
Return Material Authorization
*/
public void setM_RMA_ID (int M_RMA_ID)
{
if (M_RMA_ID < 1)
throw new IllegalArgumentException ("M_RMA_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID));
}
/** Get RMA.
@return Return Material Authorization
*/
public int getM_RMA_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_RMA_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_RMAType getM_RMAType() throws RuntimeException
{
Class<?> clazz = MTable.getClass(I_M_RMAType.Table_Name);
@ -532,7 +510,8 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
public void setM_RMAType_ID (int M_RMAType_ID)
{
if (M_RMAType_ID < 1)
throw new IllegalArgumentException ("M_RMAType_ID is mandatory.");
set_Value (COLUMNNAME_M_RMAType_ID, null);
else
set_Value (COLUMNNAME_M_RMAType_ID, Integer.valueOf(M_RMAType_ID));
}
@ -547,14 +526,35 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
return ii.intValue();
}
/** Set RMA.
@param M_RMA_ID
Return Material Authorization
*/
public void setM_RMA_ID (int M_RMA_ID)
{
if (M_RMA_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_RMA_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID));
}
/** Get RMA.
@return Return Material Authorization
*/
public int getM_RMA_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_RMA_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
if (Name == null)
throw new IllegalArgumentException ("Name is mandatory.");
set_Value (COLUMNNAME_Name, Name);
}
@ -611,6 +611,26 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
return false;
}
/** Set Referenced RMA.
@param Ref_RMA_ID Referenced RMA */
public void setRef_RMA_ID (int Ref_RMA_ID)
{
if (Ref_RMA_ID < 1)
set_Value (COLUMNNAME_Ref_RMA_ID, null);
else
set_Value (COLUMNNAME_Ref_RMA_ID, Integer.valueOf(Ref_RMA_ID));
}
/** Get Referenced RMA.
@return Referenced RMA */
public int getRef_RMA_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Ref_RMA_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Sales Representative.
@param SalesRep_ID
Sales Representative or Company Agent
@ -618,7 +638,8 @@ public class X_M_RMA extends PO implements I_M_RMA, I_Persistent
public void setSalesRep_ID (int SalesRep_ID)
{
if (SalesRep_ID < 1)
throw new IllegalArgumentException ("SalesRep_ID is mandatory.");
set_Value (COLUMNNAME_SalesRep_ID, null);
else
set_Value (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
}

View File

@ -34,7 +34,7 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20081221L;
private static final long serialVersionUID = 20090601;
/** Standard Constructor */
public X_M_RMALine (Properties ctx, int M_RMALine_ID, String trxName)
@ -42,8 +42,8 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
super (ctx, M_RMALine_ID, trxName);
/** if (M_RMALine_ID == 0)
{
setM_RMA_ID (0);
setM_RMALine_ID (0);
setM_RMA_ID (0);
setProcessed (false);
setQty (Env.ZERO);
} */
@ -232,6 +232,29 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
return ii.intValue();
}
/** Set RMA Line.
@param M_RMALine_ID
Return Material Authorization Line
*/
public void setM_RMALine_ID (int M_RMALine_ID)
{
if (M_RMALine_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_RMALine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_RMALine_ID, Integer.valueOf(M_RMALine_ID));
}
/** Get RMA Line.
@return Return Material Authorization Line
*/
public int getM_RMALine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_RMALine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_RMA getM_RMA() throws RuntimeException
{
Class<?> clazz = MTable.getClass(I_M_RMA.Table_Name);
@ -255,7 +278,8 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
public void setM_RMA_ID (int M_RMA_ID)
{
if (M_RMA_ID < 1)
throw new IllegalArgumentException ("M_RMA_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_RMA_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID));
}
@ -278,28 +302,6 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
return new KeyNamePair(get_ID(), String.valueOf(getM_RMA_ID()));
}
/** Set RMA Line.
@param M_RMALine_ID
Return Material Authorization Line
*/
public void setM_RMALine_ID (int M_RMALine_ID)
{
if (M_RMALine_ID < 1)
throw new IllegalArgumentException ("M_RMALine_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_RMALine_ID, Integer.valueOf(M_RMALine_ID));
}
/** Get RMA Line.
@return Return Material Authorization Line
*/
public int getM_RMALine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_RMALine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Processed.
@param Processed
The document has been processed
@ -330,8 +332,6 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
*/
public void setQty (BigDecimal Qty)
{
if (Qty == null)
throw new IllegalArgumentException ("Qty is mandatory.");
set_Value (COLUMNNAME_Qty, Qty);
}
@ -365,4 +365,44 @@ public class X_M_RMALine extends PO implements I_M_RMALine, I_Persistent
return Env.ZERO;
return bd;
}
/** Set Quantity Invoiced.
@param QtyInvoiced
Invoiced Quantity
*/
public void setQtyInvoiced (BigDecimal QtyInvoiced)
{
set_Value (COLUMNNAME_QtyInvoiced, QtyInvoiced);
}
/** Get Quantity Invoiced.
@return Invoiced Quantity
*/
public BigDecimal getQtyInvoiced ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_QtyInvoiced);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Referenced RMA Line.
@param Ref_RMALine_ID Referenced RMA Line */
public void setRef_RMALine_ID (int Ref_RMALine_ID)
{
if (Ref_RMALine_ID < 1)
set_Value (COLUMNNAME_Ref_RMALine_ID, null);
else
set_Value (COLUMNNAME_Ref_RMALine_ID, Integer.valueOf(Ref_RMALine_ID));
}
/** Get Referenced RMA Line.
@return Referenced RMA Line */
public int getRef_RMALine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_Ref_RMALine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
}

View File

@ -24,12 +24,12 @@ import java.util.logging.Level;
import org.compiere.minigrid.IMiniTable;
import org.compiere.model.GridTab;
import org.compiere.model.MOrder;
import org.compiere.model.MRMA;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
public abstract class CreateFrom implements ICreateFrom
{
@ -39,6 +39,9 @@ public abstract class CreateFrom implements ICreateFrom
/** Loaded Order */
protected MOrder p_order = null;
/** Loaded RMA */
protected MRMA m_rma = null;
private GridTab gridTab;
private String title;

View File

@ -30,6 +30,8 @@ import org.compiere.model.MInvoiceLine;
import org.compiere.model.MOrder;
import org.compiere.model.MOrderLine;
import org.compiere.model.MProduct;
import org.compiere.model.MRMA;
import org.compiere.model.MRMALine;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
@ -164,6 +166,10 @@ public class CreateFromInvoice extends CreateFrom
if (inout.getC_Order_ID() != 0)
p_order = new MOrder (Env.getCtx(), inout.getC_Order_ID(), null);
m_rma = null;
if (inout.getM_RMA_ID() != 0)
m_rma = new MRMA (Env.getCtx(), inout.getM_RMA_ID(), null);
//
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
StringBuffer sql = new StringBuffer("SELECT " // QtyEntered
@ -241,7 +247,7 @@ public class CreateFromInvoice extends CreateFrom
Vector<Vector<Object>> data = new Vector<Vector<Object>>();
StringBuffer sqlStmt = new StringBuffer();
sqlStmt.append("SELECT rl.M_RMALine_ID, rl.line, rl.Qty - rl.QtyDelivered, iol.M_Product_ID, p.Name, uom.C_UOM_ID, COALESCE(uom.UOMSymbol,uom.Name) ");
sqlStmt.append("SELECT rl.M_RMALine_ID, rl.line, rl.Qty - COALESCE(rl.QtyInvoiced, 0), iol.M_Product_ID, p.Name, uom.C_UOM_ID, COALESCE(uom.UOMSymbol,uom.Name) ");
sqlStmt.append("FROM M_RMALine rl INNER JOIN M_InOutLine iol ON rl.M_InOutLine_ID=iol.M_InOutLine_ID ");
if (Env.isBaseLanguage(Env.getCtx(), "C_UOM"))
@ -352,6 +358,12 @@ public class CreateFromInvoice extends CreateFrom
invoice.saveEx();
}
if (m_rma != null)
{
invoice.setM_RMA_ID(m_rma.getM_RMA_ID());
invoice.saveEx();
}
MInOut inout = null;
// if (m_M_InOut_ID > 0)
// {
@ -388,6 +400,12 @@ public class CreateFromInvoice extends CreateFrom
pp = (KeyNamePair)miniTable.getValueAt(i, 6); // 6-Shipment
if (pp != null)
M_InOutLine_ID = pp.getKey();
//
int M_RMALine_ID = 0;
pp = (KeyNamePair)miniTable.getValueAt(i, 7); // 7-RMALine
if (pp != null)
M_RMALine_ID = pp.getKey();
// Precision of Qty UOM
int precision = 2;
if (M_Product_ID != 0)
@ -410,6 +428,11 @@ public class CreateFromInvoice extends CreateFrom
MOrderLine orderLine = null;
if (C_OrderLine_ID != 0)
orderLine = new MOrderLine (Env.getCtx(), C_OrderLine_ID, trxName);
//
MRMALine rmaLine = null;
if (M_RMALine_ID > 0)
rmaLine = new MRMALine (Env.getCtx(), M_RMALine_ID, null);
//
MInOutLine inoutLine = null;
if (M_InOutLine_ID != 0)
{
@ -420,7 +443,7 @@ public class CreateFromInvoice extends CreateFrom
orderLine = new MOrderLine (Env.getCtx(), C_OrderLine_ID, trxName);
}
}
else
else if (C_OrderLine_ID > 0)
{
String whereClause = "EXISTS (SELECT 1 FROM M_InOut io WHERE io.M_InOut_ID=M_InOutLine.M_InOut_ID AND io.DocStatus IN ('CO','CL'))";
MInOutLine[] lines = MInOutLine.getOfOrderLine(Env.getCtx(),
@ -444,7 +467,33 @@ public class CreateFromInvoice extends CreateFrom
M_InOutLine_ID = inoutLine.getM_InOutLine_ID();
}
}
} // get Ship info
}
else if (M_RMALine_ID != 0)
{
String whereClause = "EXISTS (SELECT 1 FROM M_InOut io WHERE io.M_InOut_ID=M_InOutLine.M_InOut_ID AND io.DocStatus IN ('CO','CL'))";
MInOutLine[] lines = MInOutLine.getOfRMALine(Env.getCtx(), M_RMALine_ID, whereClause, null);
log.fine ("Receipt Lines with RMALine = #" + lines.length);
if (lines.length > 0)
{
for (int j = 0; j < lines.length; j++)
{
MInOutLine line = lines[j];
if (rmaLine.getQty().compareTo(QtyEntered) == 0)
{
inoutLine = line;
M_InOutLine_ID = inoutLine.getM_InOutLine_ID();
break;
}
}
if (rmaLine == null)
{
inoutLine = lines[0]; // first as default
M_InOutLine_ID = inoutLine.getM_InOutLine_ID();
}
}
}
// get Ship info
// Shipment Info
if (inoutLine != null)
@ -472,6 +521,14 @@ public class CreateFromInvoice extends CreateFrom
invoiceLine.setPrice();
invoiceLine.setTax();
}
//RMA Info
if (rmaLine != null)
{
invoiceLine.setRMALine(rmaLine); // overwrites
}
else
log.fine("No RMA Line");
}
invoiceLine.saveEx();
} // if selected

View File

@ -0,0 +1,130 @@
-- May 31, 2009 11:58:22 PM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Tab SET WhereClause='MovementType IN (''C-'', ''V-'')',Updated=TO_DATE('2009-05-31 23:58:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=257
;
-- May 31, 2009 11:58:58 PM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Tab SET WhereClause='MovementType IN (''V+'', ''C+'')',Updated=TO_DATE('2009-05-31 23:58:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=296
;
-- Jun 1, 2009 12:01:38 AM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'')',Updated=TO_DATE('2009-06-01 00:01:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125
;
-- Jun 1, 2009 12:07:49 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52053,'C_DocType.DocBaseType IN (''MMS'')',TO_DATE('2009-06-01 00:07:45','YYYY-MM-DD HH24:MI:SS'),100,'Document Type Material Shipments','D','Y','C_DocType Material Shipments','S',TO_DATE('2009-06-01 00:07:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:08:41 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52054,'C_DocType.DocBaseType IN (''MMR'')',TO_DATE('2009-06-01 00:08:39','YYYY-MM-DD HH24:MI:SS'),100,'Document Type Material Receipts','D','Y','C_DocType Material Receipts','S',TO_DATE('2009-06-01 00:08:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:10:25 AM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Field SET AD_Reference_ID=19, AD_Val_Rule_ID=52054,Updated=TO_DATE('2009-06-01 00:10:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3489
;
-- Jun 1, 2009 12:11:25 AM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Field SET AD_Reference_ID=19, AD_Val_Rule_ID=52053,Updated=TO_DATE('2009-06-01 00:11:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2931
;
-- Jun 1, 2009 12:17:54 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53866,0,'Ref_RMA_ID',TO_DATE('2009-06-01 00:17:47','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Referenced RMA','Ref RMA',TO_DATE('2009-06-01 00:17:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:17:54 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53866 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Jun 1, 2009 12:18:40 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53867,0,'Ref_RMALine_ID',TO_DATE('2009-06-01 00:18:37','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Referenced RMA Line','Ref RMA Line',TO_DATE('2009-06-01 00:18:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:18:40 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53867 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Jun 1, 2009 12:33:03 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,53306,TO_DATE('2009-06-01 00:33:01','YYYY-MM-DD HH24:MI:SS'),100,'RMA','D','Y','N','M_RMA',TO_DATE('2009-06-01 00:33:01','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- Jun 1, 2009 12:33:03 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53306 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID)
;
-- Jun 1, 2009 12:36:11 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,OrderByClause,Updated,UpdatedBy) VALUES (0,10841,10847,0,53306,661,TO_DATE('2009-06-01 00:36:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','M_RMA.DocumentNo',TO_DATE('2009-06-01 00:36:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:37:45 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57790,53866,0,30,53306,661,'Ref_RMA_ID',TO_DATE('2009-06-01 00:37:41','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Referenced RMA',0,TO_DATE('2009-06-01 00:37:41','YYYY-MM-DD HH24:MI:SS'),100,1.000000000000)
;
-- Jun 1, 2009 12:37:45 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57790 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 1, 2009 12:37:54 AM MYT
-- RMA Feature - ID: 1756793
ALTER TABLE M_RMA ADD Ref_RMA_ID NUMBER(10) DEFAULT NULL
;
-- Jun 1, 2009 12:41:24 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,53307,TO_DATE('2009-06-01 00:41:21','YYYY-MM-DD HH24:MI:SS'),100,'RMA Line','D',NULL,'Y','N','M_RMALine',TO_DATE('2009-06-01 00:41:21','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- Jun 1, 2009 12:41:24 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53307 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID)
;
-- Jun 1, 2009 12:41:52 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,52004,10831,0,53307,660,TO_DATE('2009-06-01 00:41:52','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_DATE('2009-06-01 00:41:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:43:30 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57791,53867,0,18,53307,660,'Ref_RMALine_ID',TO_DATE('2009-06-01 00:43:28','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Referenced RMA Line',0,TO_DATE('2009-06-01 00:43:28','YYYY-MM-DD HH24:MI:SS'),100,1.000000000000)
;
-- Jun 1, 2009 12:43:30 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57791 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 1, 2009 12:47:11 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57792,529,0,29,660,'QtyInvoiced',TO_DATE('2009-06-01 00:47:09','YYYY-MM-DD HH24:MI:SS'),100,'Invoiced Quantity','D',22,'The Invoiced Quantity indicates the quantity of a product that have been invoiced.','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Quantity Invoiced',0,TO_DATE('2009-06-01 00:47:09','YYYY-MM-DD HH24:MI:SS'),100,1.000000000000)
;
-- Jun 1, 2009 12:47:11 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57792 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 1, 2009 12:47:30 AM MYT
-- RMA Feature - ID: 1756793
ALTER TABLE M_RMALine ADD QtyInvoiced NUMBER DEFAULT NULL
;
-- Jun 1, 2009 12:49:19 AM MYT
-- RMA Feature - ID: 1756793
ALTER TABLE M_RMALine ADD Ref_RMALine_ID NUMBER(10) DEFAULT NULL
;

View File

@ -0,0 +1,130 @@
-- May 31, 2009 11:58:22 PM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Tab SET WhereClause='MovementType IN (''C-'', ''V-'')',Updated=TO_TIMESTAMP('2009-05-31 23:58:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=257
;
-- May 31, 2009 11:58:58 PM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Tab SET WhereClause='MovementType IN (''V+'', ''C+'')',Updated=TO_TIMESTAMP('2009-05-31 23:58:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=296
;
-- Jun 1, 2009 12:01:38 AM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Val_Rule SET Code='C_DocType.DocBaseType IN (''MMR'', ''MMS'')',Updated=TO_TIMESTAMP('2009-06-01 00:01:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=125
;
-- Jun 1, 2009 12:07:49 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52053,'C_DocType.DocBaseType IN (''MMS'')',TO_TIMESTAMP('2009-06-01 00:07:45','YYYY-MM-DD HH24:MI:SS'),100,'Document Type Material Shipments','D','Y','C_DocType Material Shipments','S',TO_TIMESTAMP('2009-06-01 00:07:45','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:08:41 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,52054,'C_DocType.DocBaseType IN (''MMR'')',TO_TIMESTAMP('2009-06-01 00:08:39','YYYY-MM-DD HH24:MI:SS'),100,'Document Type Material Receipts','D','Y','C_DocType Material Receipts','S',TO_TIMESTAMP('2009-06-01 00:08:39','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:10:25 AM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Field SET AD_Reference_ID=19, AD_Val_Rule_ID=52054,Updated=TO_TIMESTAMP('2009-06-01 00:10:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=3489
;
-- Jun 1, 2009 12:11:25 AM MYT
-- RMA Feature - ID: 1756793
UPDATE AD_Field SET AD_Reference_ID=19, AD_Val_Rule_ID=52053,Updated=TO_TIMESTAMP('2009-06-01 00:11:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2931
;
-- Jun 1, 2009 12:17:54 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53866,0,'Ref_RMA_ID',TO_TIMESTAMP('2009-06-01 00:17:47','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Referenced RMA','Ref RMA',TO_TIMESTAMP('2009-06-01 00:17:47','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:17:54 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53866 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Jun 1, 2009 12:18:40 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,53867,0,'Ref_RMALine_ID',TO_TIMESTAMP('2009-06-01 00:18:37','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Referenced RMA Line','Ref RMA Line',TO_TIMESTAMP('2009-06-01 00:18:37','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:18:40 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=53867 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Jun 1, 2009 12:33:03 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,53306,TO_TIMESTAMP('2009-06-01 00:33:01','YYYY-MM-DD HH24:MI:SS'),100,'RMA','D','Y','N','M_RMA',TO_TIMESTAMP('2009-06-01 00:33:01','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- Jun 1, 2009 12:33:03 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53306 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID)
;
-- Jun 1, 2009 12:36:11 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,OrderByClause,Updated,UpdatedBy) VALUES (0,10841,10847,0,53306,661,TO_TIMESTAMP('2009-06-01 00:36:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','M_RMA.DocumentNo',TO_TIMESTAMP('2009-06-01 00:36:11','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:37:45 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57790,53866,0,30,53306,661,'Ref_RMA_ID',TO_TIMESTAMP('2009-06-01 00:37:41','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Referenced RMA',0,TO_TIMESTAMP('2009-06-01 00:37:41','YYYY-MM-DD HH24:MI:SS'),100,1.000000000000)
;
-- Jun 1, 2009 12:37:45 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57790 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 1, 2009 12:37:54 AM MYT
-- RMA Feature - ID: 1756793
ALTER TABLE M_RMA ADD COLUMN Ref_RMA_ID NUMERIC(10) DEFAULT NULL
;
-- Jun 1, 2009 12:41:24 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference (AD_Client_ID,AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType) VALUES (0,0,53307,TO_TIMESTAMP('2009-06-01 00:41:21','YYYY-MM-DD HH24:MI:SS'),100,'RMA Line','D',NULL,'Y','N','M_RMALine',TO_TIMESTAMP('2009-06-01 00:41:21','YYYY-MM-DD HH24:MI:SS'),100,'T')
;
-- Jun 1, 2009 12:41:24 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53307 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID)
;
-- Jun 1, 2009 12:41:52 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Ref_Table (AD_Client_ID,AD_Display,AD_Key,AD_Org_ID,AD_Reference_ID,AD_Table_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy) VALUES (0,52004,10831,0,53307,660,TO_TIMESTAMP('2009-06-01 00:41:52','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_TIMESTAMP('2009-06-01 00:41:52','YYYY-MM-DD HH24:MI:SS'),100)
;
-- Jun 1, 2009 12:43:30 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Reference_Value_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57791,53867,0,18,53307,660,'Ref_RMALine_ID',TO_TIMESTAMP('2009-06-01 00:43:28','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Referenced RMA Line',0,TO_TIMESTAMP('2009-06-01 00:43:28','YYYY-MM-DD HH24:MI:SS'),100,1.000000000000)
;
-- Jun 1, 2009 12:43:30 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57791 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 1, 2009 12:47:11 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version) VALUES (0,57792,529,0,29,660,'QtyInvoiced',TO_TIMESTAMP('2009-06-01 00:47:09','YYYY-MM-DD HH24:MI:SS'),100,'Invoiced Quantity','D',22,'The Invoiced Quantity indicates the quantity of a product that have been invoiced.','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Quantity Invoiced',0,TO_TIMESTAMP('2009-06-01 00:47:09','YYYY-MM-DD HH24:MI:SS'),100,1.000000000000)
;
-- Jun 1, 2009 12:47:11 AM MYT
-- RMA Feature - ID: 1756793
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=57792 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Jun 1, 2009 12:47:30 AM MYT
-- RMA Feature - ID: 1756793
ALTER TABLE M_RMALine ADD COLUMN QtyInvoiced NUMERIC DEFAULT NULL
;
-- Jun 1, 2009 12:49:19 AM MYT
-- RMA Feature - ID: 1756793
ALTER TABLE M_RMALine ADD COLUMN Ref_RMALine_ID NUMERIC(10) DEFAULT NULL
;