From: Jorg J. <jj...@us...> - 2005-05-30 02:32:58
|
Update of /cvsroot/compiere/base/src/org/compiere/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18436/src/org/compiere/model Modified Files: MProjectIssue.java MOrder.java MAttributeSetInstance.java MInOut.java MStorage.java Log Message: Index: MProjectIssue.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MProjectIssue.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** MProjectIssue.java 28 May 2005 21:03:00 -0000 1.9 --- MProjectIssue.java 30 May 2005 02:32:47 -0000 1.10 *************** *** 140,144 **** MLocator loc = MLocator.get(getCtx(), getM_Locator_ID()); if (MStorage.add(getCtx(), getM_Locator_ID(), loc.getM_Warehouse_ID(), ! getM_Product_ID(), getM_AttributeSetInstance_ID(), getMovementQty().negate(), null, null, get_TrxName())) { --- 140,144 ---- MLocator loc = MLocator.get(getCtx(), getM_Locator_ID()); if (MStorage.add(getCtx(), getM_Locator_ID(), loc.getM_Warehouse_ID(), ! getM_Product_ID(), getM_AttributeSetInstance_ID(), getM_AttributeSetInstance_ID(), getMovementQty().negate(), null, null, get_TrxName())) { *************** *** 149,159 **** return true; else ! log.log(Level.SEVERE, "process - Issue not saved"); // requires trx !! } else ! log.log(Level.SEVERE, "process - Transaction not saved"); // requires trx !! } else ! log.log(Level.SEVERE, "process - Storage not updated"); // OK // return false; --- 149,159 ---- return true; else ! log.log(Level.SEVERE, "Issue not saved"); // requires trx !! } else ! log.log(Level.SEVERE, "Transaction not saved"); // requires trx !! } else ! log.log(Level.SEVERE, "Storage not updated"); // OK // return false; Index: MOrder.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MOrder.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** MOrder.java 28 May 2005 21:03:00 -0000 1.92 --- MOrder.java 30 May 2005 02:32:48 -0000 1.93 *************** *** 1367,1371 **** MOrderLine line = lines[i]; // Check/set WH/Org ! if (header_M_Warehouse_ID != 0) { if (header_M_Warehouse_ID != line.getM_Warehouse_ID()) --- 1367,1371 ---- MOrderLine line = lines[i]; // Check/set WH/Org ! if (header_M_Warehouse_ID != 0) // enforce WH { if (header_M_Warehouse_ID != line.getM_Warehouse_ID()) *************** *** 1408,1412 **** // Update Storage if (!MStorage.add(getCtx(), line.getM_Warehouse_ID(), M_Locator_ID, ! line.getM_Product_ID(), line.getM_AttributeSetInstance_ID(), Env.ZERO, reserved, ordered, get_TrxName())) { --- 1408,1413 ---- // Update Storage if (!MStorage.add(getCtx(), line.getM_Warehouse_ID(), M_Locator_ID, ! line.getM_Product_ID(), ! line.getM_AttributeSetInstance_ID(), line.getM_AttributeSetInstance_ID(), Env.ZERO, reserved, ordered, get_TrxName())) { Index: MAttributeSetInstance.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MAttributeSetInstance.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MAttributeSetInstance.java 29 May 2005 05:48:10 -0000 1.14 --- MAttributeSetInstance.java 30 May 2005 02:32:48 -0000 1.15 *************** *** 172,180 **** // Lot if (m_mas.isLot() && getLot() != null) ! { ! if (sb.length() > 0) ! sb.append("_"); ! sb.append("\u013D").append(getLot ()); ! } // GuaranteeDate if (m_mas.isGuaranteeDate() && getGuaranteeDate() != null) --- 172,176 ---- // Lot if (m_mas.isLot() && getLot() != null) ! sb.append("«").append(getLot()).append("»"); // GuaranteeDate if (m_mas.isGuaranteeDate() && getGuaranteeDate() != null) *************** *** 182,186 **** if (sb.length() > 0) sb.append("_"); ! sb.append (m_dateFormat.format (getGuaranteeDate())); } // Instance Attribute Values --- 178,182 ---- if (sb.length() > 0) sb.append("_"); ! sb.append (m_dateFormat.format(getGuaranteeDate())); } // Instance Attribute Values Index: MInOut.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MInOut.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** MInOut.java 29 May 2005 06:34:11 -0000 1.64 --- MInOut.java 30 May 2005 02:32:48 -0000 1.65 *************** *** 1082,1086 **** ol = new MOrderLine (getCtx(), sLine.getC_OrderLine_ID(), get_TrxName()); log.fine("OrderLine - Reserved=" + ol.getQtyReserved() ! + ", Delivered=" + ol.getQtyReserved()); if (isSOTrx()) QtySO = sLine.getMovementQty(); --- 1082,1086 ---- ol = new MOrderLine (getCtx(), sLine.getC_OrderLine_ID(), get_TrxName()); log.fine("OrderLine - Reserved=" + ol.getQtyReserved() ! + ", Delivered=" + ol.getQtyDelivered()); if (isSOTrx()) QtySO = sLine.getMovementQty(); *************** *** 1097,1100 **** --- 1097,1104 ---- log.fine("Material Transaction"); MTransaction mtrx = null; + int reservationAttributeSetInstance_ID = sLine.getM_AttributeSetInstance_ID(); + if (ol != null) + reservationAttributeSetInstance_ID = ol.getM_AttributeSetInstance_ID(); + // if (sLine.getM_AttributeSetInstance_ID() == 0) { *************** *** 1119,1123 **** if (!MStorage.add(getCtx(), getM_Warehouse_ID(), sLine.getM_Locator_ID(), ! sLine.getM_Product_ID(), ma.getM_AttributeSetInstance_ID(), QtyMA, QtySOMA.negate(), QtyPOMA.negate(), get_TrxName())) { --- 1123,1128 ---- if (!MStorage.add(getCtx(), getM_Warehouse_ID(), sLine.getM_Locator_ID(), ! sLine.getM_Product_ID(), ! ma.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, QtyMA, QtySOMA.negate(), QtyPOMA.negate(), get_TrxName())) { *************** *** 1144,1148 **** if (!MStorage.add(getCtx(), getM_Warehouse_ID(), sLine.getM_Locator_ID(), ! sLine.getM_Product_ID(), sLine.getM_AttributeSetInstance_ID(), Qty, QtySO.negate(), QtyPO.negate(), get_TrxName())) { --- 1149,1154 ---- if (!MStorage.add(getCtx(), getM_Warehouse_ID(), sLine.getM_Locator_ID(), ! sLine.getM_Product_ID(), ! sLine.getM_AttributeSetInstance_ID(), reservationAttributeSetInstance_ID, Qty, QtySO.negate(), QtyPO.negate(), get_TrxName())) { Index: MStorage.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MStorage.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MStorage.java 29 May 2005 05:48:10 -0000 1.21 --- MStorage.java 30 May 2005 02:32:48 -0000 1.22 *************** *** 312,316 **** * @param M_Locator_ID locator * @param M_Product_ID product ! * @param M_AttributeSetInstance_ID instance * @param diffQtyOnHand add on hand * @param diffQtyReserved add reserved --- 312,317 ---- * @param M_Locator_ID locator * @param M_Product_ID product ! * @param M_AttributeSetInstance_ID AS Instance ! * @param reservationAttributeSetInstance_ID reservation AS Instance * @param diffQtyOnHand add on hand * @param diffQtyReserved add reserved *************** *** 319,366 **** */ public static boolean add (Properties ctx, int M_Warehouse_ID, int M_Locator_ID, ! int M_Product_ID, int M_AttributeSetInstance_ID, BigDecimal diffQtyOnHand, BigDecimal diffQtyReserved, BigDecimal diffQtyOrdered, String trxName) { - int AttributeSetInstance_ID = M_AttributeSetInstance_ID; MStorage storage = null; StringBuffer diffText = new StringBuffer("("); - - // Outgoing Trx - with ASI - if (diffQtyOnHand.signum() < 0 && AttributeSetInstance_ID != 0) - { - storage = get(ctx, M_Locator_ID, - M_Product_ID, AttributeSetInstance_ID, trxName); - if (storage == null) // no storage exists - { - AttributeSetInstance_ID = 0; // Use no ASI - diffText.append("UseNoASI_For=") - .append(M_AttributeSetInstance_ID).append(" "); - } - } // Get Storage if (storage == null) storage = getCreate (ctx, M_Locator_ID, ! M_Product_ID, AttributeSetInstance_ID, trxName); // Verify if (storage.getM_Locator_ID() != M_Locator_ID && storage.getM_Product_ID() != M_Product_ID ! && storage.getM_AttributeSetInstance_ID() != AttributeSetInstance_ID) { s_log.severe ("No Storage found - M_Locator_ID=" + M_Locator_ID ! + ",M_Product_ID=" + M_Product_ID + ",ASI=" + AttributeSetInstance_ID); return false; } MStorage storage0 = null; ! if (AttributeSetInstance_ID != 0 // get Storage with no instance ! && (diffQtyOrdered.signum() != 0 || diffQtyReserved.signum() != 0) ! && (storage.getQtyOrdered().signum() == 0 || storage.getQtyReserved().signum() == 0)) { ! MWarehouse wh = MWarehouse.get(ctx, M_Warehouse_ID); ! int xM_Locator_ID = wh.getDefaultLocator().getM_Locator_ID(); ! storage0 = getCreate (ctx, xM_Locator_ID, M_Product_ID, 0, trxName); ! } ! boolean changed = false; if (diffQtyOnHand != null && diffQtyOnHand.compareTo(Env.ZERO) != 0) --- 320,356 ---- */ public static boolean add (Properties ctx, int M_Warehouse_ID, int M_Locator_ID, ! int M_Product_ID, int M_AttributeSetInstance_ID, int reservationAttributeSetInstance_ID, BigDecimal diffQtyOnHand, BigDecimal diffQtyReserved, BigDecimal diffQtyOrdered, String trxName) { MStorage storage = null; StringBuffer diffText = new StringBuffer("("); // Get Storage if (storage == null) storage = getCreate (ctx, M_Locator_ID, ! M_Product_ID, M_AttributeSetInstance_ID, trxName); // Verify if (storage.getM_Locator_ID() != M_Locator_ID && storage.getM_Product_ID() != M_Product_ID ! && storage.getM_AttributeSetInstance_ID() != M_AttributeSetInstance_ID) { s_log.severe ("No Storage found - M_Locator_ID=" + M_Locator_ID ! + ",M_Product_ID=" + M_Product_ID + ",ASI=" + M_AttributeSetInstance_ID); return false; } MStorage storage0 = null; ! if (M_AttributeSetInstance_ID != reservationAttributeSetInstance_ID) { ! storage0 = get(ctx, M_Locator_ID, ! M_Product_ID, reservationAttributeSetInstance_ID, trxName); ! if (storage0 == null) // create if not existing - should not happen ! { ! MWarehouse wh = MWarehouse.get(ctx, M_Warehouse_ID); ! int xM_Locator_ID = wh.getDefaultLocator().getM_Locator_ID(); ! storage0 = getCreate (ctx, xM_Locator_ID, ! M_Product_ID, reservationAttributeSetInstance_ID, trxName); ! } ! } boolean changed = false; if (diffQtyOnHand != null && diffQtyOnHand.compareTo(Env.ZERO) != 0) *************** *** 560,566 **** } // MStorage ! /** Log */ private static CLogger s_log = CLogger.getCLogger (MStorage.class); ! /** * Change Qty OnHand --- 550,558 ---- } // MStorage ! /** Log */ private static CLogger s_log = CLogger.getCLogger (MStorage.class); ! /** Warehouse */ ! private int m_M_Warehouse_ID = 0; ! /** * Change Qty OnHand *************** *** 578,582 **** } // changeQtyOnHand ! /** * String Representation --- 570,587 ---- } // changeQtyOnHand ! /** ! * Get M_Warehouse_ID of Locator ! * @return warehouse ! */ ! public int getM_Warehouse_ID() ! { ! if (m_M_Warehouse_ID == 0) ! { ! MLocator loc = MLocator.get(getCtx(), getM_Locator_ID()); ! m_M_Warehouse_ID = loc.getM_Warehouse_ID(); ! } ! return m_M_Warehouse_ID; ! } // getM_Warehouse_ID ! /** * String Representation |