parent
3fcf307d1d
commit
fda8a2d406
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<feature
|
||||
id="andromedia.midsuit.feature"
|
||||
id="he"
|
||||
label="Feature"
|
||||
version="1.0.0.qualifier">
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import org.compiere.model.GridTab;
|
|||
import org.compiere.model.X_M_InventoryLine;
|
||||
import org.compiere.util.DB;
|
||||
|
||||
import andromedia.midsuit.model.MID_PPO;
|
||||
|
||||
public class MID_CalloutInventoryLine extends CalloutEngine implements IColumnCallout {
|
||||
|
||||
@Override
|
||||
|
|
@ -24,14 +26,16 @@ public class MID_CalloutInventoryLine extends CalloutEngine implements IColumnCa
|
|||
if (value == null) {
|
||||
return "";
|
||||
}
|
||||
String isEnd = "N";
|
||||
int PS_PPO_ID = (int) mTab.getValue("ps_ppoline_ID");
|
||||
if(PS_PPO_ID > 0) {
|
||||
isEnd = DB.getSQLValueStringEx(null, "SELECT IsEndProduct FROM PS_PPOLine WHERE PS_PPOLine_ID =?", new Object[] { PS_PPO_ID });
|
||||
}
|
||||
BigDecimal retValue = (BigDecimal) value;
|
||||
if(isEnd.equals("Y"))
|
||||
retValue = retValue.multiply(new BigDecimal(-1));
|
||||
String isEnd = "N";
|
||||
|
||||
int PS_PPO_ID = 0;
|
||||
if(mTab.getValue("ps_ppo_ID") != null) {
|
||||
PS_PPO_ID = (int) mTab.getValue("ps_ppo_ID");
|
||||
isEnd = DB.getSQLValueStringEx(null, "SELECT IsEndProduct FROM PS_PPOLine WHERE PS_PPOLine_ID =?", new Object[] { PS_PPO_ID });
|
||||
if(isEnd.equals("Y"))
|
||||
retValue = retValue.multiply(new BigDecimal(-1));
|
||||
}
|
||||
|
||||
mTab.setValue(X_M_InventoryLine.COLUMNNAME_QtyInternalUse, retValue);
|
||||
return "";
|
||||
|
|
|
|||
|
|
@ -604,13 +604,11 @@ public abstract class MID_CreateFromInvoice extends CreateFrom {
|
|||
invoice.validatePaySchedule();
|
||||
invoice.saveEx();
|
||||
}
|
||||
invoice.set_ValueOfColumn("RegisterDate", (Timestamp) p_order.get_Value("RegisterDate") == null ? null : (Timestamp)p_order.get_Value("RegisterDate"));
|
||||
invoice.set_ValueOfColumn("RegisterNo", p_order.get_ValueAsString("RegisterNo") == null ? null : p_order.get_ValueAsString("RegisterNo"));
|
||||
invoice.set_ValueOfColumn("MID_AJUDocumentType_ID", p_order.get_ValueAsInt("MID_AJUDocumentType_ID"));
|
||||
invoice.set_ValueOfColumn("noaju1", p_order.get_ValueAsString("noaju1") == null ? null : p_order.get_ValueAsString("noaju1"));
|
||||
invoice.set_ValueOfColumn("noaju2", p_order.get_ValueAsString("noaju2") == null ? null : p_order.get_ValueAsString("noaju2"));
|
||||
invoice.set_ValueOfColumn("noaju3", p_order.get_ValueAsString("noaju3") == null ? null : p_order.get_ValueAsString("noaju3"));
|
||||
invoice.set_ValueOfColumn("noaju4", p_order.get_ValueAsString("noaju4") == null ? null : p_order.get_ValueAsString("noaju4"));
|
||||
invoice.set_ValueNoCheck("RegisterDate", (Timestamp) p_order.get_Value("RegisterDate") == null ? null : (Timestamp)p_order.get_Value("RegisterDate"));
|
||||
invoice.set_ValueNoCheck("RegisterNo", p_order.get_ValueAsString("RegisterNo") == null ? null : p_order.get_ValueAsString("RegisterNo"));
|
||||
if(p_order.get_ValueAsInt("MID_AJUDocumentType_ID") > 0)
|
||||
invoice.set_ValueNoCheck("MID_AJUDocumentType_ID", p_order.get_ValueAsInt("MID_AJUDocumentType_ID"));
|
||||
invoice.set_ValueNoCheck("NoAju1", p_order.get_ValueAsString("NoAju1") == null ? null : p_order.get_ValueAsString("NoAju1"));
|
||||
invoice.saveEx();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -834,13 +834,11 @@ public abstract class MID_CreateFromShipment extends CreateFrom
|
|||
inout.setC_Activity_ID(p_order.getC_Activity_ID());
|
||||
inout.setUser1_ID(p_order.getUser1_ID());
|
||||
inout.setUser2_ID(p_order.getUser2_ID());
|
||||
inout.set_ValueOfColumn("RegisterDate", (Timestamp) p_order.get_Value("RegisterDate") == null ? null : (Timestamp)p_order.get_Value("RegisterDate"));
|
||||
inout.set_ValueOfColumn("RegisterNo", p_order.get_ValueAsString("RegisterNo") == null ? null : p_order.get_ValueAsString("RegisterNo"));
|
||||
inout.set_ValueOfColumn("MID_AJUDocumentType_ID", p_order.get_ValueAsInt("MID_AJUDocumentType_ID"));
|
||||
inout.set_ValueOfColumn("noaju1", p_order.get_ValueAsString("noaju1") == null ? null : p_order.get_ValueAsString("noaju1"));
|
||||
inout.set_ValueOfColumn("noaju2", p_order.get_ValueAsString("noaju2") == null ? null : p_order.get_ValueAsString("noaju2"));
|
||||
inout.set_ValueOfColumn("noaju3", p_order.get_ValueAsString("noaju3") == null ? null : p_order.get_ValueAsString("noaju3"));
|
||||
inout.set_ValueOfColumn("noaju4", p_order.get_ValueAsString("noaju4") == null ? null : p_order.get_ValueAsString("noaju4"));
|
||||
inout.set_ValueNoCheck("RegisterDate", (Timestamp) p_order.get_Value("RegisterDate") == null ? null : (Timestamp)p_order.get_Value("RegisterDate"));
|
||||
inout.set_ValueNoCheck("RegisterNo", p_order.get_ValueAsString("RegisterNo") == null ? null : p_order.get_ValueAsString("RegisterNo"));
|
||||
if(p_order.get_ValueAsInt("MID_AJUDocumentType_ID")>0)
|
||||
inout.set_ValueNoCheck("MID_AJUDocumentType_ID", p_order.get_ValueAsInt("MID_AJUDocumentType_ID"));
|
||||
inout.set_ValueNoCheck("NoAju1", p_order.get_ValueAsString("noaju1") == null ? null : p_order.get_ValueAsString("noaju1"));
|
||||
|
||||
if ( p_order.isDropShip() )
|
||||
{
|
||||
|
|
@ -862,10 +860,7 @@ public abstract class MID_CreateFromShipment extends CreateFrom
|
|||
inout.setC_Activity_ID(m_invoice.getC_Activity_ID());
|
||||
inout.setUser1_ID(m_invoice.getUser1_ID());
|
||||
inout.setUser2_ID(m_invoice.getUser2_ID());
|
||||
inout.set_ValueOfColumn("noaju1", m_invoice.get_ValueAsString("noaju1") == null ? null : m_invoice.get_ValueAsString("noaju1"));
|
||||
inout.set_ValueOfColumn("noaju2", m_invoice.get_ValueAsString("noaju2") == null ? null : m_invoice.get_ValueAsString("noaju2"));
|
||||
inout.set_ValueOfColumn("noaju3", m_invoice.get_ValueAsString("noaju3") == null ? null : m_invoice.get_ValueAsString("noaju3"));
|
||||
inout.set_ValueOfColumn("noaju4", m_invoice.get_ValueAsString("noaju4") == null ? null : m_invoice.get_ValueAsString("noaju4"));
|
||||
inout.set_ValueNoCheck("NoAju1", m_invoice.get_ValueAsString("NoAju1") == null ? null : m_invoice.get_ValueAsString("NoAju1"));
|
||||
}
|
||||
if (m_rma != null && m_rma.getM_RMA_ID() != 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,11 +3,15 @@ package andromedia.midsuit.process;
|
|||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.Iterator;
|
||||
|
||||
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.process.ProcessInfoParameter;
|
||||
import org.compiere.process.SvrProcess;
|
||||
|
||||
|
|
@ -30,6 +34,27 @@ public class MID_UploadPEB extends SvrProcess{
|
|||
@Override
|
||||
protected String doIt() throws Exception {
|
||||
File TPB = new File(p_File);
|
||||
int formatIndex = TPB.getName().lastIndexOf(".");
|
||||
|
||||
if(TPB.getName().substring(formatIndex).equalsIgnoreCase("xls") ||
|
||||
TPB.getName().substring(formatIndex).equalsIgnoreCase("xls")){
|
||||
readExcel(TPB);
|
||||
}else{
|
||||
|
||||
readAccess(TPB);
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
|
||||
private void readExcel(File TPB) throws Exception{
|
||||
Workbook workbook = WorkbookFactory.create(TPB);
|
||||
Sheet header = workbook.getSheet("Header");
|
||||
Iterator<Row> rows = header.rowIterator();
|
||||
int rowNum = 0;
|
||||
}
|
||||
|
||||
private void readAccess(File TPB) throws Exception{
|
||||
Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
|
||||
UcanaccessDriver driver = new UcanaccessDriver();
|
||||
String databaseURL = "jdbc:ucanaccess://"+TPB.getPath()+";jackcessOpener=andromedia.midsuit.process.CryptCodecOpener";
|
||||
|
|
@ -47,9 +72,7 @@ public class MID_UploadPEB extends SvrProcess{
|
|||
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import org.compiere.util.Msg;
|
|||
public class MID_UploadTPB extends SvrProcess{
|
||||
|
||||
String p_File = "";
|
||||
int p_C_DocType_ID = 0;
|
||||
@Override
|
||||
protected void prepare() {
|
||||
// TODO Auto-generated method stub
|
||||
|
|
@ -33,6 +34,8 @@ public class MID_UploadTPB extends SvrProcess{
|
|||
{
|
||||
if(para[i].getParameterName().equals("FileName"))
|
||||
p_File = para[i].getParameterAsString();
|
||||
if(para[i].getParameterName().equals("C_DocType_ID"))
|
||||
p_C_DocType_ID = para[i].getParameterAsInt();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -68,11 +71,11 @@ public class MID_UploadTPB extends SvrProcess{
|
|||
int C_Currency_ID = DB.getSQLValue(get_TrxName(), "SELECT C_Currency_ID FROM C_Currency WHERE ISO_Code =? ", new Object[] { 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();
|
||||
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 =?", new Object[] { C_Currency_ID, getAD_Client_ID() });
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -151,17 +151,12 @@ public class MID_OrderValidator {
|
|||
|
||||
private static String beforeChange(MOrder order) {
|
||||
if (order.isSOTrx()) return "";
|
||||
if(order.get_ValueAsString("NoAju1").equals("") || order.get_ValueAsString("NoAju2").equals("")
|
||||
|| order.get_ValueAsString("NoAju3").equals("") || order.get_ValueAsString("NoAju4").equals("")) {
|
||||
if(order.get_ValueAsString("NoAju1").equals("")) {
|
||||
DB.executeUpdateEx("UPDATE C_OrderLine SET NoAju = ? WHERE C_Order_ID = ?",
|
||||
new Object[] { "", order.getC_Order_ID() }, order.get_TrxName());
|
||||
}
|
||||
else if(order.is_ValueChanged("NoAju1") || order.is_ValueChanged("NoAju3") ||
|
||||
order.is_ValueChanged("NoAju2") || order.is_ValueChanged("NoAju4")) {
|
||||
String noAju = order.get_ValueAsString("NoAju1")+"/"
|
||||
+ order.get_ValueAsString("NoAju2") + "/"
|
||||
+ order.get_ValueAsString("NoAju3") + "/"
|
||||
+ order.get_ValueAsString("NoAju4");
|
||||
else if(order.is_ValueChanged("NoAju1")) {
|
||||
String noAju = order.get_ValueAsString("NoAju1");
|
||||
DB.executeUpdateEx("UPDATE C_OrderLine SET NoAju = ? WHERE C_Order_ID = ?",
|
||||
new Object[] { noAju, order.getC_Order_ID() }, order.get_TrxName());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,26 +22,10 @@ public class EDI_CalloutOrderLine extends CalloutEngine implements IColumnCallou
|
|||
if(value==null)
|
||||
return null;
|
||||
MOrder Order = new MOrder(ctx, (int) mTab.getValue(X_C_OrderLine.COLUMNNAME_C_Order_ID), null);
|
||||
// MProduct Product = new MProduct(ctx, (int)value, null);
|
||||
String retValue = Order.get_ValueAsString("NoAju1") + "/"
|
||||
+ Order.get_ValueAsString("NoAju2") + "/"
|
||||
+ Order.get_ValueAsString("NoAju3") + "/"
|
||||
+ Order.get_ValueAsString("NoAju4") + "";
|
||||
String retValue = Order.get_ValueAsString("NoAju1");
|
||||
|
||||
mTab.setValue("NoAju", retValue);
|
||||
|
||||
// String sqlExec = "SELECT M_AttributeSetInstance_ID " +
|
||||
// " FROM M_Storage S " +
|
||||
// " WHERE M_Product_ID = ? AND " +
|
||||
// " DateMaterialPolicy = (SELECT MIN(DateMaterialPolicy) FROM M_StorageOnHand SOH " +
|
||||
// " WHERE SOH.QtyOnHand>0 AND M_AttributeSetInstance_ID > 0 AND M_Product_ID = S.M_Product_ID)";
|
||||
// int M_AttributeSetInstance_ID = DB.getSQLValueEx(null, sqlExec, new Object[] { Product.getM_Product_ID() });
|
||||
// if(M_AttributeSetInstance_ID>0)
|
||||
// mTab.setValue(X_C_OrderLine.COLUMNNAME_M_AttributeSetInstance_ID, M_AttributeSetInstance_ID);
|
||||
// else
|
||||
mTab.setValue(X_C_OrderLine.COLUMNNAME_M_AttributeSetInstance_ID, 0);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue