From a6054066ab708f602c3c85b6a64e90ef98eafab0 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 20 Jul 2007 22:44:10 +0000 Subject: [PATCH] [ 1756793 ] RMA Feature Developed by aj_kimball --- base/src/org/adempiere/model/CalloutRMA.java | 61 + .../adempiere/process/InOutGenerateRMA.java | 245 +++ .../adempiere/process/InvoiceGenerateRMA.java | 262 +++ .../org/adempiere/process/RMACreateOrder.java | 123 ++ base/src/org/compiere/model/MInOut.java | 65 +- base/src/org/compiere/model/MInOutLine.java | 4 +- base/src/org/compiere/model/MInvoice.java | 25 + base/src/org/compiere/model/MInvoiceLine.java | 15 +- base/src/org/compiere/model/MRMA.java | 211 +- base/src/org/compiere/model/MRMALine.java | 443 ++++- base/src/org/compiere/model/MSetup.java | 9 +- base/src/org/compiere/model/X_C_Invoice.java | 1704 ++++++++-------- .../org/compiere/model/X_C_InvoiceLine.java | 1018 +++++----- base/src/org/compiere/model/X_M_InOut.java | 1768 +++++++++-------- .../src/org/compiere/model/X_M_InOutLine.java | 822 ++++---- base/src/org/compiere/model/X_M_RMA.java | 757 +++---- base/src/org/compiere/model/X_M_RMALine.java | 339 ++-- .../compiere/process/InOutCreateInvoice.java | 3 +- .../src/org/compiere/apps/form/VInOutGen.java | 144 +- .../org/compiere/apps/form/VInvoiceGen.java | 139 +- client/src/org/compiere/grid/VCreateFrom.java | 18 +- .../org/compiere/grid/VCreateFromInvoice.java | 4 + .../compiere/grid/VCreateFromShipment.java | 339 +++- .../compiere/grid/VCreateFromStatement.java | 475 ++--- migration/320-trunk/019_RMA_dml.sql | 287 +++ migration/320-trunk/020_RMA_Oracle_ddl.sql | 38 + .../postgresql/020_RMA_Postgresql_ddl.sql | 40 + 27 files changed, 5862 insertions(+), 3496 deletions(-) create mode 100644 base/src/org/adempiere/model/CalloutRMA.java create mode 100644 base/src/org/adempiere/process/InOutGenerateRMA.java create mode 100644 base/src/org/adempiere/process/InvoiceGenerateRMA.java create mode 100644 base/src/org/adempiere/process/RMACreateOrder.java create mode 100644 migration/320-trunk/019_RMA_dml.sql create mode 100644 migration/320-trunk/020_RMA_Oracle_ddl.sql create mode 100644 migration/320-trunk/postgresql/020_RMA_Postgresql_ddl.sql diff --git a/base/src/org/adempiere/model/CalloutRMA.java b/base/src/org/adempiere/model/CalloutRMA.java new file mode 100644 index 0000000000..6dd4a3f3bc --- /dev/null +++ b/base/src/org/adempiere/model/CalloutRMA.java @@ -0,0 +1,61 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ + +package org.adempiere.model; + +import java.util.Properties; + +import org.compiere.model.CalloutEngine; +import org.compiere.model.GridField; +import org.compiere.model.GridTab; +import org.compiere.model.MRMA; +import org.compiere.util.DB; + +/** + * + * @author Ashley G Ramdass + */ +public class CalloutRMA extends CalloutEngine +{ + + /** + * docType - set document properties based on document type. + * @param ctx + * @param WindowNo + * @param mTab + * @param mField + * @param value + * @return error message or "" + */ + public String docType (Properties ctx, int WindowNo, GridTab mTab, GridField mField, Object value) + { + Integer C_DocType_ID = (Integer)value; + if (C_DocType_ID == null || C_DocType_ID.intValue() == 0) + return ""; + + String sql = "SELECT d.IsSoTrx " + + "FROM C_DocType d WHERE C_DocType_ID=?"; + + String docSOTrx = DB.getSQLValueString(null, sql, C_DocType_ID); + + boolean isSOTrx = "Y".equals(docSOTrx); + + mTab.setValue("IsSOTrx", isSOTrx); + + return ""; + } +} diff --git a/base/src/org/adempiere/process/InOutGenerateRMA.java b/base/src/org/adempiere/process/InOutGenerateRMA.java new file mode 100644 index 0000000000..7441ad6b08 --- /dev/null +++ b/base/src/org/adempiere/process/InOutGenerateRMA.java @@ -0,0 +1,245 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ + +package org.adempiere.process; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.logging.Level; + +import org.compiere.model.MInOut; +import org.compiere.model.MInOutLine; +import org.compiere.model.MRMA; +import org.compiere.model.MRMALine; +import org.compiere.process.DocAction; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.process.SvrProcess; +import org.compiere.util.DB; +import org.compiere.util.Env; + +/** + * Generate shipment for Vendor RMA + * @author Ashley Ramdass + * + * Based on org.compiere.process.InOutGenerate + */ +public class InOutGenerateRMA extends SvrProcess +{ + /** Manual Selection */ + private boolean p_Selection = false; + /** Warehouse */ + @SuppressWarnings("unused") + private int p_M_Warehouse_ID = 0; + /** DocAction */ + private String p_docAction = DocAction.ACTION_Complete; + /** Number of Shipments */ + private int m_created = 0; + /** Movement Date */ + private Timestamp m_movementDate = null; + + protected void prepare() + { + ProcessInfoParameter[] para = getParameter(); + for (int i = 0; i < para.length; i++) + { + String name = para[i].getParameterName(); + if (para[i].getParameter() == null) + ; + else if (name.equals("M_Warehouse_ID")) + p_M_Warehouse_ID = para[i].getParameterAsInt(); + else if (name.equals("Selection")) + p_Selection = "Y".equals(para[i].getParameter()); + else if (name.equals("DocAction")) + p_docAction = (String)para[i].getParameter(); + else + log.log(Level.SEVERE, "Unknown Parameter: " + name); + } + + m_movementDate = Env.getContextAsDate(getCtx(), "#Date"); + if (m_movementDate == null) + { + m_movementDate = new Timestamp(System.currentTimeMillis()); + } + } + + protected String doIt() throws Exception + { + if (!p_Selection) + { + throw new IllegalStateException("Shipments can only be generated from selection"); + } + + String sql = "SELECT rma.M_RMA_ID FROM M_RMA rma, T_Selection " + + "WHERE rma.DocStatus='CO' AND rma.IsSOTrx='N' AND rma.AD_Client_ID=? " + + "AND rma.M_RMA_ID = T_Selection.T_Selection_ID " + + "AND T_Selection.AD_PInstance_ID=? "; + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, Env.getAD_Client_ID(getCtx())); + pstmt.setInt(2, getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) + { + generateShipment(rs.getInt(1)); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not close prepared statement"); + } + } + + return "@Created@ = " + m_created; + } + + private int getShipmentDocTypeId(int M_RMA_ID) + { + String docTypeSQl = "SELECT dt.C_DocTypeShipment_ID FROM C_DocType dt " + + "INNER JOIN M_RMA rma ON dt.C_DocType_ID=rma.C_DocType_ID " + + "WHERE rma.M_RMA_ID=?"; + + int docTypeId = DB.getSQLValue(null, docTypeSQl, M_RMA_ID); + + return docTypeId; + } + + private MInOut createShipment(MRMA rma) + { + int docTypeId = getShipmentDocTypeId(rma.get_ID()); + + if (docTypeId == -1) + { + throw new IllegalStateException("Could not get invoice document type for Vendor RMA"); + } + + MInOut originalReceipt = rma.getShipment(); + + MInOut shipment = new MInOut(getCtx(), 0, get_TrxName()); + shipment.setM_RMA_ID(rma.get_ID()); + shipment.setAD_Org_ID(rma.getAD_Org_ID()); + shipment.setAD_OrgTrx_ID(originalReceipt.getAD_OrgTrx_ID()); + shipment.setDescription(rma.getDescription()); + shipment.setC_BPartner_ID(rma.getC_BPartner_ID()); + shipment.setC_BPartner_Location_ID(originalReceipt.getC_BPartner_Location_ID()); + shipment.setIsSOTrx(!rma.isSOTrx()); + shipment.setC_DocType_ID(docTypeId); + shipment.setM_Warehouse_ID(originalReceipt.getM_Warehouse_ID()); + shipment.setMovementType(MInOut.MOVEMENTTYPE_VendorReturns); + shipment.setC_Project_ID(originalReceipt.getC_Project_ID()); + shipment.setC_Campaign_ID(originalReceipt.getC_Campaign_ID()); + shipment.setC_Activity_ID(originalReceipt.getC_Activity_ID()); + shipment.setUser1_ID(originalReceipt.getUser1_ID()); + shipment.setUser2_ID(originalReceipt.getUser2_ID()); + + if (!shipment.save()) + { + throw new IllegalStateException("Could not create Shipment"); + } + + return shipment; + } + + private MInOutLine[] createShipmentLines(MRMA rma, MInOut shipment) + { + ArrayList shipLineList = new ArrayList(); + + MRMALine rmaLines[] = rma.getLines(true); + for (MRMALine rmaLine : rmaLines) + { + if (rmaLine.getM_InOutLine_ID() != 0) + { + MInOutLine shipLine = new MInOutLine(shipment); + shipLine.setM_RMALine_ID(rmaLine.get_ID()); + shipLine.setLine(rmaLine.getLine()); + shipLine.setDescription(rmaLine.getDescription()); + shipLine.setM_Product_ID(rmaLine.getM_Product_ID()); + shipLine.setM_AttributeSetInstance_ID(rmaLine.getM_AttributeSetInstance_ID()); + shipLine.setC_UOM_ID(rmaLine.getC_UOM_ID()); + shipLine.setQty(rmaLine.getQty()); + shipLine.setM_Locator_ID(rmaLine.getM_Locator_ID()); + shipLine.setC_Project_ID(rmaLine.getC_Project_ID()); + shipLine.setC_Campaign_ID(rmaLine.getC_Campaign_ID()); + shipLine.setC_Activity_ID(rmaLine.getC_Activity_ID()); + shipLine.setC_ProjectPhase_ID(rmaLine.getC_ProjectPhase_ID()); + shipLine.setC_ProjectTask_ID(rmaLine.getC_ProjectTask_ID()); + shipLine.setUser1_ID(rmaLine.getUser1_ID()); + shipLine.setUser2_ID(rmaLine.getUser2_ID()); + + if (!shipLine.save()) + { + throw new IllegalStateException("Could not create shipment line"); + } + + shipLineList.add(shipLine); + } + } + + MInOutLine shipLines[] = new MInOutLine[shipLineList.size()]; + shipLineList.toArray(shipLines); + + return shipLines; + } + + private void generateShipment(int M_RMA_ID) + { + MRMA rma = new MRMA(getCtx(), M_RMA_ID, get_TrxName()); + + MInOut shipment = createShipment(rma); + MInOutLine shipmentLines[] = createShipmentLines(rma, shipment); + + if (shipmentLines.length == 0) + { + log.log(Level.WARNING, "No shipment lines created: M_RMA_ID=" + + M_RMA_ID + ", M_InOut_ID=" + shipment.get_ID()); + } + + StringBuffer processMsg = new StringBuffer(shipment.getDocumentNo()); + + if (!shipment.processIt(p_docAction)) + { + processMsg.append(" (NOT Processed)"); + log.warning("Shipment Processing failed: " + shipment + " - " + shipment.getProcessMsg()); + } + + if (!shipment.save()) + { + throw new IllegalStateException("Could not update shipment"); + } + + // Add processing information to process log + addLog(shipment.getM_InOut_ID(), shipment.getMovementDate(), null, processMsg.toString()); + m_created++; + } + +} diff --git a/base/src/org/adempiere/process/InvoiceGenerateRMA.java b/base/src/org/adempiere/process/InvoiceGenerateRMA.java new file mode 100644 index 0000000000..63324e6501 --- /dev/null +++ b/base/src/org/adempiere/process/InvoiceGenerateRMA.java @@ -0,0 +1,262 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ + +package org.adempiere.process; + +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Timestamp; +import java.util.ArrayList; +import java.util.logging.Level; + +import org.compiere.model.MInvoice; +import org.compiere.model.MInvoiceLine; +import org.compiere.model.MRMA; +import org.compiere.model.MRMALine; +import org.compiere.process.DocAction; +import org.compiere.process.ProcessInfoParameter; +import org.compiere.process.SvrProcess; +import org.compiere.util.DB; +import org.compiere.util.Env; + +/** + * Generate invoice for Vendor RMA + * @author Ashley Ramdass + * + * Based on org.compiere.process.InvoiceGenerate + */ +public class InvoiceGenerateRMA extends SvrProcess +{ + /** Manual Selection */ + private boolean p_Selection = false; + /** Invoice Document Action */ + private String p_docAction = DocAction.ACTION_Complete; + + /** Number of Invoices */ + private int m_created = 0; + /** Invoice Date */ + private Timestamp m_dateinvoiced = null; + /** Line Number */ + private int m_line = 0; + + /** + * Prepare - e.g., get Parameters. + */ + protected void prepare() + { + + ProcessInfoParameter[] para = getParameter(); + for (int i = 0; i < para.length; i++) + { + String name = para[i].getParameterName(); + if (para[i].getParameter() == null) + ; + else if (name.equals("Selection")) + p_Selection = "Y".equals(para[i].getParameter()); + else if (name.equals("DocAction")) + p_docAction = (String)para[i].getParameter(); + else + log.log(Level.SEVERE, "Unknown Parameter: " + name); + } + + m_dateinvoiced = Env.getContextAsDate(getCtx(), "#Date"); + if (m_dateinvoiced == null) + { + m_dateinvoiced = new Timestamp(System.currentTimeMillis()); + } + } + + protected String doIt() throws Exception + { + if (!p_Selection) + { + throw new IllegalStateException("Shipments can only be generated from selection"); + } + + String sql = "SELECT rma.M_RMA_ID FROM M_RMA rma, T_Selection " + + "WHERE rma.DocStatus='CO' AND rma.IsSOTrx='N' AND rma.AD_Client_ID=? " + + "AND rma.M_RMA_ID = T_Selection.T_Selection_ID " + + "AND T_Selection.AD_PInstance_ID=? "; + + PreparedStatement pstmt = null; + + try + { + pstmt = DB.prepareStatement(sql, get_TrxName()); + pstmt.setInt(1, Env.getAD_Client_ID(getCtx())); + pstmt.setInt(2, getAD_PInstance_ID()); + ResultSet rs = pstmt.executeQuery(); + + while (rs.next()) + { + generateInvoice(rs.getInt(1)); + } + } + catch (Exception ex) + { + log.log(Level.SEVERE, sql, ex); + } + finally + { + try + { + pstmt.close(); + } + catch (Exception ex) + { + log.log(Level.SEVERE, "Could not close prepared statement"); + } + } + return "@Created@ = " + m_created; + } + + private int getInvoiceDocTypeId(int M_RMA_ID) + { + String docTypeSQl = "SELECT dt.C_DocTypeInvoice_ID FROM C_DocType dt " + + "INNER JOIN M_RMA rma ON dt.C_DocType_ID=rma.C_DocType_ID " + + "WHERE rma.M_RMA_ID=?"; + + int docTypeId = DB.getSQLValue(null, docTypeSQl, M_RMA_ID); + + return docTypeId; + } + + private MInvoice createInvoice(MRMA rma) + { + int docTypeId = getInvoiceDocTypeId(rma.get_ID()); + + if (docTypeId == -1) + { + throw new IllegalStateException("Could not get invoice document type for Vendor RMA"); + } + + MInvoice invoice = new MInvoice(getCtx(), 0, get_TrxName()); + + invoice.setM_RMA_ID(rma.getM_RMA_ID()); + invoice.setAD_Org_ID(rma.getAD_Org_ID()); + invoice.setDescription(rma.getDescription()); + invoice.setC_BPartner_ID(rma.getC_BPartner_ID()); + invoice.setSalesRep_ID(rma.getSalesRep_ID()); + invoice.setC_DocTypeTarget_ID(docTypeId); + invoice.setGrandTotal(rma.getAmt()); + invoice.setIsSOTrx(rma.isSOTrx()); + invoice.setTotalLines(rma.getAmt()); + + MInvoice originalInvoice = rma.getOriginalInvoice(); + + if (originalInvoice == null) + { + throw new IllegalStateException("Not invoiced - RMA: " + rma.getDocumentNo()); + } + + invoice.setC_BPartner_Location_ID(originalInvoice.getC_BPartner_Location_ID()); + invoice.setAD_User_ID(originalInvoice.getAD_User_ID()); + invoice.setC_Currency_ID(originalInvoice.getC_Currency_ID()); + invoice.setIsTaxIncluded(originalInvoice.isTaxIncluded()); + invoice.setM_PriceList_ID(originalInvoice.getM_PriceList_ID()); + invoice.setC_Project_ID(originalInvoice.getC_Project_ID()); + invoice.setC_Activity_ID(originalInvoice.getC_Activity_ID()); + invoice.setC_Campaign_ID(originalInvoice.getC_Campaign_ID()); + invoice.setUser1_ID(originalInvoice.getUser1_ID()); + invoice.setUser2_ID(originalInvoice.getUser2_ID()); + + if (!invoice.save()) + { + throw new IllegalStateException("Could not create invoice"); + } + + return invoice; + } + + private MInvoiceLine[] createInvoiceLines(MRMA rma, MInvoice invoice) + { + ArrayList invLineList = new ArrayList(); + + MRMALine rmaLines[] = rma.getLines(true); + + for (MRMALine rmaLine : rmaLines) + { + if (!rmaLine.isShipLineInvoiced() && rmaLine.getM_InOutLine_ID() != 0) + { + throw new IllegalStateException("No invoice line - RMA = " + + rma.getDocumentNo() + ", Line = " + rmaLine.getLine()); + } + + MInvoiceLine invLine = new MInvoiceLine(invoice); + invLine.setAD_Org_ID(rmaLine.getAD_Org_ID()); + invLine.setM_RMALine_ID(rmaLine.getM_RMALine_ID()); + invLine.setDescription(rmaLine.getDescription()); + invLine.setLine(rmaLine.getLine()); + invLine.setC_Charge_ID(rmaLine.getC_Charge_ID()); + invLine.setM_Product_ID(rmaLine.getM_Product_ID()); + invLine.setC_UOM_ID(rmaLine.getC_UOM_ID()); + invLine.setC_Tax_ID(rmaLine.getC_Tax_ID()); + invLine.setPrice(rmaLine.getAmt()); + invLine.setQty(rmaLine.getQty()); + invLine.setLineNetAmt(); + invLine.setTaxAmt(); + invLine.setLineTotalAmt(rmaLine.getLineNetAmt()); + invLine.setC_Project_ID(rmaLine.getC_Project_ID()); + invLine.setC_Activity_ID(rmaLine.getC_Activity_ID()); + invLine.setC_Campaign_ID(rmaLine.getC_Campaign_ID()); + + if (!invLine.save()) + { + throw new IllegalStateException("Could not create invoice line"); + } + + invLineList.add(invLine); + } + + MInvoiceLine invLines[] = new MInvoiceLine[invLineList.size()]; + invLineList.toArray(invLines); + + return invLines; + } + + + private void generateInvoice(int M_RMA_ID) + { + MRMA rma = new MRMA(getCtx(), M_RMA_ID, get_TrxName()); + + MInvoice invoice = createInvoice(rma); + MInvoiceLine invoiceLines[] = createInvoiceLines(rma, invoice); + + if (invoiceLines.length == 0) + { + log.log(Level.WARNING, "No invoice lines created: M_RMA_ID=" + + M_RMA_ID + ", M_Invoice_ID=" + invoice.get_ID()); + } + + StringBuffer processMsg = new StringBuffer(invoice.getDocumentNo()); + + if (!invoice.processIt(p_docAction)) + { + processMsg.append(" (NOT Processed)"); + log.warning("Invoice Processing failed: " + invoice + " - " + invoice.getProcessMsg()); + } + + if (!invoice.save()) + { + throw new IllegalStateException("Could not update invoice"); + } + + // Add processing information to process log + addLog(invoice.getC_Invoice_ID(), invoice.getDateInvoiced(), null, processMsg.toString()); + m_created++; + } +} diff --git a/base/src/org/adempiere/process/RMACreateOrder.java b/base/src/org/adempiere/process/RMACreateOrder.java new file mode 100644 index 0000000000..5796a45fd9 --- /dev/null +++ b/base/src/org/adempiere/process/RMACreateOrder.java @@ -0,0 +1,123 @@ +/****************************************************************************** + * Product: Adempiere ERP & CRM Smart Business Solution * + * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * For the text or an alternative of this public license, you may reach us * + * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * + * or via info@compiere.org or http://www.compiere.org/license.html * + *****************************************************************************/ + +package org.adempiere.process; + +import org.compiere.model.MOrder; +import org.compiere.model.MOrderLine; +import org.compiere.model.MRMA; +import org.compiere.model.MRMALine; +import org.compiere.process.SvrProcess; + +/** + * Creates Sales Order from RMA document + * + * @author Ashley Ramdass + */ + +public class RMACreateOrder extends SvrProcess +{ + @Override + protected void prepare() + { + + } + + @Override + protected String doIt() throws Exception + { + int rmaId = getRecord_ID(); + + // Load RMA + MRMA rma = new MRMA(getCtx(), rmaId, get_TrxName()); + + // Load Original Order + MOrder originalOrder = rma.getOriginalOrder(); + + if (rma.get_ID() == 0) + { + throw new Exception("No RMA defined"); + } + + if (originalOrder == null) + { + throw new Exception("Could not load the original order"); + } + + // Create new order and set the different values based on original order/RMA doc + MOrder order = new MOrder(getCtx(), 0, get_TrxName()); + order.setAD_Org_ID(rma.getAD_Org_ID()); + order.setC_BPartner_ID(originalOrder.getC_BPartner_ID()); + order.setC_BPartner_Location_ID(originalOrder.getC_BPartner_Location_ID()); + order.setAD_User_ID(originalOrder.getAD_User_ID()); + order.setBill_BPartner_ID(originalOrder.getBill_BPartner_ID()); + order.setBill_Location_ID(originalOrder.getBill_Location_ID()); + order.setBill_User_ID(originalOrder.getBill_User_ID()); + order.setSalesRep_ID(rma.getSalesRep_ID()); + order.setM_PriceList_ID(originalOrder.getM_PriceList_ID()); + order.setM_Warehouse_ID(originalOrder.getM_Warehouse_ID()); + order.setC_DocTypeTarget_ID(originalOrder.getC_DocTypeTarget_ID()); + order.setC_PaymentTerm_ID(originalOrder.getC_PaymentTerm_ID()); + order.setDeliveryRule(originalOrder.getDeliveryRule()); + + if (!order.save()) + { + throw new IllegalStateException("Could not create order"); + } + + MRMALine lines[] = rma.getLines(true); + + for (MRMALine line : lines) + { + if (line.getShipLine() != null && line.getShipLine().getC_OrderLine_ID() != 0) + { + // Create order lines if the RMA Doc line has a shipment line + MOrderLine orderLine = new MOrderLine(order); + MOrderLine originalOLine = new MOrderLine(getCtx(), line.getShipLine().getC_OrderLine_ID(), null); + orderLine.setAD_Org_ID(line.getAD_Org_ID()); + orderLine.setM_Product_ID(originalOLine.getM_Product_ID()); + orderLine.setM_AttributeSetInstance_ID(originalOLine.getM_AttributeSetInstance_ID()); + orderLine.setC_UOM_ID(originalOLine.getC_UOM_ID()); + orderLine.setC_Tax_ID(originalOLine.getC_Tax_ID()); + orderLine.setM_Warehouse_ID(originalOLine.getM_Warehouse_ID()); + orderLine.setC_Currency_ID(originalOLine.getC_Currency_ID()); + orderLine.setQty(line.getQty()); + orderLine.setC_Project_ID(originalOLine.getC_Project_ID()); + orderLine.setC_Activity_ID(originalOLine.getC_Activity_ID()); + orderLine.setC_Campaign_ID(originalOLine.getC_Campaign_ID()); + orderLine.setPrice(); + orderLine.setPrice(line.getAmt()); + + if (!orderLine.save()) + { + throw new IllegalStateException("Could not create Order Line"); + } + } + } + + rma.setC_Order_ID(order.getC_Order_ID()); + if (!rma.save()) + { + throw new IllegalStateException("Could not update RMA document"); + } + + commit(); + + return "Order Created: " + order.getDocumentNo(); + } + +} diff --git a/base/src/org/compiere/model/MInOut.java b/base/src/org/compiere/model/MInOut.java index 389e1f71bf..cc51a1d360 100644 --- a/base/src/org/compiere/model/MInOut.java +++ b/base/src/org/compiere/model/MInOut.java @@ -30,6 +30,8 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: MInOut.java,v 1.4 2006/07/30 00:51:03 jjanke Exp $ + * + * Modifications: Added the RMA functionality (Ashley Ramdass) */ public class MInOut extends X_M_InOut implements DocAction { @@ -189,6 +191,7 @@ public class MInOut extends X_M_InOut implements DocAction //[ 1633721 ] Reverse Documents- Processing=Y to.setProcessing(false); to.setC_Order_ID(0); // Overwritten by setOrder + to.setM_RMA_ID(0); // Overwritten by setOrder if (counter) { to.setC_Order_ID(0); @@ -211,7 +214,10 @@ public class MInOut extends X_M_InOut implements DocAction { to.setRef_InOut_ID(0); if (setOrder) + { to.setC_Order_ID(from.getC_Order_ID()); + to.setM_RMA_ID(from.getM_RMA_ID()); // Copy also RMA + } } // if (!to.save(trxName)) @@ -663,7 +669,10 @@ public class MInOut extends X_M_InOut implements DocAction line.set_ValueNoCheck ("M_InOutLine_ID", I_ZERO); // new // Reset if (!setOrder) + { line.setC_OrderLine_ID(0); + line.setM_RMALine_ID(0); // Reset RMA Line + } if (!counter) line.setM_AttributeSetInstance_ID(0); // line.setS_ResourceAssignment_ID(0); @@ -923,12 +932,30 @@ public class MInOut extends X_M_InOut implements DocAction return false; } } - // Shipment - Needs Order - if (isSOTrx() && getC_Order_ID() == 0) + + // Shipment/Receipt can have either Order/RMA (For Movement type) + if (getC_Order_ID() != 0 && getM_RMA_ID() != 0) + { + log.saveError("OrderOrRMA", ""); + return false; + } + + // Shipment - Needs Order/RMA + if (isSOTrx() && getC_Order_ID() == 0 && getM_RMA_ID() == 0) { log.saveError("FillMandatory", Msg.translate(getCtx(), "C_Order_ID")); return false; } + + if (!isSOTrx() && getM_RMA_ID() != 0) + { + // Set Document and Movement type for this Receipt + MRMA rma = new MRMA(getCtx(), getM_RMA_ID(), get_TrxName()); + MDocType docType = MDocType.get(getCtx(), rma.getC_DocType_ID()); + setC_DocType_ID(docType.getC_DocTypeShipment_ID()); + setMovementType(MOVEMENTTYPE_CustomerReturns); + } + return true; } // beforeSave @@ -1009,6 +1036,12 @@ public class MInOut extends X_M_InOut implements DocAction MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); + // Order OR RMA can be processed on a shipment/receipt + if (getC_Order_ID() != 0 && getM_RMA_ID() != 0) + { + m_processMsg = "@OrderOrRMA@"; + return DocAction.STATUS_Invalid; + } // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), dt.getDocBaseType())) { @@ -1193,6 +1226,15 @@ public class MInOut extends X_M_InOut implements DocAction else QtyPO = sLine.getMovementQty(); } + + + // Load RMA Line + MRMALine rmaLine = null; + + if (sLine.getM_RMALine_ID() != 0) + { + rmaLine = new MRMALine(getCtx(), sLine.getM_RMALine_ID(), get_TrxName()); + } log.info("Line=" + sLine.getLine() + " - Qty=" + sLine.getMovementQty()); @@ -1301,6 +1343,23 @@ public class MInOut extends X_M_InOut implements DocAction log.fine("OrderLine -> Reserved=" + oLine.getQtyReserved() + ", Delivered=" + oLine.getQtyReserved()); } + // Update RMA Line Qty Delivered + else if (rmaLine != null) + { + if (isSOTrx()) + { + rmaLine.setQtyDelivered(rmaLine.getQtyDelivered().subtract(Qty)); + } + else + { + rmaLine.setQtyDelivered(rmaLine.getQtyDelivered().add(Qty)); + } + if (!rmaLine.save()) + { + m_processMsg = "Could not update RMA Line"; + return DocAction.STATUS_Invalid; + } + } // Create Asset for SO if (product != null @@ -1799,6 +1858,8 @@ public class MInOut extends X_M_InOut implements DocAction } } reversal.setC_Order_ID(getC_Order_ID()); + // Set M_RMA_ID + reversal.setM_RMA_ID(getM_RMA_ID()); reversal.addDescription("{->" + getDocumentNo() + ")"); // if (!reversal.processIt(DocAction.ACTION_Complete) diff --git a/base/src/org/compiere/model/MInOutLine.java b/base/src/org/compiere/model/MInOutLine.java index ccb2a06441..7c8b6bd60a 100644 --- a/base/src/org/compiere/model/MInOutLine.java +++ b/base/src/org/compiere/model/MInOutLine.java @@ -556,8 +556,8 @@ public class MInOutLine extends X_M_InOutLine if (newRecord || is_ValueChanged("MovementQty")) setMovementQty(getMovementQty()); - // Order Line - if (getC_OrderLine_ID() == 0) + // Order/RMA Line + if (getC_OrderLine_ID() == 0 && getM_RMALine_ID() == 0) { if (getParent().isSOTrx()) { diff --git a/base/src/org/compiere/model/MInvoice.java b/base/src/org/compiere/model/MInvoice.java index 0937cbd9d7..afeea1adfa 100644 --- a/base/src/org/compiere/model/MInvoice.java +++ b/base/src/org/compiere/model/MInvoice.java @@ -34,6 +34,8 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: MInvoice.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $ + * + * Modifications: Added RMA functionality (Ashley Ramdass) */ public class MInvoice extends X_C_Invoice implements DocAction { @@ -497,6 +499,29 @@ public class MInvoice extends X_C_Invoice implements DocAction // Overwrite Invoice Address setC_BPartner_Location_ID(order.getBill_Location_ID()); } + // Check if Shipment/Receipt is based on RMA + if (ship.getM_RMA_ID() != 0) + { + MRMA rma = new MRMA(getCtx(), ship.getM_RMA_ID(), get_TrxName()); + MOrder rmaOrder = rma.getOriginalOrder(); + setM_RMA_ID(ship.getM_RMA_ID()); + setIsSOTrx(rma.isSOTrx()); + setM_PriceList_ID(rmaOrder.getM_PriceList_ID()); + setIsTaxIncluded(rmaOrder.isTaxIncluded()); + setC_Currency_ID(rmaOrder.getC_Currency_ID()); + setC_ConversionType_ID(rmaOrder.getC_ConversionType_ID()); + setPaymentRule(rmaOrder.getPaymentRule()); + setC_PaymentTerm_ID(rmaOrder.getC_PaymentTerm_ID()); + + // Retrieves the invoice DocType + MDocType dt = MDocType.get(getCtx(), rma.getC_DocType_ID()); + if (dt.getC_DocTypeInvoice_ID() != 0) + { + setC_DocTypeTarget_ID(dt.getC_DocTypeInvoice_ID()); + } + setC_BPartner_Location_ID(rmaOrder.getBill_Location_ID()); + } + } // setShipment /** diff --git a/base/src/org/compiere/model/MInvoiceLine.java b/base/src/org/compiere/model/MInvoiceLine.java index 4cc8d95b56..ca0151bfff 100644 --- a/base/src/org/compiere/model/MInvoiceLine.java +++ b/base/src/org/compiere/model/MInvoiceLine.java @@ -227,6 +227,8 @@ public class MInvoiceLine extends X_C_InvoiceLine { setM_InOutLine_ID(sLine.getM_InOutLine_ID()); setC_OrderLine_ID(sLine.getC_OrderLine_ID()); + // Set RMALine ID if shipment/receipt is based on RMA Doc + setM_RMALine_ID(sLine.getM_RMALine_ID()); // setLine(sLine.getLine()); @@ -238,7 +240,7 @@ public class MInvoiceLine extends X_C_InvoiceLine setM_AttributeSetInstance_ID(sLine.getM_AttributeSetInstance_ID()); // setS_ResourceAssignment_ID(sLine.getS_ResourceAssignment_ID()); if(getM_Product_ID() == 0) - setC_Charge_ID(sLine.getC_Charge_ID()); + setC_Charge_ID(sLine.getC_Charge_ID()); // int C_OrderLine_ID = sLine.getC_OrderLine_ID(); if (C_OrderLine_ID != 0) @@ -255,6 +257,17 @@ public class MInvoiceLine extends X_C_InvoiceLine setLineNetAmt(oLine.getLineNetAmt()); setC_Project_ID(oLine.getC_Project_ID()); } + // Check if shipment line is based on RMA + else if (sLine.getM_RMALine_ID() != 0) + { + // Set Pricing details from the RMA Line on which it is based + MRMALine rmaLine = new MRMALine(getCtx(), sLine.getM_RMALine_ID(), get_TrxName()); + + setPrice(); + setPrice(rmaLine.getAmt()); + setC_Tax_ID(rmaLine.getC_Tax_ID()); + setLineNetAmt(rmaLine.getLineNetAmt()); + } else { setPrice(); diff --git a/base/src/org/compiere/model/MRMA.java b/base/src/org/compiere/model/MRMA.java index 8dffb5587c..1857283853 100644 --- a/base/src/org/compiere/model/MRMA.java +++ b/base/src/org/compiere/model/MRMA.java @@ -29,6 +29,8 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: MRMA.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $ + * + * Modifications: Completed RMA functionality (Ashley Ramdass) */ public class MRMA extends X_M_RMA implements DocAction { @@ -69,10 +71,10 @@ public class MRMA extends X_M_RMA implements DocAction private MRMALine[] m_lines = null; /** The Shipment */ private MInOut m_inout = null; - + /** * Get Lines - * @param requery requary + * @param requery requery * @return lines */ public MRMALine[] getLines (boolean requery) @@ -120,11 +122,56 @@ public class MRMA extends X_M_RMA implements DocAction */ public MInOut getShipment() { - if (m_inout == null && getM_InOut_ID() != 0) - m_inout = new MInOut (getCtx(), getM_InOut_ID(), get_TrxName()); + if (m_inout == null && getInOut_ID() != 0) + m_inout = new MInOut (getCtx(), getInOut_ID(), get_TrxName()); return m_inout; } // getShipment + /** + * Get the original order on which the shipment/receipt defined is based upon. + * @return order + */ + public MOrder getOriginalOrder() + { + MInOut shipment = getShipment(); + if (shipment == null) + { + return null; + } + return new MOrder(getCtx(), shipment.getC_Order_ID(), get_TrxName()); + } + + /** + * Get the original invoice on which the shipment/receipt defined is based upon. + * @return invoice + */ + public MInvoice getOriginalInvoice() + { + MInOut shipment = getShipment(); + if (shipment == null) + { + return null; + } + + int invId = 0; + + if (shipment.getC_Invoice_ID() != 0) + { + invId = shipment.getC_Invoice_ID(); + } + else + { + String sqlStmt = "SELECT C_Invoice_ID FROM C_Invoice WHERE C_Order_ID=?"; + invId = DB.getSQLValue(null, sqlStmt, shipment.getC_Order_ID()); + } + + if (invId <= 0) + { + return null; + } + + return new MInvoice(getCtx(), invId, get_TrxName()); + } /** * Set M_InOut_ID @@ -132,7 +179,7 @@ public class MRMA extends X_M_RMA implements DocAction */ public void setM_InOut_ID (int M_InOut_ID) { - super.setM_InOut_ID (M_InOut_ID); + setInOut_ID (M_InOut_ID); setC_Currency_ID(0); setAmt(Env.ZERO); setC_BPartner_ID(0); @@ -190,17 +237,16 @@ public class MRMA extends X_M_RMA implements DocAction */ protected boolean beforeSave (boolean newRecord) { + getShipment(); // Set BPartner if (getC_BPartner_ID() == 0) { - getShipment(); if (m_inout != null) setC_BPartner_ID(m_inout.getC_BPartner_ID()); } // Set Currency if (getC_Currency_ID() == 0) { - getShipment(); if (m_inout != null) { if (m_inout.getC_Order_ID() != 0) @@ -215,6 +261,14 @@ public class MRMA extends X_M_RMA implements DocAction } } } + + // Verification whether Shipment/Receipt matches RMA for sales transaction + if (m_inout != null && m_inout.isSOTrx() != isSOTrx()) + { + log.saveError("RMA.IsSOTrx <> InOut.IsSOTrx", ""); + return false; + } + return true; } // beforeSave @@ -275,14 +329,9 @@ public class MRMA extends X_M_RMA implements DocAction m_processMsg = "@NoLines@"; return DocAction.STATUS_Invalid; } - // Check Lines - BigDecimal amt = Env.ZERO; - for (int i = 0; i < lines.length; i++) - { - MRMALine line = lines[i]; - amt = amt.add(line.getAmt()); - } - setAmt(amt); + + // Updates Amount + setAmt(getTotalAmount()); m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_PREPARE); if (m_processMsg != null) @@ -313,7 +362,7 @@ public class MRMA extends X_M_RMA implements DocAction setIsApproved(false); return true; } // rejectIt - + /** * Complete Document * @return new status (Complete, In Progress, Invalid, Waiting ..) @@ -337,11 +386,14 @@ public class MRMA extends X_M_RMA implements DocAction approveIt(); log.info("completeIt - " + toString()); // - if (true) + /* + Flow for the creation of the credit memo document changed + if (true) { m_processMsg = "Need to code creating the credit memo"; return DocAction.STATUS_InProgress; } + */ // User Validation String valid = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_COMPLETE); if (valid != null) @@ -366,13 +418,32 @@ public class MRMA extends X_M_RMA implements DocAction m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_VOID); if (m_processMsg != null) return false; + + MRMALine lines[] = getLines(true); + // Set Qty and Amt on all lines to be Zero + for (MRMALine rmaLine : lines) + { + rmaLine.addDescription(Msg.getMsg(getCtx(), "Voided") + " (" + rmaLine.getQty() + ")"); + rmaLine.setQty(Env.ZERO); + rmaLine.setAmt(Env.ZERO); + + if (!rmaLine.save()) + { + m_processMsg = "Could not update line"; + } + } + + addDescription(Msg.getMsg(getCtx(), "Voided")); + setAmt(Env.ZERO); + // After Void m_processMsg = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (m_processMsg != null) return false; - // Revoke Credit - return false; + setProcessed(true); + setDocAction(DOCACTION_None); + return true; } // voidIt /** @@ -455,7 +526,63 @@ public class MRMA extends X_M_RMA implements DocAction return false; } // reActivateIt - + /** + * Set Processed. + * Propagate to Lines + * @param processed processed + */ + public void setProcessed (boolean processed) + { + super.setProcessed (processed); + if (get_ID() == 0) + return; + String set = "SET Processed='" + + (processed ? "Y" : "N") + + "' WHERE M_RMA_ID=" + getM_RMA_ID(); + int noLine = DB.executeUpdate("UPDATE M_RMALine " + set, get_TrxName()); + m_lines = null; + log.fine("setProcessed - " + processed + " - Lines=" + noLine); + } // setProcessed + + /** + * Add to Description + * @param description text + */ + public void addDescription (String description) + { + String desc = getDescription(); + if (desc == null) + setDescription(description); + else + setDescription(desc + " | " + description); + } // addDescription + + /** + * Get the total amount based on the lines + * @return Total Amount + */ + public BigDecimal getTotalAmount() + { + MRMALine lines[] = this.getLines(true); + + BigDecimal amt = Env.ZERO; + + for (MRMALine line : lines) + { + amt = amt.add(line.getLineNetAmt()); + } + + return amt; + } + + /** + * Updates the amount on the document + */ + public void updateAmount() + { + setAmt(getTotalAmount()); + } + /************************************************************************* * Get Summary * @return Summary of Document @@ -473,7 +600,50 @@ public class MRMA extends X_M_RMA implements DocAction sb.append(" - ").append(getDescription()); return sb.toString(); } // getSummary + + /** + * Retrieves all the charge lines that is present on the document + * @return Charge Lines + */ + public MRMALine[] getChargeLines() + { + StringBuffer whereClause = new StringBuffer(); + whereClause.append("IsActive='Y' AND M_RMA_ID="); + whereClause.append(get_ID()); + whereClause.append(" AND C_Charge_ID IS NOT null"); + + int rmaLineIds[] = MRMALine.getAllIDs(MRMALine.Table_Name, whereClause.toString(), get_TrxName()); + + ArrayList chargeLineList = new ArrayList(); + + for (int i = 0; i < rmaLineIds.length; i++) + { + MRMALine rmaLine = new MRMALine(getCtx(), rmaLineIds[i], get_TrxName()); + chargeLineList.add(rmaLine); + } + + MRMALine lines[] = new MRMALine[chargeLineList.size()]; + chargeLineList.toArray(lines); + + return lines; + } + /** + * Get whether Tax is included (based on the original order) + * @return True if tax is included + */ + public boolean isTaxIncluded() + { + MOrder order = getOriginalOrder(); + + if (order != null && order.get_ID() != 0) + { + return order.isTaxIncluded(); + } + + return true; + } + /** * Get Process Message * @return clear text error message @@ -500,5 +670,4 @@ public class MRMA extends X_M_RMA implements DocAction { return getAmt(); } // getApprovalAmt - } // MRMA diff --git a/base/src/org/compiere/model/MRMALine.java b/base/src/org/compiere/model/MRMALine.java index c73530db54..d5df139cb0 100644 --- a/base/src/org/compiere/model/MRMALine.java +++ b/base/src/org/compiere/model/MRMALine.java @@ -44,10 +44,12 @@ public class MRMALine extends X_M_RMALine { setQty(Env.ONE); } + + init(); } // MRMALine /** - * Load Cosntructor + * Load Constructor * @param ctx context * @param rs result set * @param trxName transaction @@ -55,11 +57,80 @@ public class MRMALine extends X_M_RMALine public MRMALine (Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); + init(); } // MRMALine /** Shipment Line */ private MInOutLine m_ioLine = null; + /** Parent */ + private MRMA m_parent = null; + + private int precision = 0; + private int taxId = 0; + private BigDecimal unitAmount = Env.ZERO; + private BigDecimal originalQty = Env.ZERO; + + /** + * Initialise parameters that are required + */ + private void init() + { + if (getC_Charge_ID() != 0) + { + // Retrieve tax Exempt + String sql = "SELECT C_Tax_ID FROM C_Tax WHERE AD_Client_ID=? AND IsActive='Y' " + + "AND IsTaxExempt='Y' AND ValidFrom < SYSDATE ORDER BY IsDefault DESC"; + + // Set tax for charge as exempt + taxId = DB.getSQLValue(null, sql, Env.getAD_Client_ID(getCtx())); + m_ioLine = null; + } + else + { + getShipLine(); + } + + if (m_ioLine != null) + { + // Get pricing details (Based on invoice if found, on order otherwise) + if (m_ioLine.isInvoiced() && getInvoiceLineId() != 0) + { + MInvoiceLine invoiceLine = new MInvoiceLine(getCtx(), getInvoiceLineId(), get_TrxName()); + precision = invoiceLine.getPrecision(); + unitAmount = invoiceLine.getPriceEntered(); + originalQty = invoiceLine.getQtyInvoiced(); + taxId = invoiceLine.getC_Tax_ID(); + } + else if (m_ioLine.getC_OrderLine_ID() != 0) + { + MOrderLine orderLine = new MOrderLine (getCtx(), m_ioLine.getC_OrderLine_ID(), get_TrxName()); + precision = orderLine.getPrecision(); + unitAmount = orderLine.getPriceEntered(); + originalQty = orderLine.getQtyDelivered(); + taxId = orderLine.getC_Tax_ID(); + } + else + { + throw new IllegalStateException("No Invoice/Order line found the Shipment/Receipt line associated"); + } + } + else if (getC_Charge_ID() != 0) + { + MCharge charge = new MCharge(this.getCtx(), getC_Charge_ID(), null); + unitAmount = charge.getChargeAmt(); + } + } + /** + * Get Parent + * @return parent + */ + public MRMA getParent() + { + if (m_parent == null) + m_parent = new MRMA(getCtx(), getM_RMA_ID(), get_TrxName()); + return m_parent; + } // getParent /** * Set M_InOutLine_ID @@ -77,30 +148,356 @@ public class MRMALine extends X_M_RMALine */ public MInOutLine getShipLine() { - if (m_ioLine == null && getM_InOutLine_ID() != 0) + if ((m_ioLine == null || is_ValueChanged("M_InOutLine_ID")) && getM_InOutLine_ID() != 0) m_ioLine = new MInOutLine (getCtx(), getM_InOutLine_ID(), get_TrxName()); return m_ioLine; } // getShipLine - /** - * Get Total Amt - * @return amt - */ - public BigDecimal getAmt() - { - BigDecimal amt = Env.ZERO; - getShipLine(); - if (m_ioLine != null) - { - if (m_ioLine.getC_OrderLine_ID() != 0) - { - MOrderLine ol = new MOrderLine (getCtx(), m_ioLine.getC_OrderLine_ID(), get_TrxName()); - amt = ol.getPriceActual(); - } - } - // - return amt.multiply(getQty()); - } // getAmt - - + /** + * Retrieves the invoiceLine Id associated with the Shipment/Receipt Line + * @return Invoice Line ID + */ + private int getInvoiceLineId() + { + String whereClause = "M_InOutLine_ID=" + getM_InOutLine_ID(); + + int invoiceLineIds[] = MInvoiceLine.getAllIDs(MInvoiceLine.Table_Name, whereClause, null); + + if (invoiceLineIds.length == 0) + { + return 0; + } + else + { + return invoiceLineIds[0]; + } + } + + /** + * Calculates the unit amount for the product/charge + * @return Unit Amount + */ + public BigDecimal getUnitAmt() + { + return unitAmount; + } + + /** + * Get Total Amt for the line including tax + * @return amt + */ + public BigDecimal getTotalAmt() + { + BigDecimal totalAmt = Env.ZERO; + BigDecimal taxAmt = Env.ZERO; + + if (Env.ZERO.compareTo(getQty()) != 0 && Env.ZERO.compareTo(getAmt()) != 0) + { + totalAmt = getQty().multiply(getAmt()); + if (!getParent().isTaxIncluded()) + { + MTax tax = MTax.get (getCtx(), taxId); + taxAmt = tax.calculateTax(getQty().multiply(unitAmount), + getParent().isTaxIncluded(), precision); + } + } + + totalAmt = totalAmt.add(taxAmt); + return totalAmt; + } // getAmt + + /** + * Get whether the Ship line has been invoiced + * @return true if invoiced + */ + public boolean isShipLineInvoiced() + { + return (getInvoiceLineId() != 0); + } + + /** + * Before Save + * @param newRecord new + * @return save + */ + protected boolean beforeSave(boolean newRecord) + { + if (this.getM_InOutLine_ID() == 0 && this.getC_Charge_ID() == 0) + { + log.saveError("FillMandatory", "Shipment/Receipt Line or charge should be entered"); + return false; + } + + if (this.getM_InOutLine_ID() != 0 && this.getC_Charge_ID() != 0) + { + log.saveError("Error", "Either shipment/receipt line or charge should be selected"); + return false; + } + + init(); + if (m_ioLine != null) + { + if (m_ioLine.getMovementQty().compareTo(getQty()) < 0) + { + log.saveError("Error", "Amount to be returned is greater than the amount shipped"); + return false; + } + + if (newRecord) + { + String whereClause = "M_RMA_ID=" + this.getM_RMA_ID() + " and M_InOutLine_ID=" + this.getM_InOutLine_ID(); + + int lineIds[] = MRMALine.getAllIDs(MRMALine.Table_Name, whereClause, this.get_TrxName()); + + if (lineIds.length > 0) + { + log.saveError("Error", "Shipment/Receipt line is already defined in another line"); + return false; + } + } + } + + // Set default amount for charge and qty + if (this.getC_Charge_ID() != 0 && this.getQty().doubleValue() <= 0) + { + if (Env.ZERO.compareTo(getQty()) == 0) + this.setQty(new BigDecimal(1)); + if (Env.ZERO.compareTo(getAmt()) == 0) + this.setAmt(getUnitAmt()); + } + + // Set amount for products + if (this.getM_InOutLine_ID() != 0) + { + this.setAmt(getUnitAmt()); + + if (newRecord && Env.ZERO.compareTo(getQty()) == 0) + { + this.setQty(originalQty); + } + } + + this.setLineNetAmt(getTotalAmt()); + + return true; + } + + /** + * After Save + * @param newRecord new + * @param success success + * @return true if can be saved + */ + protected boolean afterSave(boolean newRecord, boolean success) + { + if (!success) + { + return success; + } + + MRMA rma = new MRMA(getCtx(), getM_RMA_ID(), get_TrxName()); + rma.updateAmount(); + + if (!rma.save()) + { + throw new IllegalStateException("Could not update RMA grand total"); + } + + return true; + } + + /** + * Add to Description + * @param description text + */ + public void addDescription (String description) + { + String desc = getDescription(); + if (desc == null) + setDescription(description); + else + setDescription(desc + " | " + description); + } // addDescription + + /** + * Get precision + * Based on Invoice if the shipment was invoiced, on Order otherwise + */ + public int getPrecision() + { + return precision; + } + + /** + * Get UOM + * Based on Shipment line if present + * Default to Each (100) for charge + * @return UOM if based on shipment line and 100 for charge based + */ + public int getC_UOM_ID() + { + if (m_ioLine == null) // Charge + { + return 100; // Each + } + + return m_ioLine.getC_UOM_ID(); + } + + /** + * Get Product + * @return product if based on shipment line and 0 for charge based + */ + public int getM_Product_ID() + { + if (getC_Charge_ID() != 0) + { + return 0; + } + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getM_Product_ID(); + } + + /** + * Get Project + * @return project if based on shipment line and 0 for charge based + */ + public int getC_Project_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getC_Project_ID(); + } + + /** + * Get Project Phase + * @return project phase if based on shipment line and 0 for charge based + */ + public int getC_ProjectPhase_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getC_ProjectPhase_ID(); + } + + /** + * Get Project Task + * @return project task if based on shipment line and 0 for charge based + */ + public int getC_ProjectTask_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getC_ProjectTask_ID(); + } + + /** + * Get Activity + * @return project phase if based on shipment line and 0 for charge based + */ + public int getC_Activity_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getC_Activity_ID(); + } + + /** + * Get Campaign + * @return campaign if based on shipment line and 0 for charge based + */ + public int getC_Campaign_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getC_Campaign_ID(); + } + + /** + * Get Org Trx + * @return Org Trx if based on shipment line and 0 for charge based + */ + public int getAD_OrgTrx_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getAD_OrgTrx_ID(); + } + + /** + * Get User1 + * @return user1 if based on shipment line and 0 for charge based + */ + public int getUser1_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getUser1_ID(); + } + + /** + * Get User2 + * @return user2 if based on shipment line and 0 for charge based + */ + public int getUser2_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getUser2_ID(); + } + + /** + * Get Attribute Set Instance + * @return ASI if based on shipment line and 0 for charge based + */ + public int getM_AttributeSetInstance_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getM_AttributeSetInstance_ID(); + } + + /** + * Get Locator + * @return locator if based on shipment line and 0 for charge based + */ + public int getM_Locator_ID() + { + if (m_ioLine == null) + { + return 0; + } + return m_ioLine.getM_Locator_ID(); + } + + /** + * Get Tax + * @return Tax based on Invoice/Order line and Tax exempt for charge based + */ + public int getC_Tax_ID() + { + return taxId; + } + } // MRMALine diff --git a/base/src/org/compiere/model/MSetup.java b/base/src/org/compiere/model/MSetup.java index 7e626ababc..d6c2be57f4 100644 --- a/base/src/org/compiere/model/MSetup.java +++ b/base/src/org/compiere/model/MSetup.java @@ -734,7 +734,7 @@ public final class MSetup createDocType("AP Invoice", Msg.getElement(m_ctx, "C_Invoice_ID", false), MDocType.DOCBASETYPE_APInvoice, null, 0, 0, 0, GL_API); - createDocType("AP CreditMemo", Msg.getMsg(m_ctx, "CreditMemo"), + int DT_IPC = createDocType("AP CreditMemo", Msg.getMsg(m_ctx, "CreditMemo"), MDocType.DOCBASETYPE_APCreditMemo, null, 0, 0, 0, GL_API); createDocType("Match Invoice", Msg.getElement(m_ctx, "M_MatchInv_ID", false), MDocType.DOCBASETYPE_MatchInvoice, null, 0, 0, 390000, GL_API); @@ -750,6 +750,8 @@ public final class MSetup MDocType.DOCBASETYPE_MaterialDelivery, null, 0, 0, 500000, GL_MM); int DT_SI = createDocType("MM Shipment Indirect", "Delivery Note", MDocType.DOCBASETYPE_MaterialDelivery, null, 0, 0, 550000, GL_MM); + int DT_VRM = createDocType("MM Vendor Return", "Vendor Returns", + MDocType.DOCBASETYPE_MaterialDelivery, null, 0, 0, 590000, GL_MM); createDocType("MM Receipt", "Vendor Delivery", MDocType.DOCBASETYPE_MaterialReceipt, null, 0, 0, 0, GL_MM); @@ -762,7 +764,10 @@ public final class MSetup MDocType.DOCBASETYPE_MatchPO, null, 0, 0, 890000, GL_None); createDocType("Purchase Requisition", Msg.getElement(m_ctx, "M_Requisition_ID", false), MDocType.DOCBASETYPE_PurchaseRequisition, null, 0, 0, 900000, GL_None); - + createDocType("Vendor Return Material", "Vendor Return Material Authorization", + MDocType.DOCBASETYPE_PurchaseOrder, MDocType.DOCSUBTYPESO_ReturnMaterial, DT_VRM, + DT_IPC, 990000, GL_MM); + createDocType("Bank Statement", Msg.getElement(m_ctx, "C_BankStatemet_ID", true), MDocType.DOCBASETYPE_BankStatement, null, 0, 0, 700000, GL_CASH); createDocType("Cash Journal", Msg.getElement(m_ctx, "C_Cash_ID", true), diff --git a/base/src/org/compiere/model/X_C_Invoice.java b/base/src/org/compiere/model/X_C_Invoice.java index 26b1b5d0a2..a8d4b84857 100644 --- a/base/src/org/compiere/model/X_C_Invoice.java +++ b/base/src/org/compiere/model/X_C_Invoice.java @@ -1,1202 +1,1220 @@ /****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * - * This program is free software; + * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * - * with this program; + * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -package org.compiere.model; +package org.compiere.model; /** Generated Model - DO NOT CHANGE */ -import java.util.*; -import java.sql.*; -import java.math.*; -import org.compiere.util.*; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; /** Generated Model for C_Invoice * @author Adempiere (generated) * @version Release 3.2.0 - $Id$ */ -public class X_C_Invoice extends PO -{ +public class X_C_Invoice extends PO +{ /** Standard Constructor @param ctx context @param C_Invoice_ID id @param trxName transaction */ -public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) -{ -super (ctx, C_Invoice_ID, trxName); -/** if (C_Invoice_ID == 0) -{ -setC_BPartner_ID (0); -setC_BPartner_Location_ID (0); -setC_Currency_ID (0); // @C_Currency_ID@ -setC_DocTypeTarget_ID (0); -setC_DocType_ID (0); // 0 -setC_Invoice_ID (0); -setC_PaymentTerm_ID (0); -setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ -setDateInvoiced (new Timestamp(System.currentTimeMillis())); // @#Date@ -setDocAction (null); // CO -setDocStatus (null); // DR -setDocumentNo (null); -setGrandTotal (Env.ZERO); -setIsApproved (false); // @IsApproved@ -setIsDiscountPrinted (false); -setIsInDispute (false); // N -setIsPaid (false); -setIsPayScheduleValid (false); -setIsPrinted (false); -setIsSOTrx (false); // @IsSOTrx@ -setIsSelfService (false); -setIsTaxIncluded (false); -setIsTransferred (false); -setM_PriceList_ID (0); -setPaymentRule (null); // P -setPosted (false); // N -setProcessed (false); -setSendEMail (false); -setTotalLines (Env.ZERO); -} +public X_C_Invoice (Properties ctx, int C_Invoice_ID, String trxName) +{ +super (ctx, C_Invoice_ID, trxName); +/** if (C_Invoice_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_Currency_ID (0); // @C_Currency_ID@ +setC_DocTypeTarget_ID (0); +setC_DocType_ID (0); // 0 +setC_Invoice_ID (0); +setC_PaymentTerm_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDateInvoiced (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setGrandTotal (Env.ZERO); +setIsApproved (false); // @IsApproved@ +setIsDiscountPrinted (false); +setIsInDispute (false); // N +setIsPaid (false); +setIsPayScheduleValid (false); +setIsPrinted (false); +setIsSOTrx (false); // @IsSOTrx@ +setIsSelfService (false); +setIsTaxIncluded (false); +setIsTransferred (false); +setM_PriceList_ID (0); +setPaymentRule (null); // P +setPosted (false); // N +setProcessed (false); +setSendEMail (false); +setTotalLines (Env.ZERO); +} */ -} +} /** Load Constructor @param ctx context @param rs result set @param trxName transaction */ -public X_C_Invoice (Properties ctx, ResultSet rs, String trxName) -{ -super (ctx, rs, trxName); -} -/** AD_Table_ID=318 */ -public static final int Table_ID=MTable.getTable_ID("C_Invoice"); - +public X_C_Invoice (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} /** TableName=C_Invoice */ -public static final String Table_Name="C_Invoice"; +public static final String Table_Name="C_Invoice"; -protected static KeyNamePair Model = new KeyNamePair(Table_ID,"C_Invoice"); +/** AD_Table_ID=318 */ +public static final int Table_ID=MTable.getTable_ID(Table_Name); -protected BigDecimal accessLevel = BigDecimal.valueOf(1); +protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + +protected BigDecimal accessLevel = BigDecimal.valueOf(1); /** AccessLevel @return 1 - Org */ -protected int get_AccessLevel() -{ -return accessLevel.intValue(); -} +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} /** Load Meta Data @param ctx context @return PO Info */ -protected POInfo initPO (Properties ctx) -{ -POInfo poi = POInfo.getPOInfo (ctx, Table_ID); -return poi; -} +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} /** Info @return info */ -public String toString() -{ -StringBuffer sb = new StringBuffer ("X_C_Invoice[").append(get_ID()).append("]"); -return sb.toString(); -} +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_Invoice[").append(get_ID()).append("]"); +return sb.toString(); +} /** AD_OrgTrx_ID AD_Reference_ID=130 */ -public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; /** Set Trx Organization. @param AD_OrgTrx_ID Performing or initiating organization */ -public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) -{ -if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); else -set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); -} +set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); +} /** Get Trx Organization. @return Performing or initiating organization */ -public int getAD_OrgTrx_ID() -{ -Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name AD_OrgTrx_ID */ -public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; +public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; /** Set User/Contact. @param AD_User_ID User within the system - Internal or Business Partner Contact */ -public void setAD_User_ID (int AD_User_ID) -{ -if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); else -set_Value ("AD_User_ID", Integer.valueOf(AD_User_ID)); -} +set_Value ("AD_User_ID", Integer.valueOf(AD_User_ID)); +} /** Get User/Contact. @return User within the system - Internal or Business Partner Contact */ -public int getAD_User_ID() -{ -Integer ii = (Integer)get_Value("AD_User_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name AD_User_ID */ -public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; +public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; /** Set Activity. @param C_Activity_ID Business Activity */ -public void setC_Activity_ID (int C_Activity_ID) -{ -if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); else -set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); -} +set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); +} /** Get Activity. @return Business Activity */ -public int getC_Activity_ID() -{ -Integer ii = (Integer)get_Value("C_Activity_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Activity_ID */ -public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; +public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; /** Set Business Partner . @param C_BPartner_ID Identifies a Business Partner */ -public void setC_BPartner_ID (int C_BPartner_ID) -{ -if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); -set_Value ("C_BPartner_ID", Integer.valueOf(C_BPartner_ID)); -} +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", Integer.valueOf(C_BPartner_ID)); +} /** Get Business Partner . @return Identifies a Business Partner */ -public int getC_BPartner_ID() -{ -Integer ii = (Integer)get_Value("C_BPartner_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_BPartner_ID */ -public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; +public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; /** Set Partner Location. @param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ -public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) -{ -if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); -set_Value ("C_BPartner_Location_ID", Integer.valueOf(C_BPartner_Location_ID)); -} +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", Integer.valueOf(C_BPartner_Location_ID)); +} /** Get Partner Location. @return Identifies the (ship to) address for this Business Partner */ -public int getC_BPartner_Location_ID() -{ -Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_BPartner_Location_ID */ -public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; +public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; /** Set Campaign. @param C_Campaign_ID Marketing Campaign */ -public void setC_Campaign_ID (int C_Campaign_ID) -{ -if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); else -set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); -} +set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); +} /** Get Campaign. @return Marketing Campaign */ -public int getC_Campaign_ID() -{ -Integer ii = (Integer)get_Value("C_Campaign_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Campaign_ID */ -public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; +public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; /** Set Cash Journal Line. @param C_CashLine_ID Cash Journal Line */ -public void setC_CashLine_ID (int C_CashLine_ID) -{ -if (C_CashLine_ID <= 0) set_Value ("C_CashLine_ID", null); +public void setC_CashLine_ID (int C_CashLine_ID) +{ +if (C_CashLine_ID <= 0) set_Value ("C_CashLine_ID", null); else -set_Value ("C_CashLine_ID", Integer.valueOf(C_CashLine_ID)); -} +set_Value ("C_CashLine_ID", Integer.valueOf(C_CashLine_ID)); +} /** Get Cash Journal Line. @return Cash Journal Line */ -public int getC_CashLine_ID() -{ -Integer ii = (Integer)get_Value("C_CashLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_CashLine_ID() +{ +Integer ii = (Integer)get_Value("C_CashLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_CashLine_ID */ -public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; +public static final String COLUMNNAME_C_CashLine_ID = "C_CashLine_ID"; /** C_Charge_ID AD_Reference_ID=200 */ -public static final int C_CHARGE_ID_AD_Reference_ID=200; +public static final int C_CHARGE_ID_AD_Reference_ID=200; /** Set Charge. @param C_Charge_ID Additional document charges */ -public void setC_Charge_ID (int C_Charge_ID) -{ -if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); else -set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); -} +set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); +} /** Get Charge. @return Additional document charges */ -public int getC_Charge_ID() -{ -Integer ii = (Integer)get_Value("C_Charge_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Charge_ID */ -public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; +public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; /** Set Currency Type. @param C_ConversionType_ID Currency Conversion Rate Type */ -public void setC_ConversionType_ID (int C_ConversionType_ID) -{ -if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); +public void setC_ConversionType_ID (int C_ConversionType_ID) +{ +if (C_ConversionType_ID <= 0) set_Value ("C_ConversionType_ID", null); else -set_Value ("C_ConversionType_ID", Integer.valueOf(C_ConversionType_ID)); -} +set_Value ("C_ConversionType_ID", Integer.valueOf(C_ConversionType_ID)); +} /** Get Currency Type. @return Currency Conversion Rate Type */ -public int getC_ConversionType_ID() -{ -Integer ii = (Integer)get_Value("C_ConversionType_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_ConversionType_ID() +{ +Integer ii = (Integer)get_Value("C_ConversionType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_ConversionType_ID */ -public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; +public static final String COLUMNNAME_C_ConversionType_ID = "C_ConversionType_ID"; /** Set Currency. @param C_Currency_ID The Currency for this record */ -public void setC_Currency_ID (int C_Currency_ID) -{ -if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); -set_Value ("C_Currency_ID", Integer.valueOf(C_Currency_ID)); -} +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID < 1) throw new IllegalArgumentException ("C_Currency_ID is mandatory."); +set_Value ("C_Currency_ID", Integer.valueOf(C_Currency_ID)); +} /** Get Currency. @return The Currency for this record */ -public int getC_Currency_ID() -{ -Integer ii = (Integer)get_Value("C_Currency_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Currency_ID */ -public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; +public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; /** C_DocTypeTarget_ID AD_Reference_ID=170 */ -public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; +public static final int C_DOCTYPETARGET_ID_AD_Reference_ID=170; /** Set Target Document Type. @param C_DocTypeTarget_ID Target document type for conversing documents */ -public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) -{ -if (C_DocTypeTarget_ID < 1) throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); -set_Value ("C_DocTypeTarget_ID", Integer.valueOf(C_DocTypeTarget_ID)); -} +public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID) +{ +if (C_DocTypeTarget_ID < 1) throw new IllegalArgumentException ("C_DocTypeTarget_ID is mandatory."); +set_Value ("C_DocTypeTarget_ID", Integer.valueOf(C_DocTypeTarget_ID)); +} /** Get Target Document Type. @return Target document type for conversing documents */ -public int getC_DocTypeTarget_ID() -{ -Integer ii = (Integer)get_Value("C_DocTypeTarget_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_DocTypeTarget_ID() +{ +Integer ii = (Integer)get_Value("C_DocTypeTarget_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_DocTypeTarget_ID */ -public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID"; +public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID"; /** Set Document Type. @param C_DocType_ID Document type or rules */ -public void setC_DocType_ID (int C_DocType_ID) -{ -if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); -set_ValueNoCheck ("C_DocType_ID", Integer.valueOf(C_DocType_ID)); -} +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_ValueNoCheck ("C_DocType_ID", Integer.valueOf(C_DocType_ID)); +} /** Get Document Type. @return Document type or rules */ -public int getC_DocType_ID() -{ -Integer ii = (Integer)get_Value("C_DocType_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_DocType_ID */ -public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; +public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; /** Set Invoice. @param C_Invoice_ID Invoice Identifier */ -public void setC_Invoice_ID (int C_Invoice_ID) -{ -if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); -set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID)); -} +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID)); +} /** Get Invoice. @return Invoice Identifier */ -public int getC_Invoice_ID() -{ -Integer ii = (Integer)get_Value("C_Invoice_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Invoice_ID */ -public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; +public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; /** Set Order. @param C_Order_ID Order */ -public void setC_Order_ID (int C_Order_ID) -{ -if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); else -set_ValueNoCheck ("C_Order_ID", Integer.valueOf(C_Order_ID)); -} +set_ValueNoCheck ("C_Order_ID", Integer.valueOf(C_Order_ID)); +} /** Get Order. @return Order */ -public int getC_Order_ID() -{ -Integer ii = (Integer)get_Value("C_Order_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Order_ID */ -public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; +public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; /** Set Payment Term. @param C_PaymentTerm_ID The terms of Payment (timing, discount) */ -public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) -{ -if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); -set_Value ("C_PaymentTerm_ID", Integer.valueOf(C_PaymentTerm_ID)); -} +public void setC_PaymentTerm_ID (int C_PaymentTerm_ID) +{ +if (C_PaymentTerm_ID < 1) throw new IllegalArgumentException ("C_PaymentTerm_ID is mandatory."); +set_Value ("C_PaymentTerm_ID", Integer.valueOf(C_PaymentTerm_ID)); +} /** Get Payment Term. @return The terms of Payment (timing, discount) */ -public int getC_PaymentTerm_ID() -{ -Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_PaymentTerm_ID() +{ +Integer ii = (Integer)get_Value("C_PaymentTerm_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_PaymentTerm_ID */ -public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID"; +public static final String COLUMNNAME_C_PaymentTerm_ID = "C_PaymentTerm_ID"; /** Set Payment. @param C_Payment_ID Payment identifier */ -public void setC_Payment_ID (int C_Payment_ID) -{ -if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); +public void setC_Payment_ID (int C_Payment_ID) +{ +if (C_Payment_ID <= 0) set_Value ("C_Payment_ID", null); else -set_Value ("C_Payment_ID", Integer.valueOf(C_Payment_ID)); -} +set_Value ("C_Payment_ID", Integer.valueOf(C_Payment_ID)); +} /** Get Payment. @return Payment identifier */ -public int getC_Payment_ID() -{ -Integer ii = (Integer)get_Value("C_Payment_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Payment_ID() +{ +Integer ii = (Integer)get_Value("C_Payment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Payment_ID */ -public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; +public static final String COLUMNNAME_C_Payment_ID = "C_Payment_ID"; /** Set Project. @param C_Project_ID Financial Project */ -public void setC_Project_ID (int C_Project_ID) -{ -if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); else -set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); -} +set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); +} /** Get Project. @return Financial Project */ -public int getC_Project_ID() -{ -Integer ii = (Integer)get_Value("C_Project_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Project_ID */ -public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; +public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; /** Set Charge amount. @param ChargeAmt Charge Amount */ -public void setChargeAmt (BigDecimal ChargeAmt) -{ -set_Value ("ChargeAmt", ChargeAmt); -} +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} /** Get Charge amount. @return Charge Amount */ -public BigDecimal getChargeAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name ChargeAmt */ -public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; +public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; /** Set Copy From. @param CopyFrom Copy From Record */ -public void setCopyFrom (String CopyFrom) -{ -if (CopyFrom != null && CopyFrom.length() > 1) -{ -log.warning("Length > 1 - truncated"); -CopyFrom = CopyFrom.substring(0,0); -} -set_Value ("CopyFrom", CopyFrom); -} +public void setCopyFrom (String CopyFrom) +{ +if (CopyFrom != null && CopyFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CopyFrom = CopyFrom.substring(0,0); +} +set_Value ("CopyFrom", CopyFrom); +} /** Get Copy From. @return Copy From Record */ -public String getCopyFrom() -{ -return (String)get_Value("CopyFrom"); -} +public String getCopyFrom() +{ +return (String)get_Value("CopyFrom"); +} /** Column name CopyFrom */ -public static final String COLUMNNAME_CopyFrom = "CopyFrom"; +public static final String COLUMNNAME_CopyFrom = "CopyFrom"; /** Set Create lines from. @param CreateFrom Process which will generate a new document lines based on an existing document */ -public void setCreateFrom (String CreateFrom) -{ -if (CreateFrom != null && CreateFrom.length() > 1) -{ -log.warning("Length > 1 - truncated"); -CreateFrom = CreateFrom.substring(0,0); -} -set_Value ("CreateFrom", CreateFrom); -} +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} /** Get Create lines from. @return Process which will generate a new document lines based on an existing document */ -public String getCreateFrom() -{ -return (String)get_Value("CreateFrom"); -} +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} /** Column name CreateFrom */ -public static final String COLUMNNAME_CreateFrom = "CreateFrom"; +public static final String COLUMNNAME_CreateFrom = "CreateFrom"; /** Set Account Date. @param DateAcct Accounting Date */ -public void setDateAcct (Timestamp DateAcct) -{ -if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); -set_Value ("DateAcct", DateAcct); -} +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} /** Get Account Date. @return Accounting Date */ -public Timestamp getDateAcct() -{ -return (Timestamp)get_Value("DateAcct"); -} +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} /** Column name DateAcct */ -public static final String COLUMNNAME_DateAcct = "DateAcct"; +public static final String COLUMNNAME_DateAcct = "DateAcct"; /** Set Date Invoiced. @param DateInvoiced Date printed on Invoice */ -public void setDateInvoiced (Timestamp DateInvoiced) -{ -if (DateInvoiced == null) throw new IllegalArgumentException ("DateInvoiced is mandatory."); -set_Value ("DateInvoiced", DateInvoiced); -} +public void setDateInvoiced (Timestamp DateInvoiced) +{ +if (DateInvoiced == null) throw new IllegalArgumentException ("DateInvoiced is mandatory."); +set_Value ("DateInvoiced", DateInvoiced); +} /** Get Date Invoiced. @return Date printed on Invoice */ -public Timestamp getDateInvoiced() -{ -return (Timestamp)get_Value("DateInvoiced"); -} +public Timestamp getDateInvoiced() +{ +return (Timestamp)get_Value("DateInvoiced"); +} /** Column name DateInvoiced */ -public static final String COLUMNNAME_DateInvoiced = "DateInvoiced"; +public static final String COLUMNNAME_DateInvoiced = "DateInvoiced"; /** Set Date Ordered. @param DateOrdered Date of Order */ -public void setDateOrdered (Timestamp DateOrdered) -{ -set_ValueNoCheck ("DateOrdered", DateOrdered); -} +public void setDateOrdered (Timestamp DateOrdered) +{ +set_ValueNoCheck ("DateOrdered", DateOrdered); +} /** Get Date Ordered. @return Date of Order */ -public Timestamp getDateOrdered() -{ -return (Timestamp)get_Value("DateOrdered"); -} +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} /** Column name DateOrdered */ -public static final String COLUMNNAME_DateOrdered = "DateOrdered"; +public static final String COLUMNNAME_DateOrdered = "DateOrdered"; /** Set Date printed. @param DatePrinted Date the document was printed. */ -public void setDatePrinted (Timestamp DatePrinted) -{ -set_Value ("DatePrinted", DatePrinted); -} +public void setDatePrinted (Timestamp DatePrinted) +{ +set_Value ("DatePrinted", DatePrinted); +} /** Get Date printed. @return Date the document was printed. */ -public Timestamp getDatePrinted() -{ -return (Timestamp)get_Value("DatePrinted"); -} +public Timestamp getDatePrinted() +{ +return (Timestamp)get_Value("DatePrinted"); +} /** Column name DatePrinted */ -public static final String COLUMNNAME_DatePrinted = "DatePrinted"; +public static final String COLUMNNAME_DatePrinted = "DatePrinted"; /** Set Description. @param Description Optional short description of the record */ -public void setDescription (String Description) -{ -if (Description != null && Description.length() > 255) -{ -log.warning("Length > 255 - truncated"); -Description = Description.substring(0,254); -} -set_Value ("Description", Description); -} +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} /** Get Description. @return Optional short description of the record */ -public String getDescription() -{ -return (String)get_Value("Description"); -} +public String getDescription() +{ +return (String)get_Value("Description"); +} /** Column name Description */ -public static final String COLUMNNAME_Description = "Description"; +public static final String COLUMNNAME_Description = "Description"; /** DocAction AD_Reference_ID=135 */ -public static final int DOCACTION_AD_Reference_ID=135; -/** = -- */ -public static final String DOCACTION_None = "--"; -/** Approve = AP */ -public static final String DOCACTION_Approve = "AP"; -/** Close = CL */ -public static final String DOCACTION_Close = "CL"; +public static final int DOCACTION_AD_Reference_ID=135; /** Complete = CO */ -public static final String DOCACTION_Complete = "CO"; -/** Invalidate = IN */ -public static final String DOCACTION_Invalidate = "IN"; -/** Post = PO */ -public static final String DOCACTION_Post = "PO"; -/** Prepare = PR */ -public static final String DOCACTION_Prepare = "PR"; -/** Reverse - Accrual = RA */ -public static final String DOCACTION_Reverse_Accrual = "RA"; -/** Reverse - Correct = RC */ -public static final String DOCACTION_Reverse_Correct = "RC"; -/** Re-activate = RE */ -public static final String DOCACTION_Re_Activate = "RE"; +public static final String DOCACTION_Complete = "CO"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; /** Reject = RJ */ -public static final String DOCACTION_Reject = "RJ"; +public static final String DOCACTION_Reject = "RJ"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; /** Void = VO */ -public static final String DOCACTION_Void = "VO"; +public static final String DOCACTION_Void = "VO"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** = -- */ +public static final String DOCACTION_None = "--"; /** Wait Complete = WC */ -public static final String DOCACTION_WaitComplete = "WC"; +public static final String DOCACTION_WaitComplete = "WC"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; /** Unlock = XL */ -public static final String DOCACTION_Unlock = "XL"; +public static final String DOCACTION_Unlock = "XL"; /** Set Document Action. @param DocAction The targeted status of the document */ -public void setDocAction (String DocAction) -{ -if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); -if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); - else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); -if (DocAction.length() > 2) -{ -log.warning("Length > 2 - truncated"); -DocAction = DocAction.substring(0,1); -} -set_Value ("DocAction", DocAction); -} +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("WC") || DocAction.equals("PR") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - WC - PR - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} /** Get Document Action. @return The targeted status of the document */ -public String getDocAction() -{ -return (String)get_Value("DocAction"); -} +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} /** Column name DocAction */ -public static final String COLUMNNAME_DocAction = "DocAction"; +public static final String COLUMNNAME_DocAction = "DocAction"; /** DocStatus AD_Reference_ID=131 */ -public static final int DOCSTATUS_AD_Reference_ID=131; -/** Unknown = ?? */ -public static final String DOCSTATUS_Unknown = "??"; -/** Approved = AP */ -public static final String DOCSTATUS_Approved = "AP"; -/** Closed = CL */ -public static final String DOCSTATUS_Closed = "CL"; -/** Completed = CO */ -public static final String DOCSTATUS_Completed = "CO"; -/** Drafted = DR */ -public static final String DOCSTATUS_Drafted = "DR"; -/** Invalid = IN */ -public static final String DOCSTATUS_Invalid = "IN"; -/** In Progress = IP */ -public static final String DOCSTATUS_InProgress = "IP"; -/** Not Approved = NA */ -public static final String DOCSTATUS_NotApproved = "NA"; -/** Reversed = RE */ -public static final String DOCSTATUS_Reversed = "RE"; -/** Voided = VO */ -public static final String DOCSTATUS_Voided = "VO"; +public static final int DOCSTATUS_AD_Reference_ID=131; /** Waiting Confirmation = WC */ -public static final String DOCSTATUS_WaitingConfirmation = "WC"; +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; /** Waiting Payment = WP */ -public static final String DOCSTATUS_WaitingPayment = "WP"; +public static final String DOCSTATUS_WaitingPayment = "WP"; /** Set Document Status. @param DocStatus The current status of the document */ -public void setDocStatus (String DocStatus) -{ -if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); -if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); - else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); -if (DocStatus.length() > 2) -{ -log.warning("Length > 2 - truncated"); -DocStatus = DocStatus.substring(0,1); -} -set_Value ("DocStatus", DocStatus); -} +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("WC") || DocStatus.equals("IP") || DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - WC - IP - DR - CO - AP - NA - VO - IN - RE - CL - ?? - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} /** Get Document Status. @return The current status of the document */ -public String getDocStatus() -{ -return (String)get_Value("DocStatus"); -} +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} /** Column name DocStatus */ -public static final String COLUMNNAME_DocStatus = "DocStatus"; +public static final String COLUMNNAME_DocStatus = "DocStatus"; /** Set Document No. @param DocumentNo Document sequence number of the document */ -public void setDocumentNo (String DocumentNo) -{ -if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); -if (DocumentNo.length() > 30) -{ -log.warning("Length > 30 - truncated"); -DocumentNo = DocumentNo.substring(0,29); -} -set_ValueNoCheck ("DocumentNo", DocumentNo); -} +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} /** Get Document No. @return Document sequence number of the document */ -public String getDocumentNo() -{ -return (String)get_Value("DocumentNo"); -} +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} /** Get Record ID/ColumnName @return ID/ColumnName pair -*/public KeyNamePair getKeyNamePair() -{ -return new KeyNamePair(get_ID(), getDocumentNo()); -} +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} /** Column name DocumentNo */ -public static final String COLUMNNAME_DocumentNo = "DocumentNo"; +public static final String COLUMNNAME_DocumentNo = "DocumentNo"; /** Set Generate To. @param GenerateTo Generate To */ -public void setGenerateTo (String GenerateTo) -{ -if (GenerateTo != null && GenerateTo.length() > 1) -{ -log.warning("Length > 1 - truncated"); -GenerateTo = GenerateTo.substring(0,0); -} -set_Value ("GenerateTo", GenerateTo); -} +public void setGenerateTo (String GenerateTo) +{ +if (GenerateTo != null && GenerateTo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateTo = GenerateTo.substring(0,0); +} +set_Value ("GenerateTo", GenerateTo); +} /** Get Generate To. @return Generate To */ -public String getGenerateTo() -{ -return (String)get_Value("GenerateTo"); -} +public String getGenerateTo() +{ +return (String)get_Value("GenerateTo"); +} /** Column name GenerateTo */ -public static final String COLUMNNAME_GenerateTo = "GenerateTo"; +public static final String COLUMNNAME_GenerateTo = "GenerateTo"; /** Set Grand Total. @param GrandTotal Total amount of document */ -public void setGrandTotal (BigDecimal GrandTotal) -{ -if (GrandTotal == null) throw new IllegalArgumentException ("GrandTotal is mandatory."); -set_ValueNoCheck ("GrandTotal", GrandTotal); -} +public void setGrandTotal (BigDecimal GrandTotal) +{ +if (GrandTotal == null) throw new IllegalArgumentException ("GrandTotal is mandatory."); +set_ValueNoCheck ("GrandTotal", GrandTotal); +} /** Get Grand Total. @return Total amount of document */ -public BigDecimal getGrandTotal() -{ -BigDecimal bd = (BigDecimal)get_Value("GrandTotal"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getGrandTotal() +{ +BigDecimal bd = (BigDecimal)get_Value("GrandTotal"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name GrandTotal */ -public static final String COLUMNNAME_GrandTotal = "GrandTotal"; +public static final String COLUMNNAME_GrandTotal = "GrandTotal"; /** InvoiceCollectionType AD_Reference_ID=394 */ -public static final int INVOICECOLLECTIONTYPE_AD_Reference_ID=394; -/** Collection Agency = C */ -public static final String INVOICECOLLECTIONTYPE_CollectionAgency = "C"; +public static final int INVOICECOLLECTIONTYPE_AD_Reference_ID=394; /** Dunning = D */ -public static final String INVOICECOLLECTIONTYPE_Dunning = "D"; +public static final String INVOICECOLLECTIONTYPE_Dunning = "D"; +/** Collection Agency = C */ +public static final String INVOICECOLLECTIONTYPE_CollectionAgency = "C"; /** Legal Procedure = L */ -public static final String INVOICECOLLECTIONTYPE_LegalProcedure = "L"; +public static final String INVOICECOLLECTIONTYPE_LegalProcedure = "L"; /** Uncollectable = U */ -public static final String INVOICECOLLECTIONTYPE_Uncollectable = "U"; +public static final String INVOICECOLLECTIONTYPE_Uncollectable = "U"; /** Set Collection Status. @param InvoiceCollectionType Invoice Collection Status */ -public void setInvoiceCollectionType (String InvoiceCollectionType) -{ -if (InvoiceCollectionType == null || InvoiceCollectionType.equals("C") || InvoiceCollectionType.equals("D") || InvoiceCollectionType.equals("L") || InvoiceCollectionType.equals("U")); - else throw new IllegalArgumentException ("InvoiceCollectionType Invalid value - " + InvoiceCollectionType + " - Reference_ID=394 - C - D - L - U"); -if (InvoiceCollectionType != null && InvoiceCollectionType.length() > 1) -{ -log.warning("Length > 1 - truncated"); -InvoiceCollectionType = InvoiceCollectionType.substring(0,0); -} -set_Value ("InvoiceCollectionType", InvoiceCollectionType); -} +public void setInvoiceCollectionType (String InvoiceCollectionType) +{ +if (InvoiceCollectionType == null || InvoiceCollectionType.equals("D") || InvoiceCollectionType.equals("C") || InvoiceCollectionType.equals("L") || InvoiceCollectionType.equals("U")); + else throw new IllegalArgumentException ("InvoiceCollectionType Invalid value - " + InvoiceCollectionType + " - Reference_ID=394 - D - C - L - U"); +if (InvoiceCollectionType != null && InvoiceCollectionType.length() > 1) +{ +log.warning("Length > 1 - truncated"); +InvoiceCollectionType = InvoiceCollectionType.substring(0,0); +} +set_Value ("InvoiceCollectionType", InvoiceCollectionType); +} /** Get Collection Status. @return Invoice Collection Status */ -public String getInvoiceCollectionType() -{ -return (String)get_Value("InvoiceCollectionType"); -} +public String getInvoiceCollectionType() +{ +return (String)get_Value("InvoiceCollectionType"); +} /** Column name InvoiceCollectionType */ -public static final String COLUMNNAME_InvoiceCollectionType = "InvoiceCollectionType"; +public static final String COLUMNNAME_InvoiceCollectionType = "InvoiceCollectionType"; /** Set Approved. @param IsApproved Indicates if this document requires approval */ -public void setIsApproved (boolean IsApproved) -{ -set_ValueNoCheck ("IsApproved", Boolean.valueOf(IsApproved)); -} +public void setIsApproved (boolean IsApproved) +{ +set_ValueNoCheck ("IsApproved", Boolean.valueOf(IsApproved)); +} /** Get Approved. @return Indicates if this document requires approval */ -public boolean isApproved() -{ -Object oo = get_Value("IsApproved"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsApproved */ -public static final String COLUMNNAME_IsApproved = "IsApproved"; +public static final String COLUMNNAME_IsApproved = "IsApproved"; /** Set Discount Printed. @param IsDiscountPrinted Print Discount on Invoice and Order */ -public void setIsDiscountPrinted (boolean IsDiscountPrinted) -{ -set_Value ("IsDiscountPrinted", Boolean.valueOf(IsDiscountPrinted)); -} +public void setIsDiscountPrinted (boolean IsDiscountPrinted) +{ +set_Value ("IsDiscountPrinted", Boolean.valueOf(IsDiscountPrinted)); +} /** Get Discount Printed. @return Print Discount on Invoice and Order */ -public boolean isDiscountPrinted() -{ -Object oo = get_Value("IsDiscountPrinted"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isDiscountPrinted() +{ +Object oo = get_Value("IsDiscountPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsDiscountPrinted */ -public static final String COLUMNNAME_IsDiscountPrinted = "IsDiscountPrinted"; +public static final String COLUMNNAME_IsDiscountPrinted = "IsDiscountPrinted"; /** Set In Dispute. @param IsInDispute Document is in dispute */ -public void setIsInDispute (boolean IsInDispute) -{ -set_Value ("IsInDispute", Boolean.valueOf(IsInDispute)); -} +public void setIsInDispute (boolean IsInDispute) +{ +set_Value ("IsInDispute", Boolean.valueOf(IsInDispute)); +} /** Get In Dispute. @return Document is in dispute */ -public boolean isInDispute() -{ -Object oo = get_Value("IsInDispute"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isInDispute() +{ +Object oo = get_Value("IsInDispute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsInDispute */ -public static final String COLUMNNAME_IsInDispute = "IsInDispute"; +public static final String COLUMNNAME_IsInDispute = "IsInDispute"; /** Set Paid. @param IsPaid The document is paid */ -public void setIsPaid (boolean IsPaid) -{ -set_Value ("IsPaid", Boolean.valueOf(IsPaid)); -} +public void setIsPaid (boolean IsPaid) +{ +set_Value ("IsPaid", Boolean.valueOf(IsPaid)); +} /** Get Paid. @return The document is paid */ -public boolean isPaid() -{ -Object oo = get_Value("IsPaid"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPaid() +{ +Object oo = get_Value("IsPaid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsPaid */ -public static final String COLUMNNAME_IsPaid = "IsPaid"; +public static final String COLUMNNAME_IsPaid = "IsPaid"; /** Set Pay Schedule valid. @param IsPayScheduleValid Is the Payment Schedule is valid */ -public void setIsPayScheduleValid (boolean IsPayScheduleValid) -{ -set_ValueNoCheck ("IsPayScheduleValid", Boolean.valueOf(IsPayScheduleValid)); -} +public void setIsPayScheduleValid (boolean IsPayScheduleValid) +{ +set_ValueNoCheck ("IsPayScheduleValid", Boolean.valueOf(IsPayScheduleValid)); +} /** Get Pay Schedule valid. @return Is the Payment Schedule is valid */ -public boolean isPayScheduleValid() -{ -Object oo = get_Value("IsPayScheduleValid"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPayScheduleValid() +{ +Object oo = get_Value("IsPayScheduleValid"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsPayScheduleValid */ -public static final String COLUMNNAME_IsPayScheduleValid = "IsPayScheduleValid"; +public static final String COLUMNNAME_IsPayScheduleValid = "IsPayScheduleValid"; /** Set Printed. @param IsPrinted Indicates if this document / line is printed */ -public void setIsPrinted (boolean IsPrinted) -{ -set_ValueNoCheck ("IsPrinted", Boolean.valueOf(IsPrinted)); -} +public void setIsPrinted (boolean IsPrinted) +{ +set_ValueNoCheck ("IsPrinted", Boolean.valueOf(IsPrinted)); +} /** Get Printed. @return Indicates if this document / line is printed */ -public boolean isPrinted() -{ -Object oo = get_Value("IsPrinted"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsPrinted */ -public static final String COLUMNNAME_IsPrinted = "IsPrinted"; +public static final String COLUMNNAME_IsPrinted = "IsPrinted"; /** Set Sales Transaction. @param IsSOTrx This is a Sales Transaction */ -public void setIsSOTrx (boolean IsSOTrx) -{ -set_ValueNoCheck ("IsSOTrx", Boolean.valueOf(IsSOTrx)); -} +public void setIsSOTrx (boolean IsSOTrx) +{ +set_ValueNoCheck ("IsSOTrx", Boolean.valueOf(IsSOTrx)); +} /** Get Sales Transaction. @return This is a Sales Transaction */ -public boolean isSOTrx() -{ -Object oo = get_Value("IsSOTrx"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsSOTrx */ -public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; +public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; /** Set Self-Service. @param IsSelfService This is a Self-Service entry or this entry can be changed via Self-Service */ -public void setIsSelfService (boolean IsSelfService) -{ -set_Value ("IsSelfService", Boolean.valueOf(IsSelfService)); -} +public void setIsSelfService (boolean IsSelfService) +{ +set_Value ("IsSelfService", Boolean.valueOf(IsSelfService)); +} /** Get Self-Service. @return This is a Self-Service entry or this entry can be changed via Self-Service */ -public boolean isSelfService() -{ -Object oo = get_Value("IsSelfService"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isSelfService() +{ +Object oo = get_Value("IsSelfService"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsSelfService */ -public static final String COLUMNNAME_IsSelfService = "IsSelfService"; +public static final String COLUMNNAME_IsSelfService = "IsSelfService"; /** Set Price includes Tax. @param IsTaxIncluded Tax is included in the price */ -public void setIsTaxIncluded (boolean IsTaxIncluded) -{ -set_Value ("IsTaxIncluded", Boolean.valueOf(IsTaxIncluded)); -} +public void setIsTaxIncluded (boolean IsTaxIncluded) +{ +set_Value ("IsTaxIncluded", Boolean.valueOf(IsTaxIncluded)); +} /** Get Price includes Tax. @return Tax is included in the price */ -public boolean isTaxIncluded() -{ -Object oo = get_Value("IsTaxIncluded"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isTaxIncluded() +{ +Object oo = get_Value("IsTaxIncluded"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsTaxIncluded */ -public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; +public static final String COLUMNNAME_IsTaxIncluded = "IsTaxIncluded"; /** Set Transferred. @param IsTransferred Transferred to General Ledger (i.e. accounted) */ -public void setIsTransferred (boolean IsTransferred) -{ -set_ValueNoCheck ("IsTransferred", Boolean.valueOf(IsTransferred)); -} +public void setIsTransferred (boolean IsTransferred) +{ +set_ValueNoCheck ("IsTransferred", Boolean.valueOf(IsTransferred)); +} /** Get Transferred. @return Transferred to General Ledger (i.e. accounted) */ -public boolean isTransferred() -{ -Object oo = get_Value("IsTransferred"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isTransferred() +{ +Object oo = get_Value("IsTransferred"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsTransferred */ -public static final String COLUMNNAME_IsTransferred = "IsTransferred"; +public static final String COLUMNNAME_IsTransferred = "IsTransferred"; /** Set Price List. @param M_PriceList_ID Unique identifier of a Price List */ -public void setM_PriceList_ID (int M_PriceList_ID) -{ -if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); -set_Value ("M_PriceList_ID", Integer.valueOf(M_PriceList_ID)); -} +public void setM_PriceList_ID (int M_PriceList_ID) +{ +if (M_PriceList_ID < 1) throw new IllegalArgumentException ("M_PriceList_ID is mandatory."); +set_Value ("M_PriceList_ID", Integer.valueOf(M_PriceList_ID)); +} /** Get Price List. @return Unique identifier of a Price List */ -public int getM_PriceList_ID() -{ -Integer ii = (Integer)get_Value("M_PriceList_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_PriceList_ID() +{ +Integer ii = (Integer)get_Value("M_PriceList_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_PriceList_ID */ -public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; +public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID"; +/** Set RMA. +@param M_RMA_ID Return Material Authorization */ +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID <= 0) set_Value ("M_RMA_ID", null); + else +set_Value ("M_RMA_ID", Integer.valueOf(M_RMA_ID)); +} +/** Get RMA. +@return Return Material Authorization */ +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name M_RMA_ID */ +public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; /** Set Order Reference. @param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ -public void setPOReference (String POReference) -{ -if (POReference != null && POReference.length() > 20) -{ -log.warning("Length > 20 - truncated"); -POReference = POReference.substring(0,19); -} -set_Value ("POReference", POReference); -} +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} /** Get Order Reference. @return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ -public String getPOReference() -{ -return (String)get_Value("POReference"); -} +public String getPOReference() +{ +return (String)get_Value("POReference"); +} /** Column name POReference */ -public static final String COLUMNNAME_POReference = "POReference"; +public static final String COLUMNNAME_POReference = "POReference"; /** PaymentRule AD_Reference_ID=195 */ -public static final int PAYMENTRULE_AD_Reference_ID=195; +public static final int PAYMENTRULE_AD_Reference_ID=195; /** Cash = B */ -public static final String PAYMENTRULE_Cash = "B"; -/** Direct Debit = D */ -public static final String PAYMENTRULE_DirectDebit = "D"; +public static final String PAYMENTRULE_Cash = "B"; /** Credit Card = K */ -public static final String PAYMENTRULE_CreditCard = "K"; -/** On Credit = P */ -public static final String PAYMENTRULE_OnCredit = "P"; -/** Check = S */ -public static final String PAYMENTRULE_Check = "S"; +public static final String PAYMENTRULE_CreditCard = "K"; /** Direct Deposit = T */ -public static final String PAYMENTRULE_DirectDeposit = "T"; +public static final String PAYMENTRULE_DirectDeposit = "T"; +/** Check = S */ +public static final String PAYMENTRULE_Check = "S"; +/** On Credit = P */ +public static final String PAYMENTRULE_OnCredit = "P"; +/** Direct Debit = D */ +public static final String PAYMENTRULE_DirectDebit = "D"; /** Set Payment Rule. @param PaymentRule How you pay the invoice */ -public void setPaymentRule (String PaymentRule) -{ -if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); -if (PaymentRule.equals("B") || PaymentRule.equals("D") || PaymentRule.equals("K") || PaymentRule.equals("P") || PaymentRule.equals("S") || PaymentRule.equals("T")); - else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - D - K - P - S - T"); -if (PaymentRule.length() > 1) -{ -log.warning("Length > 1 - truncated"); -PaymentRule = PaymentRule.substring(0,0); -} -set_Value ("PaymentRule", PaymentRule); -} +public void setPaymentRule (String PaymentRule) +{ +if (PaymentRule == null) throw new IllegalArgumentException ("PaymentRule is mandatory"); +if (PaymentRule.equals("B") || PaymentRule.equals("K") || PaymentRule.equals("T") || PaymentRule.equals("S") || PaymentRule.equals("P") || PaymentRule.equals("D")); + else throw new IllegalArgumentException ("PaymentRule Invalid value - " + PaymentRule + " - Reference_ID=195 - B - K - T - S - P - D"); +if (PaymentRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PaymentRule = PaymentRule.substring(0,0); +} +set_Value ("PaymentRule", PaymentRule); +} /** Get Payment Rule. @return How you pay the invoice */ -public String getPaymentRule() -{ -return (String)get_Value("PaymentRule"); -} +public String getPaymentRule() +{ +return (String)get_Value("PaymentRule"); +} /** Column name PaymentRule */ -public static final String COLUMNNAME_PaymentRule = "PaymentRule"; +public static final String COLUMNNAME_PaymentRule = "PaymentRule"; /** Set Posted. @param Posted Posting status */ -public void setPosted (boolean Posted) -{ -set_Value ("Posted", Boolean.valueOf(Posted)); -} +public void setPosted (boolean Posted) +{ +set_Value ("Posted", Boolean.valueOf(Posted)); +} /** Get Posted. @return Posting status */ -public boolean isPosted() -{ -Object oo = get_Value("Posted"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Posted */ -public static final String COLUMNNAME_Posted = "Posted"; +public static final String COLUMNNAME_Posted = "Posted"; /** Set Processed. @param Processed The document has been processed */ -public void setProcessed (boolean Processed) -{ -set_ValueNoCheck ("Processed", Boolean.valueOf(Processed)); -} +public void setProcessed (boolean Processed) +{ +set_ValueNoCheck ("Processed", Boolean.valueOf(Processed)); +} /** Get Processed. @return The document has been processed */ -public boolean isProcessed() -{ -Object oo = get_Value("Processed"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processed */ -public static final String COLUMNNAME_Processed = "Processed"; +public static final String COLUMNNAME_Processed = "Processed"; /** Set Process Now. @param Processing Process Now */ -public void setProcessing (boolean Processing) -{ -set_Value ("Processing", Boolean.valueOf(Processing)); -} +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", Boolean.valueOf(Processing)); +} /** Get Process Now. @return Process Now */ -public boolean isProcessing() -{ -Object oo = get_Value("Processing"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processing */ -public static final String COLUMNNAME_Processing = "Processing"; +public static final String COLUMNNAME_Processing = "Processing"; /** Set Referenced Invoice. @param Ref_Invoice_ID Referenced Invoice */ -public void setRef_Invoice_ID (int Ref_Invoice_ID) -{ -if (Ref_Invoice_ID <= 0) set_Value ("Ref_Invoice_ID", null); +public void setRef_Invoice_ID (int Ref_Invoice_ID) +{ +if (Ref_Invoice_ID <= 0) set_Value ("Ref_Invoice_ID", null); else -set_Value ("Ref_Invoice_ID", Integer.valueOf(Ref_Invoice_ID)); -} +set_Value ("Ref_Invoice_ID", Integer.valueOf(Ref_Invoice_ID)); +} /** Get Referenced Invoice. @return Referenced Invoice */ -public int getRef_Invoice_ID() -{ -Integer ii = (Integer)get_Value("Ref_Invoice_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getRef_Invoice_ID() +{ +Integer ii = (Integer)get_Value("Ref_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name Ref_Invoice_ID */ -public static final String COLUMNNAME_Ref_Invoice_ID = "Ref_Invoice_ID"; +public static final String COLUMNNAME_Ref_Invoice_ID = "Ref_Invoice_ID"; /** SalesRep_ID AD_Reference_ID=190 */ -public static final int SALESREP_ID_AD_Reference_ID=190; +public static final int SALESREP_ID_AD_Reference_ID=190; /** Set Sales Representative. @param SalesRep_ID Sales Representative or Company Agent */ -public void setSalesRep_ID (int SalesRep_ID) -{ -if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); else -set_Value ("SalesRep_ID", Integer.valueOf(SalesRep_ID)); -} +set_Value ("SalesRep_ID", Integer.valueOf(SalesRep_ID)); +} /** Get Sales Representative. @return Sales Representative or Company Agent */ -public int getSalesRep_ID() -{ -Integer ii = (Integer)get_Value("SalesRep_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name SalesRep_ID */ -public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; +public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; /** Set Send EMail. @param SendEMail Enable sending Document EMail */ -public void setSendEMail (boolean SendEMail) -{ -set_Value ("SendEMail", Boolean.valueOf(SendEMail)); -} +public void setSendEMail (boolean SendEMail) +{ +set_Value ("SendEMail", Boolean.valueOf(SendEMail)); +} /** Get Send EMail. @return Enable sending Document EMail */ -public boolean isSendEMail() -{ -Object oo = get_Value("SendEMail"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name SendEMail */ -public static final String COLUMNNAME_SendEMail = "SendEMail"; +public static final String COLUMNNAME_SendEMail = "SendEMail"; /** Set Total Lines. @param TotalLines Total of all document lines */ -public void setTotalLines (BigDecimal TotalLines) -{ -if (TotalLines == null) throw new IllegalArgumentException ("TotalLines is mandatory."); -set_ValueNoCheck ("TotalLines", TotalLines); -} +public void setTotalLines (BigDecimal TotalLines) +{ +if (TotalLines == null) throw new IllegalArgumentException ("TotalLines is mandatory."); +set_ValueNoCheck ("TotalLines", TotalLines); +} /** Get Total Lines. @return Total of all document lines */ -public BigDecimal getTotalLines() -{ -BigDecimal bd = (BigDecimal)get_Value("TotalLines"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getTotalLines() +{ +BigDecimal bd = (BigDecimal)get_Value("TotalLines"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name TotalLines */ -public static final String COLUMNNAME_TotalLines = "TotalLines"; +public static final String COLUMNNAME_TotalLines = "TotalLines"; /** User1_ID AD_Reference_ID=134 */ -public static final int USER1_ID_AD_Reference_ID=134; +public static final int USER1_ID_AD_Reference_ID=134; /** Set User List 1. @param User1_ID User defined list element #1 */ -public void setUser1_ID (int User1_ID) -{ -if (User1_ID <= 0) set_Value ("User1_ID", null); +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); else -set_Value ("User1_ID", Integer.valueOf(User1_ID)); -} +set_Value ("User1_ID", Integer.valueOf(User1_ID)); +} /** Get User List 1. @return User defined list element #1 */ -public int getUser1_ID() -{ -Integer ii = (Integer)get_Value("User1_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User1_ID */ -public static final String COLUMNNAME_User1_ID = "User1_ID"; +public static final String COLUMNNAME_User1_ID = "User1_ID"; /** User2_ID AD_Reference_ID=137 */ -public static final int USER2_ID_AD_Reference_ID=137; +public static final int USER2_ID_AD_Reference_ID=137; /** Set User List 2. @param User2_ID User defined list element #2 */ -public void setUser2_ID (int User2_ID) -{ -if (User2_ID <= 0) set_Value ("User2_ID", null); +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); else -set_Value ("User2_ID", Integer.valueOf(User2_ID)); -} +set_Value ("User2_ID", Integer.valueOf(User2_ID)); +} /** Get User List 2. @return User defined list element #2 */ -public int getUser2_ID() -{ -Integer ii = (Integer)get_Value("User2_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User2_ID */ -public static final String COLUMNNAME_User2_ID = "User2_ID"; -} +public static final String COLUMNNAME_User2_ID = "User2_ID"; +} diff --git a/base/src/org/compiere/model/X_C_InvoiceLine.java b/base/src/org/compiere/model/X_C_InvoiceLine.java index f91270aec6..8076c3f540 100644 --- a/base/src/org/compiere/model/X_C_InvoiceLine.java +++ b/base/src/org/compiere/model/X_C_InvoiceLine.java @@ -1,749 +1,767 @@ /****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * - * This program is free software; + * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * - * with this program; + * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -package org.compiere.model; +package org.compiere.model; /** Generated Model - DO NOT CHANGE */ -import java.util.*; -import java.sql.*; -import java.math.*; -import org.compiere.util.*; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; /** Generated Model for C_InvoiceLine * @author Adempiere (generated) * @version Release 3.2.0 - $Id$ */ -public class X_C_InvoiceLine extends PO -{ +public class X_C_InvoiceLine extends PO +{ /** Standard Constructor @param ctx context @param C_InvoiceLine_ID id @param trxName transaction */ -public X_C_InvoiceLine (Properties ctx, int C_InvoiceLine_ID, String trxName) -{ -super (ctx, C_InvoiceLine_ID, trxName); -/** if (C_InvoiceLine_ID == 0) -{ -setC_InvoiceLine_ID (0); -setC_Invoice_ID (0); -setC_Tax_ID (0); -setIsDescription (false); // N -setIsPrinted (true); // Y -setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_InvoiceLine WHERE C_Invoice_ID=@C_Invoice_ID@ -setLineNetAmt (Env.ZERO); -setM_AttributeSetInstance_ID (0); -setPriceActual (Env.ZERO); -setPriceEntered (Env.ZERO); -setPriceLimit (Env.ZERO); -setPriceList (Env.ZERO); -setProcessed (false); -setQtyEntered (Env.ZERO); // 1 -setQtyInvoiced (Env.ZERO); // 1 -} +public X_C_InvoiceLine (Properties ctx, int C_InvoiceLine_ID, String trxName) +{ +super (ctx, C_InvoiceLine_ID, trxName); +/** if (C_InvoiceLine_ID == 0) +{ +setC_InvoiceLine_ID (0); +setC_Invoice_ID (0); +setC_Tax_ID (0); +setIsDescription (false); // N +setIsPrinted (true); // Y +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM C_InvoiceLine WHERE C_Invoice_ID=@C_Invoice_ID@ +setLineNetAmt (Env.ZERO); +setM_AttributeSetInstance_ID (0); +setPriceActual (Env.ZERO); +setPriceEntered (Env.ZERO); +setPriceLimit (Env.ZERO); +setPriceList (Env.ZERO); +setProcessed (false); +setQtyEntered (Env.ZERO); // 1 +setQtyInvoiced (Env.ZERO); // 1 +} */ -} +} /** Load Constructor @param ctx context @param rs result set @param trxName transaction */ -public X_C_InvoiceLine (Properties ctx, ResultSet rs, String trxName) -{ -super (ctx, rs, trxName); -} -/** AD_Table_ID=333 */ -public static final int Table_ID=MTable.getTable_ID("C_InvoiceLine"); - +public X_C_InvoiceLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} /** TableName=C_InvoiceLine */ -public static final String Table_Name="C_InvoiceLine"; +public static final String Table_Name="C_InvoiceLine"; -protected static KeyNamePair Model = new KeyNamePair(Table_ID,"C_InvoiceLine"); +/** AD_Table_ID=333 */ +public static final int Table_ID=MTable.getTable_ID(Table_Name); -protected BigDecimal accessLevel = BigDecimal.valueOf(1); +protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + +protected BigDecimal accessLevel = BigDecimal.valueOf(1); /** AccessLevel @return 1 - Org */ -protected int get_AccessLevel() -{ -return accessLevel.intValue(); -} +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} /** Load Meta Data @param ctx context @return PO Info */ -protected POInfo initPO (Properties ctx) -{ -POInfo poi = POInfo.getPOInfo (ctx, Table_ID); -return poi; -} +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} /** Info @return info */ -public String toString() -{ -StringBuffer sb = new StringBuffer ("X_C_InvoiceLine[").append(get_ID()).append("]"); -return sb.toString(); -} +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_C_InvoiceLine[").append(get_ID()).append("]"); +return sb.toString(); +} /** AD_OrgTrx_ID AD_Reference_ID=130 */ -public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; /** Set Trx Organization. @param AD_OrgTrx_ID Performing or initiating organization */ -public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) -{ -if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); else -set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); -} +set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); +} /** Get Trx Organization. @return Performing or initiating organization */ -public int getAD_OrgTrx_ID() -{ -Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name AD_OrgTrx_ID */ -public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; +public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; /** Set Asset. @param A_Asset_ID Asset used internally or by customers */ -public void setA_Asset_ID (int A_Asset_ID) -{ -if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); +public void setA_Asset_ID (int A_Asset_ID) +{ +if (A_Asset_ID <= 0) set_Value ("A_Asset_ID", null); else -set_Value ("A_Asset_ID", Integer.valueOf(A_Asset_ID)); -} +set_Value ("A_Asset_ID", Integer.valueOf(A_Asset_ID)); +} /** Get Asset. @return Asset used internally or by customers */ -public int getA_Asset_ID() -{ -Integer ii = (Integer)get_Value("A_Asset_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getA_Asset_ID() +{ +Integer ii = (Integer)get_Value("A_Asset_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name A_Asset_ID */ -public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID"; +public static final String COLUMNNAME_A_Asset_ID = "A_Asset_ID"; /** Set Activity. @param C_Activity_ID Business Activity */ -public void setC_Activity_ID (int C_Activity_ID) -{ -if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); else -set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); -} +set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); +} /** Get Activity. @return Business Activity */ -public int getC_Activity_ID() -{ -Integer ii = (Integer)get_Value("C_Activity_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Activity_ID */ -public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; +public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; /** Set Campaign. @param C_Campaign_ID Marketing Campaign */ -public void setC_Campaign_ID (int C_Campaign_ID) -{ -if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); else -set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); -} +set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); +} /** Get Campaign. @return Marketing Campaign */ -public int getC_Campaign_ID() -{ -Integer ii = (Integer)get_Value("C_Campaign_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Campaign_ID */ -public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; +public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; /** Set Charge. @param C_Charge_ID Additional document charges */ -public void setC_Charge_ID (int C_Charge_ID) -{ -if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); else -set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); -} +set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); +} /** Get Charge. @return Additional document charges */ -public int getC_Charge_ID() -{ -Integer ii = (Integer)get_Value("C_Charge_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Charge_ID */ -public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; +public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; /** Set Invoice Line. @param C_InvoiceLine_ID Invoice Detail Line */ -public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) -{ -if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); -set_ValueNoCheck ("C_InvoiceLine_ID", Integer.valueOf(C_InvoiceLine_ID)); -} +public void setC_InvoiceLine_ID (int C_InvoiceLine_ID) +{ +if (C_InvoiceLine_ID < 1) throw new IllegalArgumentException ("C_InvoiceLine_ID is mandatory."); +set_ValueNoCheck ("C_InvoiceLine_ID", Integer.valueOf(C_InvoiceLine_ID)); +} /** Get Invoice Line. @return Invoice Detail Line */ -public int getC_InvoiceLine_ID() -{ -Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("C_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_InvoiceLine_ID */ -public static final String COLUMNNAME_C_InvoiceLine_ID = "C_InvoiceLine_ID"; +public static final String COLUMNNAME_C_InvoiceLine_ID = "C_InvoiceLine_ID"; /** Set Invoice. @param C_Invoice_ID Invoice Identifier */ -public void setC_Invoice_ID (int C_Invoice_ID) -{ -if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); -set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID)); -} +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID < 1) throw new IllegalArgumentException ("C_Invoice_ID is mandatory."); +set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID)); +} /** Get Invoice. @return Invoice Identifier */ -public int getC_Invoice_ID() -{ -Integer ii = (Integer)get_Value("C_Invoice_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Get Record ID/ColumnName @return ID/ColumnName pair -*/public KeyNamePair getKeyNamePair() -{ -return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); -} +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getC_Invoice_ID())); +} /** Column name C_Invoice_ID */ -public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; +public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; /** Set Sales Order Line. @param C_OrderLine_ID Sales Order Line */ -public void setC_OrderLine_ID (int C_OrderLine_ID) -{ -if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); else -set_ValueNoCheck ("C_OrderLine_ID", Integer.valueOf(C_OrderLine_ID)); -} +set_ValueNoCheck ("C_OrderLine_ID", Integer.valueOf(C_OrderLine_ID)); +} /** Get Sales Order Line. @return Sales Order Line */ -public int getC_OrderLine_ID() -{ -Integer ii = (Integer)get_Value("C_OrderLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_OrderLine_ID */ -public static final String COLUMNNAME_C_OrderLine_ID = "C_OrderLine_ID"; +public static final String COLUMNNAME_C_OrderLine_ID = "C_OrderLine_ID"; /** Set Project Phase. @param C_ProjectPhase_ID Phase of a Project */ -public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) -{ -if (C_ProjectPhase_ID <= 0) set_ValueNoCheck ("C_ProjectPhase_ID", null); +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_ValueNoCheck ("C_ProjectPhase_ID", null); else -set_ValueNoCheck ("C_ProjectPhase_ID", Integer.valueOf(C_ProjectPhase_ID)); -} +set_ValueNoCheck ("C_ProjectPhase_ID", Integer.valueOf(C_ProjectPhase_ID)); +} /** Get Project Phase. @return Phase of a Project */ -public int getC_ProjectPhase_ID() -{ -Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_ProjectPhase_ID */ -public static final String COLUMNNAME_C_ProjectPhase_ID = "C_ProjectPhase_ID"; +public static final String COLUMNNAME_C_ProjectPhase_ID = "C_ProjectPhase_ID"; /** Set Project Task. @param C_ProjectTask_ID Actual Project Task in a Phase */ -public void setC_ProjectTask_ID (int C_ProjectTask_ID) -{ -if (C_ProjectTask_ID <= 0) set_ValueNoCheck ("C_ProjectTask_ID", null); +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_ValueNoCheck ("C_ProjectTask_ID", null); else -set_ValueNoCheck ("C_ProjectTask_ID", Integer.valueOf(C_ProjectTask_ID)); -} +set_ValueNoCheck ("C_ProjectTask_ID", Integer.valueOf(C_ProjectTask_ID)); +} /** Get Project Task. @return Actual Project Task in a Phase */ -public int getC_ProjectTask_ID() -{ -Integer ii = (Integer)get_Value("C_ProjectTask_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_ProjectTask_ID */ -public static final String COLUMNNAME_C_ProjectTask_ID = "C_ProjectTask_ID"; +public static final String COLUMNNAME_C_ProjectTask_ID = "C_ProjectTask_ID"; /** Set Project. @param C_Project_ID Financial Project */ -public void setC_Project_ID (int C_Project_ID) -{ -if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); else -set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); -} +set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); +} /** Get Project. @return Financial Project */ -public int getC_Project_ID() -{ -Integer ii = (Integer)get_Value("C_Project_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Project_ID */ -public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; +public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; /** Set Tax. @param C_Tax_ID Tax identifier */ -public void setC_Tax_ID (int C_Tax_ID) -{ -if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); -set_Value ("C_Tax_ID", Integer.valueOf(C_Tax_ID)); -} +public void setC_Tax_ID (int C_Tax_ID) +{ +if (C_Tax_ID < 1) throw new IllegalArgumentException ("C_Tax_ID is mandatory."); +set_Value ("C_Tax_ID", Integer.valueOf(C_Tax_ID)); +} /** Get Tax. @return Tax identifier */ -public int getC_Tax_ID() -{ -Integer ii = (Integer)get_Value("C_Tax_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Tax_ID() +{ +Integer ii = (Integer)get_Value("C_Tax_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Tax_ID */ -public static final String COLUMNNAME_C_Tax_ID = "C_Tax_ID"; +public static final String COLUMNNAME_C_Tax_ID = "C_Tax_ID"; /** Set UOM. @param C_UOM_ID Unit of Measure */ -public void setC_UOM_ID (int C_UOM_ID) -{ -if (C_UOM_ID <= 0) set_ValueNoCheck ("C_UOM_ID", null); +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID <= 0) set_ValueNoCheck ("C_UOM_ID", null); else -set_ValueNoCheck ("C_UOM_ID", Integer.valueOf(C_UOM_ID)); -} +set_ValueNoCheck ("C_UOM_ID", Integer.valueOf(C_UOM_ID)); +} /** Get UOM. @return Unit of Measure */ -public int getC_UOM_ID() -{ -Integer ii = (Integer)get_Value("C_UOM_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_UOM_ID */ -public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID"; +public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID"; /** Set Description. @param Description Optional short description of the record */ -public void setDescription (String Description) -{ -if (Description != null && Description.length() > 255) -{ -log.warning("Length > 255 - truncated"); -Description = Description.substring(0,254); -} -set_Value ("Description", Description); -} +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} /** Get Description. @return Optional short description of the record */ -public String getDescription() -{ -return (String)get_Value("Description"); -} +public String getDescription() +{ +return (String)get_Value("Description"); +} /** Column name Description */ -public static final String COLUMNNAME_Description = "Description"; +public static final String COLUMNNAME_Description = "Description"; /** Set Description Only. @param IsDescription if true, the line is just description and no transaction */ -public void setIsDescription (boolean IsDescription) -{ -set_Value ("IsDescription", Boolean.valueOf(IsDescription)); -} +public void setIsDescription (boolean IsDescription) +{ +set_Value ("IsDescription", Boolean.valueOf(IsDescription)); +} /** Get Description Only. @return if true, the line is just description and no transaction */ -public boolean isDescription() -{ -Object oo = get_Value("IsDescription"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isDescription() +{ +Object oo = get_Value("IsDescription"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsDescription */ -public static final String COLUMNNAME_IsDescription = "IsDescription"; +public static final String COLUMNNAME_IsDescription = "IsDescription"; /** Set Printed. @param IsPrinted Indicates if this document / line is printed */ -public void setIsPrinted (boolean IsPrinted) -{ -set_Value ("IsPrinted", Boolean.valueOf(IsPrinted)); -} +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", Boolean.valueOf(IsPrinted)); +} /** Get Printed. @return Indicates if this document / line is printed */ -public boolean isPrinted() -{ -Object oo = get_Value("IsPrinted"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsPrinted */ -public static final String COLUMNNAME_IsPrinted = "IsPrinted"; +public static final String COLUMNNAME_IsPrinted = "IsPrinted"; /** Set Line No. @param Line Unique line for this document */ -public void setLine (int Line) -{ -set_Value ("Line", Integer.valueOf(Line)); -} +public void setLine (int Line) +{ +set_Value ("Line", Integer.valueOf(Line)); +} /** Get Line No. @return Unique line for this document */ -public int getLine() -{ -Integer ii = (Integer)get_Value("Line"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name Line */ -public static final String COLUMNNAME_Line = "Line"; +public static final String COLUMNNAME_Line = "Line"; /** Set Line Amount. @param LineNetAmt Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ -public void setLineNetAmt (BigDecimal LineNetAmt) -{ -if (LineNetAmt == null) throw new IllegalArgumentException ("LineNetAmt is mandatory."); -set_ValueNoCheck ("LineNetAmt", LineNetAmt); -} +public void setLineNetAmt (BigDecimal LineNetAmt) +{ +if (LineNetAmt == null) throw new IllegalArgumentException ("LineNetAmt is mandatory."); +set_ValueNoCheck ("LineNetAmt", LineNetAmt); +} /** Get Line Amount. @return Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ -public BigDecimal getLineNetAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getLineNetAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name LineNetAmt */ -public static final String COLUMNNAME_LineNetAmt = "LineNetAmt"; +public static final String COLUMNNAME_LineNetAmt = "LineNetAmt"; /** Set Line Total. @param LineTotalAmt Total line amount incl. Tax */ -public void setLineTotalAmt (BigDecimal LineTotalAmt) -{ -set_Value ("LineTotalAmt", LineTotalAmt); -} +public void setLineTotalAmt (BigDecimal LineTotalAmt) +{ +set_Value ("LineTotalAmt", LineTotalAmt); +} /** Get Line Total. @return Total line amount incl. Tax */ -public BigDecimal getLineTotalAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("LineTotalAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getLineTotalAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineTotalAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name LineTotalAmt */ -public static final String COLUMNNAME_LineTotalAmt = "LineTotalAmt"; +public static final String COLUMNNAME_LineTotalAmt = "LineTotalAmt"; /** Set Attribute Set Instance. @param M_AttributeSetInstance_ID Product Attribute Set Instance */ -public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) -{ -if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); -set_Value ("M_AttributeSetInstance_ID", Integer.valueOf(M_AttributeSetInstance_ID)); -} +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", Integer.valueOf(M_AttributeSetInstance_ID)); +} /** Get Attribute Set Instance. @return Product Attribute Set Instance */ -public int getM_AttributeSetInstance_ID() -{ -Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_AttributeSetInstance_ID */ -public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID"; +public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID"; /** 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 <= 0) set_ValueNoCheck ("M_InOutLine_ID", null); +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_ValueNoCheck ("M_InOutLine_ID", null); else -set_ValueNoCheck ("M_InOutLine_ID", Integer.valueOf(M_InOutLine_ID)); -} +set_ValueNoCheck ("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("M_InOutLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_InOutLine_ID */ -public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID"; +public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID"; /** Set Product. @param M_Product_ID Product, Service, Item */ -public void setM_Product_ID (int M_Product_ID) -{ -if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); else -set_Value ("M_Product_ID", Integer.valueOf(M_Product_ID)); -} +set_Value ("M_Product_ID", Integer.valueOf(M_Product_ID)); +} /** Get Product. @return Product, Service, Item */ -public int getM_Product_ID() -{ -Integer ii = (Integer)get_Value("M_Product_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_Product_ID */ -public static final String COLUMNNAME_M_Product_ID = "M_Product_ID"; +public static final String COLUMNNAME_M_Product_ID = "M_Product_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 <= 0) set_Value ("M_RMALine_ID", null); + else +set_Value ("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("M_RMALine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name M_RMALine_ID */ +public static final String COLUMNNAME_M_RMALine_ID = "M_RMALine_ID"; /** Set Unit Price. @param PriceActual Actual Price */ -public void setPriceActual (BigDecimal PriceActual) -{ -if (PriceActual == null) throw new IllegalArgumentException ("PriceActual is mandatory."); -set_ValueNoCheck ("PriceActual", PriceActual); -} +public void setPriceActual (BigDecimal PriceActual) +{ +if (PriceActual == null) throw new IllegalArgumentException ("PriceActual is mandatory."); +set_ValueNoCheck ("PriceActual", PriceActual); +} /** Get Unit Price. @return Actual Price */ -public BigDecimal getPriceActual() -{ -BigDecimal bd = (BigDecimal)get_Value("PriceActual"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getPriceActual() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceActual"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name PriceActual */ -public static final String COLUMNNAME_PriceActual = "PriceActual"; +public static final String COLUMNNAME_PriceActual = "PriceActual"; /** Set Price. @param PriceEntered Price Entered - the price based on the selected/base UoM */ -public void setPriceEntered (BigDecimal PriceEntered) -{ -if (PriceEntered == null) throw new IllegalArgumentException ("PriceEntered is mandatory."); -set_Value ("PriceEntered", PriceEntered); -} +public void setPriceEntered (BigDecimal PriceEntered) +{ +if (PriceEntered == null) throw new IllegalArgumentException ("PriceEntered is mandatory."); +set_Value ("PriceEntered", PriceEntered); +} /** Get Price. @return Price Entered - the price based on the selected/base UoM */ -public BigDecimal getPriceEntered() -{ -BigDecimal bd = (BigDecimal)get_Value("PriceEntered"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getPriceEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceEntered"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name PriceEntered */ -public static final String COLUMNNAME_PriceEntered = "PriceEntered"; +public static final String COLUMNNAME_PriceEntered = "PriceEntered"; /** Set Limit Price. @param PriceLimit Lowest price for a product */ -public void setPriceLimit (BigDecimal PriceLimit) -{ -if (PriceLimit == null) throw new IllegalArgumentException ("PriceLimit is mandatory."); -set_Value ("PriceLimit", PriceLimit); -} +public void setPriceLimit (BigDecimal PriceLimit) +{ +if (PriceLimit == null) throw new IllegalArgumentException ("PriceLimit is mandatory."); +set_Value ("PriceLimit", PriceLimit); +} /** Get Limit Price. @return Lowest price for a product */ -public BigDecimal getPriceLimit() -{ -BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getPriceLimit() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceLimit"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name PriceLimit */ -public static final String COLUMNNAME_PriceLimit = "PriceLimit"; +public static final String COLUMNNAME_PriceLimit = "PriceLimit"; /** Set List Price. @param PriceList List Price */ -public void setPriceList (BigDecimal PriceList) -{ -if (PriceList == null) throw new IllegalArgumentException ("PriceList is mandatory."); -set_Value ("PriceList", PriceList); -} +public void setPriceList (BigDecimal PriceList) +{ +if (PriceList == null) throw new IllegalArgumentException ("PriceList is mandatory."); +set_Value ("PriceList", PriceList); +} /** Get List Price. @return List Price */ -public BigDecimal getPriceList() -{ -BigDecimal bd = (BigDecimal)get_Value("PriceList"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getPriceList() +{ +BigDecimal bd = (BigDecimal)get_Value("PriceList"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name PriceList */ -public static final String COLUMNNAME_PriceList = "PriceList"; +public static final String COLUMNNAME_PriceList = "PriceList"; /** Set Processed. @param Processed The document has been processed */ -public void setProcessed (boolean Processed) -{ -set_Value ("Processed", Boolean.valueOf(Processed)); -} +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", Boolean.valueOf(Processed)); +} /** Get Processed. @return The document has been processed */ -public boolean isProcessed() -{ -Object oo = get_Value("Processed"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processed */ -public static final String COLUMNNAME_Processed = "Processed"; +public static final String COLUMNNAME_Processed = "Processed"; /** Set Quantity. @param QtyEntered The Quantity Entered is based on the selected UoM */ -public void setQtyEntered (BigDecimal QtyEntered) -{ -if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); -set_Value ("QtyEntered", QtyEntered); -} +public void setQtyEntered (BigDecimal QtyEntered) +{ +if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); +set_Value ("QtyEntered", QtyEntered); +} /** Get Quantity. @return The Quantity Entered is based on the selected UoM */ -public BigDecimal getQtyEntered() -{ -BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getQtyEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name QtyEntered */ -public static final String COLUMNNAME_QtyEntered = "QtyEntered"; +public static final String COLUMNNAME_QtyEntered = "QtyEntered"; /** Set Quantity Invoiced. @param QtyInvoiced Invoiced Quantity */ -public void setQtyInvoiced (BigDecimal QtyInvoiced) -{ -if (QtyInvoiced == null) throw new IllegalArgumentException ("QtyInvoiced is mandatory."); -set_Value ("QtyInvoiced", QtyInvoiced); -} +public void setQtyInvoiced (BigDecimal QtyInvoiced) +{ +if (QtyInvoiced == null) throw new IllegalArgumentException ("QtyInvoiced is mandatory."); +set_Value ("QtyInvoiced", QtyInvoiced); +} /** Get Quantity Invoiced. @return Invoiced Quantity */ -public BigDecimal getQtyInvoiced() -{ -BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getQtyInvoiced() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyInvoiced"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name QtyInvoiced */ -public static final String COLUMNNAME_QtyInvoiced = "QtyInvoiced"; +public static final String COLUMNNAME_QtyInvoiced = "QtyInvoiced"; /** Set Revenue Recognition Amt. @param RRAmt Revenue Recognition Amount */ -public void setRRAmt (BigDecimal RRAmt) -{ -set_Value ("RRAmt", RRAmt); -} +public void setRRAmt (BigDecimal RRAmt) +{ +set_Value ("RRAmt", RRAmt); +} /** Get Revenue Recognition Amt. @return Revenue Recognition Amount */ -public BigDecimal getRRAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("RRAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getRRAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("RRAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name RRAmt */ -public static final String COLUMNNAME_RRAmt = "RRAmt"; +public static final String COLUMNNAME_RRAmt = "RRAmt"; /** Set Revenue Recognition Start. @param RRStartDate Revenue Recognition Start Date */ -public void setRRStartDate (Timestamp RRStartDate) -{ -set_Value ("RRStartDate", RRStartDate); -} +public void setRRStartDate (Timestamp RRStartDate) +{ +set_Value ("RRStartDate", RRStartDate); +} /** Get Revenue Recognition Start. @return Revenue Recognition Start Date */ -public Timestamp getRRStartDate() -{ -return (Timestamp)get_Value("RRStartDate"); -} +public Timestamp getRRStartDate() +{ +return (Timestamp)get_Value("RRStartDate"); +} /** Column name RRStartDate */ -public static final String COLUMNNAME_RRStartDate = "RRStartDate"; +public static final String COLUMNNAME_RRStartDate = "RRStartDate"; /** Set Referenced Invoice Line. @param Ref_InvoiceLine_ID Referenced Invoice Line */ -public void setRef_InvoiceLine_ID (int Ref_InvoiceLine_ID) -{ -if (Ref_InvoiceLine_ID <= 0) set_Value ("Ref_InvoiceLine_ID", null); +public void setRef_InvoiceLine_ID (int Ref_InvoiceLine_ID) +{ +if (Ref_InvoiceLine_ID <= 0) set_Value ("Ref_InvoiceLine_ID", null); else -set_Value ("Ref_InvoiceLine_ID", Integer.valueOf(Ref_InvoiceLine_ID)); -} +set_Value ("Ref_InvoiceLine_ID", Integer.valueOf(Ref_InvoiceLine_ID)); +} /** Get Referenced Invoice Line. @return Referenced Invoice Line */ -public int getRef_InvoiceLine_ID() -{ -Integer ii = (Integer)get_Value("Ref_InvoiceLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getRef_InvoiceLine_ID() +{ +Integer ii = (Integer)get_Value("Ref_InvoiceLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name Ref_InvoiceLine_ID */ -public static final String COLUMNNAME_Ref_InvoiceLine_ID = "Ref_InvoiceLine_ID"; +public static final String COLUMNNAME_Ref_InvoiceLine_ID = "Ref_InvoiceLine_ID"; /** Set Resource Assignment. @param S_ResourceAssignment_ID Resource Assignment */ -public void setS_ResourceAssignment_ID (int S_ResourceAssignment_ID) -{ -if (S_ResourceAssignment_ID <= 0) set_ValueNoCheck ("S_ResourceAssignment_ID", null); +public void setS_ResourceAssignment_ID (int S_ResourceAssignment_ID) +{ +if (S_ResourceAssignment_ID <= 0) set_ValueNoCheck ("S_ResourceAssignment_ID", null); else -set_ValueNoCheck ("S_ResourceAssignment_ID", Integer.valueOf(S_ResourceAssignment_ID)); -} +set_ValueNoCheck ("S_ResourceAssignment_ID", Integer.valueOf(S_ResourceAssignment_ID)); +} /** Get Resource Assignment. @return Resource Assignment */ -public int getS_ResourceAssignment_ID() -{ -Integer ii = (Integer)get_Value("S_ResourceAssignment_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getS_ResourceAssignment_ID() +{ +Integer ii = (Integer)get_Value("S_ResourceAssignment_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name S_ResourceAssignment_ID */ -public static final String COLUMNNAME_S_ResourceAssignment_ID = "S_ResourceAssignment_ID"; +public static final String COLUMNNAME_S_ResourceAssignment_ID = "S_ResourceAssignment_ID"; /** Set Tax Amount. @param TaxAmt Tax Amount for a document */ -public void setTaxAmt (BigDecimal TaxAmt) -{ -set_Value ("TaxAmt", TaxAmt); -} +public void setTaxAmt (BigDecimal TaxAmt) +{ +set_Value ("TaxAmt", TaxAmt); +} /** Get Tax Amount. @return Tax Amount for a document */ -public BigDecimal getTaxAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getTaxAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("TaxAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name TaxAmt */ -public static final String COLUMNNAME_TaxAmt = "TaxAmt"; +public static final String COLUMNNAME_TaxAmt = "TaxAmt"; /** User1_ID AD_Reference_ID=134 */ -public static final int USER1_ID_AD_Reference_ID=134; +public static final int USER1_ID_AD_Reference_ID=134; /** Set User List 1. @param User1_ID User defined list element #1 */ -public void setUser1_ID (int User1_ID) -{ -if (User1_ID <= 0) set_Value ("User1_ID", null); +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); else -set_Value ("User1_ID", Integer.valueOf(User1_ID)); -} +set_Value ("User1_ID", Integer.valueOf(User1_ID)); +} /** Get User List 1. @return User defined list element #1 */ -public int getUser1_ID() -{ -Integer ii = (Integer)get_Value("User1_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User1_ID */ -public static final String COLUMNNAME_User1_ID = "User1_ID"; +public static final String COLUMNNAME_User1_ID = "User1_ID"; /** User2_ID AD_Reference_ID=137 */ -public static final int USER2_ID_AD_Reference_ID=137; +public static final int USER2_ID_AD_Reference_ID=137; /** Set User List 2. @param User2_ID User defined list element #2 */ -public void setUser2_ID (int User2_ID) -{ -if (User2_ID <= 0) set_Value ("User2_ID", null); +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); else -set_Value ("User2_ID", Integer.valueOf(User2_ID)); -} +set_Value ("User2_ID", Integer.valueOf(User2_ID)); +} /** Get User List 2. @return User defined list element #2 */ -public int getUser2_ID() -{ -Integer ii = (Integer)get_Value("User2_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User2_ID */ -public static final String COLUMNNAME_User2_ID = "User2_ID"; -} +public static final String COLUMNNAME_User2_ID = "User2_ID"; +} diff --git a/base/src/org/compiere/model/X_M_InOut.java b/base/src/org/compiere/model/X_M_InOut.java index 294a5dc2f2..99c0a98f61 100644 --- a/base/src/org/compiere/model/X_M_InOut.java +++ b/base/src/org/compiere/model/X_M_InOut.java @@ -1,1253 +1,1271 @@ /****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * - * This program is free software; + * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * - * with this program; + * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -package org.compiere.model; +package org.compiere.model; /** Generated Model - DO NOT CHANGE */ -import java.util.*; -import java.sql.*; -import java.math.*; -import org.compiere.util.*; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; /** Generated Model for M_InOut * @author Adempiere (generated) * @version Release 3.2.0 - $Id$ */ -public class X_M_InOut extends PO -{ +public class X_M_InOut extends PO +{ /** Standard Constructor @param ctx context @param M_InOut_ID id @param trxName transaction */ -public X_M_InOut (Properties ctx, int M_InOut_ID, String trxName) -{ -super (ctx, M_InOut_ID, trxName); -/** if (M_InOut_ID == 0) -{ -setC_BPartner_ID (0); -setC_BPartner_Location_ID (0); -setC_DocType_ID (0); -setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ -setDeliveryRule (null); // A -setDeliveryViaRule (null); // P -setDocAction (null); // CO -setDocStatus (null); // DR -setDocumentNo (null); -setFreightCostRule (null); // I -setIsApproved (false); -setIsInDispute (false); -setIsInTransit (false); -setIsPrinted (false); -setIsSOTrx (false); // @IsSOTrx@ -setM_InOut_ID (0); -setM_Warehouse_ID (0); -setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ -setMovementType (null); -setPosted (false); -setPriorityRule (null); // 5 -setProcessed (false); -setSendEMail (false); -} +public X_M_InOut (Properties ctx, int M_InOut_ID, String trxName) +{ +super (ctx, M_InOut_ID, trxName); +/** if (M_InOut_ID == 0) +{ +setC_BPartner_ID (0); +setC_BPartner_Location_ID (0); +setC_DocType_ID (0); +setDateAcct (new Timestamp(System.currentTimeMillis())); // @#Date@ +setDeliveryRule (null); // A +setDeliveryViaRule (null); // P +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setFreightCostRule (null); // I +setIsApproved (false); +setIsInDispute (false); +setIsInTransit (false); +setIsPrinted (false); +setIsSOTrx (false); // @IsSOTrx@ +setM_InOut_ID (0); +setM_Warehouse_ID (0); +setMovementDate (new Timestamp(System.currentTimeMillis())); // @#Date@ +setMovementType (null); +setPosted (false); +setPriorityRule (null); // 5 +setProcessed (false); +setSendEMail (false); +} */ -} +} /** Load Constructor @param ctx context @param rs result set @param trxName transaction */ -public X_M_InOut (Properties ctx, ResultSet rs, String trxName) -{ -super (ctx, rs, trxName); -} -/** AD_Table_ID=319 */ -public static final int Table_ID=MTable.getTable_ID("M_InOut"); - +public X_M_InOut (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} /** TableName=M_InOut */ -public static final String Table_Name="M_InOut"; +public static final String Table_Name="M_InOut"; -protected static KeyNamePair Model = new KeyNamePair(Table_ID,"M_InOut"); +/** AD_Table_ID=319 */ +public static final int Table_ID=MTable.getTable_ID(Table_Name); -protected BigDecimal accessLevel = BigDecimal.valueOf(1); +protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + +protected BigDecimal accessLevel = BigDecimal.valueOf(1); /** AccessLevel @return 1 - Org */ -protected int get_AccessLevel() -{ -return accessLevel.intValue(); -} +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} /** Load Meta Data @param ctx context @return PO Info */ -protected POInfo initPO (Properties ctx) -{ -POInfo poi = POInfo.getPOInfo (ctx, Table_ID); -return poi; -} +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} /** Info @return info */ -public String toString() -{ -StringBuffer sb = new StringBuffer ("X_M_InOut[").append(get_ID()).append("]"); -return sb.toString(); -} +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOut[").append(get_ID()).append("]"); +return sb.toString(); +} /** AD_OrgTrx_ID AD_Reference_ID=130 */ -public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; /** Set Trx Organization. @param AD_OrgTrx_ID Performing or initiating organization */ -public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) -{ -if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); else -set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); -} +set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); +} /** Get Trx Organization. @return Performing or initiating organization */ -public int getAD_OrgTrx_ID() -{ -Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name AD_OrgTrx_ID */ -public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; +public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; /** Set User/Contact. @param AD_User_ID User within the system - Internal or Business Partner Contact */ -public void setAD_User_ID (int AD_User_ID) -{ -if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); +public void setAD_User_ID (int AD_User_ID) +{ +if (AD_User_ID <= 0) set_Value ("AD_User_ID", null); else -set_Value ("AD_User_ID", Integer.valueOf(AD_User_ID)); -} +set_Value ("AD_User_ID", Integer.valueOf(AD_User_ID)); +} /** Get User/Contact. @return User within the system - Internal or Business Partner Contact */ -public int getAD_User_ID() -{ -Integer ii = (Integer)get_Value("AD_User_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getAD_User_ID() +{ +Integer ii = (Integer)get_Value("AD_User_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name AD_User_ID */ -public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; +public static final String COLUMNNAME_AD_User_ID = "AD_User_ID"; /** Set Activity. @param C_Activity_ID Business Activity */ -public void setC_Activity_ID (int C_Activity_ID) -{ -if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); else -set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); -} +set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); +} /** Get Activity. @return Business Activity */ -public int getC_Activity_ID() -{ -Integer ii = (Integer)get_Value("C_Activity_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Activity_ID */ -public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; +public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; /** Set Business Partner . @param C_BPartner_ID Identifies a Business Partner */ -public void setC_BPartner_ID (int C_BPartner_ID) -{ -if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); -set_Value ("C_BPartner_ID", Integer.valueOf(C_BPartner_ID)); -} +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID < 1) throw new IllegalArgumentException ("C_BPartner_ID is mandatory."); +set_Value ("C_BPartner_ID", Integer.valueOf(C_BPartner_ID)); +} /** Get Business Partner . @return Identifies a Business Partner */ -public int getC_BPartner_ID() -{ -Integer ii = (Integer)get_Value("C_BPartner_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_BPartner_ID */ -public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; +public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; /** Set Partner Location. @param C_BPartner_Location_ID Identifies the (ship to) address for this Business Partner */ -public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) -{ -if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); -set_Value ("C_BPartner_Location_ID", Integer.valueOf(C_BPartner_Location_ID)); -} +public void setC_BPartner_Location_ID (int C_BPartner_Location_ID) +{ +if (C_BPartner_Location_ID < 1) throw new IllegalArgumentException ("C_BPartner_Location_ID is mandatory."); +set_Value ("C_BPartner_Location_ID", Integer.valueOf(C_BPartner_Location_ID)); +} /** Get Partner Location. @return Identifies the (ship to) address for this Business Partner */ -public int getC_BPartner_Location_ID() -{ -Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_BPartner_Location_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_Location_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_BPartner_Location_ID */ -public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; +public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID"; /** Set Campaign. @param C_Campaign_ID Marketing Campaign */ -public void setC_Campaign_ID (int C_Campaign_ID) -{ -if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); else -set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); -} +set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); +} /** Get Campaign. @return Marketing Campaign */ -public int getC_Campaign_ID() -{ -Integer ii = (Integer)get_Value("C_Campaign_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Campaign_ID */ -public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; +public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; /** C_Charge_ID AD_Reference_ID=200 */ -public static final int C_CHARGE_ID_AD_Reference_ID=200; +public static final int C_CHARGE_ID_AD_Reference_ID=200; /** Set Charge. @param C_Charge_ID Additional document charges */ -public void setC_Charge_ID (int C_Charge_ID) -{ -if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); else -set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); -} +set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); +} /** Get Charge. @return Additional document charges */ -public int getC_Charge_ID() -{ -Integer ii = (Integer)get_Value("C_Charge_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Charge_ID */ -public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; +public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; /** C_DocType_ID AD_Reference_ID=170 */ -public static final int C_DOCTYPE_ID_AD_Reference_ID=170; +public static final int C_DOCTYPE_ID_AD_Reference_ID=170; /** Set Document Type. @param C_DocType_ID Document type or rules */ -public void setC_DocType_ID (int C_DocType_ID) -{ -if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); -set_ValueNoCheck ("C_DocType_ID", Integer.valueOf(C_DocType_ID)); -} +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_ValueNoCheck ("C_DocType_ID", Integer.valueOf(C_DocType_ID)); +} /** Get Document Type. @return Document type or rules */ -public int getC_DocType_ID() -{ -Integer ii = (Integer)get_Value("C_DocType_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_DocType_ID */ -public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; +public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; /** Set Invoice. @param C_Invoice_ID Invoice Identifier */ -public void setC_Invoice_ID (int C_Invoice_ID) -{ -if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); +public void setC_Invoice_ID (int C_Invoice_ID) +{ +if (C_Invoice_ID <= 0) set_ValueNoCheck ("C_Invoice_ID", null); else -set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID)); -} +set_ValueNoCheck ("C_Invoice_ID", Integer.valueOf(C_Invoice_ID)); +} /** Get Invoice. @return Invoice Identifier */ -public int getC_Invoice_ID() -{ -Integer ii = (Integer)get_Value("C_Invoice_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Invoice_ID() +{ +Integer ii = (Integer)get_Value("C_Invoice_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Invoice_ID */ -public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; +public static final String COLUMNNAME_C_Invoice_ID = "C_Invoice_ID"; /** Set Order. @param C_Order_ID Order */ -public void setC_Order_ID (int C_Order_ID) -{ -if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); else -set_ValueNoCheck ("C_Order_ID", Integer.valueOf(C_Order_ID)); -} +set_ValueNoCheck ("C_Order_ID", Integer.valueOf(C_Order_ID)); +} /** Get Order. @return Order */ -public int getC_Order_ID() -{ -Integer ii = (Integer)get_Value("C_Order_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Order_ID */ -public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; +public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; /** Set Project. @param C_Project_ID Financial Project */ -public void setC_Project_ID (int C_Project_ID) -{ -if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); else -set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); -} +set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); +} /** Get Project. @return Financial Project */ -public int getC_Project_ID() -{ -Integer ii = (Integer)get_Value("C_Project_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Project_ID */ -public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; +public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; /** Set Charge amount. @param ChargeAmt Charge Amount */ -public void setChargeAmt (BigDecimal ChargeAmt) -{ -set_Value ("ChargeAmt", ChargeAmt); -} +public void setChargeAmt (BigDecimal ChargeAmt) +{ +set_Value ("ChargeAmt", ChargeAmt); +} /** Get Charge amount. @return Charge Amount */ -public BigDecimal getChargeAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getChargeAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("ChargeAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name ChargeAmt */ -public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; +public static final String COLUMNNAME_ChargeAmt = "ChargeAmt"; /** Set Create Confirm. @param CreateConfirm Create Confirm */ -public void setCreateConfirm (String CreateConfirm) -{ -if (CreateConfirm != null && CreateConfirm.length() > 1) -{ -log.warning("Length > 1 - truncated"); -CreateConfirm = CreateConfirm.substring(0,0); -} -set_Value ("CreateConfirm", CreateConfirm); -} +public void setCreateConfirm (String CreateConfirm) +{ +if (CreateConfirm != null && CreateConfirm.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateConfirm = CreateConfirm.substring(0,0); +} +set_Value ("CreateConfirm", CreateConfirm); +} /** Get Create Confirm. @return Create Confirm */ -public String getCreateConfirm() -{ -return (String)get_Value("CreateConfirm"); -} +public String getCreateConfirm() +{ +return (String)get_Value("CreateConfirm"); +} /** Column name CreateConfirm */ -public static final String COLUMNNAME_CreateConfirm = "CreateConfirm"; +public static final String COLUMNNAME_CreateConfirm = "CreateConfirm"; /** Set Create lines from. @param CreateFrom Process which will generate a new document lines based on an existing document */ -public void setCreateFrom (String CreateFrom) -{ -if (CreateFrom != null && CreateFrom.length() > 1) -{ -log.warning("Length > 1 - truncated"); -CreateFrom = CreateFrom.substring(0,0); -} -set_Value ("CreateFrom", CreateFrom); -} +public void setCreateFrom (String CreateFrom) +{ +if (CreateFrom != null && CreateFrom.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreateFrom = CreateFrom.substring(0,0); +} +set_Value ("CreateFrom", CreateFrom); +} /** Get Create lines from. @return Process which will generate a new document lines based on an existing document */ -public String getCreateFrom() -{ -return (String)get_Value("CreateFrom"); -} +public String getCreateFrom() +{ +return (String)get_Value("CreateFrom"); +} /** Column name CreateFrom */ -public static final String COLUMNNAME_CreateFrom = "CreateFrom"; +public static final String COLUMNNAME_CreateFrom = "CreateFrom"; /** Set Create Package. @param CreatePackage Create Package */ -public void setCreatePackage (String CreatePackage) -{ -if (CreatePackage != null && CreatePackage.length() > 1) -{ -log.warning("Length > 1 - truncated"); -CreatePackage = CreatePackage.substring(0,0); -} -set_Value ("CreatePackage", CreatePackage); -} +public void setCreatePackage (String CreatePackage) +{ +if (CreatePackage != null && CreatePackage.length() > 1) +{ +log.warning("Length > 1 - truncated"); +CreatePackage = CreatePackage.substring(0,0); +} +set_Value ("CreatePackage", CreatePackage); +} /** Get Create Package. @return Create Package */ -public String getCreatePackage() -{ -return (String)get_Value("CreatePackage"); -} +public String getCreatePackage() +{ +return (String)get_Value("CreatePackage"); +} /** Column name CreatePackage */ -public static final String COLUMNNAME_CreatePackage = "CreatePackage"; +public static final String COLUMNNAME_CreatePackage = "CreatePackage"; /** Set Account Date. @param DateAcct Accounting Date */ -public void setDateAcct (Timestamp DateAcct) -{ -if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); -set_Value ("DateAcct", DateAcct); -} +public void setDateAcct (Timestamp DateAcct) +{ +if (DateAcct == null) throw new IllegalArgumentException ("DateAcct is mandatory."); +set_Value ("DateAcct", DateAcct); +} /** Get Account Date. @return Accounting Date */ -public Timestamp getDateAcct() -{ -return (Timestamp)get_Value("DateAcct"); -} +public Timestamp getDateAcct() +{ +return (Timestamp)get_Value("DateAcct"); +} /** Column name DateAcct */ -public static final String COLUMNNAME_DateAcct = "DateAcct"; +public static final String COLUMNNAME_DateAcct = "DateAcct"; /** Set Date Ordered. @param DateOrdered Date of Order */ -public void setDateOrdered (Timestamp DateOrdered) -{ -set_ValueNoCheck ("DateOrdered", DateOrdered); -} +public void setDateOrdered (Timestamp DateOrdered) +{ +set_ValueNoCheck ("DateOrdered", DateOrdered); +} /** Get Date Ordered. @return Date of Order */ -public Timestamp getDateOrdered() -{ -return (Timestamp)get_Value("DateOrdered"); -} +public Timestamp getDateOrdered() +{ +return (Timestamp)get_Value("DateOrdered"); +} /** Column name DateOrdered */ -public static final String COLUMNNAME_DateOrdered = "DateOrdered"; +public static final String COLUMNNAME_DateOrdered = "DateOrdered"; /** Set Date printed. @param DatePrinted Date the document was printed. */ -public void setDatePrinted (Timestamp DatePrinted) -{ -set_Value ("DatePrinted", DatePrinted); -} +public void setDatePrinted (Timestamp DatePrinted) +{ +set_Value ("DatePrinted", DatePrinted); +} /** Get Date printed. @return Date the document was printed. */ -public Timestamp getDatePrinted() -{ -return (Timestamp)get_Value("DatePrinted"); -} +public Timestamp getDatePrinted() +{ +return (Timestamp)get_Value("DatePrinted"); +} /** Column name DatePrinted */ -public static final String COLUMNNAME_DatePrinted = "DatePrinted"; +public static final String COLUMNNAME_DatePrinted = "DatePrinted"; /** Set Date received. @param DateReceived Date a product was received */ -public void setDateReceived (Timestamp DateReceived) -{ -set_Value ("DateReceived", DateReceived); -} +public void setDateReceived (Timestamp DateReceived) +{ +set_Value ("DateReceived", DateReceived); +} /** Get Date received. @return Date a product was received */ -public Timestamp getDateReceived() -{ -return (Timestamp)get_Value("DateReceived"); -} +public Timestamp getDateReceived() +{ +return (Timestamp)get_Value("DateReceived"); +} /** Column name DateReceived */ -public static final String COLUMNNAME_DateReceived = "DateReceived"; +public static final String COLUMNNAME_DateReceived = "DateReceived"; /** DeliveryRule AD_Reference_ID=151 */ -public static final int DELIVERYRULE_AD_Reference_ID=151; -/** Availability = A */ -public static final String DELIVERYRULE_Availability = "A"; -/** Force = F */ -public static final String DELIVERYRULE_Force = "F"; -/** Complete Line = L */ -public static final String DELIVERYRULE_CompleteLine = "L"; -/** Manual = M */ -public static final String DELIVERYRULE_Manual = "M"; -/** Complete Order = O */ -public static final String DELIVERYRULE_CompleteOrder = "O"; +public static final int DELIVERYRULE_AD_Reference_ID=151; /** After Receipt = R */ -public static final String DELIVERYRULE_AfterReceipt = "R"; +public static final String DELIVERYRULE_AfterReceipt = "R"; +/** Availability = A */ +public static final String DELIVERYRULE_Availability = "A"; +/** Complete Line = L */ +public static final String DELIVERYRULE_CompleteLine = "L"; +/** Complete Order = O */ +public static final String DELIVERYRULE_CompleteOrder = "O"; +/** Manual = M */ +public static final String DELIVERYRULE_Manual = "M"; +/** Force = F */ +public static final String DELIVERYRULE_Force = "F"; /** Set Delivery Rule. @param DeliveryRule Defines the timing of Delivery */ -public void setDeliveryRule (String DeliveryRule) -{ -if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); -if (DeliveryRule.equals("A") || DeliveryRule.equals("F") || DeliveryRule.equals("L") || DeliveryRule.equals("M") || DeliveryRule.equals("O") || DeliveryRule.equals("R")); - else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - A - F - L - M - O - R"); -if (DeliveryRule.length() > 1) -{ -log.warning("Length > 1 - truncated"); -DeliveryRule = DeliveryRule.substring(0,0); -} -set_Value ("DeliveryRule", DeliveryRule); -} +public void setDeliveryRule (String DeliveryRule) +{ +if (DeliveryRule == null) throw new IllegalArgumentException ("DeliveryRule is mandatory"); +if (DeliveryRule.equals("R") || DeliveryRule.equals("A") || DeliveryRule.equals("L") || DeliveryRule.equals("O") || DeliveryRule.equals("M") || DeliveryRule.equals("F")); + else throw new IllegalArgumentException ("DeliveryRule Invalid value - " + DeliveryRule + " - Reference_ID=151 - R - A - L - O - M - F"); +if (DeliveryRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryRule = DeliveryRule.substring(0,0); +} +set_Value ("DeliveryRule", DeliveryRule); +} /** Get Delivery Rule. @return Defines the timing of Delivery */ -public String getDeliveryRule() -{ -return (String)get_Value("DeliveryRule"); -} +public String getDeliveryRule() +{ +return (String)get_Value("DeliveryRule"); +} /** Column name DeliveryRule */ -public static final String COLUMNNAME_DeliveryRule = "DeliveryRule"; +public static final String COLUMNNAME_DeliveryRule = "DeliveryRule"; /** DeliveryViaRule AD_Reference_ID=152 */ -public static final int DELIVERYVIARULE_AD_Reference_ID=152; -/** Delivery = D */ -public static final String DELIVERYVIARULE_Delivery = "D"; +public static final int DELIVERYVIARULE_AD_Reference_ID=152; /** Pickup = P */ -public static final String DELIVERYVIARULE_Pickup = "P"; +public static final String DELIVERYVIARULE_Pickup = "P"; +/** Delivery = D */ +public static final String DELIVERYVIARULE_Delivery = "D"; /** Shipper = S */ -public static final String DELIVERYVIARULE_Shipper = "S"; +public static final String DELIVERYVIARULE_Shipper = "S"; /** Set Delivery Via. @param DeliveryViaRule How the order will be delivered */ -public void setDeliveryViaRule (String DeliveryViaRule) -{ -if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); -if (DeliveryViaRule.equals("D") || DeliveryViaRule.equals("P") || DeliveryViaRule.equals("S")); - else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - D - P - S"); -if (DeliveryViaRule.length() > 1) -{ -log.warning("Length > 1 - truncated"); -DeliveryViaRule = DeliveryViaRule.substring(0,0); -} -set_Value ("DeliveryViaRule", DeliveryViaRule); -} +public void setDeliveryViaRule (String DeliveryViaRule) +{ +if (DeliveryViaRule == null) throw new IllegalArgumentException ("DeliveryViaRule is mandatory"); +if (DeliveryViaRule.equals("P") || DeliveryViaRule.equals("D") || DeliveryViaRule.equals("S")); + else throw new IllegalArgumentException ("DeliveryViaRule Invalid value - " + DeliveryViaRule + " - Reference_ID=152 - P - D - S"); +if (DeliveryViaRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +DeliveryViaRule = DeliveryViaRule.substring(0,0); +} +set_Value ("DeliveryViaRule", DeliveryViaRule); +} /** Get Delivery Via. @return How the order will be delivered */ -public String getDeliveryViaRule() -{ -return (String)get_Value("DeliveryViaRule"); -} +public String getDeliveryViaRule() +{ +return (String)get_Value("DeliveryViaRule"); +} /** Column name DeliveryViaRule */ -public static final String COLUMNNAME_DeliveryViaRule = "DeliveryViaRule"; +public static final String COLUMNNAME_DeliveryViaRule = "DeliveryViaRule"; /** Set Description. @param Description Optional short description of the record */ -public void setDescription (String Description) -{ -if (Description != null && Description.length() > 255) -{ -log.warning("Length > 255 - truncated"); -Description = Description.substring(0,254); -} -set_Value ("Description", Description); -} +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} /** Get Description. @return Optional short description of the record */ -public String getDescription() -{ -return (String)get_Value("Description"); -} +public String getDescription() +{ +return (String)get_Value("Description"); +} /** Column name Description */ -public static final String COLUMNNAME_Description = "Description"; +public static final String COLUMNNAME_Description = "Description"; /** DocAction AD_Reference_ID=135 */ -public static final int DOCACTION_AD_Reference_ID=135; -/** = -- */ -public static final String DOCACTION_None = "--"; -/** Approve = AP */ -public static final String DOCACTION_Approve = "AP"; -/** Close = CL */ -public static final String DOCACTION_Close = "CL"; +public static final int DOCACTION_AD_Reference_ID=135; /** Complete = CO */ -public static final String DOCACTION_Complete = "CO"; -/** Invalidate = IN */ -public static final String DOCACTION_Invalidate = "IN"; -/** Post = PO */ -public static final String DOCACTION_Post = "PO"; -/** Prepare = PR */ -public static final String DOCACTION_Prepare = "PR"; -/** Reverse - Accrual = RA */ -public static final String DOCACTION_Reverse_Accrual = "RA"; -/** Reverse - Correct = RC */ -public static final String DOCACTION_Reverse_Correct = "RC"; -/** Re-activate = RE */ -public static final String DOCACTION_Re_Activate = "RE"; +public static final String DOCACTION_Complete = "CO"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; /** Reject = RJ */ -public static final String DOCACTION_Reject = "RJ"; +public static final String DOCACTION_Reject = "RJ"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; /** Void = VO */ -public static final String DOCACTION_Void = "VO"; +public static final String DOCACTION_Void = "VO"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** = -- */ +public static final String DOCACTION_None = "--"; /** Wait Complete = WC */ -public static final String DOCACTION_WaitComplete = "WC"; +public static final String DOCACTION_WaitComplete = "WC"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; /** Unlock = XL */ -public static final String DOCACTION_Unlock = "XL"; +public static final String DOCACTION_Unlock = "XL"; /** Set Document Action. @param DocAction The targeted status of the document */ -public void setDocAction (String DocAction) -{ -if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); -if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); - else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); -if (DocAction.length() > 2) -{ -log.warning("Length > 2 - truncated"); -DocAction = DocAction.substring(0,1); -} -set_Value ("DocAction", DocAction); -} +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("WC") || DocAction.equals("PR") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - WC - PR - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} /** Get Document Action. @return The targeted status of the document */ -public String getDocAction() -{ -return (String)get_Value("DocAction"); -} +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} /** Column name DocAction */ -public static final String COLUMNNAME_DocAction = "DocAction"; +public static final String COLUMNNAME_DocAction = "DocAction"; /** DocStatus AD_Reference_ID=131 */ -public static final int DOCSTATUS_AD_Reference_ID=131; -/** Unknown = ?? */ -public static final String DOCSTATUS_Unknown = "??"; -/** Approved = AP */ -public static final String DOCSTATUS_Approved = "AP"; -/** Closed = CL */ -public static final String DOCSTATUS_Closed = "CL"; -/** Completed = CO */ -public static final String DOCSTATUS_Completed = "CO"; -/** Drafted = DR */ -public static final String DOCSTATUS_Drafted = "DR"; -/** Invalid = IN */ -public static final String DOCSTATUS_Invalid = "IN"; -/** In Progress = IP */ -public static final String DOCSTATUS_InProgress = "IP"; -/** Not Approved = NA */ -public static final String DOCSTATUS_NotApproved = "NA"; -/** Reversed = RE */ -public static final String DOCSTATUS_Reversed = "RE"; -/** Voided = VO */ -public static final String DOCSTATUS_Voided = "VO"; +public static final int DOCSTATUS_AD_Reference_ID=131; /** Waiting Confirmation = WC */ -public static final String DOCSTATUS_WaitingConfirmation = "WC"; +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; /** Waiting Payment = WP */ -public static final String DOCSTATUS_WaitingPayment = "WP"; +public static final String DOCSTATUS_WaitingPayment = "WP"; /** Set Document Status. @param DocStatus The current status of the document */ -public void setDocStatus (String DocStatus) -{ -if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); -if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); - else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); -if (DocStatus.length() > 2) -{ -log.warning("Length > 2 - truncated"); -DocStatus = DocStatus.substring(0,1); -} -set_Value ("DocStatus", DocStatus); -} +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("WC") || DocStatus.equals("IP") || DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - WC - IP - DR - CO - AP - NA - VO - IN - RE - CL - ?? - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} /** Get Document Status. @return The current status of the document */ -public String getDocStatus() -{ -return (String)get_Value("DocStatus"); -} +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} /** Column name DocStatus */ -public static final String COLUMNNAME_DocStatus = "DocStatus"; +public static final String COLUMNNAME_DocStatus = "DocStatus"; /** Set Document No. @param DocumentNo Document sequence number of the document */ -public void setDocumentNo (String DocumentNo) -{ -if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); -if (DocumentNo.length() > 30) -{ -log.warning("Length > 30 - truncated"); -DocumentNo = DocumentNo.substring(0,29); -} -set_ValueNoCheck ("DocumentNo", DocumentNo); -} +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_ValueNoCheck ("DocumentNo", DocumentNo); +} /** Get Document No. @return Document sequence number of the document */ -public String getDocumentNo() -{ -return (String)get_Value("DocumentNo"); -} +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} /** Get Record ID/ColumnName @return ID/ColumnName pair -*/public KeyNamePair getKeyNamePair() -{ -return new KeyNamePair(get_ID(), getDocumentNo()); -} +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} /** Column name DocumentNo */ -public static final String COLUMNNAME_DocumentNo = "DocumentNo"; +public static final String COLUMNNAME_DocumentNo = "DocumentNo"; /** Set Freight Amount. @param FreightAmt Freight Amount */ -public void setFreightAmt (BigDecimal FreightAmt) -{ -set_Value ("FreightAmt", FreightAmt); -} +public void setFreightAmt (BigDecimal FreightAmt) +{ +set_Value ("FreightAmt", FreightAmt); +} /** Get Freight Amount. @return Freight Amount */ -public BigDecimal getFreightAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getFreightAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("FreightAmt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name FreightAmt */ -public static final String COLUMNNAME_FreightAmt = "FreightAmt"; +public static final String COLUMNNAME_FreightAmt = "FreightAmt"; /** FreightCostRule AD_Reference_ID=153 */ -public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; -/** Calculated = C */ -public static final String FREIGHTCOSTRULE_Calculated = "C"; -/** Fix price = F */ -public static final String FREIGHTCOSTRULE_FixPrice = "F"; +public static final int FREIGHTCOSTRULE_AD_Reference_ID=153; /** Freight included = I */ -public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; +public static final String FREIGHTCOSTRULE_FreightIncluded = "I"; +/** Fix price = F */ +public static final String FREIGHTCOSTRULE_FixPrice = "F"; +/** Calculated = C */ +public static final String FREIGHTCOSTRULE_Calculated = "C"; /** Line = L */ -public static final String FREIGHTCOSTRULE_Line = "L"; +public static final String FREIGHTCOSTRULE_Line = "L"; /** Set Freight Cost Rule. @param FreightCostRule Method for charging Freight */ -public void setFreightCostRule (String FreightCostRule) -{ -if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); -if (FreightCostRule.equals("C") || FreightCostRule.equals("F") || FreightCostRule.equals("I") || FreightCostRule.equals("L")); - else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - C - F - I - L"); -if (FreightCostRule.length() > 1) -{ -log.warning("Length > 1 - truncated"); -FreightCostRule = FreightCostRule.substring(0,0); -} -set_Value ("FreightCostRule", FreightCostRule); -} +public void setFreightCostRule (String FreightCostRule) +{ +if (FreightCostRule == null) throw new IllegalArgumentException ("FreightCostRule is mandatory"); +if (FreightCostRule.equals("I") || FreightCostRule.equals("F") || FreightCostRule.equals("C") || FreightCostRule.equals("L")); + else throw new IllegalArgumentException ("FreightCostRule Invalid value - " + FreightCostRule + " - Reference_ID=153 - I - F - C - L"); +if (FreightCostRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +FreightCostRule = FreightCostRule.substring(0,0); +} +set_Value ("FreightCostRule", FreightCostRule); +} /** Get Freight Cost Rule. @return Method for charging Freight */ -public String getFreightCostRule() -{ -return (String)get_Value("FreightCostRule"); -} +public String getFreightCostRule() +{ +return (String)get_Value("FreightCostRule"); +} /** Column name FreightCostRule */ -public static final String COLUMNNAME_FreightCostRule = "FreightCostRule"; +public static final String COLUMNNAME_FreightCostRule = "FreightCostRule"; /** Set Generate To. @param GenerateTo Generate To */ -public void setGenerateTo (String GenerateTo) -{ -if (GenerateTo != null && GenerateTo.length() > 1) -{ -log.warning("Length > 1 - truncated"); -GenerateTo = GenerateTo.substring(0,0); -} -set_Value ("GenerateTo", GenerateTo); -} +public void setGenerateTo (String GenerateTo) +{ +if (GenerateTo != null && GenerateTo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateTo = GenerateTo.substring(0,0); +} +set_Value ("GenerateTo", GenerateTo); +} /** Get Generate To. @return Generate To */ -public String getGenerateTo() -{ -return (String)get_Value("GenerateTo"); -} +public String getGenerateTo() +{ +return (String)get_Value("GenerateTo"); +} /** Column name GenerateTo */ -public static final String COLUMNNAME_GenerateTo = "GenerateTo"; +public static final String COLUMNNAME_GenerateTo = "GenerateTo"; /** Set Approved. @param IsApproved Indicates if this document requires approval */ -public void setIsApproved (boolean IsApproved) -{ -set_Value ("IsApproved", Boolean.valueOf(IsApproved)); -} +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", Boolean.valueOf(IsApproved)); +} /** Get Approved. @return Indicates if this document requires approval */ -public boolean isApproved() -{ -Object oo = get_Value("IsApproved"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsApproved */ -public static final String COLUMNNAME_IsApproved = "IsApproved"; +public static final String COLUMNNAME_IsApproved = "IsApproved"; /** Set In Dispute. @param IsInDispute Document is in dispute */ -public void setIsInDispute (boolean IsInDispute) -{ -set_Value ("IsInDispute", Boolean.valueOf(IsInDispute)); -} +public void setIsInDispute (boolean IsInDispute) +{ +set_Value ("IsInDispute", Boolean.valueOf(IsInDispute)); +} /** Get In Dispute. @return Document is in dispute */ -public boolean isInDispute() -{ -Object oo = get_Value("IsInDispute"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isInDispute() +{ +Object oo = get_Value("IsInDispute"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsInDispute */ -public static final String COLUMNNAME_IsInDispute = "IsInDispute"; +public static final String COLUMNNAME_IsInDispute = "IsInDispute"; /** Set In Transit. @param IsInTransit Movement is in transit */ -public void setIsInTransit (boolean IsInTransit) -{ -set_Value ("IsInTransit", Boolean.valueOf(IsInTransit)); -} +public void setIsInTransit (boolean IsInTransit) +{ +set_Value ("IsInTransit", Boolean.valueOf(IsInTransit)); +} /** Get In Transit. @return Movement is in transit */ -public boolean isInTransit() -{ -Object oo = get_Value("IsInTransit"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isInTransit() +{ +Object oo = get_Value("IsInTransit"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsInTransit */ -public static final String COLUMNNAME_IsInTransit = "IsInTransit"; +public static final String COLUMNNAME_IsInTransit = "IsInTransit"; /** Set Printed. @param IsPrinted Indicates if this document / line is printed */ -public void setIsPrinted (boolean IsPrinted) -{ -set_Value ("IsPrinted", Boolean.valueOf(IsPrinted)); -} +public void setIsPrinted (boolean IsPrinted) +{ +set_Value ("IsPrinted", Boolean.valueOf(IsPrinted)); +} /** Get Printed. @return Indicates if this document / line is printed */ -public boolean isPrinted() -{ -Object oo = get_Value("IsPrinted"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPrinted() +{ +Object oo = get_Value("IsPrinted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsPrinted */ -public static final String COLUMNNAME_IsPrinted = "IsPrinted"; +public static final String COLUMNNAME_IsPrinted = "IsPrinted"; /** Set Sales Transaction. @param IsSOTrx This is a Sales Transaction */ -public void setIsSOTrx (boolean IsSOTrx) -{ -set_Value ("IsSOTrx", Boolean.valueOf(IsSOTrx)); -} +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", Boolean.valueOf(IsSOTrx)); +} /** Get Sales Transaction. @return This is a Sales Transaction */ -public boolean isSOTrx() -{ -Object oo = get_Value("IsSOTrx"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsSOTrx */ -public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; +public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; /** Set Shipment/Receipt. @param M_InOut_ID Material Shipment Document */ -public void setM_InOut_ID (int M_InOut_ID) -{ -if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); -set_ValueNoCheck ("M_InOut_ID", Integer.valueOf(M_InOut_ID)); -} +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", Integer.valueOf(M_InOut_ID)); +} /** Get Shipment/Receipt. @return Material Shipment Document */ -public int getM_InOut_ID() -{ -Integer ii = (Integer)get_Value("M_InOut_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_InOut_ID */ -public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID"; +public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID"; +/** Set RMA. +@param M_RMA_ID Return Material Authorization */ +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID <= 0) set_Value ("M_RMA_ID", null); + else +set_Value ("M_RMA_ID", Integer.valueOf(M_RMA_ID)); +} +/** Get RMA. +@return Return Material Authorization */ +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name M_RMA_ID */ +public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; /** Set Shipper. @param M_Shipper_ID Method or manner of product delivery */ -public void setM_Shipper_ID (int M_Shipper_ID) -{ -if (M_Shipper_ID <= 0) set_Value ("M_Shipper_ID", null); +public void setM_Shipper_ID (int M_Shipper_ID) +{ +if (M_Shipper_ID <= 0) set_Value ("M_Shipper_ID", null); else -set_Value ("M_Shipper_ID", Integer.valueOf(M_Shipper_ID)); -} +set_Value ("M_Shipper_ID", Integer.valueOf(M_Shipper_ID)); +} /** Get Shipper. @return Method or manner of product delivery */ -public int getM_Shipper_ID() -{ -Integer ii = (Integer)get_Value("M_Shipper_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_Shipper_ID() +{ +Integer ii = (Integer)get_Value("M_Shipper_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_Shipper_ID */ -public static final String COLUMNNAME_M_Shipper_ID = "M_Shipper_ID"; +public static final String COLUMNNAME_M_Shipper_ID = "M_Shipper_ID"; /** Set Warehouse. @param M_Warehouse_ID Storage Warehouse and Service Point */ -public void setM_Warehouse_ID (int M_Warehouse_ID) -{ -if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); -set_ValueNoCheck ("M_Warehouse_ID", Integer.valueOf(M_Warehouse_ID)); -} +public void setM_Warehouse_ID (int M_Warehouse_ID) +{ +if (M_Warehouse_ID < 1) throw new IllegalArgumentException ("M_Warehouse_ID is mandatory."); +set_ValueNoCheck ("M_Warehouse_ID", Integer.valueOf(M_Warehouse_ID)); +} /** Get Warehouse. @return Storage Warehouse and Service Point */ -public int getM_Warehouse_ID() -{ -Integer ii = (Integer)get_Value("M_Warehouse_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_Warehouse_ID() +{ +Integer ii = (Integer)get_Value("M_Warehouse_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_Warehouse_ID */ -public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID"; +public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID"; /** Set Movement Date. @param MovementDate Date a product was moved in or out of inventory */ -public void setMovementDate (Timestamp MovementDate) -{ -if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); -set_Value ("MovementDate", MovementDate); -} +public void setMovementDate (Timestamp MovementDate) +{ +if (MovementDate == null) throw new IllegalArgumentException ("MovementDate is mandatory."); +set_Value ("MovementDate", MovementDate); +} /** Get Movement Date. @return Date a product was moved in or out of inventory */ -public Timestamp getMovementDate() -{ -return (Timestamp)get_Value("MovementDate"); -} +public Timestamp getMovementDate() +{ +return (Timestamp)get_Value("MovementDate"); +} /** Column name MovementDate */ -public static final String COLUMNNAME_MovementDate = "MovementDate"; +public static final String COLUMNNAME_MovementDate = "MovementDate"; /** MovementType AD_Reference_ID=189 */ -public static final int MOVEMENTTYPE_AD_Reference_ID=189; -/** Customer Returns = C+ */ -public static final String MOVEMENTTYPE_CustomerReturns = "C+"; -/** Customer Shipment = C- */ -public static final String MOVEMENTTYPE_CustomerShipment = "C-"; -/** Inventory In = I+ */ -public static final String MOVEMENTTYPE_InventoryIn = "I+"; -/** Inventory Out = I- */ -public static final String MOVEMENTTYPE_InventoryOut = "I-"; -/** Movement To = M+ */ -public static final String MOVEMENTTYPE_MovementTo = "M+"; -/** Movement From = M- */ -public static final String MOVEMENTTYPE_MovementFrom = "M-"; +public static final int MOVEMENTTYPE_AD_Reference_ID=189; /** Production + = P+ */ -public static final String MOVEMENTTYPE_ProductionPlus = "P+"; +public static final String MOVEMENTTYPE_ProductionPlus = "P+"; /** Production - = P- */ -public static final String MOVEMENTTYPE_Production_ = "P-"; +public static final String MOVEMENTTYPE_Production_ = "P-"; +/** Customer Shipment = C- */ +public static final String MOVEMENTTYPE_CustomerShipment = "C-"; +/** Customer Returns = C+ */ +public static final String MOVEMENTTYPE_CustomerReturns = "C+"; /** Vendor Receipts = V+ */ -public static final String MOVEMENTTYPE_VendorReceipts = "V+"; +public static final String MOVEMENTTYPE_VendorReceipts = "V+"; /** Vendor Returns = V- */ -public static final String MOVEMENTTYPE_VendorReturns = "V-"; +public static final String MOVEMENTTYPE_VendorReturns = "V-"; +/** Inventory Out = I- */ +public static final String MOVEMENTTYPE_InventoryOut = "I-"; +/** Inventory In = I+ */ +public static final String MOVEMENTTYPE_InventoryIn = "I+"; +/** Movement From = M- */ +public static final String MOVEMENTTYPE_MovementFrom = "M-"; +/** Movement To = M+ */ +public static final String MOVEMENTTYPE_MovementTo = "M+"; /** Work Order + = W+ */ -public static final String MOVEMENTTYPE_WorkOrderPlus = "W+"; +public static final String MOVEMENTTYPE_WorkOrderPlus = "W+"; /** Work Order - = W- */ -public static final String MOVEMENTTYPE_WorkOrder_ = "W-"; +public static final String MOVEMENTTYPE_WorkOrder_ = "W-"; /** Set Movement Type. @param MovementType Method of moving the inventory */ -public void setMovementType (String MovementType) -{ -if (MovementType == null) throw new IllegalArgumentException ("MovementType is mandatory"); -if (MovementType.equals("C+") || MovementType.equals("C-") || MovementType.equals("I+") || MovementType.equals("I-") || MovementType.equals("M+") || MovementType.equals("M-") || MovementType.equals("P+") || MovementType.equals("P-") || MovementType.equals("V+") || MovementType.equals("V-") || MovementType.equals("W+") || MovementType.equals("W-")); - else throw new IllegalArgumentException ("MovementType Invalid value - " + MovementType + " - Reference_ID=189 - C+ - C- - I+ - I- - M+ - M- - P+ - P- - V+ - V- - W+ - W-"); -if (MovementType.length() > 2) -{ -log.warning("Length > 2 - truncated"); -MovementType = MovementType.substring(0,1); -} -set_ValueNoCheck ("MovementType", MovementType); -} +public void setMovementType (String MovementType) +{ +if (MovementType == null) throw new IllegalArgumentException ("MovementType is mandatory"); +if (MovementType.equals("P+") || MovementType.equals("P-") || MovementType.equals("C-") || MovementType.equals("C+") || MovementType.equals("V+") || MovementType.equals("V-") || MovementType.equals("I-") || MovementType.equals("I+") || MovementType.equals("M-") || MovementType.equals("M+") || MovementType.equals("W+") || MovementType.equals("W-")); + else throw new IllegalArgumentException ("MovementType Invalid value - " + MovementType + " - Reference_ID=189 - P+ - P- - C- - C+ - V+ - V- - I- - I+ - M- - M+ - W+ - W-"); +if (MovementType.length() > 2) +{ +log.warning("Length > 2 - truncated"); +MovementType = MovementType.substring(0,1); +} +set_ValueNoCheck ("MovementType", MovementType); +} /** Get Movement Type. @return Method of moving the inventory */ -public String getMovementType() -{ -return (String)get_Value("MovementType"); -} +public String getMovementType() +{ +return (String)get_Value("MovementType"); +} /** Column name MovementType */ -public static final String COLUMNNAME_MovementType = "MovementType"; +public static final String COLUMNNAME_MovementType = "MovementType"; /** Set No Packages. @param NoPackages Number of packages shipped */ -public void setNoPackages (int NoPackages) -{ -set_Value ("NoPackages", Integer.valueOf(NoPackages)); -} +public void setNoPackages (int NoPackages) +{ +set_Value ("NoPackages", Integer.valueOf(NoPackages)); +} /** Get No Packages. @return Number of packages shipped */ -public int getNoPackages() -{ -Integer ii = (Integer)get_Value("NoPackages"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getNoPackages() +{ +Integer ii = (Integer)get_Value("NoPackages"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name NoPackages */ -public static final String COLUMNNAME_NoPackages = "NoPackages"; +public static final String COLUMNNAME_NoPackages = "NoPackages"; /** Set Order Reference. @param POReference Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ -public void setPOReference (String POReference) -{ -if (POReference != null && POReference.length() > 20) -{ -log.warning("Length > 20 - truncated"); -POReference = POReference.substring(0,19); -} -set_Value ("POReference", POReference); -} +public void setPOReference (String POReference) +{ +if (POReference != null && POReference.length() > 20) +{ +log.warning("Length > 20 - truncated"); +POReference = POReference.substring(0,19); +} +set_Value ("POReference", POReference); +} /** Get Order Reference. @return Transaction Reference Number (Sales Order, Purchase Order) of your Business Partner */ -public String getPOReference() -{ -return (String)get_Value("POReference"); -} +public String getPOReference() +{ +return (String)get_Value("POReference"); +} /** Column name POReference */ -public static final String COLUMNNAME_POReference = "POReference"; +public static final String COLUMNNAME_POReference = "POReference"; /** Set Pick Date. @param PickDate Date/Time when picked for Shipment */ -public void setPickDate (Timestamp PickDate) -{ -set_Value ("PickDate", PickDate); -} +public void setPickDate (Timestamp PickDate) +{ +set_Value ("PickDate", PickDate); +} /** Get Pick Date. @return Date/Time when picked for Shipment */ -public Timestamp getPickDate() -{ -return (Timestamp)get_Value("PickDate"); -} +public Timestamp getPickDate() +{ +return (Timestamp)get_Value("PickDate"); +} /** Column name PickDate */ -public static final String COLUMNNAME_PickDate = "PickDate"; +public static final String COLUMNNAME_PickDate = "PickDate"; /** Set Posted. @param Posted Posting status */ -public void setPosted (boolean Posted) -{ -set_Value ("Posted", Boolean.valueOf(Posted)); -} +public void setPosted (boolean Posted) +{ +set_Value ("Posted", Boolean.valueOf(Posted)); +} /** Get Posted. @return Posting status */ -public boolean isPosted() -{ -Object oo = get_Value("Posted"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isPosted() +{ +Object oo = get_Value("Posted"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Posted */ -public static final String COLUMNNAME_Posted = "Posted"; +public static final String COLUMNNAME_Posted = "Posted"; /** PriorityRule AD_Reference_ID=154 */ -public static final int PRIORITYRULE_AD_Reference_ID=154; -/** Urgent = 1 */ -public static final String PRIORITYRULE_Urgent = "1"; +public static final int PRIORITYRULE_AD_Reference_ID=154; /** High = 3 */ -public static final String PRIORITYRULE_High = "3"; +public static final String PRIORITYRULE_High = "3"; /** Medium = 5 */ -public static final String PRIORITYRULE_Medium = "5"; +public static final String PRIORITYRULE_Medium = "5"; /** Low = 7 */ -public static final String PRIORITYRULE_Low = "7"; +public static final String PRIORITYRULE_Low = "7"; +/** Urgent = 1 */ +public static final String PRIORITYRULE_Urgent = "1"; /** Minor = 9 */ -public static final String PRIORITYRULE_Minor = "9"; +public static final String PRIORITYRULE_Minor = "9"; /** Set Priority. @param PriorityRule Priority of a document */ -public void setPriorityRule (String PriorityRule) -{ -if (PriorityRule == null) throw new IllegalArgumentException ("PriorityRule is mandatory"); -if (PriorityRule.equals("1") || PriorityRule.equals("3") || PriorityRule.equals("5") || PriorityRule.equals("7") || PriorityRule.equals("9")); - else throw new IllegalArgumentException ("PriorityRule Invalid value - " + PriorityRule + " - Reference_ID=154 - 1 - 3 - 5 - 7 - 9"); -if (PriorityRule.length() > 1) -{ -log.warning("Length > 1 - truncated"); -PriorityRule = PriorityRule.substring(0,0); -} -set_Value ("PriorityRule", PriorityRule); -} +public void setPriorityRule (String PriorityRule) +{ +if (PriorityRule == null) throw new IllegalArgumentException ("PriorityRule is mandatory"); +if (PriorityRule.equals("3") || PriorityRule.equals("5") || PriorityRule.equals("7") || PriorityRule.equals("1") || PriorityRule.equals("9")); + else throw new IllegalArgumentException ("PriorityRule Invalid value - " + PriorityRule + " - Reference_ID=154 - 3 - 5 - 7 - 1 - 9"); +if (PriorityRule.length() > 1) +{ +log.warning("Length > 1 - truncated"); +PriorityRule = PriorityRule.substring(0,0); +} +set_Value ("PriorityRule", PriorityRule); +} /** Get Priority. @return Priority of a document */ -public String getPriorityRule() -{ -return (String)get_Value("PriorityRule"); -} +public String getPriorityRule() +{ +return (String)get_Value("PriorityRule"); +} /** Column name PriorityRule */ -public static final String COLUMNNAME_PriorityRule = "PriorityRule"; +public static final String COLUMNNAME_PriorityRule = "PriorityRule"; /** Set Processed. @param Processed The document has been processed */ -public void setProcessed (boolean Processed) -{ -set_Value ("Processed", Boolean.valueOf(Processed)); -} +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", Boolean.valueOf(Processed)); +} /** Get Processed. @return The document has been processed */ -public boolean isProcessed() -{ -Object oo = get_Value("Processed"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processed */ -public static final String COLUMNNAME_Processed = "Processed"; +public static final String COLUMNNAME_Processed = "Processed"; /** Set Process Now. @param Processing Process Now */ -public void setProcessing (boolean Processing) -{ -set_Value ("Processing", Boolean.valueOf(Processing)); -} +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", Boolean.valueOf(Processing)); +} /** Get Process Now. @return Process Now */ -public boolean isProcessing() -{ -Object oo = get_Value("Processing"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processing */ -public static final String COLUMNNAME_Processing = "Processing"; +public static final String COLUMNNAME_Processing = "Processing"; /** Set Referenced Shipment. @param Ref_InOut_ID Referenced Shipment */ -public void setRef_InOut_ID (int Ref_InOut_ID) -{ -if (Ref_InOut_ID <= 0) set_Value ("Ref_InOut_ID", null); +public void setRef_InOut_ID (int Ref_InOut_ID) +{ +if (Ref_InOut_ID <= 0) set_Value ("Ref_InOut_ID", null); else -set_Value ("Ref_InOut_ID", Integer.valueOf(Ref_InOut_ID)); -} +set_Value ("Ref_InOut_ID", Integer.valueOf(Ref_InOut_ID)); +} /** Get Referenced Shipment. @return Referenced Shipment */ -public int getRef_InOut_ID() -{ -Integer ii = (Integer)get_Value("Ref_InOut_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getRef_InOut_ID() +{ +Integer ii = (Integer)get_Value("Ref_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name Ref_InOut_ID */ -public static final String COLUMNNAME_Ref_InOut_ID = "Ref_InOut_ID"; +public static final String COLUMNNAME_Ref_InOut_ID = "Ref_InOut_ID"; /** SalesRep_ID AD_Reference_ID=190 */ -public static final int SALESREP_ID_AD_Reference_ID=190; +public static final int SALESREP_ID_AD_Reference_ID=190; /** Set Sales Representative. @param SalesRep_ID Sales Representative or Company Agent */ -public void setSalesRep_ID (int SalesRep_ID) -{ -if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID <= 0) set_Value ("SalesRep_ID", null); else -set_Value ("SalesRep_ID", Integer.valueOf(SalesRep_ID)); -} +set_Value ("SalesRep_ID", Integer.valueOf(SalesRep_ID)); +} /** Get Sales Representative. @return Sales Representative or Company Agent */ -public int getSalesRep_ID() -{ -Integer ii = (Integer)get_Value("SalesRep_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name SalesRep_ID */ -public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; +public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; /** Set Send EMail. @param SendEMail Enable sending Document EMail */ -public void setSendEMail (boolean SendEMail) -{ -set_Value ("SendEMail", Boolean.valueOf(SendEMail)); -} +public void setSendEMail (boolean SendEMail) +{ +set_Value ("SendEMail", Boolean.valueOf(SendEMail)); +} /** Get Send EMail. @return Enable sending Document EMail */ -public boolean isSendEMail() -{ -Object oo = get_Value("SendEMail"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isSendEMail() +{ +Object oo = get_Value("SendEMail"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name SendEMail */ -public static final String COLUMNNAME_SendEMail = "SendEMail"; +public static final String COLUMNNAME_SendEMail = "SendEMail"; /** Set Ship Date. @param ShipDate Shipment Date/Time */ -public void setShipDate (Timestamp ShipDate) -{ -set_Value ("ShipDate", ShipDate); -} +public void setShipDate (Timestamp ShipDate) +{ +set_Value ("ShipDate", ShipDate); +} /** Get Ship Date. @return Shipment Date/Time */ -public Timestamp getShipDate() -{ -return (Timestamp)get_Value("ShipDate"); -} +public Timestamp getShipDate() +{ +return (Timestamp)get_Value("ShipDate"); +} /** Column name ShipDate */ -public static final String COLUMNNAME_ShipDate = "ShipDate"; +public static final String COLUMNNAME_ShipDate = "ShipDate"; /** Set Tracking No. @param TrackingNo Number to track the shipment */ -public void setTrackingNo (String TrackingNo) -{ -if (TrackingNo != null && TrackingNo.length() > 60) -{ -log.warning("Length > 60 - truncated"); -TrackingNo = TrackingNo.substring(0,59); -} -set_Value ("TrackingNo", TrackingNo); -} +public void setTrackingNo (String TrackingNo) +{ +if (TrackingNo != null && TrackingNo.length() > 60) +{ +log.warning("Length > 60 - truncated"); +TrackingNo = TrackingNo.substring(0,59); +} +set_Value ("TrackingNo", TrackingNo); +} /** Get Tracking No. @return Number to track the shipment */ -public String getTrackingNo() -{ -return (String)get_Value("TrackingNo"); -} +public String getTrackingNo() +{ +return (String)get_Value("TrackingNo"); +} /** Column name TrackingNo */ -public static final String COLUMNNAME_TrackingNo = "TrackingNo"; +public static final String COLUMNNAME_TrackingNo = "TrackingNo"; /** User1_ID AD_Reference_ID=134 */ -public static final int USER1_ID_AD_Reference_ID=134; +public static final int USER1_ID_AD_Reference_ID=134; /** Set User List 1. @param User1_ID User defined list element #1 */ -public void setUser1_ID (int User1_ID) -{ -if (User1_ID <= 0) set_Value ("User1_ID", null); +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); else -set_Value ("User1_ID", Integer.valueOf(User1_ID)); -} +set_Value ("User1_ID", Integer.valueOf(User1_ID)); +} /** Get User List 1. @return User defined list element #1 */ -public int getUser1_ID() -{ -Integer ii = (Integer)get_Value("User1_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User1_ID */ -public static final String COLUMNNAME_User1_ID = "User1_ID"; +public static final String COLUMNNAME_User1_ID = "User1_ID"; /** User2_ID AD_Reference_ID=137 */ -public static final int USER2_ID_AD_Reference_ID=137; +public static final int USER2_ID_AD_Reference_ID=137; /** Set User List 2. @param User2_ID User defined list element #2 */ -public void setUser2_ID (int User2_ID) -{ -if (User2_ID <= 0) set_Value ("User2_ID", null); +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); else -set_Value ("User2_ID", Integer.valueOf(User2_ID)); -} +set_Value ("User2_ID", Integer.valueOf(User2_ID)); +} /** Get User List 2. @return User defined list element #2 */ -public int getUser2_ID() -{ -Integer ii = (Integer)get_Value("User2_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User2_ID */ -public static final String COLUMNNAME_User2_ID = "User2_ID"; +public static final String COLUMNNAME_User2_ID = "User2_ID"; /** Set Volume. @param Volume Volume of a product */ -public void setVolume (BigDecimal Volume) -{ -set_Value ("Volume", Volume); -} +public void setVolume (BigDecimal Volume) +{ +set_Value ("Volume", Volume); +} /** Get Volume. @return Volume of a product */ -public BigDecimal getVolume() -{ -BigDecimal bd = (BigDecimal)get_Value("Volume"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getVolume() +{ +BigDecimal bd = (BigDecimal)get_Value("Volume"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name Volume */ -public static final String COLUMNNAME_Volume = "Volume"; +public static final String COLUMNNAME_Volume = "Volume"; /** Set Weight. @param Weight Weight of a product */ -public void setWeight (BigDecimal Weight) -{ -set_Value ("Weight", Weight); -} +public void setWeight (BigDecimal Weight) +{ +set_Value ("Weight", Weight); +} /** Get Weight. @return Weight of a product */ -public BigDecimal getWeight() -{ -BigDecimal bd = (BigDecimal)get_Value("Weight"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getWeight() +{ +BigDecimal bd = (BigDecimal)get_Value("Weight"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name Weight */ -public static final String COLUMNNAME_Weight = "Weight"; -} +public static final String COLUMNNAME_Weight = "Weight"; +} diff --git a/base/src/org/compiere/model/X_M_InOutLine.java b/base/src/org/compiere/model/X_M_InOutLine.java index 01dba19584..88146a8efa 100644 --- a/base/src/org/compiere/model/X_M_InOutLine.java +++ b/base/src/org/compiere/model/X_M_InOutLine.java @@ -1,607 +1,625 @@ /****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * - * This program is free software; + * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * - * with this program; + * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -package org.compiere.model; +package org.compiere.model; /** Generated Model - DO NOT CHANGE */ -import java.util.*; -import java.sql.*; -import java.math.*; -import org.compiere.util.*; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; /** Generated Model for M_InOutLine * @author Adempiere (generated) * @version Release 3.2.0 - $Id$ */ -public class X_M_InOutLine extends PO -{ +public class X_M_InOutLine extends PO +{ /** Standard Constructor @param ctx context @param M_InOutLine_ID id @param trxName transaction */ -public X_M_InOutLine (Properties ctx, int M_InOutLine_ID, String trxName) -{ -super (ctx, M_InOutLine_ID, trxName); -/** if (M_InOutLine_ID == 0) -{ -setC_UOM_ID (0); // @#C_UOM_ID@ -setIsDescription (false); // N -setIsInvoiced (false); -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_InOutLine_ID (0); -setM_InOut_ID (0); -setM_Locator_ID (0); // @M_Locator_ID@ -setMovementQty (Env.ZERO); // 1 -setProcessed (false); -setQtyEntered (Env.ZERO); // 1 -} +public X_M_InOutLine (Properties ctx, int M_InOutLine_ID, String trxName) +{ +super (ctx, M_InOutLine_ID, trxName); +/** if (M_InOutLine_ID == 0) +{ +setC_UOM_ID (0); // @#C_UOM_ID@ +setIsDescription (false); // N +setIsInvoiced (false); +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_InOutLine_ID (0); +setM_InOut_ID (0); +setM_Locator_ID (0); // @M_Locator_ID@ +setMovementQty (Env.ZERO); // 1 +setProcessed (false); +setQtyEntered (Env.ZERO); // 1 +} */ -} +} /** Load Constructor @param ctx context @param rs result set @param trxName transaction */ -public X_M_InOutLine (Properties ctx, ResultSet rs, String trxName) -{ -super (ctx, rs, trxName); -} -/** AD_Table_ID=320 */ -public static final int Table_ID=MTable.getTable_ID("M_InOutLine"); - +public X_M_InOutLine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} /** TableName=M_InOutLine */ -public static final String Table_Name="M_InOutLine"; +public static final String Table_Name="M_InOutLine"; -protected static KeyNamePair Model = new KeyNamePair(Table_ID,"M_InOutLine"); +/** AD_Table_ID=320 */ +public static final int Table_ID=MTable.getTable_ID(Table_Name); -protected BigDecimal accessLevel = BigDecimal.valueOf(1); +protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + +protected BigDecimal accessLevel = BigDecimal.valueOf(1); /** AccessLevel @return 1 - Org */ -protected int get_AccessLevel() -{ -return accessLevel.intValue(); -} +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} /** Load Meta Data @param ctx context @return PO Info */ -protected POInfo initPO (Properties ctx) -{ -POInfo poi = POInfo.getPOInfo (ctx, Table_ID); -return poi; -} +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} /** Info @return info */ -public String toString() -{ -StringBuffer sb = new StringBuffer ("X_M_InOutLine[").append(get_ID()).append("]"); -return sb.toString(); -} +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_InOutLine[").append(get_ID()).append("]"); +return sb.toString(); +} /** AD_OrgTrx_ID AD_Reference_ID=130 */ -public static final int AD_ORGTRX_ID_AD_Reference_ID=130; +public static final int AD_ORGTRX_ID_AD_Reference_ID=130; /** Set Trx Organization. @param AD_OrgTrx_ID Performing or initiating organization */ -public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) -{ -if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); +public void setAD_OrgTrx_ID (int AD_OrgTrx_ID) +{ +if (AD_OrgTrx_ID <= 0) set_Value ("AD_OrgTrx_ID", null); else -set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); -} +set_Value ("AD_OrgTrx_ID", Integer.valueOf(AD_OrgTrx_ID)); +} /** Get Trx Organization. @return Performing or initiating organization */ -public int getAD_OrgTrx_ID() -{ -Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getAD_OrgTrx_ID() +{ +Integer ii = (Integer)get_Value("AD_OrgTrx_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name AD_OrgTrx_ID */ -public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; +public static final String COLUMNNAME_AD_OrgTrx_ID = "AD_OrgTrx_ID"; /** Set Activity. @param C_Activity_ID Business Activity */ -public void setC_Activity_ID (int C_Activity_ID) -{ -if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); +public void setC_Activity_ID (int C_Activity_ID) +{ +if (C_Activity_ID <= 0) set_Value ("C_Activity_ID", null); else -set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); -} +set_Value ("C_Activity_ID", Integer.valueOf(C_Activity_ID)); +} /** Get Activity. @return Business Activity */ -public int getC_Activity_ID() -{ -Integer ii = (Integer)get_Value("C_Activity_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Activity_ID() +{ +Integer ii = (Integer)get_Value("C_Activity_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Activity_ID */ -public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; +public static final String COLUMNNAME_C_Activity_ID = "C_Activity_ID"; /** Set Campaign. @param C_Campaign_ID Marketing Campaign */ -public void setC_Campaign_ID (int C_Campaign_ID) -{ -if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); +public void setC_Campaign_ID (int C_Campaign_ID) +{ +if (C_Campaign_ID <= 0) set_Value ("C_Campaign_ID", null); else -set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); -} +set_Value ("C_Campaign_ID", Integer.valueOf(C_Campaign_ID)); +} /** Get Campaign. @return Marketing Campaign */ -public int getC_Campaign_ID() -{ -Integer ii = (Integer)get_Value("C_Campaign_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Campaign_ID() +{ +Integer ii = (Integer)get_Value("C_Campaign_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Campaign_ID */ -public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; +public static final String COLUMNNAME_C_Campaign_ID = "C_Campaign_ID"; /** Set Charge. @param C_Charge_ID Additional document charges */ -public void setC_Charge_ID (int C_Charge_ID) -{ -if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); else -set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); -} +set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); +} /** Get Charge. @return Additional document charges */ -public int getC_Charge_ID() -{ -Integer ii = (Integer)get_Value("C_Charge_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Charge_ID */ -public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; +public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; /** Set Sales Order Line. @param C_OrderLine_ID Sales Order Line */ -public void setC_OrderLine_ID (int C_OrderLine_ID) -{ -if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); +public void setC_OrderLine_ID (int C_OrderLine_ID) +{ +if (C_OrderLine_ID <= 0) set_ValueNoCheck ("C_OrderLine_ID", null); else -set_ValueNoCheck ("C_OrderLine_ID", Integer.valueOf(C_OrderLine_ID)); -} +set_ValueNoCheck ("C_OrderLine_ID", Integer.valueOf(C_OrderLine_ID)); +} /** Get Sales Order Line. @return Sales Order Line */ -public int getC_OrderLine_ID() -{ -Integer ii = (Integer)get_Value("C_OrderLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_OrderLine_ID() +{ +Integer ii = (Integer)get_Value("C_OrderLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_OrderLine_ID */ -public static final String COLUMNNAME_C_OrderLine_ID = "C_OrderLine_ID"; +public static final String COLUMNNAME_C_OrderLine_ID = "C_OrderLine_ID"; /** Set Project Phase. @param C_ProjectPhase_ID Phase of a Project */ -public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) -{ -if (C_ProjectPhase_ID <= 0) set_Value ("C_ProjectPhase_ID", null); +public void setC_ProjectPhase_ID (int C_ProjectPhase_ID) +{ +if (C_ProjectPhase_ID <= 0) set_Value ("C_ProjectPhase_ID", null); else -set_Value ("C_ProjectPhase_ID", Integer.valueOf(C_ProjectPhase_ID)); -} +set_Value ("C_ProjectPhase_ID", Integer.valueOf(C_ProjectPhase_ID)); +} /** Get Project Phase. @return Phase of a Project */ -public int getC_ProjectPhase_ID() -{ -Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_ProjectPhase_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectPhase_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_ProjectPhase_ID */ -public static final String COLUMNNAME_C_ProjectPhase_ID = "C_ProjectPhase_ID"; +public static final String COLUMNNAME_C_ProjectPhase_ID = "C_ProjectPhase_ID"; /** Set Project Task. @param C_ProjectTask_ID Actual Project Task in a Phase */ -public void setC_ProjectTask_ID (int C_ProjectTask_ID) -{ -if (C_ProjectTask_ID <= 0) set_Value ("C_ProjectTask_ID", null); +public void setC_ProjectTask_ID (int C_ProjectTask_ID) +{ +if (C_ProjectTask_ID <= 0) set_Value ("C_ProjectTask_ID", null); else -set_Value ("C_ProjectTask_ID", Integer.valueOf(C_ProjectTask_ID)); -} +set_Value ("C_ProjectTask_ID", Integer.valueOf(C_ProjectTask_ID)); +} /** Get Project Task. @return Actual Project Task in a Phase */ -public int getC_ProjectTask_ID() -{ -Integer ii = (Integer)get_Value("C_ProjectTask_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_ProjectTask_ID() +{ +Integer ii = (Integer)get_Value("C_ProjectTask_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_ProjectTask_ID */ -public static final String COLUMNNAME_C_ProjectTask_ID = "C_ProjectTask_ID"; +public static final String COLUMNNAME_C_ProjectTask_ID = "C_ProjectTask_ID"; /** Set Project. @param C_Project_ID Financial Project */ -public void setC_Project_ID (int C_Project_ID) -{ -if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); +public void setC_Project_ID (int C_Project_ID) +{ +if (C_Project_ID <= 0) set_Value ("C_Project_ID", null); else -set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); -} +set_Value ("C_Project_ID", Integer.valueOf(C_Project_ID)); +} /** Get Project. @return Financial Project */ -public int getC_Project_ID() -{ -Integer ii = (Integer)get_Value("C_Project_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Project_ID() +{ +Integer ii = (Integer)get_Value("C_Project_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Project_ID */ -public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; +public static final String COLUMNNAME_C_Project_ID = "C_Project_ID"; /** Set UOM. @param C_UOM_ID Unit of Measure */ -public void setC_UOM_ID (int C_UOM_ID) -{ -if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); -set_ValueNoCheck ("C_UOM_ID", Integer.valueOf(C_UOM_ID)); -} +public void setC_UOM_ID (int C_UOM_ID) +{ +if (C_UOM_ID < 1) throw new IllegalArgumentException ("C_UOM_ID is mandatory."); +set_ValueNoCheck ("C_UOM_ID", Integer.valueOf(C_UOM_ID)); +} /** Get UOM. @return Unit of Measure */ -public int getC_UOM_ID() -{ -Integer ii = (Integer)get_Value("C_UOM_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_UOM_ID() +{ +Integer ii = (Integer)get_Value("C_UOM_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_UOM_ID */ -public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID"; +public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID"; /** Set Confirmed Quantity. @param ConfirmedQty Confirmation of a received quantity */ -public void setConfirmedQty (BigDecimal ConfirmedQty) -{ -set_Value ("ConfirmedQty", ConfirmedQty); -} +public void setConfirmedQty (BigDecimal ConfirmedQty) +{ +set_Value ("ConfirmedQty", ConfirmedQty); +} /** Get Confirmed Quantity. @return Confirmation of a received quantity */ -public BigDecimal getConfirmedQty() -{ -BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getConfirmedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ConfirmedQty"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name ConfirmedQty */ -public static final String COLUMNNAME_ConfirmedQty = "ConfirmedQty"; +public static final String COLUMNNAME_ConfirmedQty = "ConfirmedQty"; /** Set Description. @param Description Optional short description of the record */ -public void setDescription (String Description) -{ -if (Description != null && Description.length() > 255) -{ -log.warning("Length > 255 - truncated"); -Description = Description.substring(0,254); -} -set_Value ("Description", Description); -} +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} /** Get Description. @return Optional short description of the record */ -public String getDescription() -{ -return (String)get_Value("Description"); -} +public String getDescription() +{ +return (String)get_Value("Description"); +} /** Column name Description */ -public static final String COLUMNNAME_Description = "Description"; +public static final String COLUMNNAME_Description = "Description"; /** Set Description Only. @param IsDescription if true, the line is just description and no transaction */ -public void setIsDescription (boolean IsDescription) -{ -set_Value ("IsDescription", Boolean.valueOf(IsDescription)); -} +public void setIsDescription (boolean IsDescription) +{ +set_Value ("IsDescription", Boolean.valueOf(IsDescription)); +} /** Get Description Only. @return if true, the line is just description and no transaction */ -public boolean isDescription() -{ -Object oo = get_Value("IsDescription"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isDescription() +{ +Object oo = get_Value("IsDescription"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsDescription */ -public static final String COLUMNNAME_IsDescription = "IsDescription"; +public static final String COLUMNNAME_IsDescription = "IsDescription"; /** Set Invoiced. @param IsInvoiced Is this invoiced? */ -public void setIsInvoiced (boolean IsInvoiced) -{ -set_Value ("IsInvoiced", Boolean.valueOf(IsInvoiced)); -} +public void setIsInvoiced (boolean IsInvoiced) +{ +set_Value ("IsInvoiced", Boolean.valueOf(IsInvoiced)); +} /** Get Invoiced. @return Is this invoiced? */ -public boolean isInvoiced() -{ -Object oo = get_Value("IsInvoiced"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isInvoiced() +{ +Object oo = get_Value("IsInvoiced"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name IsInvoiced */ -public static final String COLUMNNAME_IsInvoiced = "IsInvoiced"; +public static final String COLUMNNAME_IsInvoiced = "IsInvoiced"; /** Set Line No. @param Line Unique line for this document */ -public void setLine (int Line) -{ -set_Value ("Line", Integer.valueOf(Line)); -} +public void setLine (int Line) +{ +set_Value ("Line", Integer.valueOf(Line)); +} /** Get Line No. @return Unique line for this document */ -public int getLine() -{ -Integer ii = (Integer)get_Value("Line"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} /** Get Record ID/ColumnName @return ID/ColumnName pair -*/public KeyNamePair getKeyNamePair() -{ -return new KeyNamePair(get_ID(), String.valueOf(getLine())); -} +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getLine())); +} /** Column name Line */ -public static final String COLUMNNAME_Line = "Line"; +public static final String COLUMNNAME_Line = "Line"; /** Set Attribute Set Instance. @param M_AttributeSetInstance_ID Product Attribute Set Instance */ -public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) -{ -if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); -set_Value ("M_AttributeSetInstance_ID", Integer.valueOf(M_AttributeSetInstance_ID)); -} +public void setM_AttributeSetInstance_ID (int M_AttributeSetInstance_ID) +{ +if (M_AttributeSetInstance_ID < 0) throw new IllegalArgumentException ("M_AttributeSetInstance_ID is mandatory."); +set_Value ("M_AttributeSetInstance_ID", Integer.valueOf(M_AttributeSetInstance_ID)); +} /** Get Attribute Set Instance. @return Product Attribute Set Instance */ -public int getM_AttributeSetInstance_ID() -{ -Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_AttributeSetInstance_ID() +{ +Integer ii = (Integer)get_Value("M_AttributeSetInstance_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_AttributeSetInstance_ID */ -public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID"; +public static final String COLUMNNAME_M_AttributeSetInstance_ID = "M_AttributeSetInstance_ID"; /** 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 ("M_InOutLine_ID", Integer.valueOf(M_InOutLine_ID)); -} +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID < 1) throw new IllegalArgumentException ("M_InOutLine_ID is mandatory."); +set_ValueNoCheck ("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("M_InOutLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_InOutLine_ID */ -public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID"; +public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID"; /** Set Shipment/Receipt. @param M_InOut_ID Material Shipment Document */ -public void setM_InOut_ID (int M_InOut_ID) -{ -if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); -set_ValueNoCheck ("M_InOut_ID", Integer.valueOf(M_InOut_ID)); -} +public void setM_InOut_ID (int M_InOut_ID) +{ +if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); +set_ValueNoCheck ("M_InOut_ID", Integer.valueOf(M_InOut_ID)); +} /** Get Shipment/Receipt. @return Material Shipment Document */ -public int getM_InOut_ID() -{ -Integer ii = (Integer)get_Value("M_InOut_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_InOut_ID() +{ +Integer ii = (Integer)get_Value("M_InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_InOut_ID */ -public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID"; +public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID"; /** Set Locator. @param M_Locator_ID Warehouse Locator */ -public void setM_Locator_ID (int M_Locator_ID) -{ -if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); -set_Value ("M_Locator_ID", Integer.valueOf(M_Locator_ID)); -} +public void setM_Locator_ID (int M_Locator_ID) +{ +if (M_Locator_ID < 1) throw new IllegalArgumentException ("M_Locator_ID is mandatory."); +set_Value ("M_Locator_ID", Integer.valueOf(M_Locator_ID)); +} /** Get Locator. @return Warehouse Locator */ -public int getM_Locator_ID() -{ -Integer ii = (Integer)get_Value("M_Locator_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_Locator_ID() +{ +Integer ii = (Integer)get_Value("M_Locator_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_Locator_ID */ -public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID"; +public static final String COLUMNNAME_M_Locator_ID = "M_Locator_ID"; /** Set Product. @param M_Product_ID Product, Service, Item */ -public void setM_Product_ID (int M_Product_ID) -{ -if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); +public void setM_Product_ID (int M_Product_ID) +{ +if (M_Product_ID <= 0) set_Value ("M_Product_ID", null); else -set_Value ("M_Product_ID", Integer.valueOf(M_Product_ID)); -} +set_Value ("M_Product_ID", Integer.valueOf(M_Product_ID)); +} /** Get Product. @return Product, Service, Item */ -public int getM_Product_ID() -{ -Integer ii = (Integer)get_Value("M_Product_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_Product_ID() +{ +Integer ii = (Integer)get_Value("M_Product_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_Product_ID */ -public static final String COLUMNNAME_M_Product_ID = "M_Product_ID"; +public static final String COLUMNNAME_M_Product_ID = "M_Product_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 <= 0) set_Value ("M_RMALine_ID", null); + else +set_Value ("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("M_RMALine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name M_RMALine_ID */ +public static final String COLUMNNAME_M_RMALine_ID = "M_RMALine_ID"; /** 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 ("MovementQty", MovementQty); -} +public void setMovementQty (BigDecimal MovementQty) +{ +if (MovementQty == null) throw new IllegalArgumentException ("MovementQty is mandatory."); +set_Value ("MovementQty", MovementQty); +} /** Get Movement Quantity. @return Quantity of a product moved. */ -public BigDecimal getMovementQty() -{ -BigDecimal bd = (BigDecimal)get_Value("MovementQty"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getMovementQty() +{ +BigDecimal bd = (BigDecimal)get_Value("MovementQty"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name MovementQty */ -public static final String COLUMNNAME_MovementQty = "MovementQty"; +public static final String COLUMNNAME_MovementQty = "MovementQty"; /** Set Picked Quantity. @param PickedQty Picked Quantity */ -public void setPickedQty (BigDecimal PickedQty) -{ -set_Value ("PickedQty", PickedQty); -} +public void setPickedQty (BigDecimal PickedQty) +{ +set_Value ("PickedQty", PickedQty); +} /** Get Picked Quantity. @return Picked Quantity */ -public BigDecimal getPickedQty() -{ -BigDecimal bd = (BigDecimal)get_Value("PickedQty"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getPickedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("PickedQty"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name PickedQty */ -public static final String COLUMNNAME_PickedQty = "PickedQty"; +public static final String COLUMNNAME_PickedQty = "PickedQty"; /** Set Processed. @param Processed The document has been processed */ -public void setProcessed (boolean Processed) -{ -set_Value ("Processed", Boolean.valueOf(Processed)); -} +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", Boolean.valueOf(Processed)); +} /** Get Processed. @return The document has been processed */ -public boolean isProcessed() -{ -Object oo = get_Value("Processed"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processed */ -public static final String COLUMNNAME_Processed = "Processed"; +public static final String COLUMNNAME_Processed = "Processed"; /** Set Quantity. @param QtyEntered The Quantity Entered is based on the selected UoM */ -public void setQtyEntered (BigDecimal QtyEntered) -{ -if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); -set_Value ("QtyEntered", QtyEntered); -} +public void setQtyEntered (BigDecimal QtyEntered) +{ +if (QtyEntered == null) throw new IllegalArgumentException ("QtyEntered is mandatory."); +set_Value ("QtyEntered", QtyEntered); +} /** Get Quantity. @return The Quantity Entered is based on the selected UoM */ -public BigDecimal getQtyEntered() -{ -BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getQtyEntered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyEntered"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name QtyEntered */ -public static final String COLUMNNAME_QtyEntered = "QtyEntered"; +public static final String COLUMNNAME_QtyEntered = "QtyEntered"; /** Set Referenced Shipment Line. @param Ref_InOutLine_ID Referenced Shipment Line */ -public void setRef_InOutLine_ID (int Ref_InOutLine_ID) -{ -if (Ref_InOutLine_ID <= 0) set_Value ("Ref_InOutLine_ID", null); +public void setRef_InOutLine_ID (int Ref_InOutLine_ID) +{ +if (Ref_InOutLine_ID <= 0) set_Value ("Ref_InOutLine_ID", null); else -set_Value ("Ref_InOutLine_ID", Integer.valueOf(Ref_InOutLine_ID)); -} +set_Value ("Ref_InOutLine_ID", Integer.valueOf(Ref_InOutLine_ID)); +} /** Get Referenced Shipment Line. @return Referenced Shipment Line */ -public int getRef_InOutLine_ID() -{ -Integer ii = (Integer)get_Value("Ref_InOutLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getRef_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("Ref_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name Ref_InOutLine_ID */ -public static final String COLUMNNAME_Ref_InOutLine_ID = "Ref_InOutLine_ID"; +public static final String COLUMNNAME_Ref_InOutLine_ID = "Ref_InOutLine_ID"; /** Set Scrapped Quantity. @param ScrappedQty The Quantity scrapped due to QA issues */ -public void setScrappedQty (BigDecimal ScrappedQty) -{ -set_Value ("ScrappedQty", ScrappedQty); -} +public void setScrappedQty (BigDecimal ScrappedQty) +{ +set_Value ("ScrappedQty", ScrappedQty); +} /** Get Scrapped Quantity. @return The Quantity scrapped due to QA issues */ -public BigDecimal getScrappedQty() -{ -BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getScrappedQty() +{ +BigDecimal bd = (BigDecimal)get_Value("ScrappedQty"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name ScrappedQty */ -public static final String COLUMNNAME_ScrappedQty = "ScrappedQty"; +public static final String COLUMNNAME_ScrappedQty = "ScrappedQty"; /** Set Target Quantity. @param TargetQty Target Movement Quantity */ -public void setTargetQty (BigDecimal TargetQty) -{ -set_Value ("TargetQty", TargetQty); -} +public void setTargetQty (BigDecimal TargetQty) +{ +set_Value ("TargetQty", TargetQty); +} /** Get Target Quantity. @return Target Movement Quantity */ -public BigDecimal getTargetQty() -{ -BigDecimal bd = (BigDecimal)get_Value("TargetQty"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getTargetQty() +{ +BigDecimal bd = (BigDecimal)get_Value("TargetQty"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name TargetQty */ -public static final String COLUMNNAME_TargetQty = "TargetQty"; +public static final String COLUMNNAME_TargetQty = "TargetQty"; /** User1_ID AD_Reference_ID=134 */ -public static final int USER1_ID_AD_Reference_ID=134; +public static final int USER1_ID_AD_Reference_ID=134; /** Set User List 1. @param User1_ID User defined list element #1 */ -public void setUser1_ID (int User1_ID) -{ -if (User1_ID <= 0) set_Value ("User1_ID", null); +public void setUser1_ID (int User1_ID) +{ +if (User1_ID <= 0) set_Value ("User1_ID", null); else -set_Value ("User1_ID", Integer.valueOf(User1_ID)); -} +set_Value ("User1_ID", Integer.valueOf(User1_ID)); +} /** Get User List 1. @return User defined list element #1 */ -public int getUser1_ID() -{ -Integer ii = (Integer)get_Value("User1_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser1_ID() +{ +Integer ii = (Integer)get_Value("User1_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User1_ID */ -public static final String COLUMNNAME_User1_ID = "User1_ID"; +public static final String COLUMNNAME_User1_ID = "User1_ID"; /** User2_ID AD_Reference_ID=137 */ -public static final int USER2_ID_AD_Reference_ID=137; +public static final int USER2_ID_AD_Reference_ID=137; /** Set User List 2. @param User2_ID User defined list element #2 */ -public void setUser2_ID (int User2_ID) -{ -if (User2_ID <= 0) set_Value ("User2_ID", null); +public void setUser2_ID (int User2_ID) +{ +if (User2_ID <= 0) set_Value ("User2_ID", null); else -set_Value ("User2_ID", Integer.valueOf(User2_ID)); -} +set_Value ("User2_ID", Integer.valueOf(User2_ID)); +} /** Get User List 2. @return User defined list element #2 */ -public int getUser2_ID() -{ -Integer ii = (Integer)get_Value("User2_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getUser2_ID() +{ +Integer ii = (Integer)get_Value("User2_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name User2_ID */ -public static final String COLUMNNAME_User2_ID = "User2_ID"; -} +public static final String COLUMNNAME_User2_ID = "User2_ID"; +} diff --git a/base/src/org/compiere/model/X_M_RMA.java b/base/src/org/compiere/model/X_M_RMA.java index c1d4af1949..0f9eb44bbf 100644 --- a/base/src/org/compiere/model/X_M_RMA.java +++ b/base/src/org/compiere/model/X_M_RMA.java @@ -1,505 +1,548 @@ /****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * - * This program is free software; + * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * - * with this program; + * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -package org.compiere.model; +package org.compiere.model; /** Generated Model - DO NOT CHANGE */ -import java.util.*; -import java.sql.*; -import java.math.*; -import org.compiere.util.*; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; /** Generated Model for M_RMA * @author Adempiere (generated) * @version Release 3.2.0 - $Id$ */ -public class X_M_RMA extends PO -{ +public class X_M_RMA extends PO +{ /** Standard Constructor @param ctx context @param M_RMA_ID id @param trxName transaction */ -public X_M_RMA (Properties ctx, int M_RMA_ID, String trxName) -{ -super (ctx, M_RMA_ID, trxName); -/** if (M_RMA_ID == 0) -{ -setC_DocType_ID (0); -setDocAction (null); // CO -setDocStatus (null); // DR -setDocumentNo (null); -setIsApproved (false); -setM_InOut_ID (0); -setM_RMAType_ID (0); -setM_RMA_ID (0); -setName (null); -setProcessed (false); -setSalesRep_ID (0); -} +public X_M_RMA (Properties ctx, int M_RMA_ID, String trxName) +{ +super (ctx, M_RMA_ID, trxName); +/** if (M_RMA_ID == 0) +{ +setC_DocType_ID (0); +setDocAction (null); // CO +setDocStatus (null); // DR +setDocumentNo (null); +setInOut_ID (0); +setIsApproved (false); +setIsSOTrx (false); // @IsSOTrx@ +setM_RMAType_ID (0); +setM_RMA_ID (0); +setName (null); +setProcessed (false); +setSalesRep_ID (0); +} */ -} +} /** Load Constructor @param ctx context @param rs result set @param trxName transaction */ -public X_M_RMA (Properties ctx, ResultSet rs, String trxName) -{ -super (ctx, rs, trxName); -} -/** AD_Table_ID=661 */ -public static final int Table_ID=MTable.getTable_ID("M_RMA"); - +public X_M_RMA (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} /** TableName=M_RMA */ -public static final String Table_Name="M_RMA"; +public static final String Table_Name="M_RMA"; -protected static KeyNamePair Model = new KeyNamePair(Table_ID,"M_RMA"); +/** AD_Table_ID=661 */ +public static final int Table_ID=MTable.getTable_ID(Table_Name); -protected BigDecimal accessLevel = BigDecimal.valueOf(1); +protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + +protected BigDecimal accessLevel = BigDecimal.valueOf(1); /** AccessLevel @return 1 - Org */ -protected int get_AccessLevel() -{ -return accessLevel.intValue(); -} +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} /** Load Meta Data @param ctx context @return PO Info */ -protected POInfo initPO (Properties ctx) -{ -POInfo poi = POInfo.getPOInfo (ctx, Table_ID); -return poi; -} +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} /** Info @return info */ -public String toString() -{ -StringBuffer sb = new StringBuffer ("X_M_RMA[").append(get_ID()).append("]"); -return sb.toString(); -} +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RMA[").append(get_ID()).append("]"); +return sb.toString(); +} /** Set Amount. @param Amt Amount */ -public void setAmt (BigDecimal Amt) -{ -set_Value ("Amt", Amt); -} +public void setAmt (BigDecimal Amt) +{ +set_Value ("Amt", Amt); +} /** Get Amount. @return Amount */ -public BigDecimal getAmt() -{ -BigDecimal bd = (BigDecimal)get_Value("Amt"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name Amt */ -public static final String COLUMNNAME_Amt = "Amt"; +public static final String COLUMNNAME_Amt = "Amt"; /** Set Business Partner . @param C_BPartner_ID Identifies a Business Partner */ -public void setC_BPartner_ID (int C_BPartner_ID) -{ -if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); +public void setC_BPartner_ID (int C_BPartner_ID) +{ +if (C_BPartner_ID <= 0) set_Value ("C_BPartner_ID", null); else -set_Value ("C_BPartner_ID", Integer.valueOf(C_BPartner_ID)); -} +set_Value ("C_BPartner_ID", Integer.valueOf(C_BPartner_ID)); +} /** Get Business Partner . @return Identifies a Business Partner */ -public int getC_BPartner_ID() -{ -Integer ii = (Integer)get_Value("C_BPartner_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_BPartner_ID() +{ +Integer ii = (Integer)get_Value("C_BPartner_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_BPartner_ID */ -public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; +public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID"; /** Set Currency. @param C_Currency_ID The Currency for this record */ -public void setC_Currency_ID (int C_Currency_ID) -{ -if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); +public void setC_Currency_ID (int C_Currency_ID) +{ +if (C_Currency_ID <= 0) set_Value ("C_Currency_ID", null); else -set_Value ("C_Currency_ID", Integer.valueOf(C_Currency_ID)); -} +set_Value ("C_Currency_ID", Integer.valueOf(C_Currency_ID)); +} /** Get Currency. @return The Currency for this record */ -public int getC_Currency_ID() -{ -Integer ii = (Integer)get_Value("C_Currency_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Currency_ID() +{ +Integer ii = (Integer)get_Value("C_Currency_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Currency_ID */ -public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; +public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID"; /** C_DocType_ID AD_Reference_ID=321 */ -public static final int C_DOCTYPE_ID_AD_Reference_ID=321; +public static final int C_DOCTYPE_ID_AD_Reference_ID=321; /** Set Document Type. @param C_DocType_ID Document type or rules */ -public void setC_DocType_ID (int C_DocType_ID) -{ -if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); -set_Value ("C_DocType_ID", Integer.valueOf(C_DocType_ID)); -} +public void setC_DocType_ID (int C_DocType_ID) +{ +if (C_DocType_ID < 0) throw new IllegalArgumentException ("C_DocType_ID is mandatory."); +set_Value ("C_DocType_ID", Integer.valueOf(C_DocType_ID)); +} /** Get Document Type. @return Document type or rules */ -public int getC_DocType_ID() -{ -Integer ii = (Integer)get_Value("C_DocType_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_DocType_ID() +{ +Integer ii = (Integer)get_Value("C_DocType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_DocType_ID */ -public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; +public static final String COLUMNNAME_C_DocType_ID = "C_DocType_ID"; /** Set Order. @param C_Order_ID Order */ -public void setC_Order_ID (int C_Order_ID) -{ -if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); +public void setC_Order_ID (int C_Order_ID) +{ +if (C_Order_ID <= 0) set_ValueNoCheck ("C_Order_ID", null); else -set_ValueNoCheck ("C_Order_ID", Integer.valueOf(C_Order_ID)); -} +set_ValueNoCheck ("C_Order_ID", Integer.valueOf(C_Order_ID)); +} /** Get Order. @return Order */ -public int getC_Order_ID() -{ -Integer ii = (Integer)get_Value("C_Order_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getC_Order_ID() +{ +Integer ii = (Integer)get_Value("C_Order_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name C_Order_ID */ -public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; +public static final String COLUMNNAME_C_Order_ID = "C_Order_ID"; /** Set Description. @param Description Optional short description of the record */ -public void setDescription (String Description) -{ -if (Description != null && Description.length() > 255) -{ -log.warning("Length > 255 - truncated"); -Description = Description.substring(0,254); -} -set_Value ("Description", Description); -} +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} /** Get Description. @return Optional short description of the record */ -public String getDescription() -{ -return (String)get_Value("Description"); -} +public String getDescription() +{ +return (String)get_Value("Description"); +} /** Column name Description */ -public static final String COLUMNNAME_Description = "Description"; +public static final String COLUMNNAME_Description = "Description"; /** DocAction AD_Reference_ID=135 */ -public static final int DOCACTION_AD_Reference_ID=135; -/** = -- */ -public static final String DOCACTION_None = "--"; -/** Approve = AP */ -public static final String DOCACTION_Approve = "AP"; -/** Close = CL */ -public static final String DOCACTION_Close = "CL"; +public static final int DOCACTION_AD_Reference_ID=135; /** Complete = CO */ -public static final String DOCACTION_Complete = "CO"; -/** Invalidate = IN */ -public static final String DOCACTION_Invalidate = "IN"; -/** Post = PO */ -public static final String DOCACTION_Post = "PO"; -/** Prepare = PR */ -public static final String DOCACTION_Prepare = "PR"; -/** Reverse - Accrual = RA */ -public static final String DOCACTION_Reverse_Accrual = "RA"; -/** Reverse - Correct = RC */ -public static final String DOCACTION_Reverse_Correct = "RC"; -/** Re-activate = RE */ -public static final String DOCACTION_Re_Activate = "RE"; +public static final String DOCACTION_Complete = "CO"; +/** Approve = AP */ +public static final String DOCACTION_Approve = "AP"; /** Reject = RJ */ -public static final String DOCACTION_Reject = "RJ"; +public static final String DOCACTION_Reject = "RJ"; +/** Post = PO */ +public static final String DOCACTION_Post = "PO"; /** Void = VO */ -public static final String DOCACTION_Void = "VO"; +public static final String DOCACTION_Void = "VO"; +/** Close = CL */ +public static final String DOCACTION_Close = "CL"; +/** Reverse - Correct = RC */ +public static final String DOCACTION_Reverse_Correct = "RC"; +/** Reverse - Accrual = RA */ +public static final String DOCACTION_Reverse_Accrual = "RA"; +/** Invalidate = IN */ +public static final String DOCACTION_Invalidate = "IN"; +/** Re-activate = RE */ +public static final String DOCACTION_Re_Activate = "RE"; +/** = -- */ +public static final String DOCACTION_None = "--"; /** Wait Complete = WC */ -public static final String DOCACTION_WaitComplete = "WC"; +public static final String DOCACTION_WaitComplete = "WC"; +/** Prepare = PR */ +public static final String DOCACTION_Prepare = "PR"; /** Unlock = XL */ -public static final String DOCACTION_Unlock = "XL"; +public static final String DOCACTION_Unlock = "XL"; /** Set Document Action. @param DocAction The targeted status of the document */ -public void setDocAction (String DocAction) -{ -if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); -if (DocAction.equals("--") || DocAction.equals("AP") || DocAction.equals("CL") || DocAction.equals("CO") || DocAction.equals("IN") || DocAction.equals("PO") || DocAction.equals("PR") || DocAction.equals("RA") || DocAction.equals("RC") || DocAction.equals("RE") || DocAction.equals("RJ") || DocAction.equals("VO") || DocAction.equals("WC") || DocAction.equals("XL")); - else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - -- - AP - CL - CO - IN - PO - PR - RA - RC - RE - RJ - VO - WC - XL"); -if (DocAction.length() > 2) -{ -log.warning("Length > 2 - truncated"); -DocAction = DocAction.substring(0,1); -} -set_Value ("DocAction", DocAction); -} +public void setDocAction (String DocAction) +{ +if (DocAction == null) throw new IllegalArgumentException ("DocAction is mandatory"); +if (DocAction.equals("CO") || DocAction.equals("AP") || DocAction.equals("RJ") || DocAction.equals("PO") || DocAction.equals("VO") || DocAction.equals("CL") || DocAction.equals("RC") || DocAction.equals("RA") || DocAction.equals("IN") || DocAction.equals("RE") || DocAction.equals("--") || DocAction.equals("WC") || DocAction.equals("PR") || DocAction.equals("XL")); + else throw new IllegalArgumentException ("DocAction Invalid value - " + DocAction + " - Reference_ID=135 - CO - AP - RJ - PO - VO - CL - RC - RA - IN - RE - -- - WC - PR - XL"); +if (DocAction.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocAction = DocAction.substring(0,1); +} +set_Value ("DocAction", DocAction); +} /** Get Document Action. @return The targeted status of the document */ -public String getDocAction() -{ -return (String)get_Value("DocAction"); -} +public String getDocAction() +{ +return (String)get_Value("DocAction"); +} /** Column name DocAction */ -public static final String COLUMNNAME_DocAction = "DocAction"; +public static final String COLUMNNAME_DocAction = "DocAction"; /** DocStatus AD_Reference_ID=131 */ -public static final int DOCSTATUS_AD_Reference_ID=131; -/** Unknown = ?? */ -public static final String DOCSTATUS_Unknown = "??"; -/** Approved = AP */ -public static final String DOCSTATUS_Approved = "AP"; -/** Closed = CL */ -public static final String DOCSTATUS_Closed = "CL"; -/** Completed = CO */ -public static final String DOCSTATUS_Completed = "CO"; -/** Drafted = DR */ -public static final String DOCSTATUS_Drafted = "DR"; -/** Invalid = IN */ -public static final String DOCSTATUS_Invalid = "IN"; -/** In Progress = IP */ -public static final String DOCSTATUS_InProgress = "IP"; -/** Not Approved = NA */ -public static final String DOCSTATUS_NotApproved = "NA"; -/** Reversed = RE */ -public static final String DOCSTATUS_Reversed = "RE"; -/** Voided = VO */ -public static final String DOCSTATUS_Voided = "VO"; +public static final int DOCSTATUS_AD_Reference_ID=131; /** Waiting Confirmation = WC */ -public static final String DOCSTATUS_WaitingConfirmation = "WC"; +public static final String DOCSTATUS_WaitingConfirmation = "WC"; +/** Drafted = DR */ +public static final String DOCSTATUS_Drafted = "DR"; +/** Completed = CO */ +public static final String DOCSTATUS_Completed = "CO"; +/** Approved = AP */ +public static final String DOCSTATUS_Approved = "AP"; +/** Not Approved = NA */ +public static final String DOCSTATUS_NotApproved = "NA"; +/** Voided = VO */ +public static final String DOCSTATUS_Voided = "VO"; +/** Invalid = IN */ +public static final String DOCSTATUS_Invalid = "IN"; +/** Reversed = RE */ +public static final String DOCSTATUS_Reversed = "RE"; +/** Closed = CL */ +public static final String DOCSTATUS_Closed = "CL"; +/** Unknown = ?? */ +public static final String DOCSTATUS_Unknown = "??"; +/** In Progress = IP */ +public static final String DOCSTATUS_InProgress = "IP"; /** Waiting Payment = WP */ -public static final String DOCSTATUS_WaitingPayment = "WP"; +public static final String DOCSTATUS_WaitingPayment = "WP"; /** Set Document Status. @param DocStatus The current status of the document */ -public void setDocStatus (String DocStatus) -{ -if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); -if (DocStatus.equals("??") || DocStatus.equals("AP") || DocStatus.equals("CL") || DocStatus.equals("CO") || DocStatus.equals("DR") || DocStatus.equals("IN") || DocStatus.equals("IP") || DocStatus.equals("NA") || DocStatus.equals("RE") || DocStatus.equals("VO") || DocStatus.equals("WC") || DocStatus.equals("WP")); - else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - ?? - AP - CL - CO - DR - IN - IP - NA - RE - VO - WC - WP"); -if (DocStatus.length() > 2) -{ -log.warning("Length > 2 - truncated"); -DocStatus = DocStatus.substring(0,1); -} -set_Value ("DocStatus", DocStatus); -} +public void setDocStatus (String DocStatus) +{ +if (DocStatus == null) throw new IllegalArgumentException ("DocStatus is mandatory"); +if (DocStatus.equals("WC") || DocStatus.equals("DR") || DocStatus.equals("CO") || DocStatus.equals("AP") || DocStatus.equals("NA") || DocStatus.equals("VO") || DocStatus.equals("IN") || DocStatus.equals("RE") || DocStatus.equals("CL") || DocStatus.equals("??") || DocStatus.equals("IP") || DocStatus.equals("WP")); + else throw new IllegalArgumentException ("DocStatus Invalid value - " + DocStatus + " - Reference_ID=131 - WC - DR - CO - AP - NA - VO - IN - RE - CL - ?? - IP - WP"); +if (DocStatus.length() > 2) +{ +log.warning("Length > 2 - truncated"); +DocStatus = DocStatus.substring(0,1); +} +set_Value ("DocStatus", DocStatus); +} /** Get Document Status. @return The current status of the document */ -public String getDocStatus() -{ -return (String)get_Value("DocStatus"); -} +public String getDocStatus() +{ +return (String)get_Value("DocStatus"); +} /** Column name DocStatus */ -public static final String COLUMNNAME_DocStatus = "DocStatus"; +public static final String COLUMNNAME_DocStatus = "DocStatus"; /** Set Document No. @param DocumentNo Document sequence number of the document */ -public void setDocumentNo (String DocumentNo) -{ -if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); -if (DocumentNo.length() > 30) -{ -log.warning("Length > 30 - truncated"); -DocumentNo = DocumentNo.substring(0,29); -} -set_Value ("DocumentNo", DocumentNo); -} +public void setDocumentNo (String DocumentNo) +{ +if (DocumentNo == null) throw new IllegalArgumentException ("DocumentNo is mandatory."); +if (DocumentNo.length() > 30) +{ +log.warning("Length > 30 - truncated"); +DocumentNo = DocumentNo.substring(0,29); +} +set_Value ("DocumentNo", DocumentNo); +} /** Get Document No. @return Document sequence number of the document */ -public String getDocumentNo() -{ -return (String)get_Value("DocumentNo"); -} +public String getDocumentNo() +{ +return (String)get_Value("DocumentNo"); +} /** Get Record ID/ColumnName @return ID/ColumnName pair -*/public KeyNamePair getKeyNamePair() -{ -return new KeyNamePair(get_ID(), getDocumentNo()); -} +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), getDocumentNo()); +} /** Column name DocumentNo */ -public static final String COLUMNNAME_DocumentNo = "DocumentNo"; +public static final String COLUMNNAME_DocumentNo = "DocumentNo"; +/** Set Generate To. +@param GenerateTo Generate To */ +public void setGenerateTo (String GenerateTo) +{ +if (GenerateTo != null && GenerateTo.length() > 1) +{ +log.warning("Length > 1 - truncated"); +GenerateTo = GenerateTo.substring(0,0); +} +set_Value ("GenerateTo", GenerateTo); +} +/** Get Generate To. +@return Generate To */ +public String getGenerateTo() +{ +return (String)get_Value("GenerateTo"); +} +/** Column name GenerateTo */ +public static final String COLUMNNAME_GenerateTo = "GenerateTo"; /** Set Comment/Help. @param Help Comment or Hint */ -public void setHelp (String Help) -{ -if (Help != null && Help.length() > 2000) -{ -log.warning("Length > 2000 - truncated"); -Help = Help.substring(0,1999); -} -set_Value ("Help", Help); -} +public void setHelp (String Help) +{ +if (Help != null && Help.length() > 2000) +{ +log.warning("Length > 2000 - truncated"); +Help = Help.substring(0,1999); +} +set_Value ("Help", Help); +} /** Get Comment/Help. @return Comment or Hint */ -public String getHelp() -{ -return (String)get_Value("Help"); -} +public String getHelp() +{ +return (String)get_Value("Help"); +} /** Column name Help */ -public static final String COLUMNNAME_Help = "Help"; -/** Set Approved. -@param IsApproved Indicates if this document requires approval */ -public void setIsApproved (boolean IsApproved) -{ -set_Value ("IsApproved", Boolean.valueOf(IsApproved)); -} -/** Get Approved. -@return Indicates if this document requires approval */ -public boolean isApproved() -{ -Object oo = get_Value("IsApproved"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} -/** Column name IsApproved */ -public static final String COLUMNNAME_IsApproved = "IsApproved"; +public static final String COLUMNNAME_Help = "Help"; + +/** InOut_ID AD_Reference_ID=337 */ +public static final int INOUT_ID_AD_Reference_ID=337; /** Set Shipment/Receipt. -@param M_InOut_ID Material Shipment Document */ -public void setM_InOut_ID (int M_InOut_ID) -{ -if (M_InOut_ID < 1) throw new IllegalArgumentException ("M_InOut_ID is mandatory."); -set_ValueNoCheck ("M_InOut_ID", Integer.valueOf(M_InOut_ID)); -} +@param InOut_ID Material Shipment Document */ +public void setInOut_ID (int InOut_ID) +{ +if (InOut_ID < 1) throw new IllegalArgumentException ("InOut_ID is mandatory."); +set_ValueNoCheck ("InOut_ID", Integer.valueOf(InOut_ID)); +} /** Get Shipment/Receipt. @return Material Shipment Document */ -public int getM_InOut_ID() -{ -Integer ii = (Integer)get_Value("M_InOut_ID"); -if (ii == null) return 0; -return ii.intValue(); -} -/** Column name M_InOut_ID */ -public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID"; +public int getInOut_ID() +{ +Integer ii = (Integer)get_Value("InOut_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name InOut_ID */ +public static final String COLUMNNAME_InOut_ID = "InOut_ID"; +/** Set Approved. +@param IsApproved Indicates if this document requires approval */ +public void setIsApproved (boolean IsApproved) +{ +set_Value ("IsApproved", Boolean.valueOf(IsApproved)); +} +/** Get Approved. +@return Indicates if this document requires approval */ +public boolean isApproved() +{ +Object oo = get_Value("IsApproved"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Column name IsApproved */ +public static final String COLUMNNAME_IsApproved = "IsApproved"; +/** Set Sales Transaction. +@param IsSOTrx This is a Sales Transaction */ +public void setIsSOTrx (boolean IsSOTrx) +{ +set_Value ("IsSOTrx", Boolean.valueOf(IsSOTrx)); +} +/** Get Sales Transaction. +@return This is a Sales Transaction */ +public boolean isSOTrx() +{ +Object oo = get_Value("IsSOTrx"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} +/** Column name IsSOTrx */ +public static final String COLUMNNAME_IsSOTrx = "IsSOTrx"; /** Set RMA Type. @param M_RMAType_ID Return Material Authorization Type */ -public void setM_RMAType_ID (int M_RMAType_ID) -{ -if (M_RMAType_ID < 1) throw new IllegalArgumentException ("M_RMAType_ID is mandatory."); -set_Value ("M_RMAType_ID", Integer.valueOf(M_RMAType_ID)); -} +public void setM_RMAType_ID (int M_RMAType_ID) +{ +if (M_RMAType_ID < 1) throw new IllegalArgumentException ("M_RMAType_ID is mandatory."); +set_Value ("M_RMAType_ID", Integer.valueOf(M_RMAType_ID)); +} /** Get RMA Type. @return Return Material Authorization Type */ -public int getM_RMAType_ID() -{ -Integer ii = (Integer)get_Value("M_RMAType_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_RMAType_ID() +{ +Integer ii = (Integer)get_Value("M_RMAType_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_RMAType_ID */ -public static final String COLUMNNAME_M_RMAType_ID = "M_RMAType_ID"; +public static final String COLUMNNAME_M_RMAType_ID = "M_RMAType_ID"; /** 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 ("M_RMA_ID", Integer.valueOf(M_RMA_ID)); -} +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID < 1) throw new IllegalArgumentException ("M_RMA_ID is mandatory."); +set_ValueNoCheck ("M_RMA_ID", Integer.valueOf(M_RMA_ID)); +} /** Get RMA. @return Return Material Authorization */ -public int getM_RMA_ID() -{ -Integer ii = (Integer)get_Value("M_RMA_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_RMA_ID */ -public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; +public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; /** Set Name. @param Name Alphanumeric identifier of the entity */ -public void setName (String Name) -{ -if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); -if (Name.length() > 60) -{ -log.warning("Length > 60 - truncated"); -Name = Name.substring(0,59); -} -set_Value ("Name", Name); -} +public void setName (String Name) +{ +if (Name == null) throw new IllegalArgumentException ("Name is mandatory."); +if (Name.length() > 60) +{ +log.warning("Length > 60 - truncated"); +Name = Name.substring(0,59); +} +set_Value ("Name", Name); +} /** Get Name. @return Alphanumeric identifier of the entity */ -public String getName() -{ -return (String)get_Value("Name"); -} +public String getName() +{ +return (String)get_Value("Name"); +} /** Column name Name */ -public static final String COLUMNNAME_Name = "Name"; +public static final String COLUMNNAME_Name = "Name"; /** Set Processed. @param Processed The document has been processed */ -public void setProcessed (boolean Processed) -{ -set_Value ("Processed", Boolean.valueOf(Processed)); -} +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", Boolean.valueOf(Processed)); +} /** Get Processed. @return The document has been processed */ -public boolean isProcessed() -{ -Object oo = get_Value("Processed"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processed */ -public static final String COLUMNNAME_Processed = "Processed"; +public static final String COLUMNNAME_Processed = "Processed"; /** Set Process Now. @param Processing Process Now */ -public void setProcessing (boolean Processing) -{ -set_Value ("Processing", Boolean.valueOf(Processing)); -} +public void setProcessing (boolean Processing) +{ +set_Value ("Processing", Boolean.valueOf(Processing)); +} /** Get Process Now. @return Process Now */ -public boolean isProcessing() -{ -Object oo = get_Value("Processing"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessing() +{ +Object oo = get_Value("Processing"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processing */ -public static final String COLUMNNAME_Processing = "Processing"; +public static final String COLUMNNAME_Processing = "Processing"; /** SalesRep_ID AD_Reference_ID=190 */ -public static final int SALESREP_ID_AD_Reference_ID=190; +public static final int SALESREP_ID_AD_Reference_ID=190; /** Set Sales Representative. @param SalesRep_ID Sales Representative or Company Agent */ -public void setSalesRep_ID (int SalesRep_ID) -{ -if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); -set_Value ("SalesRep_ID", Integer.valueOf(SalesRep_ID)); -} +public void setSalesRep_ID (int SalesRep_ID) +{ +if (SalesRep_ID < 1) throw new IllegalArgumentException ("SalesRep_ID is mandatory."); +set_Value ("SalesRep_ID", Integer.valueOf(SalesRep_ID)); +} /** Get Sales Representative. @return Sales Representative or Company Agent */ -public int getSalesRep_ID() -{ -Integer ii = (Integer)get_Value("SalesRep_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getSalesRep_ID() +{ +Integer ii = (Integer)get_Value("SalesRep_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name SalesRep_ID */ -public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; -} +public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID"; +} diff --git a/base/src/org/compiere/model/X_M_RMALine.java b/base/src/org/compiere/model/X_M_RMALine.java index 6c2fe8ca29..f84f83c70e 100644 --- a/base/src/org/compiere/model/X_M_RMALine.java +++ b/base/src/org/compiere/model/X_M_RMALine.java @@ -1,205 +1,288 @@ /****************************************************************************** * Product: Adempiere ERP & CRM Smart Business Solution * * Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. * - * This program is free software; + * This program is free software; you can redistribute it and/or modify it * * under the terms version 2 of the GNU General Public License as published * * by the Free Software Foundation. This program is distributed in the hope * - * that it will be useful, but WITHOUT ANY WARRANTY; + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * - * with this program; + * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * * For the text or an alternative of this public license, you may reach us * * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA * * or via info@compiere.org or http://www.compiere.org/license.html * *****************************************************************************/ -package org.compiere.model; +package org.compiere.model; /** Generated Model - DO NOT CHANGE */ -import java.util.*; -import java.sql.*; -import java.math.*; -import org.compiere.util.*; +import java.util.*; +import java.sql.*; +import java.math.*; +import org.compiere.util.*; /** Generated Model for M_RMALine * @author Adempiere (generated) * @version Release 3.2.0 - $Id$ */ -public class X_M_RMALine extends PO -{ +public class X_M_RMALine extends PO +{ /** Standard Constructor @param ctx context @param M_RMALine_ID id @param trxName transaction */ -public X_M_RMALine (Properties ctx, int M_RMALine_ID, String trxName) -{ -super (ctx, M_RMALine_ID, trxName); -/** if (M_RMALine_ID == 0) -{ -setM_InOutLine_ID (0); -setM_RMALine_ID (0); -setM_RMA_ID (0); -setProcessed (false); -setQty (Env.ZERO); -} +public X_M_RMALine (Properties ctx, int M_RMALine_ID, String trxName) +{ +super (ctx, M_RMALine_ID, trxName); +/** if (M_RMALine_ID == 0) +{ +setLine (0); // @SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_RMALine WHERE M_RMA_ID=@M_RMA_ID@ +setM_RMALine_ID (0); +setM_RMA_ID (0); +setProcessed (false); +setQty (Env.ZERO); +} */ -} +} /** Load Constructor @param ctx context @param rs result set @param trxName transaction */ -public X_M_RMALine (Properties ctx, ResultSet rs, String trxName) -{ -super (ctx, rs, trxName); -} -/** AD_Table_ID=660 */ -public static final int Table_ID=MTable.getTable_ID("M_RMALine"); - +public X_M_RMALine (Properties ctx, ResultSet rs, String trxName) +{ +super (ctx, rs, trxName); +} /** TableName=M_RMALine */ -public static final String Table_Name="M_RMALine"; +public static final String Table_Name="M_RMALine"; -protected static KeyNamePair Model = new KeyNamePair(Table_ID,"M_RMALine"); +/** AD_Table_ID=660 */ +public static final int Table_ID=MTable.getTable_ID(Table_Name); -protected BigDecimal accessLevel = BigDecimal.valueOf(1); +protected static KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name); + +protected BigDecimal accessLevel = BigDecimal.valueOf(1); /** AccessLevel @return 1 - Org */ -protected int get_AccessLevel() -{ -return accessLevel.intValue(); -} +protected int get_AccessLevel() +{ +return accessLevel.intValue(); +} /** Load Meta Data @param ctx context @return PO Info */ -protected POInfo initPO (Properties ctx) -{ -POInfo poi = POInfo.getPOInfo (ctx, Table_ID); -return poi; -} +protected POInfo initPO (Properties ctx) +{ +POInfo poi = POInfo.getPOInfo (ctx, Table_ID); +return poi; +} /** Info @return info */ -public String toString() -{ -StringBuffer sb = new StringBuffer ("X_M_RMALine[").append(get_ID()).append("]"); -return sb.toString(); -} +public String toString() +{ +StringBuffer sb = new StringBuffer ("X_M_RMALine[").append(get_ID()).append("]"); +return sb.toString(); +} +/** Set Amount. +@param Amt Amount */ +public void setAmt (BigDecimal Amt) +{ +set_Value ("Amt", Amt); +} +/** Get Amount. +@return Amount */ +public BigDecimal getAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("Amt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Column name Amt */ +public static final String COLUMNNAME_Amt = "Amt"; +/** Set Charge. +@param C_Charge_ID Additional document charges */ +public void setC_Charge_ID (int C_Charge_ID) +{ +if (C_Charge_ID <= 0) set_Value ("C_Charge_ID", null); + else +set_Value ("C_Charge_ID", Integer.valueOf(C_Charge_ID)); +} +/** Get Charge. +@return Additional document charges */ +public int getC_Charge_ID() +{ +Integer ii = (Integer)get_Value("C_Charge_ID"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name C_Charge_ID */ +public static final String COLUMNNAME_C_Charge_ID = "C_Charge_ID"; /** Set Description. @param Description Optional short description of the record */ -public void setDescription (String Description) -{ -if (Description != null && Description.length() > 255) -{ -log.warning("Length > 255 - truncated"); -Description = Description.substring(0,254); -} -set_Value ("Description", Description); -} +public void setDescription (String Description) +{ +if (Description != null && Description.length() > 255) +{ +log.warning("Length > 255 - truncated"); +Description = Description.substring(0,254); +} +set_Value ("Description", Description); +} /** Get Description. @return Optional short description of the record */ -public String getDescription() -{ -return (String)get_Value("Description"); -} +public String getDescription() +{ +return (String)get_Value("Description"); +} /** Column name Description */ -public static final String COLUMNNAME_Description = "Description"; +public static final String COLUMNNAME_Description = "Description"; +/** Set Line No. +@param Line Unique line for this document */ +public void setLine (int Line) +{ +set_Value ("Line", Integer.valueOf(Line)); +} +/** Get Line No. +@return Unique line for this document */ +public int getLine() +{ +Integer ii = (Integer)get_Value("Line"); +if (ii == null) return 0; +return ii.intValue(); +} +/** Column name Line */ +public static final String COLUMNNAME_Line = "Line"; +/** Set Line Amount. +@param LineNetAmt Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public void setLineNetAmt (BigDecimal LineNetAmt) +{ +set_Value ("LineNetAmt", LineNetAmt); +} +/** Get Line Amount. +@return Line Extended Amount (Quantity * Actual Price) without Freight and Charges */ +public BigDecimal getLineNetAmt() +{ +BigDecimal bd = (BigDecimal)get_Value("LineNetAmt"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Column name LineNetAmt */ +public static final String COLUMNNAME_LineNetAmt = "LineNetAmt"; /** 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_Value ("M_InOutLine_ID", Integer.valueOf(M_InOutLine_ID)); -} +public void setM_InOutLine_ID (int M_InOutLine_ID) +{ +if (M_InOutLine_ID <= 0) set_Value ("M_InOutLine_ID", null); + else +set_Value ("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("M_InOutLine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_InOutLine_ID() +{ +Integer ii = (Integer)get_Value("M_InOutLine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_InOutLine_ID */ -public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID"; +public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_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 ("M_RMALine_ID", Integer.valueOf(M_RMALine_ID)); -} +public void setM_RMALine_ID (int M_RMALine_ID) +{ +if (M_RMALine_ID < 1) throw new IllegalArgumentException ("M_RMALine_ID is mandatory."); +set_ValueNoCheck ("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("M_RMALine_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_RMALine_ID() +{ +Integer ii = (Integer)get_Value("M_RMALine_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Column name M_RMALine_ID */ -public static final String COLUMNNAME_M_RMALine_ID = "M_RMALine_ID"; +public static final String COLUMNNAME_M_RMALine_ID = "M_RMALine_ID"; /** 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 ("M_RMA_ID", Integer.valueOf(M_RMA_ID)); -} +public void setM_RMA_ID (int M_RMA_ID) +{ +if (M_RMA_ID < 1) throw new IllegalArgumentException ("M_RMA_ID is mandatory."); +set_ValueNoCheck ("M_RMA_ID", Integer.valueOf(M_RMA_ID)); +} /** Get RMA. @return Return Material Authorization */ -public int getM_RMA_ID() -{ -Integer ii = (Integer)get_Value("M_RMA_ID"); -if (ii == null) return 0; -return ii.intValue(); -} +public int getM_RMA_ID() +{ +Integer ii = (Integer)get_Value("M_RMA_ID"); +if (ii == null) return 0; +return ii.intValue(); +} /** Get Record ID/ColumnName @return ID/ColumnName pair -*/public KeyNamePair getKeyNamePair() -{ -return new KeyNamePair(get_ID(), String.valueOf(getM_RMA_ID())); -} +*/public KeyNamePair getKeyNamePair() +{ +return new KeyNamePair(get_ID(), String.valueOf(getM_RMA_ID())); +} /** Column name M_RMA_ID */ -public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; +public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID"; /** Set Processed. @param Processed The document has been processed */ -public void setProcessed (boolean Processed) -{ -set_Value ("Processed", Boolean.valueOf(Processed)); -} +public void setProcessed (boolean Processed) +{ +set_Value ("Processed", Boolean.valueOf(Processed)); +} /** Get Processed. @return The document has been processed */ -public boolean isProcessed() -{ -Object oo = get_Value("Processed"); -if (oo != null) -{ - if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); - return "Y".equals(oo); -} -return false; -} +public boolean isProcessed() +{ +Object oo = get_Value("Processed"); +if (oo != null) +{ + if (oo instanceof Boolean) return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); +} +return false; +} /** Column name Processed */ -public static final String COLUMNNAME_Processed = "Processed"; +public static final String COLUMNNAME_Processed = "Processed"; /** Set Quantity. @param Qty Quantity */ -public void setQty (BigDecimal Qty) -{ -if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); -set_Value ("Qty", Qty); -} +public void setQty (BigDecimal Qty) +{ +if (Qty == null) throw new IllegalArgumentException ("Qty is mandatory."); +set_Value ("Qty", Qty); +} /** Get Quantity. @return Quantity */ -public BigDecimal getQty() -{ -BigDecimal bd = (BigDecimal)get_Value("Qty"); -if (bd == null) return Env.ZERO; -return bd; -} +public BigDecimal getQty() +{ +BigDecimal bd = (BigDecimal)get_Value("Qty"); +if (bd == null) return Env.ZERO; +return bd; +} /** Column name Qty */ -public static final String COLUMNNAME_Qty = "Qty"; -} +public static final String COLUMNNAME_Qty = "Qty"; +/** Set Delivered Quantity. +@param QtyDelivered Delivered Quantity */ +public void setQtyDelivered (BigDecimal QtyDelivered) +{ +set_Value ("QtyDelivered", QtyDelivered); +} +/** Get Delivered Quantity. +@return Delivered Quantity */ +public BigDecimal getQtyDelivered() +{ +BigDecimal bd = (BigDecimal)get_Value("QtyDelivered"); +if (bd == null) return Env.ZERO; +return bd; +} +/** Column name QtyDelivered */ +public static final String COLUMNNAME_QtyDelivered = "QtyDelivered"; +} diff --git a/base/src/org/compiere/process/InOutCreateInvoice.java b/base/src/org/compiere/process/InOutCreateInvoice.java index 8641355a7f..7d32c51667 100644 --- a/base/src/org/compiere/process/InOutCreateInvoice.java +++ b/base/src/org/compiere/process/InOutCreateInvoice.java @@ -75,7 +75,8 @@ public class InOutCreateInvoice extends SvrProcess throw new IllegalArgumentException("Shipment not completed"); MInvoice invoice = new MInvoice (ship, null); - if (p_M_PriceList_ID != 0) + // Should not override pricelist for RMA + if (p_M_PriceList_ID != 0 && ship.getM_RMA_ID() != 0) invoice.setM_PriceList_ID(p_M_PriceList_ID); if (p_InvoiceDocumentNo != null && p_InvoiceDocumentNo.length() > 0) invoice.setDocumentNo(p_InvoiceDocumentNo); diff --git a/client/src/org/compiere/apps/form/VInOutGen.java b/client/src/org/compiere/apps/form/VInOutGen.java index b45830b847..0f7d750d82 100644 --- a/client/src/org/compiere/apps/form/VInOutGen.java +++ b/client/src/org/compiere/apps/form/VInOutGen.java @@ -100,6 +100,9 @@ public class VInOutGen extends CPanel private CTextPane info = new CTextPane(); private JScrollPane scrollPane = new JScrollPane(); private MiniTable miniTable = new MiniTable(); + + private CLabel lDocType = new CLabel(); + private VComboBox cmbDocType = new VComboBox(); /** User selection */ private ArrayList selection = null; @@ -145,6 +148,10 @@ public class VInOutGen extends CPanel info.setEditable(false); genPanel.add(confirmPanelGen, BorderLayout.SOUTH); confirmPanelGen.addActionListener(this); + + lDocType.setLabelFor(cmbDocType); + selNorthPanel.add(lDocType, null); + selNorthPanel.add(cmbDocType, null); } // jbInit /** @@ -165,6 +172,11 @@ public class VInOutGen extends CPanel fBPartner = new VLookup ("C_BPartner_ID", false, false, true, bpL); lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID")); fBPartner.addVetoableChangeListener(this); + //Document Type Sales Order/Vendor RMA + lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID")); + cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order"))); + cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA"))); + cmbDocType.addActionListener(this); } // fillPicks /** @@ -203,6 +215,83 @@ public class VInOutGen extends CPanel tabbedPane.addChangeListener(this); } // dynInit + /** + * Get SQL for Orders that needs to be shipped + * @return sql + */ + private String getOrderSQL() + { + // Create SQL + StringBuffer sql = new StringBuffer( + "SELECT C_Order_ID, o.Name, dt.Name, DocumentNo, bp.Name, DateOrdered, TotalLines " + + "FROM M_InOut_Candidate_v ic, AD_Org o, C_BPartner bp, C_DocType dt " + + "WHERE ic.AD_Org_ID=o.AD_Org_ID" + + " AND ic.C_BPartner_ID=bp.C_BPartner_ID" + + " AND ic.C_DocType_ID=dt.C_DocType_ID" + + " AND ic.AD_Client_ID=?"); + + if (m_M_Warehouse_ID != null) + sql.append(" AND ic.M_Warehouse_ID=").append(m_M_Warehouse_ID); + if (m_C_BPartner_ID != null) + sql.append(" AND ic.C_BPartner_ID=").append(m_C_BPartner_ID); + + // bug - [ 1713317 ] Generate Shipments (manual) show locked records + /* begin - Exclude locked records; @Trifon */ + int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); + String lockedIDs = MPrivateAccess.getLockedRecordWhere(MOrder.Table_ID, AD_User_ID); + if (lockedIDs != null) + { + if (sql.length() > 0) + sql.append(" AND "); + sql.append("C_Order_ID").append(lockedIDs); + } + /* eng - Exclude locked records; @Trifon */ + + // + sql.append(" ORDER BY o.Name,bp.Name,DateOrdered"); + + return sql.toString(); + } + + /** + * Get SQL for Vendor RMA that need to be shipped + * @return sql + */ + private String getRMASql() + { + StringBuffer sql = new StringBuffer(); + + sql.append("SELECT rma.M_RMA_ID, org.Name, dt.Name, rma.DocumentNo, bp.Name, rma.Created, rma.Amt "); + sql.append("FROM M_RMA rma INNER JOIN AD_Org org ON rma.AD_Org_ID=org.AD_Org_ID "); + sql.append("INNER JOIN C_DocType dt ON rma.C_DocType_ID=dt.C_DocType_ID "); + sql.append("INNER JOIN C_BPartner bp ON rma.C_BPartner_ID=bp.C_BPartner_ID "); + sql.append("INNER JOIN M_InOut io ON rma.InOut_ID=io.M_InOut_ID "); + sql.append("WHERE rma.DocStatus='CO' "); + sql.append("AND dt.DocBaseType = 'POO' "); + sql.append("AND EXISTS (SELECT * FROM M_RMA r INNER JOIN M_RMALine rl "); + sql.append("ON r.M_RMA_ID=rl.M_RMA_ID WHERE r.M_RMA_ID=rma.M_RMA_ID "); + sql.append("AND rl.IsActive='Y' AND rl.M_InOutLine_ID > 0 AND rl.QtyDelivered < rl.Qty) "); + sql.append("AND NOT EXISTS (SELECT * FROM M_InOut oio WHERE oio.M_RMA_ID=rma.M_RMA_ID "); + sql.append("AND oio.DocStatus IN ('IP', 'CO', 'CL')) " ); + sql.append("AND rma.AD_Client_ID=?"); + + if (m_M_Warehouse_ID != null) + sql.append(" AND io.M_Warehouse_ID=").append(m_M_Warehouse_ID); + if (m_C_BPartner_ID != null) + sql.append(" AND bp.C_BPartner_ID=").append(m_C_BPartner_ID); + + int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); + String lockedIDs = MPrivateAccess.getLockedRecordWhere(MRMA.Table_ID, AD_User_ID); + if (lockedIDs != null) + { + sql.append(" AND rma.M_RMA_ID").append(lockedIDs); + } + + sql.append(" ORDER BY org.Name, bp.Name, rma.Created "); + + return sql.toString(); + } + /** * Query Info */ @@ -210,36 +299,21 @@ public class VInOutGen extends CPanel { log.info(""); int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx()); - // Create SQL - StringBuffer sql = new StringBuffer( - "SELECT C_Order_ID, o.Name, dt.Name, DocumentNo, bp.Name, DateOrdered, TotalLines " - + "FROM M_InOut_Candidate_v ic, AD_Org o, C_BPartner bp, C_DocType dt " - + "WHERE ic.AD_Org_ID=o.AD_Org_ID" - + " AND ic.C_BPartner_ID=bp.C_BPartner_ID" - + " AND ic.C_DocType_ID=dt.C_DocType_ID" - + " AND ic.AD_Client_ID=?"); - - if (m_M_Warehouse_ID != null) - sql.append(" AND ic.M_Warehouse_ID=").append(m_M_Warehouse_ID); - if (m_C_BPartner_ID != null) - sql.append(" AND ic.C_BPartner_ID=").append(m_C_BPartner_ID); - // bug - [ 1713317 ] Generate Shipments (manual) show locked records - /* begin - Exclude locked records; @Trifon */ - int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID"); - String lockedIDs = MPrivateAccess.getLockedRecordWhere(MOrder.Table_ID, AD_User_ID); - if (lockedIDs != null) + String sql = ""; + + KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); + + if (docTypeKNPair.getKey() == MRMA.Table_ID) { - if (sql.length() > 0) - sql.append(" AND "); - sql.append("C_Order_ID").append(lockedIDs); + sql = getRMASql(); + } + else + { + sql = getOrderSQL(); } - /* eng - Exclude locked records; @Trifon */ - - // - sql.append(" ORDER BY o.Name,bp.Name,DateOrdered"); - log.fine(sql.toString()); + log.fine(sql); // reset table int row = 0; miniTable.setRowCount(row); @@ -300,6 +374,11 @@ public class VInOutGen extends CPanel dispose(); return; } + if (cmbDocType.equals(e.getSource())) + { + executeQuery(); + return; + } // saveSelection(); if (selection != null @@ -402,7 +481,18 @@ public class VInOutGen extends CPanel statusBar.setStatusDB(String.valueOf(selection.size())); // Prepare Process - int AD_Process_ID = 199; // M_InOutCreate - org.compiere.process.InOutGenerate + int AD_Process_ID = 0; + KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem(); + + if (docTypeKNPair.getKey() == MRMA.Table_ID) + { + AD_Process_ID = 52001; // M_InOut_GenerateRMA - org.adempiere.process.InOutGenerateRMA + } + else + { + AD_Process_ID = 199; // M_InOut_Generate - org.compiere.process.InOutGenerate + } + MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0); if (!instance.save()) { diff --git a/client/src/org/compiere/apps/form/VInvoiceGen.java b/client/src/org/compiere/apps/form/VInvoiceGen.java index ffc74e040c..a71c46f119 100644 --- a/client/src/org/compiere/apps/form/VInvoiceGen.java +++ b/client/src/org/compiere/apps/form/VInvoiceGen.java @@ -101,6 +101,9 @@ public class VInvoiceGen extends CPanel private MiniTable miniTable = new MiniTable(); private ArrayList selections = null; + private CLabel lDocType = new CLabel(); + private VComboBox cmbDocType = new VComboBox(); + /** * Static Init. *
@@ -143,6 +146,10 @@ public class VInvoiceGen extends CPanel
 		info.setEditable(false);
 		genPanel.add(confirmPanelGen, BorderLayout.SOUTH);
 		confirmPanelGen.addActionListener(this);
+		
+		lDocType.setLabelFor(cmbDocType);
+        selNorthPanel.add(lDocType, null);
+        selNorthPanel.add(cmbDocType, null);
 	}	//	jbInit
 
 	/**
@@ -161,6 +168,12 @@ public class VInvoiceGen extends CPanel
 		fBPartner = new VLookup ("C_BPartner_ID", false, false, true, bpL);
 	//	lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
 		fBPartner.addVetoableChangeListener(this);
+		
+		//Document Type Sales Order/Vendor RMA
+        lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
+        cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order")));
+        cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA")));
+        cmbDocType.addActionListener(this);
 	}	//	fillPicks
 
 	/**
@@ -198,6 +211,76 @@ public class VInvoiceGen extends CPanel
 		//	Tabbed Pane Listener
 		tabbedPane.addChangeListener(this);
 	}	//	dynInit
+	
+	private String getOrderSQL()
+	{
+	    StringBuffer sql = new StringBuffer(
+	            "SELECT C_Order_ID, o.Name, dt.Name, DocumentNo, bp.Name, DateOrdered, TotalLines "
+	            + "FROM C_Invoice_Candidate_v ic, AD_Org o, C_BPartner bp, C_DocType dt "
+	            + "WHERE ic.AD_Org_ID=o.AD_Org_ID"
+	            + " AND ic.C_BPartner_ID=bp.C_BPartner_ID"
+	            + " AND ic.C_DocType_ID=dt.C_DocType_ID"
+	            + " AND ic.AD_Client_ID=?");
+
+        if (m_AD_Org_ID != null)
+            sql.append(" AND ic.AD_Org_ID=").append(m_AD_Org_ID);
+        if (m_C_BPartner_ID != null)
+            sql.append(" AND ic.C_BPartner_ID=").append(m_C_BPartner_ID);
+        
+        // bug - [ 1713337 ] "Generate Invoices (manual)" show locked records.
+        /* begin - Exclude locked records; @Trifon */
+        int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID");
+        String lockedIDs = MPrivateAccess.getLockedRecordWhere(MOrder.Table_ID, AD_User_ID);
+        if (lockedIDs != null)
+        {
+            if (sql.length() > 0)
+                sql.append(" AND ");
+            sql.append("C_Order_ID").append(lockedIDs);
+        }
+        /* eng - Exclude locked records; @Trifon */
+
+        //
+        sql.append(" ORDER BY o.Name,bp.Name,DateOrdered");
+        
+        return sql.toString();
+	}
+	
+	private String getRMASql()
+	{
+	    StringBuffer sql = new StringBuffer();
+	    sql.append("SELECT rma.M_RMA_ID, org.Name, dt.Name, rma.DocumentNo, bp.Name, rma.Created, rma.Amt ");
+        sql.append("FROM M_RMA rma INNER JOIN AD_Org org ON rma.AD_Org_ID=org.AD_Org_ID ");
+        sql.append("INNER JOIN C_DocType dt ON rma.C_DocType_ID=dt.C_DocType_ID ");
+        sql.append("INNER JOIN C_BPartner bp ON rma.C_BPartner_ID=bp.C_BPartner_ID ");
+        sql.append("INNER JOIN M_InOut io ON rma.InOut_ID=io.M_InOut_ID ");
+        sql.append("WHERE rma.DocStatus='CO' ");
+        sql.append("AND dt.DocBaseType = 'POO' ");
+        sql.append("AND NOT EXISTS (SELECT * FROM C_Invoice i ");
+        sql.append("WHERE i.M_RMA_ID=rma.M_RMA_ID AND i.DocStatus IN ('IP', 'CO', 'CL')) ");
+        sql.append("AND EXISTS (SELECT * FROM C_InvoiceLine il INNER JOIN M_InOutLine iol ");
+        sql.append("ON il.M_InOutLine_ID=iol.M_InOutLine_ID INNER JOIN C_Invoice i ");
+        sql.append("ON i.C_Invoice_ID=il.C_Invoice_ID WHERE i.DocStatus IN ('CO', 'CL') ");
+        sql.append("AND iol.M_InOutLine_ID IN ");
+        sql.append("(SELECT M_InOutLine_ID FROM M_RMALine rl WHERE rl.M_RMA_ID=rma.M_RMA_ID ");
+        sql.append("AND rl.M_InOutLine_ID IS NOT NULL)) ");
+        sql.append("AND rma.AD_Client_ID=?");
+        
+        if (m_AD_Org_ID != null)
+            sql.append(" AND rma.AD_Org_ID=").append(m_AD_Org_ID);
+        if (m_C_BPartner_ID != null)
+            sql.append(" AND bp.C_BPartner_ID=").append(m_C_BPartner_ID);
+        
+        int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID");
+        String lockedIDs = MPrivateAccess.getLockedRecordWhere(MRMA.Table_ID, AD_User_ID);
+        if (lockedIDs != null)
+        {
+            sql.append(" AND rma.M_RMA_ID").append(lockedIDs);
+        }
+        
+        sql.append(" ORDER BY org.Name, bp.Name, rma.Created ");
+        
+        return sql.toString();
+	}
 
 	/**
 	 *  Query Info
@@ -207,34 +290,19 @@ public class VInvoiceGen extends CPanel
 		log.info("");
 		int AD_Client_ID = Env.getAD_Client_ID(Env.getCtx());
 		//  Create SQL
-		StringBuffer sql = new StringBuffer(
-			"SELECT C_Order_ID, o.Name, dt.Name, DocumentNo, bp.Name, DateOrdered, TotalLines "
-			+ "FROM C_Invoice_Candidate_v ic, AD_Org o, C_BPartner bp, C_DocType dt "
-			+ "WHERE ic.AD_Org_ID=o.AD_Org_ID"
-			+ " AND ic.C_BPartner_ID=bp.C_BPartner_ID"
-			+ " AND ic.C_DocType_ID=dt.C_DocType_ID"
-			+ " AND ic.AD_Client_ID=?");
-
-		if (m_AD_Org_ID != null)
-			sql.append(" AND ic.AD_Org_ID=").append(m_AD_Org_ID);
-		if (m_C_BPartner_ID != null)
-			sql.append(" AND ic.C_BPartner_ID=").append(m_C_BPartner_ID);
 		
-		// bug - [ 1713337 ] "Generate Invoices (manual)" show locked records.
-		/* begin - Exclude locked records; @Trifon */
-		int AD_User_ID = Env.getContextAsInt(Env.getCtx(), "#AD_User_ID");
-		String lockedIDs = MPrivateAccess.getLockedRecordWhere(MOrder.Table_ID, AD_User_ID);
-		if (lockedIDs != null)
-		{
-			if (sql.length() > 0)
-				sql.append(" AND ");
-			sql.append("C_Order_ID").append(lockedIDs);
-		}
-		/* eng - Exclude locked records; @Trifon */
-
-		//
-		sql.append(" ORDER BY o.Name,bp.Name,DateOrdered");
-	//	log.fine( "VInvoiceGen.executeQuery - AD_Client_ID=" + AD_Client_ID, sql.toString());
+		String sql = "";
+        
+        KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem();
+        
+        if (docTypeKNPair.getKey() == MOrder.Table_ID)
+        {
+            sql = getOrderSQL();
+        }
+        else
+        {
+            sql = getRMASql();
+        }
 
 		//  reset table
 		int row = 0;
@@ -296,6 +364,11 @@ public class VInvoiceGen extends CPanel
 			dispose();
 			return;
 		}
+		if (cmbDocType.equals(e.getSource()))
+        {
+            executeQuery();
+            return;
+        }
 		//
 		saveSelection();
 		if (selections != null && selections.size() > 0 && m_selectionActive)
@@ -392,7 +465,17 @@ public class VInvoiceGen extends CPanel
 		statusBar.setStatusDB(String.valueOf(selections.size()));
 
 		//	Prepare Process
-		int AD_Process_ID = 134;  // HARDCODED    C_InvoiceCreate
+		int AD_Process_ID = 0;
+		KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem();
+        
+        if (docTypeKNPair.getKey() == MRMA.Table_ID)
+        {
+            AD_Process_ID = 52002; // C_Invoice_GenerateRMA - org.adempiere.process.InvoiceGenerateRMA
+        }
+        else
+        {
+            AD_Process_ID = 134;  // HARDCODED    C_InvoiceCreate
+        }
 		MPInstance instance = new MPInstance(Env.getCtx(), AD_Process_ID, 0);
 		if (!instance.save())
 		{
diff --git a/client/src/org/compiere/grid/VCreateFrom.java b/client/src/org/compiere/grid/VCreateFrom.java
index 391bac367b..86ab087d8f 100644
--- a/client/src/org/compiere/grid/VCreateFrom.java
+++ b/client/src/org/compiere/grid/VCreateFrom.java
@@ -140,6 +140,11 @@ public abstract class VCreateFrom extends CDialog
 	protected VLocator locatorField = new VLocator();
 	public static final String SELECT_ALL = "SelectAll";
 //	public static final String SELECT_ALL_TOOLTIP = "Select all records";	
+    
+    /** Label for the rma selection */
+    protected JLabel rmaLabel = new JLabel();
+    /** Combo box for selecting RMA document */
+    protected JComboBox rmaField = new JComboBox();
 	/**
 	 *  Static Init.
 	 *  
@@ -166,6 +171,7 @@ public abstract class VCreateFrom extends CDialog
 		invoiceLabel.setText(Msg.getElement(Env.getCtx(), "C_Invoice_ID", false));
 		shipmentLabel.setText(Msg.getElement(Env.getCtx(), "M_InOut_ID", false));
 		locatorLabel.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
+        rmaLabel.setText(Msg.translate(Env.getCtx(), "M_RMA_ID"));
 		//
 		this.getContentPane().add(parameterPanel, BorderLayout.NORTH);
 		parameterPanel.add(parameterBankPanel, BorderLayout.NORTH);
@@ -196,6 +202,13 @@ public abstract class VCreateFrom extends CDialog
 			,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
 		parameterStdPanel.add(locatorField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
 			,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
+        
+        // Add RMA document selection to panel
+        parameterStdPanel.add(rmaLabel, new GridBagConstraints(2, 3, 1, 1, 0.0, 0.0
+                ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
+        parameterStdPanel.add(rmaField,  new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0
+                ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
+        
 		this.getContentPane().add(dataPane, BorderLayout.CENTER);
 		dataPane.getViewport().add(dataTable, null);
 		//
@@ -337,9 +350,7 @@ public abstract class VCreateFrom extends CDialog
 	{
 		log.config("C_BPartner_ID=" + C_BPartner_ID);
 		KeyNamePair pp = new KeyNamePair(0,"");
-        //
-		int M_Warehouse_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "M_Warehouse_ID");
-		
+
 		//  load PO Orders - Closed, Completed
 		orderField.removeActionListener(this);
 		orderField.removeAllItems();
@@ -356,7 +367,6 @@ public abstract class VCreateFrom extends CDialog
 		StringBuffer sql = new StringBuffer("SELECT o.C_Order_ID,").append(display)
 			.append(" FROM C_Order o "
 			+ "WHERE o.C_BPartner_ID=? AND o.IsSOTrx='N' AND o.DocStatus IN ('CL','CO')"
-			+ " AND o.M_Warehouse_ID = " + M_Warehouse_ID 
 			+ " AND o.C_Order_ID IN "
 				  + "(SELECT ol.C_Order_ID FROM C_OrderLine ol"
 				  + " LEFT OUTER JOIN M_MatchPO m ON (ol.C_OrderLine_ID=m.C_OrderLine_ID) "
diff --git a/client/src/org/compiere/grid/VCreateFromInvoice.java b/client/src/org/compiere/grid/VCreateFromInvoice.java
index 35f05a0f22..ba47bcfafa 100644
--- a/client/src/org/compiere/grid/VCreateFromInvoice.java
+++ b/client/src/org/compiere/grid/VCreateFromInvoice.java
@@ -62,6 +62,10 @@ public class VCreateFromInvoice extends VCreateFrom implements VetoableChangeLis
 		invoiceField.setVisible(false);
 		locatorLabel.setVisible(false);
 		locatorField.setVisible(false);
+        
+        // Do not display RMA document selection
+		rmaLabel.setVisible(false);
+        rmaField.setVisible(false);
 
 		initBPartner(true);
 		bPartnerField.addVetoableChangeListener(this);
diff --git a/client/src/org/compiere/grid/VCreateFromShipment.java b/client/src/org/compiere/grid/VCreateFromShipment.java
index b381b78794..123dd931aa 100644
--- a/client/src/org/compiere/grid/VCreateFromShipment.java
+++ b/client/src/org/compiere/grid/VCreateFromShipment.java
@@ -49,7 +49,45 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 
 	/**  Loaded Invoice             */
 	private MInvoice		m_invoice = null;
+    /**  Loaded RMA             */
+    private MRMA            m_rma = null;
 
+    /**
+     *  Load Order/Invoice/RMA data into Table
+     *  @param data data
+     */
+    protected void loadTableOIS (Vector data)
+    {
+        //  Header Info
+        Vector columnNames = new Vector(7);
+        columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
+        columnNames.add(Msg.translate(Env.getCtx(), "Quantity"));
+        columnNames.add(Msg.translate(Env.getCtx(), "C_UOM_ID"));
+        columnNames.add(Msg.translate(Env.getCtx(), "M_Product_ID"));
+        columnNames.add(Msg.getElement(Env.getCtx(), "VendorProductNo", false));
+        columnNames.add(Msg.getElement(Env.getCtx(), "C_Order_ID", false));
+        columnNames.add(Msg.getElement(Env.getCtx(), "M_RMA_ID", false));
+        columnNames.add(Msg.getElement(Env.getCtx(), "C_Invoice_ID", false));
+
+        //  Remove previous listeners
+        dataTable.getModel().removeTableModelListener(this);
+        //  Set Model
+        DefaultTableModel model = new DefaultTableModel(data, columnNames);
+        model.addTableModelListener(this);
+        dataTable.setModel(model);
+        //
+        dataTable.setColumnClass(0, Boolean.class, false);      //  0-Selection
+        dataTable.setColumnClass(1, Double.class, true);        //  1-Qty
+        dataTable.setColumnClass(2, String.class, true);        //  2-UOM
+        dataTable.setColumnClass(3, String.class, true);        //  3-Product
+        dataTable.setColumnClass(4, String.class, true);        //  4-VendorProductNo
+        dataTable.setColumnClass(5, String.class, true);        //  5-Order
+        dataTable.setColumnClass(6, String.class, true);        //  6-RMA
+        dataTable.setColumnClass(7, String.class, true);        //  7-Invoice
+        //  Table UI
+        dataTable.autoSize();
+    }   //  loadOrder
+    
 	/**
 	 *  Dynamic Init
 	 *  @throws Exception if Lookups cannot be initialized
@@ -75,55 +113,119 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 	}   //  dynInit
 
 	/**
-	 *  Init Details - load invoices not shipped
+	 *  Init Details - load invoices not shipped and RMA candidates for Shipment
 	 *  @param C_BPartner_ID BPartner
 	 */
 	protected void initBPDetails(int C_BPartner_ID)
 	{
 		log.config("C_BPartner_ID=" + C_BPartner_ID);
 
-		//  load AP Invoice closed or complete
-		invoiceField.removeActionListener(this);
-		invoiceField.removeAllItems();
-		//	None
-		KeyNamePair pp = new KeyNamePair(0,"");
-		invoiceField.addItem(pp);
-		StringBuffer display = new StringBuffer("i.DocumentNo||' - '||")
-			.append(DB.TO_CHAR("DateInvoiced", DisplayType.Date, Env.getAD_Language(Env.getCtx())))
-			.append("|| ' - ' ||")
-			.append(DB.TO_CHAR("GrandTotal", DisplayType.Amount, Env.getAD_Language(Env.getCtx())));
-		//
-		StringBuffer sql = new StringBuffer("SELECT i.C_Invoice_ID,").append(display)
-		   .append(" FROM C_Invoice i "
-		   + "WHERE i.C_BPartner_ID=? AND i.IsSOTrx='N' AND i.DocStatus IN ('CL','CO')"
-		   + " AND i.C_Invoice_ID IN "
-			   + "(SELECT il.C_Invoice_ID FROM C_InvoiceLine il"
-			   + " LEFT OUTER JOIN M_MatchInv mi ON (il.C_InvoiceLine_ID=mi.C_InvoiceLine_ID) "
-			   + "GROUP BY il.C_Invoice_ID,mi.C_InvoiceLine_ID,il.QtyInvoiced "
-			   + "HAVING (il.QtyInvoiced<>SUM(mi.Qty) AND mi.C_InvoiceLine_ID IS NOT NULL)"
-			   + " OR mi.C_InvoiceLine_ID IS NULL) "
-		   + "ORDER BY i.DateInvoiced");
-
-		try
-		{
-			PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
-			pstmt.setInt(1, C_BPartner_ID);
-			ResultSet rs = pstmt.executeQuery();
-			while (rs.next())
-			{
-				pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
-				invoiceField.addItem(pp);
-			}
-			rs.close();
-			pstmt.close();
-		}
-		catch (SQLException e)
-		{
-			log.log(Level.SEVERE, sql.toString(), e);
-		}
-		invoiceField.setSelectedIndex(0);
-		invoiceField.addActionListener(this);
+		initBPInvoiceDetails(C_BPartner_ID);
+        initBPRMADetails(C_BPartner_ID);
 	}   //  initBPDetails
+    
+    /**
+     * Init Details - load invoices not shipped
+     * @param C_BPartner_ID BPartner
+     */
+    private void initBPInvoiceDetails(int C_BPartner_ID)
+    {
+//      load AP Invoice closed or complete
+        invoiceField.removeActionListener(this);
+        invoiceField.removeAllItems();
+        //  None
+        KeyNamePair pp = new KeyNamePair(0,"");
+        invoiceField.addItem(pp);
+        StringBuffer display = new StringBuffer("i.DocumentNo||' - '||")
+            .append(DB.TO_CHAR("DateInvoiced", DisplayType.Date, Env.getAD_Language(Env.getCtx())))
+            .append("|| ' - ' ||")
+            .append(DB.TO_CHAR("GrandTotal", DisplayType.Amount, Env.getAD_Language(Env.getCtx())));
+        //
+        StringBuffer sql = new StringBuffer("SELECT i.C_Invoice_ID,").append(display)
+           .append(" FROM C_Invoice i "
+           + "WHERE i.C_BPartner_ID=? AND i.IsSOTrx='N' AND i.DocStatus IN ('CL','CO')"
+           + " AND i.C_Invoice_ID IN "
+               + "(SELECT il.C_Invoice_ID FROM C_InvoiceLine il"
+               + " LEFT OUTER JOIN M_MatchInv mi ON (il.C_InvoiceLine_ID=mi.C_InvoiceLine_ID) "
+               + "GROUP BY il.C_Invoice_ID,mi.C_InvoiceLine_ID,il.QtyInvoiced "
+               + "HAVING (il.QtyInvoiced<>SUM(mi.Qty) AND mi.C_InvoiceLine_ID IS NOT NULL)"
+               + " OR mi.C_InvoiceLine_ID IS NULL) "
+           + "ORDER BY i.DateInvoiced");
+
+        try
+        {
+            PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
+            pstmt.setInt(1, C_BPartner_ID);
+            ResultSet rs = pstmt.executeQuery();
+            while (rs.next())
+            {
+                pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
+                invoiceField.addItem(pp);
+            }
+            rs.close();
+            pstmt.close();
+        }
+        catch (SQLException e)
+        {
+            log.log(Level.SEVERE, sql.toString(), e);
+        }
+        invoiceField.setSelectedIndex(0);
+        invoiceField.addActionListener(this);
+    }
+    
+    /**
+     * Load RMA that are candidates for shipment
+     * @param C_BPartner_ID BPartner
+     */
+    private void initBPRMADetails(int C_BPartner_ID)
+    {
+        rmaField.removeActionListener(this);
+        rmaField.removeAllItems();
+        //  None
+        KeyNamePair pp = new KeyNamePair(0,"");
+        rmaField.addItem(pp);
+        
+        String sqlStmt = "SELECT r.M_RMA_ID, r.DocumentNo || '-' || r.Amt from M_RMA r "
+                       + "WHERE ISSOTRX='Y' AND r.DocStatus in ('CO', 'CL') " 
+                       + "AND r.C_BPartner_ID=? "
+                       + "AND r.M_RMA_ID in (SELECT rl.M_RMA_ID FROM M_RMALine rl "
+                       + "WHERE rl.M_RMA_ID=r.M_RMA_ID AND rl.QtyDelivered < rl.Qty " 
+                       + "AND rl.M_InOutLine_ID IS NOT NULL)";
+        
+        PreparedStatement pstmt = null;
+        try
+        {
+            pstmt = DB.prepareStatement(sqlStmt, null);
+            pstmt.setInt(1, C_BPartner_ID);
+            ResultSet rs = pstmt.executeQuery();
+            while (rs.next())
+            {
+                pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
+                rmaField.addItem(pp);
+            }
+            rs.close();
+        }
+        catch (SQLException e)
+        {
+            log.log(Level.SEVERE, sqlStmt.toString(), e);
+        }
+        finally
+        {
+            if (pstmt != null)
+            {
+                try
+                {
+                    pstmt.close();
+                }
+                catch (Exception ex)
+                {
+                    log.severe("Could not close prepared statement");
+                }
+            }
+        }
+        rmaField.setSelectedIndex(0);
+        rmaField.addActionListener(this);
+    }
 
 
 	/**
@@ -147,6 +249,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 				//  set Invoice and Shipment to Null
 				invoiceField.setSelectedIndex(-1);
 				shipmentField.setSelectedIndex(-1);
+                rmaField.setSelectedIndex(-1);
 				loadOrder(C_Order_ID, false);
 				m_invoice = null;
 			}
@@ -163,9 +266,26 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 				//  set Order and Shipment to Null
 				orderField.setSelectedIndex(-1);
 				shipmentField.setSelectedIndex(-1);
+                rmaField.setSelectedIndex(-1);
 				loadInvoice(C_Invoice_ID);
 			}
 		}
+		// RMA
+        else if (e.getSource().equals(rmaField))
+        {
+            KeyNamePair pp = (KeyNamePair)rmaField.getSelectedItem();
+            if (pp == null || pp.getKey() == 0)
+                ;
+            else
+            {
+                int M_RMA_ID = pp.getKey();
+                //  set Order and Shipment to Null
+                orderField.setSelectedIndex(-1);
+                shipmentField.setSelectedIndex(-1);
+                invoiceField.setSelectedIndex(-1);
+                loadRMA(M_RMA_ID);
+            }
+        }
 	}   //  actionPerformed
 
 
@@ -195,6 +315,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 		log.config("C_Invoice_ID=" + C_Invoice_ID);
 		m_invoice = new MInvoice(Env.getCtx(), C_Invoice_ID, null); // save
 		p_order = null;
+        m_rma = null;
 
 		Vector data = new Vector();
 		StringBuffer sql = new StringBuffer("SELECT " // Entered UOM
@@ -253,6 +374,99 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 		}
 		loadTableOIS(data);
 	} // loadInvoice
+    
+    /**
+     * Load RMA details
+     * @param M_RMA_ID RMA
+     */
+    private void loadRMA(int M_RMA_ID)
+    {
+        m_invoice = null;
+        p_order = null;
+        
+        m_rma = new MRMA(Env.getCtx(), M_RMA_ID, null);
+        
+        Vector data = new Vector();
+        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("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"))
+        {
+            sqlStmt.append("LEFT OUTER JOIN C_UOM uom ON (uom.C_UOM_ID=iol.C_UOM_ID) ");
+        }
+        else
+        {
+            sqlStmt.append("LEFT OUTER JOIN C_UOM_Trl uom ON (uom.C_UOM_ID=iol.C_UOM_ID AND uom.AD_Language='");
+            sqlStmt.append(Env.getAD_Language(Env.getCtx())).append("') ");
+        }
+        sqlStmt.append("LEFT OUTER JOIN M_Product p ON p.M_Product_ID=iol.M_Product_ID ");
+        sqlStmt.append("WHERE rl.M_RMA_ID=? ");
+        sqlStmt.append("AND rl.M_INOUTLINE_ID IS NOT NULL");
+        
+        sqlStmt.append(" UNION ");
+        
+        sqlStmt.append("SELECT rl.M_RMALine_ID, rl.line, rl.Qty - rl.QtyDelivered, 0, c.Name, uom.C_UOM_ID, COALESCE(uom.UOMSymbol,uom.Name) ");
+        sqlStmt.append("FROM M_RMALine rl INNER JOIN C_Charge c ON c.C_Charge_ID = rl.C_Charge_ID ");
+        if (Env.isBaseLanguage(Env.getCtx(), "C_UOM"))
+        {
+            sqlStmt.append("LEFT OUTER JOIN C_UOM uom ON (uom.C_UOM_ID=100) ");
+        }
+        else
+        {
+            sqlStmt.append("LEFT OUTER JOIN C_UOM_Trl uom ON (uom.C_UOM_ID=100 AND uom.AD_Language='");
+            sqlStmt.append(Env.getAD_Language(Env.getCtx())).append("') ");
+        }
+        sqlStmt.append("WHERE rl.M_RMA_ID=? ");
+        sqlStmt.append("AND rl.C_Charge_ID IS NOT NULL");
+        
+        PreparedStatement pstmt = null;
+        
+        try
+        {
+            pstmt = DB.prepareStatement(sqlStmt.toString(), null);
+            pstmt.setInt(1, M_RMA_ID);
+            pstmt.setInt(2, M_RMA_ID);
+            ResultSet rs = pstmt.executeQuery();
+            
+            while (rs.next())
+            {
+                Vector line = new Vector(7);
+                line.add(new Boolean(false));   // 0-Selection
+                line.add(rs.getBigDecimal(3).doubleValue());  // 1-Qty
+                KeyNamePair pp = new KeyNamePair(rs.getInt(6), rs.getString(7));
+                line.add(pp); // 2-UOM
+                pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
+                line.add(pp); // 3-Product
+                line.add(null); //4-Vendor Product No
+                line.add(null); //5-Order
+                pp = new KeyNamePair(rs.getInt(1), rs.getString(2));
+                line.add(pp);   //6-RMA
+                line.add(null); //7-invoice
+                data.add(line);
+            }
+            rs.close();
+        }
+        catch (Exception ex)
+        {
+            log.log(Level.SEVERE, sqlStmt.toString(), ex);
+        }
+        finally
+        {
+            if (pstmt != null)
+            {
+                try
+                {
+                    pstmt.close();
+                }
+                catch (Exception ex)
+                {
+                    log.severe("Could not close prepared statement");
+                }
+            }
+        }
+        loadTableOIS(data);
+    }
 
 	/**
 	 * List number of rows selected
@@ -297,7 +511,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 				// variable values
 				Double d = (Double) model.getValueAt(i, 1); // 1-Qty
 				BigDecimal QtyEntered = new BigDecimal(d.doubleValue());
-				KeyNamePair pp = (KeyNamePair) model.getValueAt(i, 2); // 2-Product
+				KeyNamePair pp = (KeyNamePair) model.getValueAt(i, 2); // 2-UOM
 				int C_UOM_ID = pp.getKey();
 				pp = (KeyNamePair) model.getValueAt(i, 3); // 3-Product
 				int M_Product_ID = pp.getKey();
@@ -305,6 +519,10 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 				pp = (KeyNamePair) model.getValueAt(i, 5); // 5-OrderLine
 				if (pp != null)
 					C_OrderLine_ID = pp.getKey();
+                int M_RMALine_ID = 0;
+                pp = (KeyNamePair) model.getValueAt(i, 6); // 6-RMA
+                if (pp != null)
+                    M_RMALine_ID = pp.getKey();
 				int C_InvoiceLine_ID = 0;
 				MInvoiceLine il = null;
 				pp = (KeyNamePair) model.getValueAt(i, 7); // 7-InvoiceLine
@@ -336,6 +554,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 				iol.setQty(QtyEntered);							//	Movement/Entered
 				//
 				MOrderLine ol = null;
+				MRMALine rmal = null;
 				if (C_OrderLine_ID != 0)
 				{
 					iol.setC_OrderLine_ID(C_OrderLine_ID);
@@ -380,6 +599,22 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 					iol.setUser1_ID(il.getUser1_ID());
 					iol.setUser2_ID(il.getUser2_ID());
 				}
+                else if (M_RMALine_ID != 0)
+                {
+                    rmal = new MRMALine(Env.getCtx(), M_RMALine_ID, null);
+                    iol.setM_RMALine_ID(M_RMALine_ID);
+                    iol.setQtyEntered(QtyEntered);
+                    iol.setDescription(rmal.getDescription());
+                    iol.setM_AttributeSetInstance_ID(rmal.getM_AttributeSetInstance_ID());
+                    iol.setC_Project_ID(rmal.getC_Project_ID());
+                    iol.setC_ProjectPhase_ID(rmal.getC_ProjectPhase_ID());
+                    iol.setC_ProjectTask_ID(rmal.getC_ProjectTask_ID());
+                    iol.setC_Activity_ID(rmal.getC_Activity_ID());
+                    iol.setAD_OrgTrx_ID(rmal.getAD_OrgTrx_ID());
+                    iol.setUser1_ID(rmal.getUser1_ID());
+                    iol.setUser2_ID(rmal.getUser2_ID());
+                }
+                
 				//	Charge
 				if (M_Product_ID == 0)
 				{
@@ -387,6 +622,8 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 						iol.setC_Charge_ID(ol.getC_Charge_ID());
 					else if (il != null && il.getC_Charge_ID() != 0)	//	from invoice
 						iol.setC_Charge_ID(il.getC_Charge_ID());
+					else if (rmal != null && rmal.getC_Charge_ID() != 0) // from rma
+					    iol.setC_Charge_ID(rmal.getC_Charge_ID());
 				}
 				//
 				iol.setM_Locator_ID(M_Locator_ID);
@@ -403,7 +640,7 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 
 		/**
 		 *  Update Header
-		 *  - if linked to another order/invoice - remove link
+		 *  - if linked to another order/invoice/rma - remove link
 		 *  - if no link set it
 		 */
 		if (p_order != null && p_order.getC_Order_ID() != 0)
@@ -428,6 +665,20 @@ public class VCreateFromShipment extends VCreateFrom implements VetoableChangeLi
 			inout.setUser1_ID(m_invoice.getUser1_ID());
 			inout.setUser2_ID(m_invoice.getUser2_ID());
 		}
+        if (m_rma != null && m_rma.getM_RMA_ID() != 0)
+        {
+            MInOut originalIO = m_rma.getShipment();
+            inout.setIsSOTrx(!m_rma.isSOTrx());
+            inout.setC_Order_ID(0);
+            inout.setC_Invoice_ID(0);
+            inout.setM_RMA_ID(m_rma.getM_RMA_ID());
+            inout.setAD_OrgTrx_ID(originalIO.getAD_OrgTrx_ID());
+            inout.setC_Project_ID(originalIO.getC_Project_ID());
+            inout.setC_Campaign_ID(originalIO.getC_Campaign_ID());
+            inout.setC_Activity_ID(originalIO.getC_Activity_ID());
+            inout.setUser1_ID(originalIO.getUser1_ID());
+            inout.setUser2_ID(originalIO.getUser2_ID());
+        }
 		inout.save();
 		return true;
 	}   //  save
diff --git a/client/src/org/compiere/grid/VCreateFromStatement.java b/client/src/org/compiere/grid/VCreateFromStatement.java
index 6611d46e95..1dcc25369b 100644
--- a/client/src/org/compiere/grid/VCreateFromStatement.java
+++ b/client/src/org/compiere/grid/VCreateFromStatement.java
@@ -3,121 +3,124 @@
  * Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved.                *
  * This program is free software; you can redistribute it and/or modify it    *
  * under the terms version 2 of the GNU General Public License as published   *
- * by the Free Software Foundation. This program is distributed in the hope   *
- * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
- * See the GNU General Public License for more details.                       *
- * You should have received a copy of the GNU General Public License along    *
- * with this program; if not, write to the Free Software Foundation, Inc.,    *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
- * For the text or an alternative of this public license, you may reach us    *
- * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
- * or via info@compiere.org or http://www.compiere.org/license.html           *
- *****************************************************************************/
-package org.compiere.grid;
-
-import java.beans.*;
-import java.math.*;
-import java.sql.*;
-import java.text.*;
-import java.util.*;
-import java.util.logging.*;
-import javax.swing.table.*;
-import org.compiere.apps.*;
-import org.compiere.grid.ed.*;
-import org.compiere.model.*;
-import org.compiere.util.*;
-
-/**
- *  Create Transactions for Bank Statements
- *
- *  @author Jorg Janke
- *  @version  $Id: VCreateFromStatement.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
- */
-public class VCreateFromStatement extends VCreateFrom implements VetoableChangeListener
-{
-	/**
-	 *  Protected Constructor
-	 *  @param mTab MTab
-	 */
-	VCreateFromStatement(GridTab mTab)
-	{
-		super (mTab);
-		log.info("");
-	}   //  VCreateFromStatement
-
-	/**
-	 *  Dynamic Init
-	 *  @throws Exception if Lookups cannot be initialized
-	 *  @return true if initialized
-	 */
-	protected boolean dynInit() throws Exception
-	{
-		if (p_mTab.getValue("C_BankStatement_ID") == null)
-		{
-			ADialog.error(0, this, "SaveErrorRowNotFound");
-			return false;
-		}
-
-		setTitle(Msg.translate(Env.getCtx(), "C_BankStatement_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
-		parameterStdPanel.setVisible(false);
-
-		int AD_Column_ID = 4917;        //  C_BankStatement.C_BankAccount_ID
-		MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
-		bankAccountField = new VLookup ("C_BankAccount_ID", true, false, true, lookup);
-		bankAccountField.addVetoableChangeListener(this);
-		//  Set Default
-		int C_BankAccount_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BankAccount_ID");
-		bankAccountField.setValue(new Integer(C_BankAccount_ID));
-		//  initial Loading
-		loadBankAccount(C_BankAccount_ID);
-
-		return true;
-	}   //  dynInit
-
-	/**
-	 *  Init Details (never called)
-	 *  @param C_BPartner_ID BPartner
-	 */
-	protected void initBPDetails(int C_BPartner_ID)
-	{
-	}   //  initDetails
-
-	/**
-	 *  Change Listener
-	 *  @param e event
-	 */
-	public void vetoableChange (PropertyChangeEvent e)
-	{
-		log.config(e.getPropertyName() + "=" + e.getNewValue());
-
-		//  BankAccount
-		if (e.getPropertyName().equals("C_BankAccount_ID"))
-		{
-			int C_BankAccount_ID = ((Integer)e.getNewValue()).intValue();
-			loadBankAccount(C_BankAccount_ID);
-		}
-		tableChanged(null);
-	}   //  vetoableChange
-
-	/**
-	 *  Load Data - Bank Account
-	 *  @param C_BankAccount_ID Bank Account
-	 */
-	private void loadBankAccount (int C_BankAccount_ID)
-	{
-		log.config ("C_BankAccount_ID=" + C_BankAccount_ID);
-		/**
-		 *  Selected        - 0
-		 *  Date            - 1
-		 *  C_Payment_ID    - 2
-		 *  C_Currenncy     - 3
-		 *  Amt             - 4
-		 */
-		Vector> data = new Vector>();
-		String sql = "SELECT p.DateTrx,p.C_Payment_ID,p.DocumentNo, p.C_Currency_ID,c.ISO_Code, p.PayAmt,"
-			+ "currencyConvert(p.PayAmt,p.C_Currency_ID,ba.C_Currency_ID,?,null,p.AD_Client_ID,p.AD_Org_ID),"   //  #1
-			+ " bp.Name "
+ * by the Free Software Foundation. This program is distributed in the hope   *
+ * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.           *
+ * See the GNU General Public License for more details.                       *
+ * You should have received a copy of the GNU General Public License along    *
+ * with this program; if not, write to the Free Software Foundation, Inc.,    *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.                     *
+ * For the text or an alternative of this public license, you may reach us    *
+ * ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA        *
+ * or via info@compiere.org or http://www.compiere.org/license.html           *
+ *****************************************************************************/
+package org.compiere.grid;
+
+import java.beans.*;
+import java.math.*;
+import java.sql.*;
+import java.text.*;
+import java.util.*;
+import java.util.logging.*;
+import javax.swing.table.*;
+import org.compiere.apps.*;
+import org.compiere.grid.ed.*;
+import org.compiere.model.*;
+import org.compiere.util.*;
+
+/**
+ *  Create Transactions for Bank Statements
+ *
+ *  @author Jorg Janke
+ *  @version  $Id: VCreateFromStatement.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
+ */
+public class VCreateFromStatement extends VCreateFrom implements VetoableChangeListener
+{
+	/**
+	 *  Protected Constructor
+	 *  @param mTab MTab
+	 */
+	VCreateFromStatement(GridTab mTab)
+	{
+		super (mTab);
+		log.info("");
+	}   //  VCreateFromStatement
+
+	/**
+	 *  Dynamic Init
+	 *  @throws Exception if Lookups cannot be initialized
+	 *  @return true if initialized
+	 */
+	protected boolean dynInit() throws Exception
+	{
+		if (p_mTab.getValue("C_BankStatement_ID") == null)
+		{
+			ADialog.error(0, this, "SaveErrorRowNotFound");
+			return false;
+		}
+        // Do not display RMA selection
+        rmaLabel.setVisible(false);
+        rmaField.setVisible(false);
+
+		setTitle(Msg.translate(Env.getCtx(), "C_BankStatement_ID") + " .. " + Msg.translate(Env.getCtx(), "CreateFrom"));
+		parameterStdPanel.setVisible(false);
+
+		int AD_Column_ID = 4917;        //  C_BankStatement.C_BankAccount_ID
+		MLookup lookup = MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.TableDir);
+		bankAccountField = new VLookup ("C_BankAccount_ID", true, false, true, lookup);
+		bankAccountField.addVetoableChangeListener(this);
+		//  Set Default
+		int C_BankAccount_ID = Env.getContextAsInt(Env.getCtx(), p_WindowNo, "C_BankAccount_ID");
+		bankAccountField.setValue(new Integer(C_BankAccount_ID));
+		//  initial Loading
+		loadBankAccount(C_BankAccount_ID);
+
+		return true;
+	}   //  dynInit
+
+	/**
+	 *  Init Details (never called)
+	 *  @param C_BPartner_ID BPartner
+	 */
+	protected void initBPDetails(int C_BPartner_ID)
+	{
+	}   //  initDetails
+
+	/**
+	 *  Change Listener
+	 *  @param e event
+	 */
+	public void vetoableChange (PropertyChangeEvent e)
+	{
+		log.config(e.getPropertyName() + "=" + e.getNewValue());
+
+		//  BankAccount
+		if (e.getPropertyName().equals("C_BankAccount_ID"))
+		{
+			int C_BankAccount_ID = ((Integer)e.getNewValue()).intValue();
+			loadBankAccount(C_BankAccount_ID);
+		}
+		tableChanged(null);
+	}   //  vetoableChange
+
+	/**
+	 *  Load Data - Bank Account
+	 *  @param C_BankAccount_ID Bank Account
+	 */
+	private void loadBankAccount (int C_BankAccount_ID)
+	{
+		log.config ("C_BankAccount_ID=" + C_BankAccount_ID);
+		/**
+		 *  Selected        - 0
+		 *  Date            - 1
+		 *  C_Payment_ID    - 2
+		 *  C_Currenncy     - 3
+		 *  Amt             - 4
+		 */
+		Vector> data = new Vector>();
+		String sql = "SELECT p.DateTrx,p.C_Payment_ID,p.DocumentNo, p.C_Currency_ID,c.ISO_Code, p.PayAmt,"
+			+ "currencyConvert(p.PayAmt,p.C_Currency_ID,ba.C_Currency_ID,?,null,p.AD_Client_ID,p.AD_Org_ID),"   //  #1
+			+ " bp.Name "
 			+ "FROM C_BankAccount ba"
 			+ " INNER JOIN C_Payment_v p ON (p.C_BankAccount_ID=ba.C_BankAccount_ID)"
 			+ " INNER JOIN C_Currency c ON (p.C_Currency_ID=c.C_Currency_ID)"
@@ -127,115 +130,115 @@ public class VCreateFromStatement extends VCreateFrom implements VetoableChangeL
 			+ " AND p.C_BankAccount_ID=?"                              	//  #2
 			+ " AND NOT EXISTS (SELECT * FROM C_BankStatementLine l " 
 			//	Voided Bank Statements have 0 StmtAmt
-				+ "WHERE p.C_Payment_ID=l.C_Payment_ID AND l.StmtAmt <> 0)";
-
-		//  Get StatementDate
-		Timestamp ts = (Timestamp)p_mTab.getValue("StatementDate");
-		if (ts == null)
-			ts = new Timestamp(System.currentTimeMillis());
-
-		try
-		{
-			PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
-			pstmt.setTimestamp(1, ts);
-			pstmt.setInt(2, C_BankAccount_ID);
-			ResultSet rs = pstmt.executeQuery();
-			while (rs.next())
-			{
-				Vector line = new Vector(6);
-				line.add(new Boolean(false));       //  0-Selection
-				line.add(rs.getTimestamp(1));       //  1-DateTrx
-				KeyNamePair pp = new KeyNamePair(rs.getInt(2), rs.getString(3));
-				line.add(pp);                       //  2-C_Payment_ID
-				pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
-				line.add(pp);                       //  3-Currency
-				line.add(rs.getBigDecimal(6));      //  4-PayAmt
-				line.add(rs.getBigDecimal(7));      //  5-Conv Amt
-				line.add(rs.getString(8));      	//  6-BParner
-				data.add(line);
-			}
-			rs.close();
-			pstmt.close();
-		}
-		catch (SQLException e)
-		{
-			log.log(Level.SEVERE, sql, e);
-		}
-		//  Header Info
-		Vector columnNames = new Vector(6);
-		columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
-		columnNames.add(Msg.translate(Env.getCtx(), "Date"));
-		columnNames.add(Msg.getElement(Env.getCtx(), "C_Payment_ID"));
-		columnNames.add(Msg.translate(Env.getCtx(), "C_Currency_ID"));
-		columnNames.add(Msg.translate(Env.getCtx(), "Amount"));
-		columnNames.add(Msg.translate(Env.getCtx(), "ConvertedAmount"));
-		columnNames.add(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
-
-		//  Remove previous listeners
-		dataTable.getModel().removeTableModelListener(this);
-		//  Set Model
-		DefaultTableModel model = new DefaultTableModel(data, columnNames);
-		model.addTableModelListener(this);
-		dataTable.setModel(model);
-		//
-		dataTable.setColumnClass(0, Boolean.class, false);      //  0-Selection
-		dataTable.setColumnClass(1, Timestamp.class, true);     //  1-TrxDate
-		dataTable.setColumnClass(2, String.class, true);        //  2-Payment
-		dataTable.setColumnClass(3, String.class, true);        //  3-Currency
-		dataTable.setColumnClass(4, BigDecimal.class, true);    //  4-Amount
-		dataTable.setColumnClass(5, BigDecimal.class, true);    //  5-ConvAmount
-		dataTable.setColumnClass(6, String.class, true);    	//  6-BPartner
-		//  Table UI
-		dataTable.autoSize();
-	}   //  loadBankAccount
-
-	/**
-	 *  List total amount
-	 */
-	protected void info()
-	{
-		DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount);
-
-		TableModel model = dataTable.getModel();
-		BigDecimal total = new BigDecimal(0.0);
-		int rows = model.getRowCount();
-		int count = 0;
-		for (int i = 0; i < rows; i++)
-		{
-			if (((Boolean)model.getValueAt(i, 0)).booleanValue())
-			{
-				total = total.add((BigDecimal)model.getValueAt(i, 4));
-				count++;
-			}
-		}
-		statusBar.setStatusLine(String.valueOf(count) + " - " + Msg.getMsg(Env.getCtx(), "Sum") + "  " + format.format(total));
-	}   //  infoStatement
-
-	/**
-	 *  Save Statement - Insert Data
-	 *  @return true if saved
-	 */
-	protected boolean save()
-	{
-		log.config("");
-		TableModel model = dataTable.getModel();
-		int rows = model.getRowCount();
-		if (rows == 0)
-			return false;
-
-		//  fixed values
-		int C_BankStatement_ID = ((Integer)p_mTab.getValue("C_BankStatement_ID")).intValue();
-		MBankStatement bs = new MBankStatement (Env.getCtx(), C_BankStatement_ID, null);
-		log.config(bs.toString());
-
-		//  Lines
-		for (int i = 0; i < rows; i++)
-		{
-			if (((Boolean)model.getValueAt(i, 0)).booleanValue())
-			{
-				Timestamp trxDate = (Timestamp)model.getValueAt(i, 1);  //  1-DateTrx
-				KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 2);   //  2-C_Payment_ID
-				int C_Payment_ID = pp.getKey();
+				+ "WHERE p.C_Payment_ID=l.C_Payment_ID AND l.StmtAmt <> 0)";
+
+		//  Get StatementDate
+		Timestamp ts = (Timestamp)p_mTab.getValue("StatementDate");
+		if (ts == null)
+			ts = new Timestamp(System.currentTimeMillis());
+
+		try
+		{
+			PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
+			pstmt.setTimestamp(1, ts);
+			pstmt.setInt(2, C_BankAccount_ID);
+			ResultSet rs = pstmt.executeQuery();
+			while (rs.next())
+			{
+				Vector line = new Vector(6);
+				line.add(new Boolean(false));       //  0-Selection
+				line.add(rs.getTimestamp(1));       //  1-DateTrx
+				KeyNamePair pp = new KeyNamePair(rs.getInt(2), rs.getString(3));
+				line.add(pp);                       //  2-C_Payment_ID
+				pp = new KeyNamePair(rs.getInt(4), rs.getString(5));
+				line.add(pp);                       //  3-Currency
+				line.add(rs.getBigDecimal(6));      //  4-PayAmt
+				line.add(rs.getBigDecimal(7));      //  5-Conv Amt
+				line.add(rs.getString(8));      	//  6-BParner
+				data.add(line);
+			}
+			rs.close();
+			pstmt.close();
+		}
+		catch (SQLException e)
+		{
+			log.log(Level.SEVERE, sql, e);
+		}
+		//  Header Info
+		Vector columnNames = new Vector(6);
+		columnNames.add(Msg.getMsg(Env.getCtx(), "Select"));
+		columnNames.add(Msg.translate(Env.getCtx(), "Date"));
+		columnNames.add(Msg.getElement(Env.getCtx(), "C_Payment_ID"));
+		columnNames.add(Msg.translate(Env.getCtx(), "C_Currency_ID"));
+		columnNames.add(Msg.translate(Env.getCtx(), "Amount"));
+		columnNames.add(Msg.translate(Env.getCtx(), "ConvertedAmount"));
+		columnNames.add(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
+
+		//  Remove previous listeners
+		dataTable.getModel().removeTableModelListener(this);
+		//  Set Model
+		DefaultTableModel model = new DefaultTableModel(data, columnNames);
+		model.addTableModelListener(this);
+		dataTable.setModel(model);
+		//
+		dataTable.setColumnClass(0, Boolean.class, false);      //  0-Selection
+		dataTable.setColumnClass(1, Timestamp.class, true);     //  1-TrxDate
+		dataTable.setColumnClass(2, String.class, true);        //  2-Payment
+		dataTable.setColumnClass(3, String.class, true);        //  3-Currency
+		dataTable.setColumnClass(4, BigDecimal.class, true);    //  4-Amount
+		dataTable.setColumnClass(5, BigDecimal.class, true);    //  5-ConvAmount
+		dataTable.setColumnClass(6, String.class, true);    	//  6-BPartner
+		//  Table UI
+		dataTable.autoSize();
+	}   //  loadBankAccount
+
+	/**
+	 *  List total amount
+	 */
+	protected void info()
+	{
+		DecimalFormat format = DisplayType.getNumberFormat(DisplayType.Amount);
+
+		TableModel model = dataTable.getModel();
+		BigDecimal total = new BigDecimal(0.0);
+		int rows = model.getRowCount();
+		int count = 0;
+		for (int i = 0; i < rows; i++)
+		{
+			if (((Boolean)model.getValueAt(i, 0)).booleanValue())
+			{
+				total = total.add((BigDecimal)model.getValueAt(i, 4));
+				count++;
+			}
+		}
+		statusBar.setStatusLine(String.valueOf(count) + " - " + Msg.getMsg(Env.getCtx(), "Sum") + "  " + format.format(total));
+	}   //  infoStatement
+
+	/**
+	 *  Save Statement - Insert Data
+	 *  @return true if saved
+	 */
+	protected boolean save()
+	{
+		log.config("");
+		TableModel model = dataTable.getModel();
+		int rows = model.getRowCount();
+		if (rows == 0)
+			return false;
+
+		//  fixed values
+		int C_BankStatement_ID = ((Integer)p_mTab.getValue("C_BankStatement_ID")).intValue();
+		MBankStatement bs = new MBankStatement (Env.getCtx(), C_BankStatement_ID, null);
+		log.config(bs.toString());
+
+		//  Lines
+		for (int i = 0; i < rows; i++)
+		{
+			if (((Boolean)model.getValueAt(i, 0)).booleanValue())
+			{
+				Timestamp trxDate = (Timestamp)model.getValueAt(i, 1);  //  1-DateTrx
+				KeyNamePair pp = (KeyNamePair)model.getValueAt(i, 2);   //  2-C_Payment_ID
+				int C_Payment_ID = pp.getKey();
 				pp = (KeyNamePair)model.getValueAt(i, 3);               //  3-Currency
 				int C_Currency_ID = pp.getKey();
 				BigDecimal TrxAmt = (BigDecimal)model.getValueAt(i, 4); //  4-PayAmt
@@ -243,15 +246,15 @@ public class VCreateFromStatement extends VCreateFrom implements VetoableChangeL
 				//
 				log.fine("Line Date=" + trxDate
 					+ ", Payment=" + C_Payment_ID + ", Currency=" + C_Currency_ID + ", Amt=" + TrxAmt);
-				//	
-				MBankStatementLine bsl = new MBankStatementLine (bs);
-				bsl.setStatementLineDate(trxDate);
-				bsl.setPayment(new MPayment(Env.getCtx(), C_Payment_ID, null));
-				if (!bsl.save())
-					log.log(Level.SEVERE, "Line not created #" + i);
-			}   //   if selected
-		}   //  for all rows
-		return true;
-	}   //  save
-
-}   //  VCreateFromStatement
+				//	
+				MBankStatementLine bsl = new MBankStatementLine (bs);
+				bsl.setStatementLineDate(trxDate);
+				bsl.setPayment(new MPayment(Env.getCtx(), C_Payment_ID, null));
+				if (!bsl.save())
+					log.log(Level.SEVERE, "Line not created #" + i);
+			}   //   if selected
+		}   //  for all rows
+		return true;
+	}   //  save
+
+}   //  VCreateFromStatement
diff --git a/migration/320-trunk/019_RMA_dml.sql b/migration/320-trunk/019_RMA_dml.sql
new file mode 100644
index 0000000000..3663ffb8fd
--- /dev/null
+++ b/migration/320-trunk/019_RMA_dml.sql
@@ -0,0 +1,287 @@
+-- Element change
+
+INSERT INTO AD_ELEMENT
+    (AD_ELEMENT_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY,COLUMNNAME, ENTITYTYPE, NAME, PRINTNAME, DESCRIPTION, HELP, PO_NAME, PO_PRINTNAME, PO_DESCRIPTION, PO_HELP)
+VALUES
+    (52000,0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'InOut_ID', 'D', 'Shipment/Receipt', 'Shipment/Receipt', 'MaterialShipment Document', 'The Material Shipment / Receipt ', 'Receipt', 'Receipt', 'Material Receipt Document', 'The Material Shipment / Receipt ');
+
+
+-- Rule
+
+INSERT INTO AD_VAL_RULE
+    (AD_VAL_RULE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, TYPE, CODE, ENTITYTYPE)
+VALUES
+    (52000, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'M_InOutShipment/Receipt', NULL, 'S', 'M_InOut.MovementType IN (''C-'', ''V+'') AND M_InOut.DocStatus IN (''CO'', ''CL'')', 'D');
+
+INSERT INTO AD_VAL_RULE
+    (AD_VAL_RULE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, TYPE, CODE, ENTITYTYPE)
+VALUES
+    (52001, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'M_InOutShipment/Receipt (RMA)', NULL, 'S', 'M_InOutLine.M_InOut_ID=@InOut_ID@', 'D');
+
+
+-- Processes
+
+INSERT INTO AD_PROCESS
+     (AD_PROCESS_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, DESCRIPTION, HELP, ACCESSLEVEL, ENTITYTYPE, PROCEDURENAME, ISREPORT, ISDIRECTPRINT, AD_REPORTVIEW_ID, CLASSNAME, STATISTIC_COUNT,STATISTIC_SECONDS, AD_PRINTFORMAT_ID, WORKFLOWVALUE, AD_WORKFLOW_ID, ISBETAFUNCTIONALITY, ISSERVERPROCESS, SHOWHELP, JASPERREPORT)
+VALUES
+    (52000, 0,0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'M_RMA_CreateOrder', 'Create Order From RMA', 'Creates an order based on this RMA Document. The RMA should be correct and completed.', 'Generate Order from RMA will create an order based on this RMA document.', '3', 'D', NULL, 'N', 'N', NULL, 'org.adempiere.process.RMACreateOrder', 0, 0, NULL, NULL, NULL, 'N', 'N', 'Y', NULL);
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52000, 0, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52000, 102, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52000, 103, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS
+     (AD_PROCESS_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, DESCRIPTION, HELP, ACCESSLEVEL, ENTITYTYPE, PROCEDURENAME, ISREPORT, ISDIRECTPRINT, AD_REPORTVIEW_ID, CLASSNAME, STATISTIC_COUNT,STATISTIC_SECONDS, AD_PRINTFORMAT_ID, WORKFLOWVALUE, AD_WORKFLOW_ID, ISBETAFUNCTIONALITY, ISSERVERPROCESS, SHOWHELP, JASPERREPORT)
+VALUES
+    (52001, 0,0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'M_InOut_GenerateRMA (Manual)', 'Generate Shipments for Vendor RMA', 'Generate Shipments from open vendor RMA based on selection.', NULL, '3', 'D', NULL, 'N', 'N', NULL, 'org.adempiere.process.InOutGenerateRMA', 0, 0, NULL, NULL, NULL, 'N', 'N', 'Y', NULL);
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52001, 0, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52001, 102, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52001, 103, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+
+INSERT INTO AD_PROCESS
+     (AD_PROCESS_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, VALUE, NAME, DESCRIPTION, HELP, ACCESSLEVEL, ENTITYTYPE, PROCEDURENAME, ISREPORT, ISDIRECTPRINT, AD_REPORTVIEW_ID, CLASSNAME, STATISTIC_COUNT,STATISTIC_SECONDS, AD_PRINTFORMAT_ID, WORKFLOWVALUE, AD_WORKFLOW_ID, ISBETAFUNCTIONALITY, ISSERVERPROCESS, SHOWHELP, JASPERREPORT)
+VALUES
+    (52002, 0,0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'C_Invoice_GenerateRMA (Manual)', 'Generate Invoices for Vendor RMA', 'Generate Invoices from open vendor RMA based on selection.', NULL, '3', 'D', NULL, 'N', 'N', NULL, 'org.adempiere.process.InvoiceGenerateRMA', 0, 0, NULL, NULL, NULL, 'N', 'N', 'Y', NULL);
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52002, 0, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52002, 102, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+INSERT INTO AD_PROCESS_ACCESS
+    (AD_PROCESS_ID, AD_ROLE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, ISREADWRITE)
+VALUES
+    (52002, 103, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Y');
+
+
+-- Column Addition
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52000, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Sales Transaction', 'This is a Sales Transaction', 'The Sales Transaction checkbox indicates if this item is a Sales Transaction.', 1, 'D', 'IsSOTrx', 661, 20, NULL, NULL, 1, '@IsSOTrx@', 'N', 'N', 'Y', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 1106, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52001, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Amount', 'Amount', 'Amount', 1, 'D', 'Amt', 660, 12, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', '@M_InOutLine_ID@!0', 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 160, NULL, 'N', 'N', NULL);
+
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52002, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Charge', 'Additional document charges', 'The Charge indicates a type of Charge (Handling, Shipping, Restocking)', 1, 'D', 'C_Charge_ID', 660, 19, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 968, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52003, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Line Amount', 'Line Extended Amount (Quantity * Actual Price) without Freight and Charges','Indicates the extended line amount based on the quantity and the actual price. Any additional charges or freight are not included.  The Amount may or may not include tax.  If the price list is inclusive tax, the line amount is the same as the line total.', 1, 'D', 'LineNetAmt', 660, 12, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 441, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52004, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Line No', 'Unique line for this document', 'Indicates the unique line for a document.  It will also control the display order of the lines within a document.', 1, 'D', 'Line', 660, 11, NULL, NULL, 22, '@SQL=SELECT NVL(MAX(Line),0)+10 AS DefaultValue FROM M_RMALine WHERE M_RMA_ID=@M_RMA_ID@', 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 439, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52005, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Delivered Quantity', 'Delivered Quantity', 'The Delivered Quantity indicates the quantity of a product that has been delivered.', 1, 'D', 'QtyDelivered', 660, 29, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 528, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52006, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'Generate To', 'Generate To', NULL, 0, 'D', 'GenerateTo', 661, 28, NULL, NULL, 1, NULL, 'N','N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 1491, 52000, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52007, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'RMA', 'Return Material Authorization', 'A Return Material Authorization may be required to accept returns and to create Credit Memos', 1, 'D', 'M_RMA_ID', 318, 19, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 2412, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52008, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'RMA Line', 'Return Material Authorization Line', 'Detail information about the returned goods', 1, 'D', 'M_RMALine_ID', 333, 19, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 2413, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52009, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'RMA', 'Return Material Authorization', 'A Return Material Authorization may be required to accept returns and to create Credit Memos', 1, 'D', 'M_RMA_ID', 319, 19, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 2412, NULL, 'N', 'N', NULL);
+
+INSERT INTO AD_COLUMN
+    (AD_COLUMN_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, UPDATED, CREATEDBY, UPDATEDBY, NAME, DESCRIPTION, HELP, VERSION, ENTITYTYPE, COLUMNNAME, AD_TABLE_ID, AD_REFERENCE_ID, AD_REFERENCE_VALUE_ID, AD_VAL_RULE_ID, FIELDLENGTH, DEFAULTVALUE, ISKEY, ISPARENT, ISMANDATORY, ISUPDATEABLE, READONLYLOGIC, ISIDENTIFIER, SEQNO, ISTRANSLATED, ISENCRYPTED, CALLOUT, VFORMAT, VALUEMIN, VALUEMAX, ISSELECTIONCOLUMN, AD_ELEMENT_ID, AD_PROCESS_ID, ISSYNCDATABASE, ISALWAYSUPDATEABLE, COLUMNSQL)
+VALUES
+    (52010, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 100, 'RMA Line', 'Return Material Authorization Line', 'Detail information about the returned goods', 0, 'D', 'M_RMALine_ID', 320, 19, NULL, NULL, 22, NULL, 'N', 'N', 'N', 'Y', NULL, 'N', 0, 'N', 'N', NULL, NULL, NULL, NULL, 'N', 2413, NULL, 'N', 'N', NULL);
+
+
+-- Field addition
+
+INSERT INTO AD_FIELD
+    (AD_FIELD_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, HELP, ISCENTRALLYMAINTAINED, AD_TAB_ID, AD_COLUMN_ID, AD_FIELDGROUP_ID, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, ISREADONLY, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISENCRYPTED, ENTITYTYPE, OBSCURETYPE, AD_REFERENCE_ID, ISMANDATORY)
+VALUES
+    (52000, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Create Order From RMA', 'Creates an order based on the RMA document', NULL, 'Y', 628, 52006, NULL, 'Y', '@Processed@=''Y'' & @C_Order_ID@=0 & @DocStatus@=''CO''', 1, 'N', 160, NULL, 'Y', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+INSERT INTO AD_FIELD
+    (AD_FIELD_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, HELP, ISCENTRALLYMAINTAINED, AD_TAB_ID, AD_COLUMN_ID, AD_FIELDGROUP_ID, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, ISREADONLY, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISENCRYPTED, ENTITYTYPE, OBSCURETYPE, AD_REFERENCE_ID, ISMANDATORY)
+VALUES
+    (52001, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Amount', 'Amount', 'Amount', 'Y', 629, 52001, NULL, 'Y', NULL, 22, 'N', 100, NULL, 'Y', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+INSERT INTO AD_FIELD
+    (AD_FIELD_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, HELP, ISCENTRALLYMAINTAINED, AD_TAB_ID, AD_COLUMN_ID, AD_FIELDGROUP_ID, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, ISREADONLY, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISENCRYPTED, ENTITYTYPE, OBSCURETYPE, AD_REFERENCE_ID, ISMANDATORY)
+VALUES
+    (52002, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Charge', 'Additional document charges', 'The Charge indicates a type of Charge (Handling, Shipping, Restocking)', 'Y', 629, 52002, NULL, 'Y', NULL, 22, 'N', 80, NULL, 'Y', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+INSERT INTO AD_FIELD
+    (AD_FIELD_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, HELP, ISCENTRALLYMAINTAINED, AD_TAB_ID, AD_COLUMN_ID, AD_FIELDGROUP_ID, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, ISREADONLY, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISENCRYPTED, ENTITYTYPE, OBSCURETYPE, AD_REFERENCE_ID, ISMANDATORY)
+VALUES
+    (52003, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Delivered Quantity', 'Delivered Quantity', 'The Delivered Quantity indicates the quantity of a product that has been delivered.', 'Y', 629, 52005, NULL, 'N', NULL, 22, 'N', 0, NULL, 'N', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+INSERT INTO AD_FIELD
+    (AD_FIELD_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, HELP, ISCENTRALLYMAINTAINED, AD_TAB_ID, AD_COLUMN_ID, AD_FIELDGROUP_ID, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, ISREADONLY, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISENCRYPTED, ENTITYTYPE, OBSCURETYPE, AD_REFERENCE_ID, ISMANDATORY)
+VALUES
+    (52004, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Line Amount', 'Line Extended Amount (Quantity * Actual Price) without Freight and Charges', 'Indicates the extended line amount based on the quantity and the actual price.  Any additional charges or freight are not included.  The Amount may or may not include tax.  If the price list is inclusive tax, the line amount is the same as the line total.', 'Y', 629, 52003, NULL, 'Y', NULL, 22, 'Y', 110, NULL, 'N', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+INSERT INTO AD_FIELD
+    (AD_FIELD_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE, CREATED, CREATEDBY, UPDATED, UPDATEDBY, NAME, DESCRIPTION, HELP, ISCENTRALLYMAINTAINED, AD_TAB_ID, AD_COLUMN_ID, AD_FIELDGROUP_ID, ISDISPLAYED, DISPLAYLOGIC, DISPLAYLENGTH, ISREADONLY, SEQNO, SORTNO, ISSAMELINE, ISHEADING, ISFIELDONLY, ISENCRYPTED, ENTITYTYPE, OBSCURETYPE, AD_REFERENCE_ID, ISMANDATORY)
+VALUES
+    (52005, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Line No', 'Unique line for this document', 'Indicates the unique line for a document.  It will also control the display order of the lines within a document.', 'Y', 629, 52004, NULL, 'Y', NULL, 22, 'N', 40, NULL, 'Y', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+INSERT INTO AD_FIELD(ad_field_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, NAME, description, help, iscentrallymaintained, ad_tab_id, ad_column_id, ad_fieldgroup_id, isdisplayed, displaylogic, displaylength, isreadonly, seqno, sortno, issameline, isheading, isfieldonly, isencrypted, entitytype, obscuretype, ad_reference_id, ismandatory)
+  VALUES(52007, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Sales Transaction', 'This is a Sales Transaction', 'The Sales Transaction checkbox indicates if this item is a Sales Transaction.', 'Y', 628, 52000, NULL, 'N', NULL, 1, 'N', NULL, NULL, 'N', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+-- Update Field
+
+UPDATE AD_FIELD SET SeqNo=(SeqNo + 10) WHERE AD_Tab_ID=296 AND SeqNo > 40;
+
+INSERT INTO AD_FIELD
+(ad_field_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, NAME, description, help, iscentrallymaintained, ad_tab_id, ad_column_id, ad_fieldgroup_id, isdisplayed, displaylogic, displaylength, isreadonly, seqno, sortno, issameline, isheading, isfieldonly, isencrypted, entitytype, obscuretype, ad_reference_id, ismandatory)
+  VALUES(52006, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'RMA', 'Return Material Authorization', 'A Return Material Authorization may be required to accept returns and to create Credit Memos', 'Y', 296, 52009, NULL, 'Y', '@M_RMA_ID@!0', 26, 'Y', 50, 0, 'N', 'N', 'N', 'N', 'D', NULL, NULL, NULL);
+
+
+-- Garden World RMA Fix
+
+INSERT INTO AD_SEQUENCE(ad_sequence_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, NAME, description, vformat, isautosequence, incrementno, startno, currentnext, currentnextsys, isaudited, istableid, prefix, suffix, startnewyear)
+  VALUES(52000, 11, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, 'Vendor Return Material', NULL, NULL, 'Y', 1, 990000, 990000, 900, 'N', 'N', NULL, NULL, 'N');
+
+INSERT INTO AD_SEQUENCE(ad_sequence_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, NAME, description, vformat, isautosequence, incrementno, startno, currentnext, currentnextsys, isaudited, istableid, prefix, suffix, startnewyear)
+  VALUES(52001, 11, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 0, 'MM Vendor Return', 'MM Vendor Return', NULL, 'Y', 1, 590000, 590000, 59000, 'N', 'N', NULL, NULL, 'N');
+
+INSERT INTO C_DOCTYPE(c_doctype_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, NAME, printname, description, docbasetype, issotrx, docsubtypeso, hasproforma, c_doctypeproforma_id, c_doctypeshipment_id, c_doctypeinvoice_id, isdocnocontrolled, docnosequence_id, gl_category_id, hascharges, documentnote, isdefault, documentcopies, ad_printformat_id, isdefaultcounterdoc, isshipconfirm, ispickqaconfirm, isintransit, issplitwhendifference, c_doctypedifference_id, iscreatecounter, isindexed)
+  VALUES(151, 11, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'MM Vendor Return', 'Vendor Return Material', NULL, 'MMS', 'Y', NULL, 'N', NULL, NULL, NULL, 'Y', 52001, 111, 'N', NULL, 'Y', 1, NULL, 'N', 'N', 'N', 'N', 'N', NULL, 'Y', 'Y');
+
+INSERT INTO C_DOCTYPE(c_doctype_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, NAME, printname, description, docbasetype, issotrx, docsubtypeso, hasproforma, c_doctypeproforma_id, c_doctypeshipment_id, c_doctypeinvoice_id, isdocnocontrolled, docnosequence_id, gl_category_id, hascharges, documentnote, isdefault, documentcopies, ad_printformat_id, isdefaultcounterdoc, isshipconfirm, ispickqaconfirm, isintransit, issplitwhendifference, c_doctypedifference_id, iscreatecounter, isindexed)
+  VALUES(150, 11, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'Vendor Return Material', 'Vendor Return Material Authorization', NULL, 'POO', 'N', 'RM', 'N', NULL, 151, 124, 'Y', 52000, 111, 'N', NULL, 'N', 1, NULL, 'N', 'N', 'N', 'N', 'N', NULL, 'Y', 'Y');
+
+-- Message Addition
+
+INSERT INTO AD_MESSAGE
+(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype)
+  VALUES(52000, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'OrderOrRMA', 'Either Order or RMA can be process on this document.', NULL, 'E', 'D');
+
+INSERT INTO AD_MESSAGE
+(ad_message_id, ad_client_id, ad_org_id, isactive, created, createdby, updated, updatedby, VALUE, msgtext, msgtip, msgtype, entitytype)
+  VALUES(52001, 0, 0, 'Y', TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, TO_DATE('07/05/2007 17:00:00', 'MM/DD/YYYY HH24:MI:SS'), 100, 'VendorRMA', 'Vendor RMA', NULL, 'I', 'D');
+
+-- Misc AD Updates
+
+UPDATE AD_COLUMN SET ColumnName='InOut_ID' WHERE AD_Column_ID=10842;
+
+UPDATE AD_COLUMN SET AD_Element_ID=52000 WHERE AD_Column_ID=10842;
+
+UPDATE AD_COLUMN SET AD_Reference_Value_ID=337 WHERE AD_Column_ID=10842;
+
+UPDATE AD_COLUMN SET AD_Val_Rule_ID=52000 WHERE AD_Column_ID=10842;
+
+UPDATE AD_TAB SET WhereClause='MovementType IN (''C+'', ''V+'')' WHERE AD_Tab_ID=296;
+
+UPDATE AD_TAB SET WhereClause='MovementType IN (''C-'', ''V-'')' WHERE AD_Tab_ID=257;
+
+UPDATE AD_COLUMN SET IsMandatory='N' WHERE AD_Column_ID=10829;
+
+UPDATE AD_COLUMN SET AD_Val_Rule_ID=52001 WHERE AD_Column_ID=10829;
+
+UPDATE AD_FIELD SET SeqNo=60, IsSameLine='N' WHERE AD_Field_ID=9310;
+
+UPDATE AD_FIELD SET SeqNo=20, IsSameLine='Y' WHERE AD_Field_ID=9311;
+
+UPDATE AD_FIELD SET SeqNo=70, IsSameLine='N' WHERE AD_Field_ID=9312;
+
+UPDATE AD_FIELD SET SeqNo=0, IsSameLine='N' WHERE AD_Field_ID=9313;
+
+UPDATE AD_FIELD SET SeqNo=30, IsSameLine='N' WHERE AD_Field_ID=9314;
+
+UPDATE AD_FIELD SET SeqNo=50, IsSameLine='N' WHERE AD_Field_ID=9315;
+
+UPDATE AD_FIELD SET SeqNo=90, IsSameLine='N' WHERE AD_Field_ID=9316;
+
+UPDATE AD_FIELD SET SeqNo=10, IsSameLine='N' WHERE AD_Field_ID=9317;
+
+UPDATE AD_FIELD SET SeqNo=0, IsSameLine='N' WHERE AD_Field_ID=10401;
+
+UPDATE AD_FIELD SET SeqNo=100, IsSameLine='Y' WHERE AD_Field_ID=52001;
+
+UPDATE AD_FIELD SET SeqNo=80, IsSameLine='Y' WHERE AD_Field_ID=52002;
+
+UPDATE AD_FIELD SET SeqNo=0, IsSameLine='N' WHERE AD_Field_ID=52003;
+
+UPDATE AD_FIELD SET SeqNo=110, IsSameLine='N' WHERE AD_Field_ID=52004;
+
+UPDATE AD_FIELD SET SeqNo=40, IsSameLine='Y' WHERE AD_Field_ID=52005;
+
+UPDATE AD_TAB SET IsSingleRow='Y' WHERE AD_Tab_ID=628;
+
+UPDATE AD_TAB SET IsSingleRow='Y' WHERE AD_Tab_ID=629;
+
+UPDATE C_DOCTYPE SET IsActive='Y' WHERE C_DocType_ID=149;
+
+
+UPDATE AD_COLUMN SET Callout='org.adempiere.model.CalloutRMA.docType' WHERE AD_Column_ID=12118;
+
+UPDATE AD_COLUMN SET ReadOnlyLogic='@IsSOTrx@=''N''' WHERE AD_Column_ID=52006;
+
+UPDATE AD_FIELD SET DisplayLogic='@Processed@=''Y'' & @C_Order_ID@=0 & @DocStatus@=''CO'' & @IsSOTrx@=''Y''' 
+WHERE AD_Field_ID=52000;
+
+UPDATE AD_REF_TABLE SET WhereClause='C_DocType.DocBaseType IN (''SOO'', ''POO'') AND C_DocType.DocSubTypeSO=''RM'' AND C_DocType.AD_Client_ID=@#AD_Client_ID@' 
+WHERE AD_Reference_ID=321;
+
+UPDATE AD_VAL_RULE SET Code='M_InOutLine.M_InOut_ID=@InOut_ID@ AND NOT EXISTS (SELECT * FROM M_RMALine rl WHERE rl.M_InOutLine_ID=M_InOutLine.M_InOutLine_ID AND rl.M_RMA_ID=@M_RMA_ID@)' 
+WHERE AD_Val_Rule_ID=52001;
+
+UPDATE C_DOCTYPE SET NAME='MM Returns', IsSOTrx='N' WHERE C_DocType_ID=149;
+
+COMMIT;
+
+
+-- NOTE: Don't forget to run the three processes:
+-- 1 - Add missing translations
+-- 2 - Synchronize terminology
+-- 3 - Check sequences
diff --git a/migration/320-trunk/020_RMA_Oracle_ddl.sql b/migration/320-trunk/020_RMA_Oracle_ddl.sql
new file mode 100644
index 0000000000..3c2370c991
--- /dev/null
+++ b/migration/320-trunk/020_RMA_Oracle_ddl.sql
@@ -0,0 +1,38 @@
+-- Oracle Changes
+
+ALTER TABLE C_Invoice ADD M_RMA_ID NUMBER(10, 0) DEFAULT NULL;
+
+ALTER TABLE C_InvoiceLine ADD M_RMALine_ID NUMBER(10,0) DEFAULT NULL;
+
+ALTER TABLE M_InOut ADD M_RMA_ID NUMBER(10,0) DEFAULT NULL;
+
+ALTER TABLE M_InOutLine ADD M_RMALine_ID NUMBER(10,0) DEFAULT NULL;
+
+ALTER TABLE M_RMA ADD IsSOTrx CHAR(1) DEFAULT 'Y' CHECK (IsSOTrx IN ('Y', 'N')) NOT NULL;
+
+ALTER TABLE M_RMA RENAME COLUMN M_InOut_ID TO InOut_ID;
+
+ALTER TABLE M_RMA ADD GenerateTo CHAR(1) DEFAULT NULL;
+
+ALTER TABLE M_RMALine ADD Amt NUMBER(22,2);
+
+ALTER TABLE M_RMALine ADD C_Charge_ID NUMBER(10,0);
+
+ALTER TABLE M_RMALine ADD Line NUMBER(10,0) DEFAULT 0 NOT NULL;
+
+ALTER TABLE M_RMALine ADD LineNetAmt NUMBER(22,2);
+
+ALTER TABLE M_RMALine ADD QtyDelivered NUMBER(22,2);
+
+ALTER TABLE M_RMALine MODIFY M_InOutLine_ID NUMBER(10,0) NULL;
+
+
+-- Constraints
+
+ALTER TABLE C_Invoice ADD CONSTRAINT mrma_cinvoice FOREIGN KEY (M_RMA_ID) REFERENCES M_RMA (M_RMA_ID);
+
+ALTER TABLE C_InvoiceLine ADD CONSTRAINT mrmaline_cinvoiceline FOREIGN KEY (M_RMALine_ID) REFERENCES M_RMALine (M_RMALine_ID);
+
+ALTER TABLE M_InOut ADD CONSTRAINT mrma_minout FOREIGN KEY (M_RMA_ID) REFERENCES M_RMA (M_RMA_ID);
+
+ALTER TABLE M_InOutLine ADD CONSTRAINT mrmaline_minoutline FOREIGN KEY (M_RMALine_ID) REFERENCES M_RMALine (M_RMALine_ID);
diff --git a/migration/320-trunk/postgresql/020_RMA_Postgresql_ddl.sql b/migration/320-trunk/postgresql/020_RMA_Postgresql_ddl.sql
new file mode 100644
index 0000000000..98ecdece27
--- /dev/null
+++ b/migration/320-trunk/postgresql/020_RMA_Postgresql_ddl.sql
@@ -0,0 +1,40 @@
+-- POSTGRESQL Changes
+
+ALTER TABLE C_Invoice ADD M_RMA_ID NUMERIC(10) DEFAULT NULL;
+
+ALTER TABLE C_InvoiceLine ADD M_RMALine_ID NUMERIC(10,0) DEFAULT NULL;
+
+ALTER TABLE M_InOut ADD M_RMA_ID NUMERIC(10,0) DEFAULT NULL;
+
+ALTER TABLE M_InOutLine ADD M_RMALine_ID NUMERIC(10,0) DEFAULT NULL;
+
+ALTER TABLE M_RMA ADD IsSOTrx CHAR(1) DEFAULT 'Y' CHECK (IsSOTrx IN ('Y', 'N')) NOT NULL;
+
+ALTER TABLE M_RMA RENAME M_InOut_ID TO InOut_ID;
+
+ALTER TABLE M_RMA ADD GenerateTo CHAR(1) DEFAULT NULL;
+
+ALTER TABLE M_RMALine ADD Amt NUMERIC;
+
+ALTER TABLE M_RMALine ADD C_Charge_ID NUMERIC(10,0);
+
+ALTER TABLE M_RMALine ADD Line NUMERIC(10,0) DEFAULT 0 NOT NULL;
+
+ALTER TABLE M_RMALine ADD LineNetAmt NUMERIC;
+
+ALTER TABLE M_RMALine ADD QtyDelivered NUMERIC;
+
+ALTER TABLE M_RMALine ALTER COLUMN M_InOutLine_ID DROP DEFAULT;
+
+ALTER TABLE M_RMALine ALTER COLUMN M_InOutLine_ID DROP NOT NULL;
+
+
+-- Constraints
+
+ALTER TABLE C_Invoice ADD CONSTRAINT mrma_cinvoice FOREIGN KEY (M_RMA_ID) REFERENCES M_RMA (M_RMA_ID);
+
+ALTER TABLE C_InvoiceLine ADD CONSTRAINT mrmaline_cinvoiceline FOREIGN KEY (M_RMALine_ID) REFERENCES M_RMALine (M_RMALine_ID);
+
+ALTER TABLE M_InOut ADD CONSTRAINT mrma_minout FOREIGN KEY (M_RMA_ID) REFERENCES M_RMA (M_RMA_ID);
+
+ALTER TABLE M_InOutLine ADD CONSTRAINT mrmaline_minoutline FOREIGN KEY (M_RMALine_ID) REFERENCES M_RMALine (M_RMALine_ID);