Upload TPB Modification

--HG--
branch : EDII
This commit is contained in:
hodianto 2019-01-25 07:40:12 +07:00
parent af724af2fd
commit 241dc41d33
13 changed files with 2391 additions and 100 deletions

View File

@ -34,6 +34,9 @@ import andromedia.midsuit.model.MID_UnrealizedRateLine;
import andromedia.midsuit.model.X_C_OrderLineMA;
import andromedia.midsuit.model.X_MID_UploadPEB;
import andromedia.midsuit.model.X_MID_UploadPEBLine;
import andromedia.midsuit.model.X_MID_UploadTPB;
import andromedia.midsuit.model.X_MID_UploadTPBLine;
import andromedia.midsuit.model.X_MID_UploadTPBLineDet;
import andromedia.midsuit.model.X_M_RMAMA;
import andromedia.midsuit.model.X_zpos_Cashier;
@ -68,6 +71,9 @@ public class MID_ModelFactory implements IModelFactory{
mapTableModels.put(MMovement.Table_Name, "andromedia.midsuit.model.MID_MMovement");
mapTableModels.put(X_MID_UploadPEBLine.Table_Name, "andromedia.midsuit.model.X_MID_UploadPEBLine");
mapTableModels.put(X_MID_UploadPEB.Table_Name, "andromedia.midsuit.model.X_MID_UploadPEB");
mapTableModels.put(X_MID_UploadTPB.Table_Name, "andromedia.midsuit.model.X_MID_UploadTPB");
mapTableModels.put(X_MID_UploadTPBLine.Table_Name, "andromedia.midsuit.model.X_MID_UploadTPBLine");
mapTableModels.put(X_MID_UploadTPBLineDet.Table_Name, "andromedia.midsuit.model.X_MID_UploadTPBLineDet");
}
@Override

View File

@ -181,7 +181,11 @@ public abstract class MID_CreateFromRMA extends CreateFrom {
rmaLine.setQty(d);
rmaLine.setAD_Org_ID(rma.getAD_Org_ID());
rmaLine.setDescription((String)miniTable.getValueAt(i, 6));
List<X_M_InOutLineMA> attLines = new Query(Env.getCtx(), X_M_InOutLineMA.Table_Name, "M_InOutLine_ID =?", trxName)
if (!rmaLine.save())
{
throw new IllegalStateException("Could not create RMA Line");
}
List<MInOutLineMA> attLines = new Query(Env.getCtx(), X_M_InOutLineMA.Table_Name, "M_InOutLine_ID =?", trxName)
.setParameters(new Object[] { inOutLineId })
.setOnlyActiveRecords(true)
.list();
@ -189,10 +193,11 @@ public abstract class MID_CreateFromRMA extends CreateFrom {
if(attLines.size()<=0)
rmaLine.set_ValueNoCheck("M_AttributeSetInstance_ID", iol.getM_AttributeSetInstance_ID());
else {
for(X_M_InOutLineMA attLine : attLines) {
for(MInOutLineMA attLine : attLines) {
X_M_RMAMA inoutAtt = new X_M_RMAMA(rma.getCtx(), 0, rma.get_TrxName());
inoutAtt.setAD_Org_ID(attLine.getAD_Org_ID());
inoutAtt.setM_InOutLine_ID(iol.getM_InOutLine_ID());
inoutAtt.setM_RMALine_ID(rmaLine.get_ID());
inoutAtt.setIsAutoGenerated(false);
inoutAtt.setM_AttributeSetInstance_ID(attLine.getM_AttributeSetInstance_ID());
inoutAtt.setMovementQty(attLine.getMovementQty());
@ -201,10 +206,7 @@ public abstract class MID_CreateFromRMA extends CreateFrom {
}
}
if (!rmaLine.save())
{
throw new IllegalStateException("Could not create RMA Line");
}
}
}
rma.saveEx();

View File

@ -803,7 +803,7 @@ public abstract class MID_CreateFromShipment extends CreateFrom
.setOnlyActiveRecords(true)
.list();
if(attLines.size()<=0)
iol.setM_AttributeSetInstance_ID(rmal.getM_AttributeSetInstance_ID());
iol.setM_AttributeSetInstance_ID(rmal.get_ValueAsInt("M_AttributeSetInstance_ID"));
else {
iol.setM_Locator_ID(M_Locator_ID);
iol.saveEx();
@ -813,7 +813,7 @@ public abstract class MID_CreateFromShipment extends CreateFrom
inoutAtt.setIsAutoGenerated(false);
inoutAtt.setM_AttributeSetInstance_ID(attLine.getM_AttributeSetInstance_ID());
inoutAtt.setDateMaterialPolicy(!inout.isSOTrx() ? iol.getM_InOut().getMovementDate() : attLine.getDateMaterialPolicy());
inoutAtt.setDateMaterialPolicy(attLine.getDateMaterialPolicy());
inoutAtt.saveEx();
}
}

View File

@ -0,0 +1,186 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 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 andromedia.midsuit.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.model.*;
import org.compiere.util.KeyNamePair;
/** Generated Interface for MID_UploadTPB
* @author iDempiere (generated)
* @version Release 5.1
*/
@SuppressWarnings("all")
public interface I_MID_UploadTPB
{
/** TableName=MID_UploadTPB */
public static final String Table_Name = "MID_UploadTPB";
/** AD_Table_ID=30114 */
public static final int Table_ID = 30114;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 3 - Client - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(3);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name FileName */
public static final String COLUMNNAME_FileName = "FileName";
/** Set File Name.
* Name of the local file or URL
*/
public void setFileName (String FileName);
/** Get File Name.
* Name of the local file or URL
*/
public String getFileName();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name MID_UploadTPB_ID */
public static final String COLUMNNAME_MID_UploadTPB_ID = "MID_UploadTPB_ID";
/** Set Upload TPB */
public void setMID_UploadTPB_ID (int MID_UploadTPB_ID);
/** Get Upload TPB */
public int getMID_UploadTPB_ID();
/** Column name MID_UploadTPB_UU */
public static final String COLUMNNAME_MID_UploadTPB_UU = "MID_UploadTPB_UU";
/** Set MID_UploadTPB_UU */
public void setMID_UploadTPB_UU (String MID_UploadTPB_UU);
/** Get MID_UploadTPB_UU */
public String getMID_UploadTPB_UU();
/** Column name Processed */
public static final String COLUMNNAME_Processed = "Processed";
/** Set Processed.
* The document has been processed
*/
public void setProcessed (boolean Processed);
/** Get Processed.
* The document has been processed
*/
public boolean isProcessed();
/** Column name Processing */
public static final String COLUMNNAME_Processing = "Processing";
/** Set Process Now */
public void setProcessing (boolean Processing);
/** Get Process Now */
public boolean isProcessing();
/** Column name Processing2 */
public static final String COLUMNNAME_Processing2 = "Processing2";
/** Set Process Now */
public void setProcessing2 (String Processing2);
/** Get Process Now */
public String getProcessing2();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,386 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 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 andromedia.midsuit.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.model.*;
import org.compiere.util.KeyNamePair;
/** Generated Interface for MID_UploadTPBLine
* @author iDempiere (generated)
* @version Release 5.1
*/
@SuppressWarnings("all")
public interface I_MID_UploadTPBLine
{
/** TableName=MID_UploadTPBLine */
public static final String Table_Name = "MID_UploadTPBLine";
/** AD_Table_ID=30115 */
public static final int Table_ID = 30115;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 3 - Client - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(3);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name C_BPartner_ID */
public static final String COLUMNNAME_C_BPartner_ID = "C_BPartner_ID";
/** Set Business Partner .
* Identifies a Business Partner
*/
public void setC_BPartner_ID (int C_BPartner_ID);
/** Get Business Partner .
* Identifies a Business Partner
*/
public int getC_BPartner_ID();
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException;
/** Column name C_BPartner_Location_ID */
public static final String COLUMNNAME_C_BPartner_Location_ID = "C_BPartner_Location_ID";
/** Set Partner Location.
* Identifies the (ship to) address for this Business Partner
*/
public void setC_BPartner_Location_ID (int C_BPartner_Location_ID);
/** Get Partner Location.
* Identifies the (ship to) address for this Business Partner
*/
public int getC_BPartner_Location_ID();
public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException;
/** Column name C_Currency_ID */
public static final String COLUMNNAME_C_Currency_ID = "C_Currency_ID";
/** Set Currency.
* The Currency for this record
*/
public void setC_Currency_ID (int C_Currency_ID);
/** Get Currency.
* The Currency for this record
*/
public int getC_Currency_ID();
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException;
/** Column name C_DocTypeTarget_ID */
public static final String COLUMNNAME_C_DocTypeTarget_ID = "C_DocTypeTarget_ID";
/** Set Target Document Type.
* Target document type for conversing documents
*/
public void setC_DocTypeTarget_ID (int C_DocTypeTarget_ID);
/** Get Target Document Type.
* Target document type for conversing documents
*/
public int getC_DocTypeTarget_ID();
public org.compiere.model.I_C_DocType getC_DocTypeTarget() throws RuntimeException;
/** Column name C_Order_ID */
public static final String COLUMNNAME_C_Order_ID = "C_Order_ID";
/** Set Order.
* Order
*/
public void setC_Order_ID (int C_Order_ID);
/** Get Order.
* Order
*/
public int getC_Order_ID();
public org.compiere.model.I_C_Order getC_Order() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsReturn */
public static final String COLUMNNAME_IsReturn = "IsReturn";
/** Set Retur Vendor/Cust */
public void setIsReturn (boolean IsReturn);
/** Get Retur Vendor/Cust */
public boolean isReturn();
/** Column name MID_AJUDocumentType_ID */
public static final String COLUMNNAME_MID_AJUDocumentType_ID = "MID_AJUDocumentType_ID";
/** Set Document Type AJU */
public void setMID_AJUDocumentType_ID (int MID_AJUDocumentType_ID);
/** Get Document Type AJU */
public int getMID_AJUDocumentType_ID();
/** Column name MID_UploadTPB_ID */
public static final String COLUMNNAME_MID_UploadTPB_ID = "MID_UploadTPB_ID";
/** Set Upload TPB */
public void setMID_UploadTPB_ID (int MID_UploadTPB_ID);
/** Get Upload TPB */
public int getMID_UploadTPB_ID();
public I_MID_UploadTPB getMID_UploadTPB() throws RuntimeException;
/** Column name MID_UploadTPBLine_ID */
public static final String COLUMNNAME_MID_UploadTPBLine_ID = "MID_UploadTPBLine_ID";
/** Set Upload TPB Line */
public void setMID_UploadTPBLine_ID (int MID_UploadTPBLine_ID);
/** Get Upload TPB Line */
public int getMID_UploadTPBLine_ID();
/** Column name MID_UploadTPBLine_UU */
public static final String COLUMNNAME_MID_UploadTPBLine_UU = "MID_UploadTPBLine_UU";
/** Set MID_UploadTPBLine_UU */
public void setMID_UploadTPBLine_UU (String MID_UploadTPBLine_UU);
/** Get MID_UploadTPBLine_UU */
public String getMID_UploadTPBLine_UU();
/** Column name M_InOut_ID */
public static final String COLUMNNAME_M_InOut_ID = "M_InOut_ID";
/** Set Shipment/Receipt.
* Material Shipment Document
*/
public void setM_InOut_ID (int M_InOut_ID);
/** Get Shipment/Receipt.
* Material Shipment Document
*/
public int getM_InOut_ID();
public org.compiere.model.I_M_InOut getM_InOut() throws RuntimeException;
/** Column name M_PriceList_ID */
public static final String COLUMNNAME_M_PriceList_ID = "M_PriceList_ID";
/** Set Price List.
* Unique identifier of a Price List
*/
public void setM_PriceList_ID (int M_PriceList_ID);
/** Get Price List.
* Unique identifier of a Price List
*/
public int getM_PriceList_ID();
public org.compiere.model.I_M_PriceList getM_PriceList() throws RuntimeException;
/** Column name M_Requisition_ID */
public static final String COLUMNNAME_M_Requisition_ID = "M_Requisition_ID";
/** Set Requisition.
* Material Requisition
*/
public void setM_Requisition_ID (int M_Requisition_ID);
/** Get Requisition.
* Material Requisition
*/
public int getM_Requisition_ID();
public org.compiere.model.I_M_Requisition getM_Requisition() throws RuntimeException;
/** Column name M_RMA_ID */
public static final String COLUMNNAME_M_RMA_ID = "M_RMA_ID";
/** Set RMA.
* Return Material Authorization
*/
public void setM_RMA_ID (int M_RMA_ID);
/** Get RMA.
* Return Material Authorization
*/
public int getM_RMA_ID();
public org.compiere.model.I_M_RMA getM_RMA() throws RuntimeException;
/** Column name M_Warehouse_ID */
public static final String COLUMNNAME_M_Warehouse_ID = "M_Warehouse_ID";
/** Set Warehouse.
* Storage Warehouse and Service Point
*/
public void setM_Warehouse_ID (int M_Warehouse_ID);
/** Get Warehouse.
* Storage Warehouse and Service Point
*/
public int getM_Warehouse_ID();
public org.compiere.model.I_M_Warehouse getM_Warehouse() throws RuntimeException;
/** Column name NoAju */
public static final String COLUMNNAME_NoAju = "NoAju";
/** Set No. Aju */
public void setNoAju (String NoAju);
/** Get No. Aju */
public String getNoAju();
/** Column name Processed */
public static final String COLUMNNAME_Processed = "Processed";
/** Set Processed.
* The document has been processed
*/
public void setProcessed (boolean Processed);
/** Get Processed.
* The document has been processed
*/
public boolean isProcessed();
/** Column name Processing */
public static final String COLUMNNAME_Processing = "Processing";
/** Set Process Now */
public void setProcessing (boolean Processing);
/** Get Process Now */
public boolean isProcessing();
/** Column name RegisterDate */
public static final String COLUMNNAME_RegisterDate = "RegisterDate";
/** Set Register Date */
public void setRegisterDate (Timestamp RegisterDate);
/** Get Register Date */
public Timestamp getRegisterDate();
/** Column name RegisterNo */
public static final String COLUMNNAME_RegisterNo = "RegisterNo";
/** Set Register No */
public void setRegisterNo (String RegisterNo);
/** Get Register No */
public String getRegisterNo();
/** Column name SalesRep_ID */
public static final String COLUMNNAME_SalesRep_ID = "SalesRep_ID";
/** Set Sales Representative.
* Sales Representative or Company Agent
*/
public void setSalesRep_ID (int SalesRep_ID);
/** Get Sales Representative.
* Sales Representative or Company Agent
*/
public int getSalesRep_ID();
public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException;
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,268 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 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 andromedia.midsuit.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.model.*;
import org.compiere.util.KeyNamePair;
/** Generated Interface for MID_UploadTPBLineDet
* @author iDempiere (generated)
* @version Release 5.1
*/
@SuppressWarnings("all")
public interface I_MID_UploadTPBLineDet
{
/** TableName=MID_UploadTPBLineDet */
public static final String Table_Name = "MID_UploadTPBLineDet";
/** AD_Table_ID=30116 */
public static final int Table_ID = 30116;
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 3 - Client - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(3);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name C_OrderLine_ID */
public static final String COLUMNNAME_C_OrderLine_ID = "C_OrderLine_ID";
/** Set Sales Order Line.
* Sales Order Line
*/
public void setC_OrderLine_ID (int C_OrderLine_ID);
/** Get Sales Order Line.
* Sales Order Line
*/
public int getC_OrderLine_ID();
public org.compiere.model.I_C_OrderLine getC_OrderLine() throws RuntimeException;
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name C_UOM_ID */
public static final String COLUMNNAME_C_UOM_ID = "C_UOM_ID";
/** Set UOM.
* Unit of Measure
*/
public void setC_UOM_ID (int C_UOM_ID);
/** Get UOM.
* Unit of Measure
*/
public int getC_UOM_ID();
public org.compiere.model.I_C_UOM getC_UOM() throws RuntimeException;
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name Discount */
public static final String COLUMNNAME_Discount = "Discount";
/** Set Discount %.
* Discount in percent
*/
public void setDiscount (BigDecimal Discount);
/** Get Discount %.
* Discount in percent
*/
public BigDecimal getDiscount();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
public static final String COLUMNNAME_M_InOutLine_ID = "M_InOutLine_ID";
public int getM_InOutLine_ID();
/** Column name MID_UploadTPBLineDet_ID */
public static final String COLUMNNAME_MID_UploadTPBLineDet_ID = "MID_UploadTPBLineDet_ID";
/** Set TPB Line Detail */
public void setMID_UploadTPBLineDet_ID (int MID_UploadTPBLineDet_ID);
/** Get TPB Line Detail */
public int getMID_UploadTPBLineDet_ID();
/** Column name MID_UploadTPBLineDet_UU */
public static final String COLUMNNAME_MID_UploadTPBLineDet_UU = "MID_UploadTPBLineDet_UU";
/** Set MID_UploadTPBLineDet_UU */
public void setMID_UploadTPBLineDet_UU (String MID_UploadTPBLineDet_UU);
/** Get MID_UploadTPBLineDet_UU */
public String getMID_UploadTPBLineDet_UU();
/** Column name MID_UploadTPBLine_ID */
public static final String COLUMNNAME_MID_UploadTPBLine_ID = "MID_UploadTPBLine_ID";
/** Set Upload TPB Line */
public void setMID_UploadTPBLine_ID (int MID_UploadTPBLine_ID);
/** Get Upload TPB Line */
public int getMID_UploadTPBLine_ID();
public I_MID_UploadTPBLine getMID_UploadTPBLine() throws RuntimeException;
/** Column name M_Product_ID */
public static final String COLUMNNAME_M_Product_ID = "M_Product_ID";
/** Set Product.
* Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID);
/** Get Product.
* Product, Service, Item
*/
public int getM_Product_ID();
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException;
/** Column name M_RequisitionLine_ID */
public static final String COLUMNNAME_M_RequisitionLine_ID = "M_RequisitionLine_ID";
/** Set Requisition Line.
* Material Requisition Line
*/
public void setM_RequisitionLine_ID (int M_RequisitionLine_ID);
/** Get Requisition Line.
* Material Requisition Line
*/
public int getM_RequisitionLine_ID();
public org.compiere.model.I_M_RequisitionLine getM_RequisitionLine() throws RuntimeException;
/** Column name PriceActual */
public static final String COLUMNNAME_PriceActual = "PriceActual";
/** Set Unit Price.
* Actual Price
*/
public void setPriceActual (BigDecimal PriceActual);
/** Get Unit Price.
* Actual Price
*/
public BigDecimal getPriceActual();
/** Column name PriceList */
public static final String COLUMNNAME_PriceList = "PriceList";
/** Set List Price.
* List Price
*/
public void setPriceList (BigDecimal PriceList);
/** Get List Price.
* List Price
*/
public BigDecimal getPriceList();
/** Column name Qty */
public static final String COLUMNNAME_Qty = "Qty";
/** Set Quantity.
* Quantity
*/
public void setQty (BigDecimal Qty);
/** Get Quantity.
* Quantity
*/
public BigDecimal getQty();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,200 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 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 *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package andromedia.midsuit.model;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.model.*;
/** Generated Model for MID_UploadTPB
* @author iDempiere (generated)
* @version Release 5.1 - $Id$ */
public class X_MID_UploadTPB extends PO implements I_MID_UploadTPB, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20190125L;
/** Standard Constructor */
public X_MID_UploadTPB (Properties ctx, int MID_UploadTPB_ID, String trxName)
{
super (ctx, MID_UploadTPB_ID, trxName);
/** if (MID_UploadTPB_ID == 0)
{
setProcessed (false);
// N
} */
}
/** Load Constructor */
public X_MID_UploadTPB (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 3 - Client - Org
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_MID_UploadTPB[")
.append(get_ID()).append("]");
return sb.toString();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set File Name.
@param FileName
Name of the local file or URL
*/
public void setFileName (String FileName)
{
set_Value (COLUMNNAME_FileName, FileName);
}
/** Get File Name.
@return Name of the local file or URL
*/
public String getFileName ()
{
return (String)get_Value(COLUMNNAME_FileName);
}
/** Set Upload TPB.
@param MID_UploadTPB_ID Upload TPB */
public void setMID_UploadTPB_ID (int MID_UploadTPB_ID)
{
if (MID_UploadTPB_ID < 1)
set_ValueNoCheck (COLUMNNAME_MID_UploadTPB_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MID_UploadTPB_ID, Integer.valueOf(MID_UploadTPB_ID));
}
/** Get Upload TPB.
@return Upload TPB */
public int getMID_UploadTPB_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MID_UploadTPB_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set MID_UploadTPB_UU.
@param MID_UploadTPB_UU MID_UploadTPB_UU */
public void setMID_UploadTPB_UU (String MID_UploadTPB_UU)
{
set_ValueNoCheck (COLUMNNAME_MID_UploadTPB_UU, MID_UploadTPB_UU);
}
/** Get MID_UploadTPB_UU.
@return MID_UploadTPB_UU */
public String getMID_UploadTPB_UU ()
{
return (String)get_Value(COLUMNNAME_MID_UploadTPB_UU);
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document has been processed
*/
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Process Now */
public boolean isProcessing ()
{
Object oo = get_Value(COLUMNNAME_Processing);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Process Now.
@param Processing2 Process Now */
public void setProcessing2 (String Processing2)
{
set_Value (COLUMNNAME_Processing2, Processing2);
}
/** Get Process Now.
@return Process Now */
public String getProcessing2 ()
{
return (String)get_Value(COLUMNNAME_Processing2);
}
}

View File

@ -0,0 +1,586 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 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 *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package andromedia.midsuit.model;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.Properties;
import org.compiere.model.*;
/** Generated Model for MID_UploadTPBLine
* @author iDempiere (generated)
* @version Release 5.1 - $Id$ */
public class X_MID_UploadTPBLine extends PO implements I_MID_UploadTPBLine, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20190125L;
/** Standard Constructor */
public X_MID_UploadTPBLine (Properties ctx, int MID_UploadTPBLine_ID, String trxName)
{
super (ctx, MID_UploadTPBLine_ID, trxName);
/** if (MID_UploadTPBLine_ID == 0)
{
setIsReturn (false);
// N
} */
}
/** Load Constructor */
public X_MID_UploadTPBLine (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 3 - Client - Org
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_MID_UploadTPBLine[")
.append(get_ID()).append("]");
return sb.toString();
}
public org.compiere.model.I_C_BPartner getC_BPartner() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner)MTable.get(getCtx(), org.compiere.model.I_C_BPartner.Table_Name)
.getPO(getC_BPartner_ID(), get_TrxName()); }
/** 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)
set_ValueNoCheck (COLUMNNAME_C_BPartner_ID, null);
else
set_ValueNoCheck (COLUMNNAME_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(COLUMNNAME_C_BPartner_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_BPartner_Location getC_BPartner_Location() throws RuntimeException
{
return (org.compiere.model.I_C_BPartner_Location)MTable.get(getCtx(), org.compiere.model.I_C_BPartner_Location.Table_Name)
.getPO(getC_BPartner_Location_ID(), get_TrxName()); }
/** 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)
set_Value (COLUMNNAME_C_BPartner_Location_ID, null);
else
set_Value (COLUMNNAME_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(COLUMNNAME_C_BPartner_Location_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Currency getC_Currency() throws RuntimeException
{
return (org.compiere.model.I_C_Currency)MTable.get(getCtx(), org.compiere.model.I_C_Currency.Table_Name)
.getPO(getC_Currency_ID(), get_TrxName()); }
/** 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)
set_Value (COLUMNNAME_C_Currency_ID, null);
else
set_Value (COLUMNNAME_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(COLUMNNAME_C_Currency_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_DocType getC_DocTypeTarget() throws RuntimeException
{
return (org.compiere.model.I_C_DocType)MTable.get(getCtx(), org.compiere.model.I_C_DocType.Table_Name)
.getPO(getC_DocTypeTarget_ID(), get_TrxName()); }
/** 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)
set_ValueNoCheck (COLUMNNAME_C_DocTypeTarget_ID, null);
else
set_ValueNoCheck (COLUMNNAME_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(COLUMNNAME_C_DocTypeTarget_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_Order getC_Order() throws RuntimeException
{
return (org.compiere.model.I_C_Order)MTable.get(getCtx(), org.compiere.model.I_C_Order.Table_Name)
.getPO(getC_Order_ID(), get_TrxName()); }
/** Set Order.
@param C_Order_ID
Order
*/
public void setC_Order_ID (int C_Order_ID)
{
if (C_Order_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_Order_ID, null);
else
set_ValueNoCheck (COLUMNNAME_C_Order_ID, Integer.valueOf(C_Order_ID));
}
/** Get Order.
@return Order
*/
public int getC_Order_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_Order_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Retur Vendor/Cust.
@param IsReturn Retur Vendor/Cust */
public void setIsReturn (boolean IsReturn)
{
set_Value (COLUMNNAME_IsReturn, Boolean.valueOf(IsReturn));
}
/** Get Retur Vendor/Cust.
@return Retur Vendor/Cust */
public boolean isReturn ()
{
Object oo = get_Value(COLUMNNAME_IsReturn);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Document Type AJU.
@param MID_AJUDocumentType_ID Document Type AJU */
public void setMID_AJUDocumentType_ID (int MID_AJUDocumentType_ID)
{
if (MID_AJUDocumentType_ID < 1)
set_Value (COLUMNNAME_MID_AJUDocumentType_ID, null);
else
set_Value (COLUMNNAME_MID_AJUDocumentType_ID, Integer.valueOf(MID_AJUDocumentType_ID));
}
/** Get Document Type AJU.
@return Document Type AJU */
public int getMID_AJUDocumentType_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MID_AJUDocumentType_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_MID_UploadTPB getMID_UploadTPB() throws RuntimeException
{
return (I_MID_UploadTPB)MTable.get(getCtx(), I_MID_UploadTPB.Table_Name)
.getPO(getMID_UploadTPB_ID(), get_TrxName()); }
/** Set Upload TPB.
@param MID_UploadTPB_ID Upload TPB */
public void setMID_UploadTPB_ID (int MID_UploadTPB_ID)
{
if (MID_UploadTPB_ID < 1)
set_ValueNoCheck (COLUMNNAME_MID_UploadTPB_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MID_UploadTPB_ID, Integer.valueOf(MID_UploadTPB_ID));
}
/** Get Upload TPB.
@return Upload TPB */
public int getMID_UploadTPB_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MID_UploadTPB_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Upload TPB Line.
@param MID_UploadTPBLine_ID Upload TPB Line */
public void setMID_UploadTPBLine_ID (int MID_UploadTPBLine_ID)
{
if (MID_UploadTPBLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLine_ID, Integer.valueOf(MID_UploadTPBLine_ID));
}
/** Get Upload TPB Line.
@return Upload TPB Line */
public int getMID_UploadTPBLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MID_UploadTPBLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set MID_UploadTPBLine_UU.
@param MID_UploadTPBLine_UU MID_UploadTPBLine_UU */
public void setMID_UploadTPBLine_UU (String MID_UploadTPBLine_UU)
{
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLine_UU, MID_UploadTPBLine_UU);
}
/** Get MID_UploadTPBLine_UU.
@return MID_UploadTPBLine_UU */
public String getMID_UploadTPBLine_UU ()
{
return (String)get_Value(COLUMNNAME_MID_UploadTPBLine_UU);
}
public org.compiere.model.I_M_InOut getM_InOut() throws RuntimeException
{
return (org.compiere.model.I_M_InOut)MTable.get(getCtx(), org.compiere.model.I_M_InOut.Table_Name)
.getPO(getM_InOut_ID(), get_TrxName()); }
/** Set Shipment/Receipt.
@param M_InOut_ID
Material Shipment Document
*/
public void setM_InOut_ID (int M_InOut_ID)
{
if (M_InOut_ID < 1)
set_Value (COLUMNNAME_M_InOut_ID, null);
else
set_Value (COLUMNNAME_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(COLUMNNAME_M_InOut_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_M_PriceList getM_PriceList() throws RuntimeException
{
return (org.compiere.model.I_M_PriceList)MTable.get(getCtx(), org.compiere.model.I_M_PriceList.Table_Name)
.getPO(getM_PriceList_ID(), get_TrxName()); }
/** 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)
set_Value (COLUMNNAME_M_PriceList_ID, null);
else
set_Value (COLUMNNAME_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(COLUMNNAME_M_PriceList_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_M_Requisition getM_Requisition() throws RuntimeException
{
return (org.compiere.model.I_M_Requisition)MTable.get(getCtx(), org.compiere.model.I_M_Requisition.Table_Name)
.getPO(getM_Requisition_ID(), get_TrxName()); }
/** Set Requisition.
@param M_Requisition_ID
Material Requisition
*/
public void setM_Requisition_ID (int M_Requisition_ID)
{
if (M_Requisition_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_Requisition_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_Requisition_ID, Integer.valueOf(M_Requisition_ID));
}
/** Get Requisition.
@return Material Requisition
*/
public int getM_Requisition_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Requisition_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_M_RMA getM_RMA() throws RuntimeException
{
return (org.compiere.model.I_M_RMA)MTable.get(getCtx(), org.compiere.model.I_M_RMA.Table_Name)
.getPO(getM_RMA_ID(), get_TrxName()); }
/** Set RMA.
@param M_RMA_ID
Return Material Authorization
*/
public void setM_RMA_ID (int M_RMA_ID)
{
if (M_RMA_ID < 1)
set_Value (COLUMNNAME_M_RMA_ID, null);
else
set_Value (COLUMNNAME_M_RMA_ID, Integer.valueOf(M_RMA_ID));
}
/** Get RMA.
@return Return Material Authorization
*/
public int getM_RMA_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_RMA_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_M_Warehouse getM_Warehouse() throws RuntimeException
{
return (org.compiere.model.I_M_Warehouse)MTable.get(getCtx(), org.compiere.model.I_M_Warehouse.Table_Name)
.getPO(getM_Warehouse_ID(), get_TrxName()); }
/** 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)
set_ValueNoCheck (COLUMNNAME_M_Warehouse_ID, null);
else
set_ValueNoCheck (COLUMNNAME_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(COLUMNNAME_M_Warehouse_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set No. Aju.
@param NoAju No. Aju */
public void setNoAju (String NoAju)
{
set_Value (COLUMNNAME_NoAju, NoAju);
}
/** Get No. Aju.
@return No. Aju */
public String getNoAju ()
{
return (String)get_Value(COLUMNNAME_NoAju);
}
/** Set Processed.
@param Processed
The document has been processed
*/
public void setProcessed (boolean Processed)
{
set_Value (COLUMNNAME_Processed, Boolean.valueOf(Processed));
}
/** Get Processed.
@return The document has been processed
*/
public boolean isProcessed ()
{
Object oo = get_Value(COLUMNNAME_Processed);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Process Now.
@param Processing Process Now */
public void setProcessing (boolean Processing)
{
set_Value (COLUMNNAME_Processing, Boolean.valueOf(Processing));
}
/** Get Process Now.
@return Process Now */
public boolean isProcessing ()
{
Object oo = get_Value(COLUMNNAME_Processing);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Register Date.
@param RegisterDate Register Date */
public void setRegisterDate (Timestamp RegisterDate)
{
set_Value (COLUMNNAME_RegisterDate, RegisterDate);
}
/** Get Register Date.
@return Register Date */
public Timestamp getRegisterDate ()
{
return (Timestamp)get_Value(COLUMNNAME_RegisterDate);
}
/** Set Register No.
@param RegisterNo Register No */
public void setRegisterNo (String RegisterNo)
{
set_Value (COLUMNNAME_RegisterNo, RegisterNo);
}
/** Get Register No.
@return Register No */
public String getRegisterNo ()
{
return (String)get_Value(COLUMNNAME_RegisterNo);
}
public org.compiere.model.I_AD_User getSalesRep() throws RuntimeException
{
return (org.compiere.model.I_AD_User)MTable.get(getCtx(), org.compiere.model.I_AD_User.Table_Name)
.getPO(getSalesRep_ID(), get_TrxName()); }
/** Set Sales Representative.
@param SalesRep_ID
Sales Representative or Company Agent
*/
public void setSalesRep_ID (int SalesRep_ID)
{
if (SalesRep_ID < 1)
set_ValueNoCheck (COLUMNNAME_SalesRep_ID, null);
else
set_ValueNoCheck (COLUMNNAME_SalesRep_ID, Integer.valueOf(SalesRep_ID));
}
/** Get Sales Representative.
@return Sales Representative or Company Agent
*/
public int getSalesRep_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_SalesRep_ID);
if (ii == null)
return 0;
return ii.intValue();
}
}

View File

@ -0,0 +1,347 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2012 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 *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package andromedia.midsuit.model;
import java.math.BigDecimal;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.model.*;
import org.compiere.util.Env;
/** Generated Model for MID_UploadTPBLineDet
* @author iDempiere (generated)
* @version Release 5.1 - $Id$ */
public class X_MID_UploadTPBLineDet extends PO implements I_MID_UploadTPBLineDet, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20190125L;
/** Standard Constructor */
public X_MID_UploadTPBLineDet (Properties ctx, int MID_UploadTPBLineDet_ID, String trxName)
{
super (ctx, MID_UploadTPBLineDet_ID, trxName);
/** if (MID_UploadTPBLineDet_ID == 0)
{
} */
}
/** Load Constructor */
public X_MID_UploadTPBLineDet (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 3 - Client - Org
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_MID_UploadTPBLineDet[")
.append(get_ID()).append("]");
return sb.toString();
}
public org.compiere.model.I_C_OrderLine getC_OrderLine() throws RuntimeException
{
return (org.compiere.model.I_C_OrderLine)MTable.get(getCtx(), org.compiere.model.I_C_OrderLine.Table_Name)
.getPO(getC_OrderLine_ID(), get_TrxName()); }
/** Set Sales Order Line.
@param C_OrderLine_ID
Sales Order Line
*/
public void setC_OrderLine_ID (int C_OrderLine_ID)
{
if (C_OrderLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_C_OrderLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_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(COLUMNNAME_C_OrderLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_C_UOM getC_UOM() throws RuntimeException
{
return (org.compiere.model.I_C_UOM)MTable.get(getCtx(), org.compiere.model.I_C_UOM.Table_Name)
.getPO(getC_UOM_ID(), get_TrxName()); }
/** Set UOM.
@param C_UOM_ID
Unit of Measure
*/
public void setC_UOM_ID (int C_UOM_ID)
{
if (C_UOM_ID < 1)
set_Value (COLUMNNAME_C_UOM_ID, null);
else
set_Value (COLUMNNAME_C_UOM_ID, Integer.valueOf(C_UOM_ID));
}
/** Get UOM.
@return Unit of Measure
*/
public int getC_UOM_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_C_UOM_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Discount %.
@param Discount
Discount in percent
*/
public void setDiscount (BigDecimal Discount)
{
set_ValueNoCheck (COLUMNNAME_Discount, Discount);
}
/** Get Discount %.
@return Discount in percent
*/
public BigDecimal getDiscount ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Discount);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set TPB Line Detail.
@param MID_UploadTPBLineDet_ID TPB Line Detail */
public void setMID_UploadTPBLineDet_ID (int MID_UploadTPBLineDet_ID)
{
if (MID_UploadTPBLineDet_ID < 1)
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLineDet_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLineDet_ID, Integer.valueOf(MID_UploadTPBLineDet_ID));
}
/** Get TPB Line Detail.
@return TPB Line Detail */
public int getMID_UploadTPBLineDet_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MID_UploadTPBLineDet_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public int getM_InOutLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_InOutLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set MID_UploadTPBLineDet_UU.
@param MID_UploadTPBLineDet_UU MID_UploadTPBLineDet_UU */
public void setMID_UploadTPBLineDet_UU (String MID_UploadTPBLineDet_UU)
{
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLineDet_UU, MID_UploadTPBLineDet_UU);
}
/** Get MID_UploadTPBLineDet_UU.
@return MID_UploadTPBLineDet_UU */
public String getMID_UploadTPBLineDet_UU ()
{
return (String)get_Value(COLUMNNAME_MID_UploadTPBLineDet_UU);
}
public I_MID_UploadTPBLine getMID_UploadTPBLine() throws RuntimeException
{
return (I_MID_UploadTPBLine)MTable.get(getCtx(), I_MID_UploadTPBLine.Table_Name)
.getPO(getMID_UploadTPBLine_ID(), get_TrxName()); }
/** Set Upload TPB Line.
@param MID_UploadTPBLine_ID Upload TPB Line */
public void setMID_UploadTPBLine_ID (int MID_UploadTPBLine_ID)
{
if (MID_UploadTPBLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_MID_UploadTPBLine_ID, Integer.valueOf(MID_UploadTPBLine_ID));
}
/** Get Upload TPB Line.
@return Upload TPB Line */
public int getMID_UploadTPBLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_MID_UploadTPBLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_M_Product getM_Product() throws RuntimeException
{
return (org.compiere.model.I_M_Product)MTable.get(getCtx(), org.compiere.model.I_M_Product.Table_Name)
.getPO(getM_Product_ID(), get_TrxName()); }
/** Set Product.
@param M_Product_ID
Product, Service, Item
*/
public void setM_Product_ID (int M_Product_ID)
{
if (M_Product_ID < 1)
set_Value (COLUMNNAME_M_Product_ID, null);
else
set_Value (COLUMNNAME_M_Product_ID, Integer.valueOf(M_Product_ID));
}
/** Get Product.
@return Product, Service, Item
*/
public int getM_Product_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_Product_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public org.compiere.model.I_M_RequisitionLine getM_RequisitionLine() throws RuntimeException
{
return (org.compiere.model.I_M_RequisitionLine)MTable.get(getCtx(), org.compiere.model.I_M_RequisitionLine.Table_Name)
.getPO(getM_RequisitionLine_ID(), get_TrxName()); }
/** Set Requisition Line.
@param M_RequisitionLine_ID
Material Requisition Line
*/
public void setM_RequisitionLine_ID (int M_RequisitionLine_ID)
{
if (M_RequisitionLine_ID < 1)
set_ValueNoCheck (COLUMNNAME_M_RequisitionLine_ID, null);
else
set_ValueNoCheck (COLUMNNAME_M_RequisitionLine_ID, Integer.valueOf(M_RequisitionLine_ID));
}
/** Get Requisition Line.
@return Material Requisition Line
*/
public int getM_RequisitionLine_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_M_RequisitionLine_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Unit Price.
@param PriceActual
Actual Price
*/
public void setPriceActual (BigDecimal PriceActual)
{
set_ValueNoCheck (COLUMNNAME_PriceActual, PriceActual);
}
/** Get Unit Price.
@return Actual Price
*/
public BigDecimal getPriceActual ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PriceActual);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set List Price.
@param PriceList
List Price
*/
public void setPriceList (BigDecimal PriceList)
{
set_Value (COLUMNNAME_PriceList, PriceList);
}
/** Get List Price.
@return List Price
*/
public BigDecimal getPriceList ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_PriceList);
if (bd == null)
return Env.ZERO;
return bd;
}
/** Set Quantity.
@param Qty
Quantity
*/
public void setQty (BigDecimal Qty)
{
set_Value (COLUMNNAME_Qty, Qty);
}
/** Get Quantity.
@return Quantity
*/
public BigDecimal getQty ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_Qty);
if (bd == null)
return Env.ZERO;
return bd;
}
}

View File

@ -0,0 +1,148 @@
package andromedia.midsuit.process;
import java.util.List;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MOrder;
import org.compiere.model.MOrderLine;
import org.compiere.model.MRMA;
import org.compiere.model.MRMALine;
import org.compiere.model.Query;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
import org.compiere.util.Msg;
import andromedia.midsuit.model.X_MID_UploadPEB;
import andromedia.midsuit.model.X_MID_UploadTPB;
import andromedia.midsuit.model.X_MID_UploadTPBLine;
import andromedia.midsuit.model.X_MID_UploadTPBLineDet;
public class MID_TPBUpdateOrder extends SvrProcess{
X_MID_UploadTPB tpb = null;
@Override
protected void prepare() {
// TODO Auto-generated method stub
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++)
{
}
tpb = new X_MID_UploadTPB(getCtx(), getRecord_ID(), get_TrxName());
}
@Override
protected String doIt() throws Exception {
String whereClause = " MID_UploadTPB_ID =? AND Processed='N' AND (M_Requisition_ID IS NOT NULL)";
List<X_MID_UploadTPBLine> lines = new Query(getCtx(), X_MID_UploadTPBLine.Table_Name, whereClause, get_TrxName())
.setParameters(new Object[] { getRecord_ID() })
.setOnlyActiveRecords(true)
.list();
for(X_MID_UploadTPBLine line : lines) {
boolean isRetur = line.isReturn();
if(line.getM_Requisition_ID()>0 && !isRetur) {
MOrder order = createPurchaseOrder(line);
createPurchaseOrderLine(line, order);
}else if (line.getM_RMA_ID()>0 && isRetur) {
MRMA RMA = createCustomerRMA(line);
createCustomerRMALine(line, RMA);
}else {
continue;
}
line.setProcessed(true);
line.saveEx();
}
int countNotProcessed = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM MID_UploadTPBLine WHERE Processed =? AND MID_UploadTPB_ID =?", new Object[] { false, getRecord_ID() });
if(countNotProcessed<=0) {
tpb.setProcessed(true);
tpb.saveEx();
}
return "";
}
private void createCustomerRMALine(X_MID_UploadTPBLine line, MRMA RMA) {
String whereClause = " MID_UploadTPBLine_ID =?";
List<X_MID_UploadTPBLineDet> detailLines = new Query(getCtx(), X_MID_UploadTPBLineDet.Table_Name, whereClause, get_TrxName())
.setParameters(new Object[] { line.get_ID() })
.setOnlyActiveRecords(true)
.list();
int C_Tax_ID = DB.getSQLValueEx(get_TrxName(), "SELECT C_Tax_ID FROM C_Tax WHERE Name=? AND AD_Client_ID =?", new Object[] { "Exempt", getAD_Client_ID()});
for(X_MID_UploadTPBLineDet detailLine : detailLines) {
if(detailLine.getM_RequisitionLine_ID()==0)
throw new AdempiereException(" Requistion Line untuk Aju "+line.getNoAju()+" belum terisi !!!");
MRMALine rmaLine = new MRMALine(getCtx(), 0, get_TrxName());
rmaLine.setAD_Org_ID(RMA.getAD_Org_ID());
rmaLine.setM_Product_ID(detailLine.getM_Product_ID());
rmaLine.setQty(detailLine.getQty());
rmaLine.setM_InOutLine_ID(detailLine.getM_InOutLine_ID());
rmaLine.setC_Tax_ID(C_Tax_ID);
rmaLine.saveEx();
}
}
private MRMA createCustomerRMA(X_MID_UploadTPBLine line) {
MRMA retValue = new MRMA(getCtx(), 0, get_TrxName());
retValue.setAD_Org_ID(line.getAD_Org_ID());
retValue.set_ValueNoCheck("NoAju1", line.getNoAju());
retValue.set_ValueNoCheck("RegisterDate", line.getRegisterDate());
retValue.set_ValueNoCheck("RegisterNo", line.getRegisterNo());
retValue.set_ValueNoCheck("MID_AJUDocumentType_ID", line.getMID_AJUDocumentType_ID());
retValue.setC_BPartner_ID(line.getC_BPartner_ID());
retValue.setC_Currency_ID(line.getC_Currency_ID());
retValue.setSalesRep_ID(line.getSalesRep_ID());
retValue.setIsSOTrx(true);
retValue.setM_InOut_ID(line.getM_InOut_ID());
retValue.setM_RMAType_ID(DB.getSQLValue(get_TrxName(), "SELECT M_RMAType_ID FROM M_RMAType WHERE Name =? AND AD_Client_ID =?", new Object[] {"Rusak", getAD_Client_ID()}));
retValue.saveEx();
return retValue;
}
private MOrder createPurchaseOrder(X_MID_UploadTPBLine line) {
MOrder retValue = new MOrder(getCtx(), 0, get_TrxName());
retValue.setAD_Org_ID(line.getAD_Org_ID());
retValue.set_ValueNoCheck("NoAju1", line.getNoAju());
retValue.set_ValueNoCheck("RegisterDate", line.getRegisterDate());
retValue.set_ValueNoCheck("RegisterNo", line.getRegisterNo());
retValue.set_ValueNoCheck("MID_AJUDocumentType_ID", line.getMID_AJUDocumentType_ID());
retValue.setC_BPartner_ID(line.getC_BPartner_ID());
retValue.setC_BPartner_Location_ID(line.getC_BPartner_Location_ID());
retValue.setC_Currency_ID(line.getC_Currency_ID());
retValue.setSalesRep_ID(line.getSalesRep_ID());
retValue.setM_Warehouse_ID(line.getM_Warehouse_ID());
retValue.setC_DocTypeTarget_ID(line.getC_DocTypeTarget_ID());
retValue.setM_PriceList_ID(line.getM_PriceList_ID());
retValue.saveEx();
String message = Msg.parseTranslation(getCtx(), "@PurchaseOrderCreated@ " + retValue.getDocumentNo());
addBufferLog(retValue.get_ID(), retValue.getDateOrdered(), null, message,
retValue.get_Table_ID(), retValue.get_ID());
return retValue;
}
private void createPurchaseOrderLine(X_MID_UploadTPBLine line, MOrder order) {
String whereClause = " MID_UploadTPBLine_ID =?";
List<X_MID_UploadTPBLineDet> detailLines = new Query(getCtx(), X_MID_UploadTPBLineDet.Table_Name, whereClause, get_TrxName())
.setParameters(new Object[] { line.get_ID() })
.setOnlyActiveRecords(true)
.list();
for(X_MID_UploadTPBLineDet detailLine : detailLines) {
if(detailLine.getM_RequisitionLine_ID()==0)
throw new AdempiereException(" Requistion Line untuk Aju "+line.getNoAju()+" belum terisi !!!");
MOrderLine ol = new MOrderLine(order);
ol.setM_Product_ID(detailLine.getM_Product_ID());
ol.setC_UOM_ID(detailLine.getC_UOM_ID());
ol.setQty(detailLine.getQty());
ol.setPriceList(detailLine.getPriceList());
ol.setDiscount(detailLine.getDiscount());
ol.setPrice(detailLine.getPriceActual());
ol.set_ValueNoCheck("M_Requistion_ID", line.getM_Requisition_ID());
ol.set_ValueNoCheck("M_RequisitionLine_ID", detailLine.getM_RequisitionLine_ID());
ol.saveEx();
}
}
}

View File

@ -0,0 +1,141 @@
package andromedia.midsuit.process;
import java.util.List;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MOrder;
import org.compiere.model.MOrderLine;
import org.compiere.model.MRMA;
import org.compiere.model.MRMALine;
import org.compiere.model.Query;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
import org.compiere.util.Msg;
import andromedia.midsuit.model.X_MID_UploadPEB;
import andromedia.midsuit.model.X_MID_UploadTPB;
import andromedia.midsuit.model.X_MID_UploadTPBLine;
import andromedia.midsuit.model.X_MID_UploadTPBLineDet;
public class MID_TPBUpdateOrderLine extends SvrProcess{
X_MID_UploadTPBLine tpbLine = null;
@Override
protected void prepare() {
// TODO Auto-generated method stub
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++)
{
}
tpbLine = new X_MID_UploadTPBLine(getCtx(), getRecord_ID(), get_TrxName());
}
@Override
protected String doIt() throws Exception {
boolean isRetur = tpbLine.isReturn();
if(tpbLine.getM_Requisition_ID()>0 && !isRetur) {
MOrder order = createPurchaseOrder(tpbLine);
createPurchaseOrderLine(tpbLine, order);
}else if (tpbLine.getM_RMA_ID()>0 && isRetur) {
MRMA RMA = createCustomerRMA(tpbLine);
createCustomerRMALine(tpbLine, RMA);
}else {
throw new AdempiereException("Requisition / RMA Wajib diisi !!!");
}
tpbLine.setProcessed(true);
tpbLine.saveEx();
int countNotProcessed = DB.getSQLValueEx(get_TrxName(), "SELECT COUNT(*) FROM MID_UploadTPBLine WHERE Processed =? AND MID_UploadTPB_ID =?", new Object[] { false, tpbLine.getMID_UploadTPB_ID() });
if(countNotProcessed<=0) {
X_MID_UploadTPB tpb = new X_MID_UploadTPB(getCtx(), tpbLine.getMID_UploadTPB_ID(), get_TrxName());
tpb.setProcessed(true);
tpb.saveEx();
}
return "";
}
private void createCustomerRMALine(X_MID_UploadTPBLine line, MRMA RMA) {
String whereClause = " MID_UploadTPBLine_ID =?";
List<X_MID_UploadTPBLineDet> detailLines = new Query(getCtx(), X_MID_UploadTPBLineDet.Table_Name, whereClause, get_TrxName())
.setParameters(new Object[] { line.get_ID() })
.setOnlyActiveRecords(true)
.list();
int C_Tax_ID = DB.getSQLValueEx(get_TrxName(), "SELECT C_Tax_ID FROM C_Tax WHERE Name=? AND AD_Client_ID =?", new Object[] { "Exempt", getAD_Client_ID()});
for(X_MID_UploadTPBLineDet detailLine : detailLines) {
if(detailLine.getM_RequisitionLine_ID()==0)
throw new AdempiereException(" Requistion Line untuk Aju "+line.getNoAju()+" belum terisi !!!");
MRMALine rmaLine = new MRMALine(getCtx(), 0, get_TrxName());
rmaLine.setAD_Org_ID(RMA.getAD_Org_ID());
rmaLine.setM_Product_ID(detailLine.getM_Product_ID());
rmaLine.setQty(detailLine.getQty());
rmaLine.setM_InOutLine_ID(detailLine.getM_InOutLine_ID());
rmaLine.setC_Tax_ID(C_Tax_ID);
rmaLine.saveEx();
}
}
private MRMA createCustomerRMA(X_MID_UploadTPBLine line) {
MRMA retValue = new MRMA(getCtx(), 0, get_TrxName());
retValue.setAD_Org_ID(line.getAD_Org_ID());
retValue.set_ValueNoCheck("NoAju1", line.getNoAju());
retValue.set_ValueNoCheck("RegisterDate", line.getRegisterDate());
retValue.set_ValueNoCheck("RegisterNo", line.getRegisterNo());
retValue.set_ValueNoCheck("MID_AJUDocumentType_ID", line.getMID_AJUDocumentType_ID());
retValue.setC_BPartner_ID(line.getC_BPartner_ID());
retValue.setC_Currency_ID(line.getC_Currency_ID());
retValue.setSalesRep_ID(line.getSalesRep_ID());
retValue.setIsSOTrx(true);
retValue.setM_InOut_ID(line.getM_InOut_ID());
retValue.setM_RMAType_ID(DB.getSQLValue(get_TrxName(), "SELECT M_RMAType_ID FROM M_RMAType WHERE Name =? AND AD_Client_ID =?", new Object[] {"Rusak", getAD_Client_ID()}));
retValue.saveEx();
return retValue;
}
private MOrder createPurchaseOrder(X_MID_UploadTPBLine line) {
MOrder retValue = new MOrder(getCtx(), 0, get_TrxName());
retValue.setAD_Org_ID(line.getAD_Org_ID());
retValue.set_ValueNoCheck("NoAju1", line.getNoAju());
retValue.set_ValueNoCheck("RegisterDate", line.getRegisterDate());
retValue.set_ValueNoCheck("RegisterNo", line.getRegisterNo());
retValue.set_ValueNoCheck("MID_AJUDocumentType_ID", line.getMID_AJUDocumentType_ID());
retValue.setC_BPartner_ID(line.getC_BPartner_ID());
retValue.setC_BPartner_Location_ID(line.getC_BPartner_Location_ID());
retValue.setC_Currency_ID(line.getC_Currency_ID());
retValue.setSalesRep_ID(line.getSalesRep_ID());
retValue.setM_Warehouse_ID(line.getM_Warehouse_ID());
retValue.setC_DocTypeTarget_ID(line.getC_DocTypeTarget_ID());
retValue.setM_PriceList_ID(line.getM_PriceList_ID());
retValue.saveEx();
String message = Msg.parseTranslation(getCtx(), "@PurchaseOrderCreated@ " + retValue.getDocumentNo());
addBufferLog(retValue.get_ID(), retValue.getDateOrdered(), null, message,
retValue.get_Table_ID(), retValue.get_ID());
return retValue;
}
private void createPurchaseOrderLine(X_MID_UploadTPBLine line, MOrder order) {
String whereClause = " MID_UploadTPBLine_ID =?";
List<X_MID_UploadTPBLineDet> detailLines = new Query(getCtx(), X_MID_UploadTPBLineDet.Table_Name, whereClause, get_TrxName())
.setParameters(new Object[] { line.get_ID() })
.setOnlyActiveRecords(true)
.list();
for(X_MID_UploadTPBLineDet detailLine : detailLines) {
if(detailLine.getM_RequisitionLine_ID()==0)
throw new AdempiereException(" Requistion Line untuk Aju "+line.getNoAju()+" belum terisi !!!");
MOrderLine ol = new MOrderLine(order);
ol.setM_Product_ID(detailLine.getM_Product_ID());
ol.setC_UOM_ID(detailLine.getC_UOM_ID());
ol.setQty(detailLine.getQty());
ol.setPriceList(detailLine.getPriceList());
ol.setDiscount(detailLine.getDiscount());
ol.setPrice(detailLine.getPriceActual());
ol.set_ValueNoCheck("M_Requistion_ID", line.getM_Requisition_ID());
ol.set_ValueNoCheck("M_RequisitionLine_ID", detailLine.getM_RequisitionLine_ID());
ol.saveEx();
}
}
}

View File

@ -3,30 +3,31 @@ package andromedia.midsuit.process;
import java.io.File;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.adempiere.exceptions.AdempiereException;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory;
import org.compiere.model.MBPartner;
import org.compiere.model.MBPartnerLocation;
import org.compiere.model.MOrder;
import org.compiere.model.MOrderLine;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Msg;
import andromedia.midsuit.model.X_MID_UploadTPB;
import andromedia.midsuit.model.X_MID_UploadTPBLine;
import andromedia.midsuit.model.X_MID_UploadTPBLineDet;
public class MID_UploadTPB extends SvrProcess{
String p_File = "";
int p_C_DocType_ID = 0;
X_MID_UploadTPB tpb = null;
@Override
protected void prepare() {
// TODO Auto-generated method stub
@ -42,12 +43,15 @@ public class MID_UploadTPB extends SvrProcess{
@Override
protected String doIt() throws Exception {
tpb = new X_MID_UploadTPB(getCtx(), getRecord_ID(), get_TrxName());
File TPB = new File(p_File);
Workbook workbook = WorkbookFactory.create(TPB);
Sheet header = workbook.getSheet("Header");
Iterator<Row> rows = header.rowIterator();
int rowNum = 0;
createTPBDocument(TPB);
while(rows.hasNext()){
Row row = rows.next();
if(rowNum==0) {
@ -55,46 +59,7 @@ public class MID_UploadTPB extends SvrProcess{
continue;
}
MOrder order = new MOrder(getCtx(), 0, get_TrxName());
order.setAD_Org_ID(Env.getContextAsInt(getCtx(), "#AD_Org_ID"));
order.set_ValueNoCheck("RegisterNo", row.getCell(103).getStringCellValue());
order.setIsSOTrx(false);
SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy");
Date parsedDate = dateFormat.parse(row.getCell(117).getStringCellValue());
Timestamp registerDate = new Timestamp(parsedDate.getTime());
order.set_ValueNoCheck("RegisterDate", registerDate);
order.set_ValueNoCheck("NoAju1", row.getCell(0).getStringCellValue());
String AJU_DocType_Value = row.getCell(5).getStringCellValue();
int MID_AJUDocType_ID = DB.getSQLValue(get_TrxName(), "SELECT MID_AJUDocumentType_ID FROM MID_AjuDocumentType WHERE Value =?", new Object[] { AJU_DocType_Value });
if(MID_AJUDocType_ID <=0)
throw new AdempiereException("AJU Document For "+AJU_DocType_Value+" !!!");
order.set_ValueNoCheck("MID_AJUDocumentType_ID", MID_AJUDocType_ID);
int C_BPartner_ID = 0;
int C_Currency_ID = 0;
if(AJU_DocType_Value.equals("40")) {
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? AND IsVendor ='Y'", new Object[] { row.getCell(93).getStringCellValue(), getAD_Client_ID()});
C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { "IDR" });
}else {
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? AND IsVendor ='Y'", new Object[] { row.getCell(3).getStringCellValue(), getAD_Client_ID()});
C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { row.getCell(88).getStringCellValue()});
}
if(C_BPartner_ID <=0)
throw new AdempiereException("Business Partner Not Found "+row.getCell(3).getStringCellValue()+" !!!");
if(C_Currency_ID <=0)
throw new AdempiereException("Currency Not Found "+row.getCell(88).getStringCellValue()+" !!!");
order.setC_BPartner_ID(C_BPartner_ID);
order.setC_BPartner_Location_ID(MBPartnerLocation.getForBPartner(getCtx(), C_BPartner_ID, get_TrxName())[0].getC_BPartner_Location_ID());
order.setC_DocTypeTarget_ID(p_C_DocType_ID);
order.setSalesRep_ID(30178);
order.setM_Warehouse_ID(30045);
int M_PriceList_ID = DB.getSQLValue(get_TrxName(), "SELECT M_PriceList_ID FROM M_PriceList WHERE C_Currency_ID =? AND AD_Client_ID =? AND IsSOPriceList =?", new Object[] { C_Currency_ID, getAD_Client_ID(), false });
order.setC_Currency_ID(C_Currency_ID);
order.setM_PriceList_ID(M_PriceList_ID);
order.saveEx();
X_MID_UploadTPBLine line = createTPBDocumentLine(row);
Sheet Barang = workbook.getSheet("Barang");
Iterator<Row> rowsBarang = Barang.rowIterator();
@ -106,31 +71,86 @@ public class MID_UploadTPB extends SvrProcess{
continue;
}
if(rowBarang.getCell(0).getStringCellValue().equals(row.getCell(0).getStringCellValue()))
createOrderLine(order, rowBarang, AJU_DocType_Value);
createTPBDocumentDetail(line, rowBarang);
rowBarangNum++;
}
rowNum++;
String message = Msg.parseTranslation(getCtx(), "@OrderCreated@ " + order.getDocumentNo());
addBufferLog(order.getC_Order_ID(), order.getDateOrdered(), null, message,
order.get_Table_ID(), order.getC_Order_ID());
}
return String.valueOf(workbook.getNumberOfSheets());
return "TPB Upload Success";
}
private MOrderLine createOrderLine(MOrder order, Row rowBarang, String aJU_DocType_Value) {
MOrderLine retValue = new MOrderLine(order);
private void createTPBDocument(File TPB) {
int fileNameIndex = TPB.getName().lastIndexOf("_");
tpb.setFileName(TPB.getName().substring(fileNameIndex+1));
tpb.setIsActive(true);
tpb.setProcessed(false);
tpb.saveEx();
}
String AJU_DocType_Value = "";
private X_MID_UploadTPBLine createTPBDocumentLine(Row dataRow) throws ParseException {
X_MID_UploadTPBLine tpbLine = new X_MID_UploadTPBLine(getCtx(), 0, get_TrxName());
tpbLine.setAD_Org_ID(tpb.getAD_Org_ID());
tpbLine.setMID_UploadTPB_ID(tpb.get_ID());
tpbLine.setNoAju(dataRow.getCell(0).getStringCellValue());
SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM yyyy");
Date parsedDate = dateFormat.parse(dataRow.getCell(117).getStringCellValue());
Timestamp registerDate = new Timestamp(parsedDate.getTime());
tpbLine.setRegisterDate(registerDate);
tpbLine.setRegisterNo(dataRow.getCell(103).getStringCellValue());
tpbLine.setIsActive(true);
tpbLine.setProcessed(false);
AJU_DocType_Value = dataRow.getCell(5).getStringCellValue();
int MID_AJUDocType_ID = DB.getSQLValue(get_TrxName(), "SELECT MID_AJUDocumentType_ID FROM MID_AjuDocumentType WHERE Value =?", new Object[] { AJU_DocType_Value });
if(MID_AJUDocType_ID <=0)
throw new AdempiereException("AJU Document For "+AJU_DocType_Value+" !!!");
tpbLine.setMID_AJUDocumentType_ID(MID_AJUDocType_ID);
int C_BPartner_ID = 0;
int C_Currency_ID = 0;
if(AJU_DocType_Value.equals("40")) {
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? AND IsVendor ='Y'", new Object[] { dataRow.getCell(93).getStringCellValue(), getAD_Client_ID()});
C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { "IDR" });
}else {
C_BPartner_ID = DB.getSQLValue(get_TrxName(), "SELECT C_BPartner_ID FROM C_Bpartner WHERE Name =? AND AD_Client_ID =? AND IsVendor ='Y'", new Object[] { dataRow.getCell(3).getStringCellValue(), getAD_Client_ID()});
C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { dataRow.getCell(88).getStringCellValue()});
}
if(C_BPartner_ID <=0)
throw new AdempiereException("Business Partner Not Found "+dataRow.getCell(3).getStringCellValue()+" !!!");
if(C_Currency_ID <=0)
throw new AdempiereException("Currency Not Found "+dataRow.getCell(88).getStringCellValue()+" !!!");
tpbLine.setC_BPartner_ID(C_BPartner_ID);
tpbLine.setC_BPartner_Location_ID(MBPartnerLocation.getForBPartner(getCtx(), C_BPartner_ID, get_TrxName())[0].getC_BPartner_Location_ID());
tpbLine.setC_DocTypeTarget_ID(p_C_DocType_ID);
tpbLine.setSalesRep_ID(30178);
tpbLine.setM_Warehouse_ID(30045);
int M_PriceList_ID = DB.getSQLValue(get_TrxName(), "SELECT M_PriceList_ID FROM M_PriceList WHERE C_Currency_ID =? AND AD_Client_ID =? AND IsSOPriceList =?", new Object[] { C_Currency_ID, getAD_Client_ID(), false });
tpbLine.setC_Currency_ID(C_Currency_ID);
tpbLine.setM_PriceList_ID(M_PriceList_ID);
tpbLine.saveEx();
return tpbLine;
}
private X_MID_UploadTPBLineDet createTPBDocumentDetail(X_MID_UploadTPBLine tpbLine, Row rowBarang) {
X_MID_UploadTPBLineDet tpbDetail = new X_MID_UploadTPBLineDet(getCtx(), 0, get_TrxName());
tpbDetail.setMID_UploadTPBLine_ID(tpbLine.get_ID());
tpbDetail.setAD_Org_ID(tpb.getAD_Org_ID());
int M_Product_ID =0;
BigDecimal Qty = Env.ZERO;
int C_UOM_ID = 0;
BigDecimal PriceList = Env.ZERO;
BigDecimal Discount = Env.ZERO;
BigDecimal PriceActual = Env.ZERO;
if(aJU_DocType_Value.equals("23") || aJU_DocType_Value.equals("40")){
if(AJU_DocType_Value.equals("23") || AJU_DocType_Value.equals("40")){
M_Product_ID = DB.getSQLValue(get_TrxName(), "SELECT M_Product_ID FROM M_Product WHERE Value =?", new Object[] { rowBarang.getCell(20).getStringCellValue() });
C_UOM_ID = DB.getSQLValue(get_TrxName(), " SELECT C_UOM_ID FROM C_UOM WHERE UOMSymbol =?", new Object[] { rowBarang.getCell(27).getStringCellValue()});
@ -151,12 +171,12 @@ public class MID_UploadTPB extends SvrProcess{
}
if(aJU_DocType_Value.equals("23")){
if(AJU_DocType_Value.equals("23")){
Qty = new BigDecimal(rowBarang.getCell(16).getStringCellValue());
PriceList = new BigDecimal(rowBarang.getCell(12).getStringCellValue());
Discount = new BigDecimal(rowBarang.getCell(5).getStringCellValue());
PriceActual = PriceList.subtract(Discount.divide(Env.ONEHUNDRED, 2,BigDecimal.ROUND_DOWN).multiply(PriceList));
}else if (aJU_DocType_Value.equals("40")){
}else if (AJU_DocType_Value.equals("40")){
Qty = new BigDecimal(rowBarang.getCell(32).getStringCellValue());
PriceList = new BigDecimal(rowBarang.getCell(29).getStringCellValue());
PriceActual = PriceList;
@ -166,18 +186,18 @@ public class MID_UploadTPB extends SvrProcess{
PriceActual = new BigDecimal(rowBarang.getCell(5).getStringCellValue());
}
if(aJU_DocType_Value.equals("27")){
if(AJU_DocType_Value.equals("27")){
Discount = new BigDecimal(rowBarang.getCell(22).getStringCellValue());
}
retValue.setM_Product_ID(M_Product_ID);
retValue.setC_UOM_ID(C_UOM_ID);
retValue.setQty(Qty);
retValue.setPriceList(PriceList);
retValue.setDiscount(Discount);
retValue.setPrice(PriceActual);
retValue.saveEx();
return retValue;
}
tpbDetail.setM_Product_ID(M_Product_ID);
tpbDetail.setC_UOM_ID(C_UOM_ID);
tpbDetail.setQty(Qty);
tpbDetail.setPriceList(PriceList);
tpbDetail.setDiscount(Discount);
tpbDetail.setPriceActual(PriceActual);
tpbDetail.saveEx();
return tpbDetail;
}
}

View File

@ -1,26 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edii.midsuit.feature"
label="Feature"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="edii.midsuit.project"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="edii.midsuit.feature"
label="Feature"
version="1.0.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
</description>
<copyright url="http://www.example.com/copyright">
[Enter Copyright Description here.]
</copyright>
<license url="http://www.example.com/license">
[Enter License Description here.]
</license>
<plugin
id="org.adempiere.report.jasper.fonts"
download-size="0"
install-size="0"
version="0.0.0"
fragment="true"
unpack="false"/>
</feature>