BF [ 1745154 ] Cost in Reversing Material Related Docs

This commit is contained in:
armenrz 2008-09-28 12:21:17 +00:00
parent 515ee6640a
commit f1df305ce4
16 changed files with 3717 additions and 3265 deletions

View File

@ -26,6 +26,8 @@ import org.compiere.util.*;
* Standard Document Line
*
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
* @version $Id: DocLine.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $
*/
public class DocLine
@ -1034,6 +1036,29 @@ public class DocLine
return 0;
} // getValue
//AZ Goodwill
private int m_ReversalLine_ID = 0;
/**
* Set ReversalLine_ID
* store original (voided/reversed) document line
* @param ReversalLine_ID
*/
public void setReversalLine_ID (int ReversalLine_ID)
{
m_ReversalLine_ID = ReversalLine_ID;
} // setReversalLine_ID
/**
* Get ReversalLine_ID
* get original (voided/reversed) document line
* @return ReversalLine_ID
*/
public int getReversalLine_ID()
{
return m_ReversalLine_ID;
} // getReversalLine_ID
//end AZ Goodwill
/**
* String representation
* @return String

View File

@ -32,6 +32,8 @@ import org.compiere.util.*;
* Document Types: MMS, MMR
* </pre>
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
* @version $Id: Doc_InOut.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
*/
public class Doc_InOut extends Doc
@ -47,6 +49,9 @@ public class Doc_InOut extends Doc
super (ass, MInOut.class, rs, null, trxName);
} // DocInOut
private int m_Reversal_ID = 0;
private String m_DocStatus = "";
/**
* Load Document Details
* @return error message or null
@ -56,6 +61,8 @@ public class Doc_InOut extends Doc
setC_Currency_ID(NO_CURRENCY);
MInOut inout = (MInOut)getPO();
setDateDoc (inout.getMovementDate());
m_Reversal_ID = inout.getReversal_ID();//store original (voided/reversed) document
m_DocStatus = inout.getDocStatus();
// Contained Objects
p_lines = loadLines(inout);
log.fine("Lines=" + p_lines.length);
@ -84,6 +91,7 @@ public class Doc_InOut extends Doc
DocLine docLine = new DocLine (line, this);
BigDecimal Qty = line.getMovementQty();
docLine.setReversalLine_ID(line.getReversalLine_ID());
docLine.setQty (Qty, getDocumentType().equals(DOCTYPE_MatShipment)); // sets Trx and Storage Qty
//
log.fine(docLine.toString());
@ -172,6 +180,17 @@ public class Doc_InOut extends Doc
dr.setLocationFromBPartner(getC_BPartner_Location_ID(), false); // to Loc
dr.setAD_Org_ID(line.getOrder_Org_ID()); // Revenue X-Org
dr.setQty(line.getQty().negate());
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed)
&& m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctDr from Original Shipment/Receipt
if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Shipment/Receipt not posted yet";
return null;
}
}
// Inventory CR
cr = fact.createLine(line,
@ -186,6 +205,18 @@ public class Doc_InOut extends Doc
cr.setM_Locator_ID(line.getM_Locator_ID());
cr.setLocationFromLocator(line.getM_Locator_ID(), true); // from Loc
cr.setLocationFromBPartner(getC_BPartner_Location_ID(), false); // to Loc
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed)
&& m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Shipment/Receipt
if (!cr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Shipment/Receipt not posted yet";
return null;
}
costs = cr.getAcctBalance(); //get original cost
}
//
if (line.getM_Product_ID() != 0)
{
@ -241,13 +272,25 @@ public class Doc_InOut extends Doc
as.getC_Currency_ID(), costs, null);
if (dr == null)
{
p_Error = "FactLine CR not created: " + line;
p_Error = "FactLine DR not created: " + line;
log.log(Level.WARNING, p_Error);
return null;
}
dr.setM_Locator_ID(line.getM_Locator_ID());
dr.setLocationFromLocator(line.getM_Locator_ID(), true); // from Loc
dr.setLocationFromBPartner(getC_BPartner_Location_ID(), false); // to Loc
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed)
&& m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctDr from Original Shipment/Receipt
if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Shipment/Receipt not posted yet";
return null;
}
costs = dr.getAcctBalance(); //get original cost
}
//
if (line.getM_Product_ID() != 0)
{
@ -264,7 +307,7 @@ public class Doc_InOut extends Doc
as.getC_Currency_ID(), null, costs);
if (cr == null)
{
p_Error = "FactLine DR not created: " + line;
p_Error = "FactLine CR not created: " + line;
log.log(Level.WARNING, p_Error);
return null;
}
@ -273,8 +316,17 @@ public class Doc_InOut extends Doc
cr.setLocationFromBPartner(getC_BPartner_Location_ID(), false); // to Loc
cr.setAD_Org_ID(line.getOrder_Org_ID()); // Revenue X-Org
cr.setQty(line.getQty().negate());
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed)
&& m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Shipment/Receipt
if (!cr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Shipment/Receipt not posted yet";
return null;
}
}
} // for all lines
updateProductInfo(as.getC_AcctSchema_ID()); // only for SO!
} // Sales Return
@ -344,6 +396,17 @@ public class Doc_InOut extends Doc
dr.setM_Locator_ID(line.getM_Locator_ID());
dr.setLocationFromBPartner(getC_BPartner_Location_ID(), true); // from Loc
dr.setLocationFromLocator(line.getM_Locator_ID(), false); // to Loc
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctDr from Original Shipment/Receipt
if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Receipt not posted yet";
return null;
}
}
// NotInvoicedReceipt CR
// Elaine 2008/06/26
/*cr = fact.createLine(line,
@ -363,6 +426,16 @@ public class Doc_InOut extends Doc
cr.setLocationFromBPartner(getC_BPartner_Location_ID(), true); // from Loc
cr.setLocationFromLocator(line.getM_Locator_ID(), false); // to Loc
cr.setQty(line.getQty().negate());
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Shipment/Receipt
if (!cr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Receipt not posted yet";
return null;
}
}
}
} // Receipt
// *** Purchasing - return
@ -424,6 +497,16 @@ public class Doc_InOut extends Doc
dr.setLocationFromBPartner(getC_BPartner_Location_ID(), true); // from Loc
dr.setLocationFromLocator(line.getM_Locator_ID(), false); // to Loc
dr.setQty(line.getQty().negate());
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctDr from Original Shipment/Receipt
if (!dr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Receipt not posted yet";
return null;
}
}
// Inventory/Asset CR
MAccount assets = line.getAccount(ProductCost.ACCTTYPE_P_Asset, as);
@ -444,7 +527,16 @@ public class Doc_InOut extends Doc
cr.setM_Locator_ID(line.getM_Locator_ID());
cr.setLocationFromBPartner(getC_BPartner_Location_ID(), true); // from Loc
cr.setLocationFromLocator(line.getM_Locator_ID(), false); // to Loc
if (m_DocStatus.equals(MInOut.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Shipment/Receipt
if (!cr.updateReverseLine (MInOut.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Receipt not posted yet";
return null;
}
}
}
} // Purchasing Return
else

View File

@ -30,10 +30,15 @@ import org.compiere.util.*;
* Document Types: MMI
* </pre>
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
* @version $Id: Doc_Inventory.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
*/
public class Doc_Inventory extends Doc
{
private int m_Reversal_ID = 0;
private String m_DocStatus = "";
/**
* Constructor
* @param ass accounting schemata
@ -55,6 +60,8 @@ public class Doc_Inventory extends Doc
MInventory inventory = (MInventory)getPO();
setDateDoc (inventory.getMovementDate());
setDateAcct(inventory.getMovementDate());
m_Reversal_ID = inventory.getReversal_ID();//store original (voided/reversed) document
m_DocStatus = inventory.getDocStatus();
// Contained Objects
p_lines = loadLines(inventory);
log.fine("Lines=" + p_lines.length);
@ -89,7 +96,7 @@ public class Doc_Inventory extends Doc
Qty = QtyCount.subtract(QtyBook);
}
docLine.setQty (Qty, false); // -5 => -5
//
docLine.setReversalLine_ID(line.getReversalLine_ID());
log.fine(docLine.toString());
list.add (docLine);
}
@ -151,6 +158,16 @@ public class Doc_Inventory extends Doc
if (dr == null)
continue;
dr.setM_Locator_ID(line.getM_Locator_ID());
if (m_DocStatus.equals(MInventory.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctDr from Original Phys.Inventory
if (!dr.updateReverseLine (MInventory.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Physical Inventory not posted yet";
return null;
}
}
// InventoryDiff DR CR
// or Charge
@ -165,6 +182,17 @@ public class Doc_Inventory extends Doc
cr.setQty(line.getQty().negate());
if (line.getC_Charge_ID() != 0) // explicit overwrite for charge
cr.setAD_Org_ID(line.getAD_Org_ID());
if (m_DocStatus.equals(MInventory.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Phys.Inventory
if (!cr.updateReverseLine (MInventory.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Physical Inventory not posted yet";
return null;
}
costs = cr.getAcctBalance(); //get original cost
}
// Cost Detail
MCostDetail.createInventory(as, line.getAD_Org_ID(),

View File

@ -30,10 +30,15 @@ import org.compiere.util.*;
* Document Types: MMM
* </pre>
* @author Jorg Janke
* @author Armen Rizal, Goodwill Consulting
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
* @version $Id: Doc_Movement.java,v 1.3 2006/07/30 00:53:33 jjanke Exp $
*/
public class Doc_Movement extends Doc
{
private int m_Reversal_ID = 0;
private String m_DocStatus = "";
/**
* Constructor
* @param ass accounting schemata
@ -55,6 +60,8 @@ public class Doc_Movement extends Doc
MMovement move = (MMovement)getPO();
setDateDoc (move.getMovementDate());
setDateAcct(move.getMovementDate());
m_Reversal_ID = move.getReversal_ID();//store original (voided/reversed) document
m_DocStatus = move.getDocStatus();
// Contained Objects
p_lines = loadLines(move);
log.fine("Lines=" + p_lines.length);
@ -75,7 +82,7 @@ public class Doc_Movement extends Doc
MMovementLine line = lines[i];
DocLine docLine = new DocLine (line, this);
docLine.setQty(line.getMovementQty(), false);
//
docLine.setReversalLine_ID(line.getReversalLine_ID());
log.fine(docLine.toString());
list.add (docLine);
}
@ -133,6 +140,16 @@ public class Doc_Movement extends Doc
continue;
dr.setM_Locator_ID(line.getM_Locator_ID());
dr.setQty(line.getQty().negate()); // outgoing
if (m_DocStatus.equals(MMovement.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctDr from Original Movement
if (!dr.updateReverseLine (MMovement.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Inventory Move not posted yet";
return null;
}
}
// ** InventoryTo DR CR
cr = fact.createLine(line,
@ -142,6 +159,17 @@ public class Doc_Movement extends Doc
continue;
cr.setM_Locator_ID(line.getM_LocatorTo_ID());
cr.setQty(line.getQty());
if (m_DocStatus.equals(MMovement.DOCSTATUS_Reversed) && m_Reversal_ID !=0 && line.getReversalLine_ID() != 0)
{
// Set AmtAcctCr from Original Movement
if (!cr.updateReverseLine (MMovement.Table_ID,
m_Reversal_ID, line.getReversalLine_ID(),Env.ONE))
{
p_Error = "Original Inventory Move not posted yet";
return null;
}
costs = cr.getAcctBalance(); //get original cost
}
// Only for between-org movements
if (dr.getAD_Org_ID() != cr.getAD_Org_ID())

File diff suppressed because it is too large Load Diff

View File

@ -110,19 +110,6 @@ public interface I_M_InOutLine
public I_C_Charge getC_Charge() throws Exception;
/** Column name ConfirmedQty */
public static final String COLUMNNAME_ConfirmedQty = "ConfirmedQty";
/** Set Confirmed Quantity.
* Confirmation of a received quantity
*/
public void setConfirmedQty (BigDecimal ConfirmedQty);
/** Get Confirmed Quantity.
* Confirmation of a received quantity
*/
public BigDecimal getConfirmedQty();
/** Column name C_OrderLine_ID */
public static final String COLUMNNAME_C_OrderLine_ID = "C_OrderLine_ID";
@ -138,21 +125,6 @@ public interface I_M_InOutLine
public I_C_OrderLine getC_OrderLine() throws Exception;
/** Column name C_Project_ID */
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
/** Set Project.
* Financial Project
*/
public void setC_Project_ID (int C_Project_ID);
/** Get Project.
* Financial Project
*/
public int getC_Project_ID();
public I_C_Project getC_Project() throws Exception;
/** Column name C_ProjectPhase_ID */
public static final String COLUMNNAME_C_ProjectPhase_ID = "C_ProjectPhase_ID";
@ -183,6 +155,21 @@ public interface I_M_InOutLine
public I_C_ProjectTask getC_ProjectTask() throws Exception;
/** Column name C_Project_ID */
public static final String COLUMNNAME_C_Project_ID = "C_Project_ID";
/** Set Project.
* Financial Project
*/
public void setC_Project_ID (int C_Project_ID);
/** Get Project.
* Financial Project
*/
public int getC_Project_ID();
public I_C_Project getC_Project() throws Exception;
/** Column name C_UOM_ID */
public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID";
@ -198,6 +185,19 @@ public interface I_M_InOutLine
public I_C_UOM getC_UOM() throws Exception;
/** Column name ConfirmedQty */
public static final String COLUMNNAME_ConfirmedQty = "ConfirmedQty";
/** Set Confirmed Quantity.
* Confirmation of a received quantity
*/
public void setConfirmedQty (BigDecimal ConfirmedQty);
/** Get Confirmed Quantity.
* Confirmation of a received quantity
*/
public BigDecimal getConfirmedQty();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
@ -263,6 +263,19 @@ public interface I_M_InOutLine
*/
public int getM_AttributeSetInstance_ID();
/** Column name M_InOutLine_ID */
public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID";
/** Set Shipment/Receipt Line.
* Line on Shipment or Receipt document
*/
public void setM_InOutLine_ID (int M_InOutLine_ID);
/** Get Shipment/Receipt Line.
* Line on Shipment or Receipt document
*/
public int getM_InOutLine_ID();
/** Column name M_InOut_ID */
public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID";
@ -278,19 +291,6 @@ public interface I_M_InOutLine
public I_M_InOut getM_InOut() throws Exception;
/** Column name M_InOutLine_ID */
public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID";
/** Set Shipment/Receipt Line.
* Line on Shipment or Receipt document
*/
public void setM_InOutLine_ID (int M_InOutLine_ID);
/** Get Shipment/Receipt Line.
* Line on Shipment or Receipt document
*/
public int getM_InOutLine_ID();
/** Column name M_Locator_ID */
public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID";
@ -304,19 +304,6 @@ public interface I_M_InOutLine
*/
public int getM_Locator_ID();
/** Column name MovementQty */
public static final String COLUMNNAME_MovementQty = "MovementQty";
/** Set Movement Quantity.
* Quantity of a product moved.
*/
public void setMovementQty (BigDecimal MovementQty);
/** Get Movement Quantity.
* Quantity of a product moved.
*/
public BigDecimal getMovementQty();
/** Column name M_Product_ID */
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
@ -347,6 +334,19 @@ public interface I_M_InOutLine
public I_M_RMALine getM_RMALine() throws Exception;
/** Column name MovementQty */
public static final String COLUMNNAME_MovementQty = "MovementQty";
/** Set Movement Quantity.
* Quantity of a product moved.
*/
public void setMovementQty (BigDecimal MovementQty);
/** Get Movement Quantity.
* Quantity of a product moved.
*/
public BigDecimal getMovementQty();
/** Column name PickedQty */
public static final String COLUMNNAME_PickedQty = "PickedQty";
@ -391,6 +391,19 @@ public interface I_M_InOutLine
/** Get Referenced Shipment Line */
public int getRef_InOutLine_ID();
/** Column name ReversalLine_ID */
public static final String COLUMNNAME_ReversalLine_ID = "ReversalLine_ID";
/** Set Reversal Line.
* Use to keep the reversal line ID for reversing costing purpose
*/
public void setReversalLine_ID (int ReversalLine_ID);
/** Get Reversal Line.
* Use to keep the reversal line ID for reversing costing purpose
*/
public int getReversalLine_ID();
/** Column name ScrappedQty */
public static final String COLUMNNAME_ScrappedQty = "ScrappedQty";

View File

@ -119,6 +119,19 @@ public interface I_M_InventoryLine
*/
public int getM_AttributeSetInstance_ID();
/** Column name M_InventoryLine_ID */
public static final String COLUMNNAME_M_InventoryLine_ID = "M_InventoryLine_ID";
/** Set Phys.Inventory Line.
* Unique line in an Inventory document
*/
public void setM_InventoryLine_ID (int M_InventoryLine_ID);
/** Get Phys.Inventory Line.
* Unique line in an Inventory document
*/
public int getM_InventoryLine_ID();
/** Column name M_Inventory_ID */
public static final String COLUMNNAME_M_Inventory_ID = "M_Inventory_ID";
@ -134,19 +147,6 @@ public interface I_M_InventoryLine
public I_M_Inventory getM_Inventory() throws Exception;
/** Column name M_InventoryLine_ID */
public static final String COLUMNNAME_M_InventoryLine_ID = "M_InventoryLine_ID";
/** Set Phys.Inventory Line.
* Unique line in an Inventory document
*/
public void setM_InventoryLine_ID (int M_InventoryLine_ID);
/** Get Phys.Inventory Line.
* Unique line in an Inventory document
*/
public int getM_InventoryLine_ID();
/** Column name M_Locator_ID */
public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID";
@ -225,6 +225,19 @@ public interface I_M_InventoryLine
*/
public BigDecimal getQtyInternalUse();
/** Column name ReversalLine_ID */
public static final String COLUMNNAME_ReversalLine_ID = "ReversalLine_ID";
/** Set Reversal Line.
* Use to keep the reversal line ID for reversing costing purpose
*/
public void setReversalLine_ID (int ReversalLine_ID);
/** Get Reversal Line.
* Use to keep the reversal line ID for reversing costing purpose
*/
public int getReversalLine_ID();
/** Column name UPC */
public static final String COLUMNNAME_UPC = "UPC";

View File

@ -221,6 +221,19 @@ public interface I_M_MovementLine
*/
public boolean isProcessed();
/** Column name ReversalLine_ID */
public static final String COLUMNNAME_ReversalLine_ID = "ReversalLine_ID";
/** Set Reversal Line.
* Use to keep the reversal line ID for reversing costing purpose
*/
public void setReversalLine_ID (int ReversalLine_ID);
/** Get Reversal Line.
* Use to keep the reversal line ID for reversing costing purpose
*/
public int getReversalLine_ID();
/** Column name ScrappedQty */
public static final String COLUMNNAME_ScrappedQty = "ScrappedQty";

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,8 @@ import org.compiere.util.*;
* @version $Id: MInventory.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
* @author victor.perez@e-evolution.com, e-Evolution
* <li>FR [ 1948157 ] Is necessary the reference for document reverse
* @author Armen Rizal, Goodwill Consulting
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962
*/
public class MInventory extends X_M_Inventory implements DocAction
@ -1013,6 +1015,9 @@ public class MInventory extends X_M_Inventory implements DocAction
copyValues(oLine, rLine, oLine.getAD_Client_ID(), oLine.getAD_Org_ID());
rLine.setM_Inventory_ID(reversal.getM_Inventory_ID());
rLine.setParent(reversal);
//AZ Goodwill
// store original (voided/reversed) document line
rLine.setReversalLine_ID(oLine.getM_InventoryLine_ID());
//
rLine.setQtyBook (oLine.getQtyCount()); // switch
rLine.setQtyCount (oLine.getQtyBook());

View File

@ -32,6 +32,8 @@ import org.eevolution.model.*;
* @author victor.perez@e-evolution.com, e-Evolution
* <li>FR [ 1948157 ] Is necessary the reference for document reverse
* @see http://sourceforge.net/tracker/?func=detail&atid=879335&aid=1948157&group_id=176962
* @author Armen Rizal, Goodwill Consulting
* <li>BF [ 1745154 ] Cost in Reversing Material Related Docs
* @version $Id: MMovement.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
*/
public class MMovement extends X_M_Movement implements DocAction
@ -882,6 +884,9 @@ public class MMovement extends X_M_Movement implements DocAction
MMovementLine rLine = new MMovementLine(getCtx(), 0, get_TrxName());
copyValues(oLine, rLine, oLine.getAD_Client_ID(), oLine.getAD_Org_ID());
rLine.setM_Movement_ID(reversal.getM_Movement_ID());
//AZ Goodwill
// store original (voided/reversed) document line
rLine.setReversalLine_ID(oLine.getM_MovementLine_ID());
//
rLine.setMovementQty(rLine.getMovementQty().negate());
rLine.setTargetQty(Env.ZERO);

View File

@ -50,8 +50,8 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
setLine (0);
// @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_InOutLine WHERE M_InOut_ID=@M_InOut_ID@
setM_AttributeSetInstance_ID (0);
setM_InOut_ID (0);
setM_InOutLine_ID (0);
setM_InOut_ID (0);
setM_Locator_ID (0);
// @M_Locator_ID@
setMovementQty (Env.ZERO);
@ -232,26 +232,6 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** Set Confirmed Quantity.
@param ConfirmedQty
Confirmation of a received quantity
*/
public void setConfirmedQty (BigDecimal ConfirmedQty)
{
set_Value (COLUMNNAME_ConfirmedQty, ConfirmedQty);
}
/** Get Confirmed Quantity.
@return Confirmation of a received quantity
*/
public BigDecimal getConfirmedQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ConfirmedQty);
if (bd == null)
return Env.ZERO;
return bd;
}
public I_C_OrderLine getC_OrderLine() throws Exception
{
Class<?> clazz = MTable.getClass(I_C_OrderLine.Table_Name);
@ -291,45 +271,6 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
public I_C_Project getC_Project() throws Exception
{
Class<?> clazz = MTable.getClass(I_C_Project.Table_Name);
I_C_Project result = null;
try {
Constructor<?> constructor = null;
constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class});
result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_ID()), get_TrxName()});
} catch (Exception e) {
log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e);
log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz);
throw e;
}
return result;
}
/** Set Project.
@param C_Project_ID
Financial Project
*/
public void setC_Project_ID (int C_Project_ID)
{
if (C_Project_ID < 1)
set_Value (COLUMNNAME_C_Project_ID, null);
else
set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID));
}
/** Get Project.
@return Financial Project
*/
public int getC_Project_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_C_ProjectPhase getC_ProjectPhase() throws Exception
{
Class<?> clazz = MTable.getClass(I_C_ProjectPhase.Table_Name);
@ -408,6 +349,45 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
public I_C_Project getC_Project() throws Exception
{
Class<?> clazz = MTable.getClass(I_C_Project.Table_Name);
I_C_Project result = null;
try {
Constructor<?> constructor = null;
constructor = clazz.getDeclaredConstructor(new Class[]{Properties.class, int.class, String.class});
result = (I_C_Project)constructor.newInstance(new Object[] {getCtx(), new Integer(getC_Project_ID()), get_TrxName()});
} catch (Exception e) {
log.log(Level.SEVERE, "(id) - Table=" + Table_Name + ",Class=" + clazz, e);
log.saveError("Error", "Table=" + Table_Name + ",Class=" + clazz);
throw e;
}
return result;
}
/** Set Project.
@param C_Project_ID
Financial Project
*/
public void setC_Project_ID (int C_Project_ID)
{
if (C_Project_ID < 1)
set_Value (COLUMNNAME_C_Project_ID, null);
else
set_Value (COLUMNNAME_C_Project_ID, Integer.valueOf(C_Project_ID));
}
/** Get Project.
@return Financial Project
*/
public int getC_Project_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Project_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_C_UOM getC_UOM() throws Exception
{
Class<?> clazz = MTable.getClass(I_C_UOM.Table_Name);
@ -446,6 +426,26 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** Set Confirmed Quantity.
@param ConfirmedQty
Confirmation of a received quantity
*/
public void setConfirmedQty (BigDecimal ConfirmedQty)
{
set_Value (COLUMNNAME_ConfirmedQty, ConfirmedQty);
}
/** Get Confirmed Quantity.
@return Confirmation of a received quantity
*/
public BigDecimal getConfirmedQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_ConfirmedQty);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Description.
@param Description
Optional short description of the record
@ -561,6 +561,28 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** Set Shipment/Receipt Line.
@param M_InOutLine_ID
Line on Shipment or Receipt document
*/
public void setM_InOutLine_ID (int M_InOutLine_ID)
{
if (M_InOutLine_ID < 1)
throw new IllegalArgumentException ("M_InOutLine_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_InOutLine_ID, Integer.valueOf(M_InOutLine_ID));
}
/** Get Shipment/Receipt Line.
@return Line on Shipment or Receipt document
*/
public int getM_InOutLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_InOutLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_InOut getM_InOut() throws Exception
{
Class<?> clazz = MTable.getClass(I_M_InOut.Table_Name);
@ -599,28 +621,6 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** Set Shipment/Receipt Line.
@param M_InOutLine_ID
Line on Shipment or Receipt document
*/
public void setM_InOutLine_ID (int M_InOutLine_ID)
{
if (M_InOutLine_ID < 1)
throw new IllegalArgumentException ("M_InOutLine_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_InOutLine_ID, Integer.valueOf(M_InOutLine_ID));
}
/** Get Shipment/Receipt Line.
@return Line on Shipment or Receipt document
*/
public int getM_InOutLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_InOutLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Locator.
@param M_Locator_ID
Warehouse Locator
@ -643,28 +643,6 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** Set Movement Quantity.
@param MovementQty
Quantity of a product moved.
*/
public void setMovementQty (BigDecimal MovementQty)
{
if (MovementQty == null)
throw new IllegalArgumentException ("MovementQty is mandatory.");
set_Value (COLUMNNAME_MovementQty, MovementQty);
}
/** Get Movement Quantity.
@return Quantity of a product moved.
*/
public BigDecimal getMovementQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MovementQty);
if (bd == null)
return Env.ZERO;
return bd;
}
public I_M_Product getM_Product() throws Exception
{
Class<?> clazz = MTable.getClass(I_M_Product.Table_Name);
@ -743,6 +721,28 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** Set Movement Quantity.
@param MovementQty
Quantity of a product moved.
*/
public void setMovementQty (BigDecimal MovementQty)
{
if (MovementQty == null)
throw new IllegalArgumentException ("MovementQty is mandatory.");
set_Value (COLUMNNAME_MovementQty, MovementQty);
}
/** Get Movement Quantity.
@return Quantity of a product moved.
*/
public BigDecimal getMovementQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_MovementQty);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Picked Quantity.
@param PickedQty Picked Quantity */
public void setPickedQty (BigDecimal PickedQty)
@ -826,6 +826,31 @@ public class X_M_InOutLine extends PO implements I_M_InOutLine, I_Persistent
return ii.intValue();
}
/** ReversalLine_ID AD_Reference_ID=295 */
public static final int REVERSALLINE_ID_AD_Reference_ID=295;
/** Set Reversal Line.
@param ReversalLine_ID
Use to keep the reversal line ID for reversing costing purpose
*/
public void setReversalLine_ID (int ReversalLine_ID)
{
if (ReversalLine_ID < 1)
set_Value (COLUMNNAME_ReversalLine_ID, null);
else
set_Value (COLUMNNAME_ReversalLine_ID, Integer.valueOf(ReversalLine_ID));
}
/** Get Reversal Line.
@return Use to keep the reversal line ID for reversing costing purpose
*/
public int getReversalLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_ReversalLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Scrapped Quantity.
@param ScrappedQty
The Quantity scrapped due to QA issues

View File

@ -45,8 +45,8 @@ public class X_M_InventoryLine extends PO implements I_M_InventoryLine, I_Persis
setInventoryType (null);
// D
setM_AttributeSetInstance_ID (0);
setM_Inventory_ID (0);
setM_InventoryLine_ID (0);
setM_Inventory_ID (0);
setM_Locator_ID (0);
// @M_Locator_ID@
setM_Product_ID (0);
@ -214,6 +214,28 @@ public class X_M_InventoryLine extends PO implements I_M_InventoryLine, I_Persis
return ii.intValue();
}
/** Set Phys.Inventory Line.
@param M_InventoryLine_ID
Unique line in an Inventory document
*/
public void setM_InventoryLine_ID (int M_InventoryLine_ID)
{
if (M_InventoryLine_ID < 1)
throw new IllegalArgumentException ("M_InventoryLine_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_InventoryLine_ID, Integer.valueOf(M_InventoryLine_ID));
}
/** Get Phys.Inventory Line.
@return Unique line in an Inventory document
*/
public int getM_InventoryLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_InventoryLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_M_Inventory getM_Inventory() throws Exception
{
Class<?> clazz = MTable.getClass(I_M_Inventory.Table_Name);
@ -252,28 +274,6 @@ public class X_M_InventoryLine extends PO implements I_M_InventoryLine, I_Persis
return ii.intValue();
}
/** Set Phys.Inventory Line.
@param M_InventoryLine_ID
Unique line in an Inventory document
*/
public void setM_InventoryLine_ID (int M_InventoryLine_ID)
{
if (M_InventoryLine_ID < 1)
throw new IllegalArgumentException ("M_InventoryLine_ID is mandatory.");
set_ValueNoCheck (COLUMNNAME_M_InventoryLine_ID, Integer.valueOf(M_InventoryLine_ID));
}
/** Get Phys.Inventory Line.
@return Unique line in an Inventory document
*/
public int getM_InventoryLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_InventoryLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Locator.
@param M_Locator_ID
Warehouse Locator
@ -408,6 +408,31 @@ public class X_M_InventoryLine extends PO implements I_M_InventoryLine, I_Persis
return bd;
}
/** ReversalLine_ID AD_Reference_ID=296 */
public static final int REVERSALLINE_ID_AD_Reference_ID=296;
/** Set Reversal Line.
@param ReversalLine_ID
Use to keep the reversal line ID for reversing costing purpose
*/
public void setReversalLine_ID (int ReversalLine_ID)
{
if (ReversalLine_ID < 1)
set_Value (COLUMNNAME_ReversalLine_ID, null);
else
set_Value (COLUMNNAME_ReversalLine_ID, Integer.valueOf(ReversalLine_ID));
}
/** Get Reversal Line.
@return Use to keep the reversal line ID for reversing costing purpose
*/
public int getReversalLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_ReversalLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set UPC/EAN.
@param UPC
Bar Code (Universal Product Code or its superset European Article Number)

View File

@ -410,6 +410,31 @@ public class X_M_MovementLine extends PO implements I_M_MovementLine, I_Persiste
return false;
}
/** ReversalLine_ID AD_Reference_ID=53284 */
public static final int REVERSALLINE_ID_AD_Reference_ID=53284;
/** Set Reversal Line.
@param ReversalLine_ID
Use to keep the reversal line ID for reversing costing purpose
*/
public void setReversalLine_ID (int ReversalLine_ID)
{
if (ReversalLine_ID < 1)
set_Value (COLUMNNAME_ReversalLine_ID, null);
else
set_Value (COLUMNNAME_ReversalLine_ID, Integer.valueOf(ReversalLine_ID));
}
/** Get Reversal Line.
@return Use to keep the reversal line ID for reversing costing purpose
*/
public int getReversalLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_ReversalLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Scrapped Quantity.
@param ScrappedQty
The Quantity scrapped due to QA issues

View File

@ -0,0 +1,70 @@
-- Sep 28, 2008 2:39:23 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,53689,'ReversalLine_ID',TO_DATE('2008-09-28 14:39:22','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D','Y','Reversal Line','Reversal Line',TO_DATE('2008-09-28 14:39:22','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Sep 28, 2008 2:39:24 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=53689 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Sep 28, 2008 2:39:36 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,AD_Client_ID,Version,AD_Column_ID,AD_Reference_Value_ID) VALUES (0,53689,18,320,'ReversalLine_ID',TO_DATE('2008-09-28 14:39:35','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Reversal Line',0,TO_DATE('2008-09-28 14:39:35','YYYY-MM-DD HH24:MI:SS'),0,0,1,56355,295)
;
-- Sep 28, 2008 2:39:36 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=56355 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 28, 2008 3:06:08 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,AD_Client_ID,ValidationType) VALUES (0,53284,TO_DATE('2008-09-28 15:06:03','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N','M_MovementLine',TO_DATE('2008-09-28 15:06:03','YYYY-MM-DD HH24:MI:SS'),0,0,'T')
;
-- Sep 28, 2008 3:06:08 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=53284 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID)
;
-- Sep 28, 2008 3:06:43 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,AD_Client_ID,AD_Reference_ID,AD_Table_ID) VALUES (3820,3582,0,TO_DATE('2008-09-28 15:06:43','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N',TO_DATE('2008-09-28 15:06:43','YYYY-MM-DD HH24:MI:SS'),0,0,53284,324)
;
-- Sep 28, 2008 3:08:12 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,AD_Client_ID,Version,AD_Column_ID) VALUES (0,53284,53689,18,324,'ReversalLine_ID',TO_DATE('2008-09-28 15:08:11','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D',22,'Y','Y','N','N','N','N','N','N','N','N','Y','N','Y','Reversal Line',TO_DATE('2008-09-28 15:08:11','YYYY-MM-DD HH24:MI:SS'),0,0,1,56356)
;
-- Sep 28, 2008 3:08:12 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=56356 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 28, 2008 3:09:10 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,AD_Client_ID,Version,AD_Column_ID) VALUES (0,296,53689,18,322,'ReversalLine_ID',TO_DATE('2008-09-28 15:09:08','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Reversal Line',TO_DATE('2008-09-28 15:09:08','YYYY-MM-DD HH24:MI:SS'),0,0,1,56357)
;
-- Sep 28, 2008 3:09:10 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=56357 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 28, 2008 3:14:43 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
ALTER TABLE M_InOutLine ADD ReversalLine_ID NUMBER(10)
;
-- Sep 28, 2008 3:15:02 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
ALTER TABLE M_MovementLine ADD ReversalLine_ID NUMBER(10)
;
-- Sep 28, 2008 3:15:18 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
ALTER TABLE M_InventoryLine ADD ReversalLine_ID NUMBER(10)
;

View File

@ -0,0 +1,69 @@
-- Sep 28, 2008 2:39:23 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,53689,'ReversalLine_ID',TO_TIMESTAMP('2008-09-28 14:39:22','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D','Y','Reversal Line','Reversal Line',TO_TIMESTAMP('2008-09-28 14:39:22','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Sep 28, 2008 2:39:24 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=53689 AND EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Element_ID!=t.AD_Element_ID)
;
-- Sep 28, 2008 2:39:36 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,AD_Client_ID,Version,AD_Column_ID,AD_Reference_Value_ID) VALUES (0,53689,18,320,'ReversalLine_ID',TO_TIMESTAMP('2008-09-28 14:39:35','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Reversal Line',0,TO_TIMESTAMP('2008-09-28 14:39:35','YYYY-MM-DD HH24:MI:SS'),0,0,1,56355,295)
;
-- Sep 28, 2008 2:39:36 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=56355 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 28, 2008 3:06:08 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,AD_Client_ID,ValidationType) VALUES (0,53284,TO_TIMESTAMP('2008-09-28 15:06:03','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N','M_MovementLine',TO_TIMESTAMP('2008-09-28 15:06:03','YYYY-MM-DD HH24:MI:SS'),0,0,'T')
;
-- Sep 28, 2008 3:06:08 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=53284 AND EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Reference_ID!=t.AD_Reference_ID)
;
-- Sep 28, 2008 3:06:43 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,AD_Client_ID,AD_Reference_ID,AD_Table_ID) VALUES (3820,3582,0,TO_TIMESTAMP('2008-09-28 15:06:43','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N',TO_TIMESTAMP('2008-09-28 15:06:43','YYYY-MM-DD HH24:MI:SS'),0,0,53284,324)
;
-- Sep 28, 2008 3:08:12 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,AD_Client_ID,Version,AD_Column_ID) VALUES (0,53284,53689,18,324,'ReversalLine_ID',TO_TIMESTAMP('2008-09-28 15:08:11','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D',22,'Y','Y','N','N','N','N','N','N','N','N','Y','N','Y','Reversal Line',TO_TIMESTAMP('2008-09-28 15:08:11','YYYY-MM-DD HH24:MI:SS'),0,0,1,56356)
;
-- Sep 28, 2008 3:08:12 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=56356 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 28, 2008 3:09:10 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,Updated,UpdatedBy,AD_Client_ID,Version,AD_Column_ID) VALUES (0,296,53689,18,322,'ReversalLine_ID',TO_TIMESTAMP('2008-09-28 15:09:08','YYYY-MM-DD HH24:MI:SS'),0,'Use to keep the reversal line ID for reversing costing purpose','D',22,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Reversal Line',TO_TIMESTAMP('2008-09-28 15:09:08','YYYY-MM-DD HH24:MI:SS'),0,0,1,56357)
;
-- Sep 28, 2008 3:09:10 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
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=56357 AND EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language!=l.AD_Language OR tt.AD_Column_ID!=t.AD_Column_ID)
;
-- Sep 28, 2008 3:14:43 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
ALTER TABLE M_InOutLine ADD COLUMN ReversalLine_ID NUMERIC(10)
;
-- Sep 28, 2008 3:15:02 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
ALTER TABLE M_MovementLine ADD COLUMN ReversalLine_ID NUMERIC(10)
;
-- Sep 28, 2008 3:15:18 PM ICT
-- FR [ 1745154 ] Cost in Reversing Material Related Docs
ALTER TABLE M_InventoryLine ADD COLUMN ReversalLine_ID NUMERIC(10)
;