From: Jorg J. <jj...@us...> - 2003-08-19 05:57:55
|
Update of /cvsroot/compiere/base/src/org/compiere/process In directory sc8-pr-cvs1:/tmp/cvs-serv28544/src/org/compiere/process Modified Files: ImportInvoice.java ImportOrder.java Added Files: ImportBankStatement.java ImportGLJournal.java ImportInventory.java Log Message: . --- NEW FILE: ImportBankStatement.java --- /****************************************************************************** * The contents of this file are subject to the Compiere License Version 1.1 * ("License"); You may not use this file except in compliance with the License * You may obtain a copy of the License at http://www.compiere.org/license.html * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * The Original Code is Compiere ERP & CRM Business Solution * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc. * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved. * Contributor(s): ______________________________________. *****************************************************************************/ package org.compiere.process; import java.sql.*; import java.math.*; import org.compiere.model.*; import org.compiere.util.DB; /** * Import Bank Statement from I_BankStatement * * @author Jorg Janke * @version $Id: ImportBankStatement.java,v 1.1 2003/08/19 05:57:52 jjanke Exp $ */ public class ImportBankStatement extends SvrProcess { /** Client to be imported to */ private int m_AD_Client_ID = 0; /** Organization to be imported to */ private int m_AD_Org_ID = 0; /** Default Bank Account */ private int m_C_BankAccount_ID = 0; /** Delete old Imported */ private boolean m_deleteOldImported = false; /** * 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("AD_Client_ID")) m_AD_Client_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("AD_Org_ID")) m_AD_Org_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("C_BankAccount_ID")) m_C_BankAccount_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("DeleteOldImported")) m_deleteOldImported = "Y".equals(para[i].getParameter()); else log.error("prepare - Unknown Parameter: " + name); } } // prepare /** * Perrform process. * @return Message * @throws Exception */ protected String doIt() throws java.lang.Exception { StringBuffer sql = null; int no = 0; String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; // **** Prepare **** // Delete Old Imported if (m_deleteOldImported) { sql = new StringBuffer ("DELETE I_BankStatement " + "WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Delete Old Impored =" + no); } // Set Client, Org, IsActive, Created/Updated sql = new StringBuffer ("UPDATE I_BankStatement " + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append (")," + " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),"); sql.append(" IsActive = COALESCE (IsActive, 'Y')," + " Created = COALESCE (Created, SysDate)," + " CreatedBy = COALESCE (CreatedBy, 0)," + " Updated = COALESCE (Updated, SysDate)," + " UpdatedBy = COALESCE (UpdatedBy, 0)," + " I_ErrorMsg = NULL," + " I_IsImported = 'N' " + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate (sql.toString ()); log.info ("doIt - Reset=" + no); sql = new StringBuffer ("UPDATE I_BankStatement o " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - Invalid Org=" + no); throw new IllegalStateException("Not implemented yet"); } // doIt } // ImportBankStatement --- NEW FILE: ImportGLJournal.java --- /****************************************************************************** * The contents of this file are subject to the Compiere License Version 1.1 * ("License"); You may not use this file except in compliance with the License * You may obtain a copy of the License at http://www.compiere.org/license.html * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * The Original Code is Compiere ERP & CRM Business Solution * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc. * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved. * Contributor(s): ______________________________________. *****************************************************************************/ package org.compiere.process; import java.sql.*; import java.math.*; import org.compiere.model.*; import org.compiere.util.DB; /** * Import GL Journal Batch/JournalLine from I_Journal * * @author Jorg Janke * @version $Id: ImportGLJournal.java,v 1.1 2003/08/19 05:57:52 jjanke Exp $ */ public class ImportGLJournal extends SvrProcess { /** Client to be imported to */ private int m_AD_Client_ID = 0; /** Organization to be imported to */ private int m_AD_Org_ID = 0; /** Acct Schema to be imported to */ private int m_C_AcctSchema_ID = 0; /** Default Date */ private Timestamp m_DateAcct = null; /** Delete old Imported */ private boolean m_deleteOldImported = false; /** * 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("AD_Client_ID")) m_AD_Client_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("AD_Org_ID")) m_AD_Org_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("C_AcctSchema_ID")) m_C_AcctSchema_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("DateAcct")) m_DateAcct = (Timestamp)para[i].getParameter(); else if (name.equals("DeleteOldImported")) m_deleteOldImported = "Y".equals(para[i].getParameter()); else log.error("prepare - Unknown Parameter: " + name); } } // prepare /** * Perrform process. * @return Message * @throws Exception */ protected String doIt() throws java.lang.Exception { StringBuffer sql = null; int no = 0; String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; // **** Prepare **** // Delete Old Imported if (m_deleteOldImported) { sql = new StringBuffer ("DELETE I_GLJournal " + "WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Delete Old Impored =" + no); } // Set Client, Org, AcctSchema, DatAcct, IsActive, Created/Updated sql = new StringBuffer ("UPDATE I_GLJournal " + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append (")," + " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),"); if (m_C_AcctSchema_ID != 0) sql.append(" C_AcctSchema_ID = COALESCE (C_AcctSchema_ID,").append (m_C_AcctSchema_ID).append ("),"); if (m_DateAcct != null) sql.append(" DateAcct = COALESCE (DateAcct,").append (DB.TO_DATE(m_DateAcct)).append ("),"); sql.append(" IsActive = COALESCE (IsActive, 'Y')," + " Created = COALESCE (Created, SysDate)," + " CreatedBy = COALESCE (CreatedBy, 0)," + " Updated = COALESCE (Updated, SysDate)," + " UpdatedBy = COALESCE (UpdatedBy, 0)," + " I_ErrorMsg = NULL," + " I_IsImported = 'N' " + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate (sql.toString ()); log.info ("doIt - Reset=" + no); sql = new StringBuffer ("UPDATE I_GLJournal o " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - Invalid Org=" + no); /*********************************************************************/ int noInsert = 0; int noInsertJournal = 0; int noInsertLine = 0; MJournalBatch batch = null; MJournal journal = null; // Go through Journal Records sql = new StringBuffer ("SELECT * FROM I_GLJournal " + "WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY 1"); // @@@@@ try { PreparedStatement pstmt = DB.prepareStatement (sql.toString ()); ResultSet rs = pstmt.executeQuery (); // while (rs.next()) { X_I_GLJournal imp = new X_I_GLJournal (getCtx (), rs); // Batch if (batch == null) { batch = new MJournalBatch (getCtx(), 0); // if (!batch.save()) { log.error("doIt - Batch not saved"); break; } noInsert++; journal = null; } // Journal if (journal == null) { journal = new MJournal (getCtx(), 0); // if (!journal.save()) { log.error("doIt - Journal not saved"); break; } noInsertJournal++; } // Line MJournalLine line = new MJournalLine (getCtx(), 0); // if (line.save()) { imp.setI_IsImported(true); imp.setProcessed(true); if (imp.save()) noInsertLine++; } } // while records rs.close(); pstmt.close(); } catch (Exception e) { log.error("doIt", e); } // Set Error to indicator to not imported sql = new StringBuffer ("UPDATE I_GLJournal " + "SET I_IsImported='N', Updated=SysDate " + "WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString()); addLog (0, null, new BigDecimal (no), "@Errors@"); // addLog (0, null, new BigDecimal (noInsert), "@GL_JournalBatch_ID@: @Inserted@"); addLog (0, null, new BigDecimal (noInsertJournal), "@GL_Journal_ID@: @Inserted@"); addLog (0, null, new BigDecimal (noInsertLine), "@GL_JournalLine_ID@: @Inserted@"); return ""; } // doIt } // ImportGLJournal --- NEW FILE: ImportInventory.java --- /****************************************************************************** * The contents of this file are subject to the Compiere License Version 1.1 * ("License"); You may not use this file except in compliance with the License * You may obtain a copy of the License at http://www.compiere.org/license.html * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for * the specific language governing rights and limitations under the License. * The Original Code is Compiere ERP & CRM Business Solution * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc. * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts * created by ComPiere are Copyright (C) ComPiere, Inc.; All Rights Reserved. * Contributor(s): ______________________________________. *****************************************************************************/ package org.compiere.process; import java.sql.*; import java.math.*; import org.compiere.model.*; import org.compiere.util.*; /** * Import Physical Inventory fom I_Inventory * * @author Jorg Janke * @version $Id: ImportInventory.java,v 1.1 2003/08/19 05:57:52 jjanke Exp $ */ public class ImportInventory extends SvrProcess { /** Client to be imported to */ private int m_AD_Client_ID = 0; /** Organization to be imported to */ private int m_AD_Org_ID = 0; /** Location to be imported to */ private int m_M_Location_ID = 0; /** Default Date */ private Timestamp m_MovementDate = null; /** Delete old Imported */ private boolean m_deleteOldImported = false; /** * 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("AD_Client_ID")) m_AD_Client_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("AD_Org_ID")) m_AD_Org_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("M_Location_ID")) m_M_Location_ID = ((BigDecimal)para[i].getParameter()).intValue(); else if (name.equals("MovementDate")) m_MovementDate = (Timestamp)para[i].getParameter(); else if (name.equals("DeleteOldImported")) m_deleteOldImported = "Y".equals(para[i].getParameter()); else log.error("prepare - Unknown Parameter: " + name); } } // prepare /** * Perrform process. * @return Message * @throws Exception */ protected String doIt() throws java.lang.Exception { StringBuffer sql = null; int no = 0; String clientCheck = " AND AD_Client_ID=" + m_AD_Client_ID; // **** Prepare **** // Delete Old Imported if (m_deleteOldImported) { sql = new StringBuffer ("DELETE I_Inventory " + "WHERE I_IsImported='Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Delete Old Impored =" + no); } // Set Client, Org, Location, IsActive, Created/Updated sql = new StringBuffer ("UPDATE I_Inventory " + "SET AD_Client_ID = COALESCE (AD_Client_ID,").append (m_AD_Client_ID).append (")," + " AD_Org_ID = COALESCE (AD_Org_ID,").append (m_AD_Org_ID).append ("),"); if (m_M_Location_ID != 0) sql.append(" M_Location_ID = COALESCE (M_Location_ID,").append (m_M_Location_ID).append ("),"); if (m_MovementDate != null) sql.append(" MovementDate = COALESCE (MovementDate,").append (DB.TO_DATE(m_MovementDate)).append ("),"); sql.append(" IsActive = COALESCE (IsActive, 'Y')," + " Created = COALESCE (Created, SysDate)," + " CreatedBy = COALESCE (CreatedBy, 0)," + " Updated = COALESCE (Updated, SysDate)," + " UpdatedBy = COALESCE (UpdatedBy, 0)," + " I_ErrorMsg = NULL," + " M_Warehouse_ID = NULL," // reset + " I_IsImported = 'N' " + "WHERE I_IsImported<>'Y' OR I_IsImported IS NULL"); no = DB.executeUpdate (sql.toString ()); log.info ("doIt - Reset=" + no); sql = new StringBuffer ("UPDATE I_Inventory o " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=Invalid Org, '" + "WHERE (AD_Org_ID IS NULL OR AD_Org_ID=0" + " OR EXISTS (SELECT * FROM AD_Org oo WHERE o.AD_Org_ID=oo.AD_Org_ID AND (oo.IsSummary='Y' OR oo.IsActive='N')))" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - Invalid Org=" + no); // Location sql = new StringBuffer ("UPDATE I_Inventory i " + "SET M_Locator_ID=(SELECT M_Locator_ID FROM M_Locator l" + " WHERE i.LocatorValue=l.Value AND i.AD_Client_ID=l.AD_Client_ID AND ROWNUM=1) " + "WHERE M_Locator_ID IS NULL AND LocatorValue IS NOT NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug("doIt - Set Locator from Value =" + no); sql = new StringBuffer ("UPDATE I_Inventory i " + "SET M_Locator_ID=(SELECT M_Locator_ID FROM M_Locator l" + " WHERE i.X=l.X AND i.Y=l.Y AND i.Z=l.Z AND i.AD_Client_ID=l.AD_Client_ID AND ROWNUM=1) " + "WHERE M_Locator_ID IS NULL AND X IS NOT NULL AND Y IS NOT NULL AND Z IS NOT NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug("doIt - Set Locator from X,Y,Z =" + no); sql = new StringBuffer ("UPDATE I_Inventory " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Location, ' " + "WHERE M_Location_ID IS NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - No Location=" + no); // Set M_Warehouse_ID sql = new StringBuffer ("UPDATE I_Inventory i " + "SET M_Warehouse_ID=(SELECT M_Warehouse_ID FROM M_Locator l WHERE i.M_Locator_ID=l.M_Locator_ID) " + "WHERE M_Locator_ID IS NOT NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug("doIt - Set Warehouse from Locator =" + no); sql = new StringBuffer ("UPDATE I_Inventory " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Warehouse, ' " + "WHERE M_Warehouse_ID IS NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - No Warehouse=" + no); // Product sql = new StringBuffer ("UPDATE I_Inventory i " + "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p" + " WHERE i.Value=p.Value AND i.AD_Client_ID=p.AD_Client_ID AND ROWNUM=1) " + "WHERE M_Product_ID IS NULL AND Value IS NOT NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug("doIt - Set Product from Value=" + no); sql = new StringBuffer ("UPDATE I_Inventory i " + "SET M_Product_ID=(SELECT M_Product_ID FROM M_Product p" + " WHERE i.UPC=p.UPC AND i.AD_Client_ID=p.AD_Client_ID AND ROWNUM=1) " + "WHERE M_Product_ID IS NULL AND UPC IS NOT NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug("doIt - Set Product from UPC=" + no); sql = new StringBuffer ("UPDATE I_Inventory " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Product, ' " + "WHERE M_Product_ID IS NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - No Product=" + no); // No QtyCount sql = new StringBuffer ("UPDATE I_Inventory " + "SET I_IsImported='E', I_ErrorMsg=I_ErrorMsg||'ERR=No Qty Count, ' " + "WHERE QtyCount IS NULL" + " AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); if (no != 0) log.warn ("doIt - No QtyCount=" + no); /*********************************************************************/ MInventory inventory = null; int noInsert = 0; int noInsertLine = 0; // Go through Inventory Records sql = new StringBuffer ("SELECT * FROM I_Inventory " + "WHERE I_IsImported='N'").append (clientCheck) .append(" ORDER BY M_Warehouse_ID, TRUNC(MovementDate), I_Inventory_ID"); try { PreparedStatement pstmt = DB.prepareStatement (sql.toString ()); ResultSet rs = pstmt.executeQuery (); // int x_M_Warehouse_ID = -1; Timestamp x_MovementDate = null; while (rs.next()) { X_I_Inventory imp = new X_I_Inventory (getCtx (), rs); Timestamp MovementDate = TimeUtil.getDay(imp.getMovementDate()); if (inventory == null || imp.getM_Warehouse_ID() != x_M_Warehouse_ID || !MovementDate.equals(x_MovementDate)) { inventory = new MInventory (getCtx(), 0); inventory.setName("I " + imp.getM_Warehouse_ID() + " " + MovementDate); inventory.setM_Warehouse_ID(imp.getM_Warehouse_ID()); inventory.setMovementDate(MovementDate); if (!inventory.save()) { log.error("doIt - Inventory not saved"); break; } x_M_Warehouse_ID = imp.getM_Warehouse_ID(); x_MovementDate = MovementDate; noInsert++; } // Line MInventoryLine line = new MInventoryLine (inventory, imp.getM_Locator_ID(), imp.getM_Product_ID(), imp.getQtyBook(), imp.getQtyCount()); if (line.save()) { imp.setI_IsImported(true); imp.setM_Inventory_ID(line.getM_Inventory_ID()); imp.setM_InventoryLine_ID(line.getM_InventoryLine_ID()); imp.setProcessed(true); if (imp.save()) noInsertLine++; } } rs.close(); pstmt.close(); } catch (Exception e) { log.error("doIt", e); } // Set Error to indicator to not imported sql = new StringBuffer ("UPDATE I_Inventory " + "SET I_IsImported='N', Updated=SysDate " + "WHERE I_IsImported<>'Y'").append(clientCheck); no = DB.executeUpdate(sql.toString()); addLog (0, null, new BigDecimal (no), "@Errors@"); // addLog (0, null, new BigDecimal (noInsert), "@M_Inventory_ID@: @Inserted@"); addLog (0, null, new BigDecimal (noInsertLine), "@M_InventoryLine_ID@: @Inserted@"); return ""; } // doIt } // ImportInventory Index: ImportInvoice.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/process/ImportInvoice.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ImportInvoice.java 4 Aug 2003 03:54:46 -0000 1.2 --- ImportInvoice.java 19 Aug 2003 05:57:52 -0000 1.3 *************** *** 136,140 **** + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" + " AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) " ! + "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Set DocType=" + no); --- 136,141 ---- + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" + " AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) " ! //+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); ! + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Set DocType=" + no); *************** *** 524,527 **** --- 525,529 ---- invoice = new MInvoice (getCtx(), 0); invoice.setC_DocTypeTarget_ID(imp.getC_DocType_ID()); + invoice.setIsSOTrx(imp.isSOTrx()); if (imp.getDocumentNo() != null) invoice.setDocumentNo(imp.getDocumentNo()); *************** *** 534,538 **** if (imp.getDescription() != null) invoice.setDescription(imp.getDescription()); - // Invoice.setIsSOTrx(imp.isSOTrx()); invoice.setC_PaymentTerm_ID(imp.getC_PaymentTerm_ID()); invoice.setM_PriceList_ID(imp.getM_PriceList_ID()); --- 536,539 ---- Index: ImportOrder.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/process/ImportOrder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ImportOrder.java 18 Aug 2003 15:48:03 -0000 1.5 --- ImportOrder.java 19 Aug 2003 05:57:52 -0000 1.6 *************** *** 136,140 **** + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" + " AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) " ! + "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Set DocType=" + no); --- 136,141 ---- + "SET C_DocType_ID=(SELECT C_DocType_ID FROM C_DocType d WHERE d.Name=o.DocTypeName" + " AND d.DocBaseType IN ('SOO','POO') AND o.AD_Client_ID=d.AD_Client_ID) " ! //+ "WHERE C_DocType_ID IS NULL AND IsSOTrx IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); ! + "WHERE C_DocType_ID IS NULL AND DocTypeName IS NOT NULL AND I_IsImported<>'Y'").append (clientCheck); no = DB.executeUpdate (sql.toString ()); log.debug ("doIt - Set DocType=" + no); *************** *** 561,564 **** --- 562,566 ---- order = new MOrder (getCtx(), 0); order.setC_DocTypeTarget_ID(imp.getC_DocType_ID()); + order.setIsSOTrx(imp.isSOTrx()); if (imp.getDocumentNo() != null) order.setDocumentNo(imp.getDocumentNo()); *************** *** 572,576 **** if (imp.getDescription() != null) order.setDescription(imp.getDescription()); - // order.setIsSOTrx(imp.isSOTrx()); order.setC_PaymentTerm_ID(imp.getC_PaymentTerm_ID()); order.setM_PriceList_ID(imp.getM_PriceList_ID()); --- 574,577 ---- |