hg merge release-2.1 (merge release2.1 into development)
This commit is contained in:
commit
a3ba251b49
|
@ -0,0 +1,16 @@
|
|||
SET SQLBLANKLINES ON
|
||||
SET DEFINE OFF
|
||||
|
||||
-- IDEMPIERE-2676 Incorrect context variables
|
||||
-- Jun 17, 2015 4:40:47 PM COT
|
||||
UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_DATE('2015-06-17 16:40:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2161
|
||||
;
|
||||
|
||||
-- IDEMPIERE-2676 Incorrect context variables
|
||||
-- Jun 22, 2015 12:50:04 PM COT
|
||||
UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_DATE('2015-06-22 12:50:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3484
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201506171641_IDEMPIERE-2676.sql') FROM dual
|
||||
;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
-- IDEMPIERE-2676 Incorrect context variables
|
||||
-- Jun 17, 2015 4:40:47 PM COT
|
||||
UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_TIMESTAMP('2015-06-17 16:40:47','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2161
|
||||
;
|
||||
|
||||
-- Jun 22, 2015 12:50:04 PM COT
|
||||
UPDATE AD_Column SET Callout='org.compiere.model.CalloutOrder.priceList', IsUpdateable='N',Updated=TO_TIMESTAMP('2015-06-22 12:50:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3484
|
||||
;
|
||||
|
||||
SELECT register_migration_script('201506171641_IDEMPIERE-2676.sql') FROM dual
|
||||
;
|
||||
|
|
@ -510,7 +510,7 @@ public class InOutGenerate extends SvrProcess
|
|||
throw new IllegalStateException("Could not create Shipment Line");
|
||||
if (log.isLoggable(Level.FINE)) log.fine("ToDeliver=" + qty + "/" + deliver + " - " + line);
|
||||
toDeliver = toDeliver.subtract(deliver);
|
||||
// Temp adjustment, actual update happen in MInOut.completeIt
|
||||
// Temp adjustment, actual update happen in MInOut.completeIt - just in memory - not saved
|
||||
storage.setQtyOnHand(storage.getQtyOnHand().subtract(deliver));
|
||||
//
|
||||
if (toDeliver.signum() == 0)
|
||||
|
|
|
@ -81,7 +81,7 @@ public class GridField
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -5875251339128387039L;
|
||||
private static final long serialVersionUID = 7859929653710975421L;
|
||||
|
||||
/**
|
||||
* Field Constructor.
|
||||
|
@ -851,8 +851,56 @@ public class GridField
|
|||
} // createDefault
|
||||
|
||||
/**
|
||||
* Validate initial Field Value.
|
||||
* Called from MTab.dataNew and MTab.setCurrentRow when inserting
|
||||
* Validate initial Field Value. Do not push direct value if it doesn't exist
|
||||
* Called from GridTab.dataNew when inserting
|
||||
* @return true if valid
|
||||
*/
|
||||
public boolean validateValueNoDirect()
|
||||
{
|
||||
// null
|
||||
if (m_value == null || m_value.toString().length() == 0)
|
||||
{
|
||||
if (isMandatory(true))
|
||||
{
|
||||
m_error = true;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
// Search not cached
|
||||
if (getDisplayType() == DisplayType.Search && m_lookup != null)
|
||||
{
|
||||
// need to re-set invalid values - OK BPartner in PO Line - not OK SalesRep in Invoice
|
||||
if (m_lookup.getDirect(m_value, false, true) == null)
|
||||
{
|
||||
if (log.isLoggable(Level.FINEST)) log.finest(m_vo.ColumnName + " Serach not valid - set to null");
|
||||
setValue(null, m_inserting);
|
||||
m_error = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// cannot be validated
|
||||
if (!isLookup()
|
||||
|| m_lookup == null
|
||||
|| m_lookup.containsKeyNoDirect(m_value))
|
||||
return true;
|
||||
// it's not null, a lookup and does not have the key
|
||||
if (isKey() || isParentValue()) // parents/ket are not validated
|
||||
return true;
|
||||
|
||||
if (log.isLoggable(Level.FINEST)) log.finest(m_vo.ColumnName + " - set to null");
|
||||
setValue(null, m_inserting);
|
||||
m_error = true;
|
||||
return false;
|
||||
} // validateValue
|
||||
|
||||
/**
|
||||
* Validate initial Field Value. Push direct value if it doesn't exist
|
||||
* Called from GridTab.setCurrentRow when inserting
|
||||
* @return true if valid
|
||||
*/
|
||||
public boolean validateValue()
|
||||
|
@ -896,8 +944,7 @@ public class GridField
|
|||
setValue(null, m_inserting);
|
||||
m_error = true;
|
||||
return false;
|
||||
} // validateValue
|
||||
|
||||
} // validateValuePushDirect
|
||||
|
||||
/**************************************************************************
|
||||
* Is the Column Visible ?
|
||||
|
|
|
@ -113,7 +113,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1151723870943569774L;
|
||||
private static final long serialVersionUID = 5446672147679386907L;
|
||||
|
||||
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
|
||||
|
||||
|
@ -1185,15 +1185,15 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
|||
return retValue;
|
||||
setCurrentRow(m_currentRow + 1, true);
|
||||
|
||||
// process all Callouts (no dependency check - assumed that settings are valid)
|
||||
for (int i = 0; i < getFieldCount(); i++)
|
||||
processCallout(getField(i));
|
||||
// check validity of defaults
|
||||
for (int i = 0; i < getFieldCount(); i++)
|
||||
{
|
||||
getField(i).refreshLookup();
|
||||
getField(i).validateValue();
|
||||
getField(i).validateValueNoDirect();
|
||||
}
|
||||
// process all Callouts (no dependency check - assumed that settings are valid)
|
||||
for (int i = 0; i < getFieldCount(); i++)
|
||||
processCallout(getField(i));
|
||||
m_mTable.setChanged(false);
|
||||
|
||||
fireStateChangeEvent(new StateChangeEvent(this, StateChangeEvent.DATA_NEW));
|
||||
|
@ -2542,12 +2542,14 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
|||
*/
|
||||
public int setCurrentRow (int newCurrentRow, boolean fireEvents)
|
||||
{
|
||||
boolean changingRow = (m_currentRow != newCurrentRow);
|
||||
int oldCurrentRow = m_currentRow;
|
||||
m_currentRow = verifyRow (newCurrentRow);
|
||||
if (log.isLoggable(Level.FINE)) log.fine("Row=" + m_currentRow + " - fire=" + fireEvents);
|
||||
|
||||
// Update Field Values
|
||||
int size = m_mTable.getColumnCount();
|
||||
GridField keyCalloutDelayed = null;
|
||||
for (int i = 0; i < size; i++)
|
||||
{
|
||||
GridField mField = m_mTable.getField(i);
|
||||
|
@ -2558,6 +2560,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
|||
mField.setValue(value, m_mTable.isInserting());
|
||||
if (m_mTable.isInserting()) // set invalid values to null
|
||||
mField.validateValue();
|
||||
if (mField.isKey())
|
||||
keyCalloutDelayed = mField;
|
||||
}
|
||||
else
|
||||
{ // no rows - set to a reasonable value - not updateable
|
||||
|
@ -2576,6 +2580,8 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
|||
mField.setValue();
|
||||
}
|
||||
}
|
||||
if (changingRow && keyCalloutDelayed != null)
|
||||
processCallout(keyCalloutDelayed);
|
||||
loadDependentInfo();
|
||||
|
||||
if (!fireEvents) // prevents informing twice
|
||||
|
|
|
@ -43,7 +43,7 @@ public abstract class Lookup extends AbstractListModel<Object>
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2811763289904455349L;
|
||||
private static final long serialVersionUID = -28200392264647953L;
|
||||
|
||||
/**
|
||||
* Lookup
|
||||
|
@ -382,6 +382,12 @@ public abstract class Lookup extends AbstractListModel<Object>
|
|||
*/
|
||||
public abstract boolean containsKey (Object key);
|
||||
|
||||
/**
|
||||
* The Lookup contains the key, do not push direct
|
||||
* @param key key
|
||||
* @return true if contains key
|
||||
*/
|
||||
public abstract boolean containsKeyNoDirect (Object key);
|
||||
|
||||
/**************************************************************************
|
||||
* Refresh Values - default implementation
|
||||
|
|
|
@ -39,7 +39,7 @@ public final class MAccountLookup extends Lookup implements Serializable
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5565166586045152280L;
|
||||
private static final long serialVersionUID = -6307559127917670193L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -103,6 +103,11 @@ public final class MAccountLookup extends Lookup implements Serializable
|
|||
return load (intValue);
|
||||
} // containsKey
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Description
|
||||
* @return Description
|
||||
|
|
|
@ -37,7 +37,7 @@ public final class MLocationLookup extends Lookup
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -7335118019935048922L;
|
||||
private static final long serialVersionUID = 7238110708451510319L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -95,6 +95,10 @@ public final class MLocationLookup extends Lookup
|
|||
return getLocation(key, null) != null;
|
||||
} // containsKey
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Get Location
|
||||
|
|
|
@ -48,7 +48,7 @@ public final class MLocatorLookup extends Lookup implements Serializable
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 8932848190660391496L;
|
||||
private static final long serialVersionUID = -6041455174391573888L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -208,6 +208,11 @@ public final class MLocatorLookup extends Lookup implements Serializable
|
|||
return m_lookup.containsKey(key);
|
||||
} // containsKey
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Data Direct from Table
|
||||
* @param keyValue integer key value
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class MLookup extends Lookup implements Serializable
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5784044288965615466L;
|
||||
private static final long serialVersionUID = 2228200000988048623L;
|
||||
|
||||
/**
|
||||
* MLookup Constructor
|
||||
|
@ -179,7 +179,7 @@ public final class MLookup extends Lookup implements Serializable
|
|||
* @param key key (Integer for Keys or String for Lists)
|
||||
* @return value
|
||||
*/
|
||||
public NamePair get (Object key)
|
||||
public NamePair get (Object key, boolean includeDirect)
|
||||
{
|
||||
if (key == null || MINUS_ONE.equals(key)) // indicator for null
|
||||
return null;
|
||||
|
@ -212,11 +212,23 @@ public final class MLookup extends Lookup implements Serializable
|
|||
return retValue;
|
||||
}
|
||||
|
||||
// Try to get it directly
|
||||
boolean cacheLocal = m_info.IsValidated ;
|
||||
return getDirect(key, false, cacheLocal); // do NOT cache
|
||||
if (includeDirect) {
|
||||
// Try to get it directly
|
||||
boolean cacheLocal = m_info.IsValidated ;
|
||||
return getDirect(key, false, cacheLocal); // do NOT cache
|
||||
}
|
||||
|
||||
return null;
|
||||
} // get
|
||||
|
||||
public NamePair get(Object key) {
|
||||
return get(key, true);
|
||||
}
|
||||
|
||||
public NamePair getNoDirect(Object key) {
|
||||
return get(key, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Display value (name).
|
||||
* If not found return key embedded in inactive signs.
|
||||
|
@ -254,6 +266,24 @@ public final class MLookup extends Lookup implements Serializable
|
|||
}
|
||||
} // containsKey
|
||||
|
||||
/**
|
||||
* The Lookup contains the key, do not get direct
|
||||
* @param key key
|
||||
* @return true if key is known
|
||||
*/
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
//should check direct too
|
||||
if (m_lookup.containsKey(key))
|
||||
return true;
|
||||
else {
|
||||
if (m_lookup.size() > 0)
|
||||
return false;
|
||||
else
|
||||
return ( getNoDirect(key) != null );
|
||||
}
|
||||
} // containsKeyNoDirect
|
||||
|
||||
/**
|
||||
* @return a string representation of the object.
|
||||
*/
|
||||
|
|
|
@ -607,7 +607,7 @@ public class MLookupFactory
|
|||
msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery);
|
||||
retValue.DisplayColumn = lookupDisplayColumn;
|
||||
retValue.InfoWindowId = infoWindowId;
|
||||
retValue.QueryDirect = directQuery;
|
||||
retValue.QueryDirect = MRole.getDefault().addAccessSQL(directQuery, TableName, true, false);
|
||||
s_cacheRefTable.put(key.toString(), retValue.cloneIt());
|
||||
return retValue;
|
||||
} // getLookup_Table
|
||||
|
@ -814,7 +814,7 @@ public class MLookupFactory
|
|||
MLookupInfo lInfo = new MLookupInfo(realSQL.toString(), TableName,
|
||||
msginf.toString(), ZoomWindow, ZoomWindowPO, zoomQuery);
|
||||
lInfo.DisplayColumn = displayColumn.toString();
|
||||
lInfo.QueryDirect = directQuery;
|
||||
lInfo.QueryDirect = MRole.getDefault().addAccessSQL(directQuery, TableName, true, false);
|
||||
s_cacheRefTable.put(cacheKey.toString(), lInfo.cloneIt());
|
||||
return lInfo;
|
||||
} // getLookup_TableDir
|
||||
|
|
|
@ -41,11 +41,10 @@ import org.compiere.util.NamePair;
|
|||
public class MPAttributeLookup extends Lookup
|
||||
implements Serializable
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 70273805106666111L;
|
||||
private static final long serialVersionUID = 1877125428249819248L;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -88,6 +87,11 @@ public class MPAttributeLookup extends Lookup
|
|||
return get(key) != null;
|
||||
} // containsKey
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Object of Key Value
|
||||
* @param value value
|
||||
|
|
|
@ -39,7 +39,7 @@ public class MPaymentLookup extends Lookup implements Serializable {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 6505672741140583659L;
|
||||
private static final long serialVersionUID = 2876345457828980720L;
|
||||
|
||||
/** Context */
|
||||
private Properties m_ctx;
|
||||
|
@ -97,6 +97,11 @@ public class MPaymentLookup extends Lookup implements Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getColumnName() {
|
||||
return "PaymentRule";
|
||||
|
|
|
@ -120,11 +120,8 @@ public class MProductionLine extends X_M_ProductionLine {
|
|||
}
|
||||
MStorageOnHand storage = MStorageOnHand.getCreate(getCtx(), getM_Locator_ID(),
|
||||
getM_Product_ID(), asi.get_ID(),dateMPolicy, get_TrxName());
|
||||
storage.changeQtyOnHand(getMovementQty(), true);
|
||||
if ( !storage.save(get_TrxName()) ) {
|
||||
log.log(Level.SEVERE, "Could not update storage for " + toString());
|
||||
errorString.append("Could not save transaction for " + toString() + "\n");
|
||||
}
|
||||
storage.addQtyOnHand(getMovementQty());
|
||||
storage.load(storage.get_TrxName());
|
||||
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Created finished goods line " + getLine());
|
||||
|
||||
return errorString.toString();
|
||||
|
@ -182,11 +179,8 @@ public class MProductionLine extends X_M_ProductionLine {
|
|||
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Saved transaction for " + toString());
|
||||
}
|
||||
DB.getDatabase().forUpdate(storages[sl], 120);
|
||||
storages[sl].changeQtyOnHand(lineQty, false);
|
||||
if ( !storages[sl].save(get_TrxName()) ) {
|
||||
log.log(Level.SEVERE, "Could not update storage for " + toString());
|
||||
errorString.append("Could not update storage for " + toString() + "\n");
|
||||
}
|
||||
storages[sl].addQtyOnHand(lineQty.negate());
|
||||
storages[sl].load(storages[sl].get_TrxName());
|
||||
qtyToMove = qtyToMove.subtract(lineQty);
|
||||
if (log.isLoggable(Level.FINE))log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
|
||||
}
|
||||
|
@ -244,11 +238,8 @@ public class MProductionLine extends X_M_ProductionLine {
|
|||
} else {
|
||||
if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Saved transaction for " + toString());
|
||||
}
|
||||
storage.changeQtyOnHand(lineQty, false);
|
||||
if ( !storage.save(get_TrxName()) ) {
|
||||
log.log(Level.SEVERE, "Could not update storage for " + toString());
|
||||
errorString.append("Could not update storage for " + toString() + "\n");
|
||||
}
|
||||
storage.addQtyOnHand(lineQty.negate());
|
||||
storage.load(storage.get_TrxName());
|
||||
qtyToMove = qtyToMove.subtract(lineQty);
|
||||
if (log.isLoggable(Level.FINE))log.log(Level.FINE, getLine() + " Qty moved = " + lineQty + ", Remaining = " + qtyToMove );
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import java.util.List;
|
|||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.util.CLogger;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -44,7 +45,7 @@ public class MStorageOnHand extends X_M_StorageOnHand
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1137569740767949519L;
|
||||
private static final long serialVersionUID = -3820729340100521329L;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -735,14 +736,31 @@ public class MStorageOnHand extends X_M_StorageOnHand
|
|||
return false;
|
||||
}
|
||||
|
||||
storage.setQtyOnHand (storage.getQtyOnHand().add (diffQtyOnHand));
|
||||
storage.addQtyOnHand(diffQtyOnHand);
|
||||
storage.load(storage.get_TrxName());
|
||||
if (storage.getQtyOnHand().signum() == -1) {
|
||||
if (MWarehouse.get(Env.getCtx(), M_Warehouse_ID).isDisallowNegativeInv()) {
|
||||
throw new AdempiereException(Msg.getMsg(ctx, "NegativeInventoryDisallowed"));
|
||||
}
|
||||
}
|
||||
if (s_log.isLoggable(Level.FINE)) {
|
||||
StringBuilder diffText = new StringBuilder("(OnHand=").append(diffQtyOnHand).append(") -> ").append(storage.toString());
|
||||
s_log.fine(diffText.toString());
|
||||
}
|
||||
return storage.save (trxName);
|
||||
return true;
|
||||
} // add
|
||||
|
||||
/**
|
||||
* Add quantity on hand directly - not using cached value - solving IDEMPIERE-2629
|
||||
* @param addition
|
||||
*/
|
||||
public void addQtyOnHand(BigDecimal addition) {
|
||||
final String sql = "UPDATE M_StorageOnHand SET QtyOnHand=QtyOnHand+?, Updated=SYSDATE, UpdatedBy=? " +
|
||||
"WHERE M_Product_ID=? AND M_Locator_ID=? AND M_AttributeSetInstance_ID=? AND DateMaterialPolicy=?";
|
||||
DB.executeUpdateEx(sql,
|
||||
new Object[] {addition, Env.getAD_User_ID(Env.getCtx()), getM_Product_ID(), getM_Locator_ID(), getM_AttributeSetInstance_ID(), getDateMaterialPolicy()},
|
||||
get_TrxName());
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* Get Location with highest Locator Priority and a sufficient OnHand Qty
|
||||
|
@ -854,21 +872,6 @@ public class MStorageOnHand extends X_M_StorageOnHand
|
|||
/** Warehouse */
|
||||
private int m_M_Warehouse_ID = 0;
|
||||
|
||||
/**
|
||||
* Change Qty OnHand
|
||||
* @param qty quantity
|
||||
* @param add add if true
|
||||
*/
|
||||
public void changeQtyOnHand (BigDecimal qty, boolean add)
|
||||
{
|
||||
if (qty == null || qty.signum() == 0)
|
||||
return;
|
||||
if (add)
|
||||
setQtyOnHand(getQtyOnHand().add(qty));
|
||||
else
|
||||
setQtyOnHand(getQtyOnHand().subtract(qty));
|
||||
} // changeQtyOnHand
|
||||
|
||||
/**
|
||||
* Get M_Warehouse_ID of Locator
|
||||
* @return warehouse
|
||||
|
@ -1030,8 +1033,9 @@ public class MStorageOnHand extends X_M_StorageOnHand
|
|||
{
|
||||
StringBuffer sb = new StringBuffer("MStorageOnHand[")
|
||||
.append("M_Locator_ID=").append(getM_Locator_ID())
|
||||
.append(",M_Product_ID=").append(getM_Product_ID())
|
||||
.append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID())
|
||||
.append(",M_Product_ID=").append(getM_Product_ID())
|
||||
.append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID())
|
||||
.append(",DateMaterialPolicy=").append(getDateMaterialPolicy())
|
||||
.append(": OnHand=").append(getQtyOnHand())
|
||||
/* @win commented out
|
||||
.append(",Reserved=").append(getQtyReserved())
|
||||
|
|
|
@ -30,7 +30,7 @@ public class MStorageReservation extends X_M_StorageReservation {
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -2649259510341856418L;
|
||||
private static final long serialVersionUID = 8179093165315835613L;
|
||||
|
||||
/**
|
||||
* Get Storage Info
|
||||
|
@ -248,12 +248,25 @@ public class MStorageReservation extends X_M_StorageReservation {
|
|||
return false;
|
||||
}
|
||||
|
||||
storage.setQty (storage.getQty().add(diffQty));
|
||||
storage.addQty(diffQty);
|
||||
storage.load(storage.get_TrxName());
|
||||
if (s_log.isLoggable(Level.FINE)) {
|
||||
StringBuilder diffText = new StringBuilder("(Qty=").append(diffQty).append(") -> ").append(storage.toString());
|
||||
s_log.fine(diffText.toString());
|
||||
}
|
||||
return storage.save (trxName);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add quantity on hand directly - not using cached value - solving IDEMPIERE-2629
|
||||
* @param addition
|
||||
*/
|
||||
public void addQty(BigDecimal addition) {
|
||||
final String sql = "UPDATE M_StorageReservation SET Qty=Qty+?, Updated=SYSDATE, UpdatedBy=? " +
|
||||
"WHERE M_Product_ID=? AND M_Warehouse_ID=? AND M_AttributeSetInstance_ID=? AND IsSOTrx=?";
|
||||
DB.executeUpdateEx(sql,
|
||||
new Object[] {addition, Env.getAD_User_ID(Env.getCtx()), getM_Product_ID(), getM_Warehouse_ID(), getM_AttributeSetInstance_ID(), isSOTrx()},
|
||||
get_TrxName());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -309,4 +322,20 @@ public class MStorageReservation extends X_M_StorageReservation {
|
|||
return retValue;
|
||||
} // getCreate
|
||||
|
||||
/**
|
||||
* String Representation
|
||||
* @return info
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
StringBuffer sb = new StringBuffer("MStorageReservation[")
|
||||
.append("M_Warehouse_ID=").append(getM_Warehouse_ID())
|
||||
.append(",M_Product_ID=").append(getM_Product_ID())
|
||||
.append(",M_AttributeSetInstance_ID=").append(getM_AttributeSetInstance_ID())
|
||||
.append(",IsSOTrx=").append(isSOTrx())
|
||||
.append(": Qty=").append(getQty())
|
||||
.append("]");
|
||||
return sb.toString();
|
||||
} // toString
|
||||
|
||||
}
|
||||
|
|
|
@ -903,10 +903,11 @@ public class DocumentEngine implements DocAction
|
|||
* @param AD_Table_ID
|
||||
* @param docAction
|
||||
* @param options
|
||||
* @param periodOpen - flag indicating if the period is Open - to avoid including Void and ReverseCorrect options in the list
|
||||
* @return Number of valid options
|
||||
*/
|
||||
public static int getValidActions(String docStatus, Object processing,
|
||||
String orderType, String isSOTrx, int AD_Table_ID, String[] docAction, String[] options)
|
||||
String orderType, String isSOTrx, int AD_Table_ID, String[] docAction, String[] options, boolean periodOpen)
|
||||
{
|
||||
if (options == null)
|
||||
throw new IllegalArgumentException("Option array parameter is null");
|
||||
|
@ -1001,8 +1002,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
}
|
||||
}
|
||||
|
@ -1014,8 +1016,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
}
|
||||
}
|
||||
|
@ -1027,8 +1030,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
}
|
||||
}
|
||||
|
@ -1040,9 +1044,11 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
options[index++] = DocumentEngine.ACTION_ReActivate;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
options[index++] = DocumentEngine.ACTION_ReActivate;
|
||||
}
|
||||
}
|
||||
/********************
|
||||
|
@ -1053,8 +1059,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
}
|
||||
}
|
||||
|
@ -1078,7 +1085,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
}
|
||||
}
|
||||
}
|
||||
/********************
|
||||
|
@ -1090,8 +1099,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
}
|
||||
}
|
||||
|
@ -1129,8 +1139,9 @@ public class DocumentEngine implements DocAction
|
|||
// Complete .. CO
|
||||
else if (docStatus.equals(DocumentEngine.STATUS_Completed))
|
||||
{
|
||||
options[index++] = DocumentEngine.ACTION_Void;
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
if (periodOpen) {
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Correct;
|
||||
}
|
||||
options[index++] = DocumentEngine.ACTION_Reverse_Accrual;
|
||||
}
|
||||
|
||||
|
|
|
@ -866,9 +866,9 @@ public class ConfigurationData
|
|||
Ini.setAdempiereHome(m_adempiereHome.getAbsolutePath());
|
||||
|
||||
// Create Connection
|
||||
String ccType = Database.DB_POSTGRESQL;
|
||||
if (getDatabaseType().equals(DBTYPE_ORACLE))
|
||||
ccType = Database.DB_ORACLE;
|
||||
String ccType = Database.DB_ORACLE;
|
||||
if (getDatabaseType() != null && !getDatabaseType().equals(Database.DB_ORACLE))
|
||||
ccType = getDatabaseType();
|
||||
CConnection cc = null;
|
||||
try
|
||||
{
|
||||
|
@ -1127,12 +1127,6 @@ public class ConfigurationData
|
|||
* Database Settings
|
||||
*************************************************************************/
|
||||
|
||||
/** Oracle directory */
|
||||
private static String DBTYPE_ORACLE = "Oracle";
|
||||
|
||||
/** PostgreSQL */
|
||||
private static String DBTYPE_POSTGRESQL = "PostgreSQL";
|
||||
|
||||
/** Database Types */
|
||||
public static String[] DBTYPE = null;
|
||||
//end e-evolution vpj-cd 02/07/2005 PostgreSQL
|
||||
|
|
|
@ -18,7 +18,8 @@ goto START
|
|||
|
||||
:START
|
||||
@REM Setup idempiere.properties and idempiereEnv.properties
|
||||
@"%JAVA%" -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install setup -configuration setup/configuration -application org.adempiere.install.console-application
|
||||
FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c
|
||||
@"%JAVA%" -jar %JARFILE% -install setup -configuration setup/configuration -application org.adempiere.install.console-application
|
||||
|
||||
@Echo ErrorLevel = %ERRORLEVEL%
|
||||
@IF NOT ERRORLEVEL = 1 GOTO NEXT
|
||||
|
@ -30,7 +31,7 @@ goto START
|
|||
|
||||
:NEXT
|
||||
@REM setup jetty
|
||||
@"%JAVA%" -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install setup -configuration setup/configuration -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
@"%JAVA%" -jar %JARFILE% -install setup -configuration setup/configuration -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
@Echo .
|
||||
@Echo For problems, check log file in base directory
|
||||
|
|
|
@ -17,4 +17,5 @@ goto START
|
|||
@Echo Starting iDempiere Server ...
|
||||
@Echo =======================================
|
||||
|
||||
@"%JAVA%" -Dosgi.console=localhost:12612 -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-selector.xml,etc/jetty-ssl.xml,etc/jetty-https.xml,etc/jetty-deployer.xml -XX:MaxPermSize=192m -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -jar plugins/org.eclipse.equinox.launcher_1.*.jar -application org.adempiere.server.application
|
||||
FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c
|
||||
@"%JAVA%" -Dosgi.console=localhost:12612 -Djetty.home=jettyhome -Djetty.etc.config.urls=etc/jetty.xml,etc/jetty-selector.xml,etc/jetty-ssl.xml,etc/jetty-https.xml,etc/jetty-deployer.xml -XX:MaxPermSize=192m -Dmail.mime.encodefilename=true -Dmail.mime.decodefilename=true -Dmail.mime.encodeparameters=true -Dmail.mime.decodeparameters=true -jar %JARFILE% -application org.adempiere.server.application
|
||||
|
|
|
@ -18,7 +18,8 @@ goto START
|
|||
|
||||
:START
|
||||
@REM Setup idempiere.properties and idempiereEnv.properties
|
||||
@"%JAVA%" -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install setup -configuration setup/configuration -application org.adempiere.install.application -consoleLog
|
||||
FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c
|
||||
@"%JAVA%" -jar %JARFILE% -install setup -configuration setup/configuration -application org.adempiere.install.application -consoleLog
|
||||
|
||||
@Echo ErrorLevel = %ERRORLEVEL%
|
||||
@IF NOT ERRORLEVEL = 1 GOTO NEXT
|
||||
|
@ -31,7 +32,7 @@ goto START
|
|||
:NEXT
|
||||
@REM setup jetty
|
||||
@Echo ... Setup Jetty
|
||||
@"%JAVA%" -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install setup -configuration setup/configuration -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
@"%JAVA%" -jar %JARFILE% -install setup -configuration setup/configuration -application org.eclipse.ant.core.antRunner -buildfile build.xml
|
||||
|
||||
@Echo ...
|
||||
@Echo For problems, check log file in base directory
|
||||
|
|
|
@ -36,7 +36,7 @@ public class XLookup extends Lookup
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1388987648081532657L;
|
||||
private static final long serialVersionUID = -1960941688071305272L;
|
||||
|
||||
/**
|
||||
* Manual Lookup
|
||||
|
@ -94,6 +94,11 @@ public class XLookup extends Lookup
|
|||
return false;
|
||||
} // containsKey
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Object of Key Value
|
||||
* @param key key
|
||||
|
|
|
@ -37,9 +37,11 @@ import org.compiere.model.GridTab;
|
|||
import org.compiere.model.MAllocationHdr;
|
||||
import org.compiere.model.MBankStatement;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MPeriod;
|
||||
import org.compiere.model.MProduction;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocOptions;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
import org.compiere.swing.CComboBox;
|
||||
|
@ -235,12 +237,16 @@ public class VDocAction extends CDialog
|
|||
/*******************
|
||||
* General Actions
|
||||
*/
|
||||
String[] docActionHolder = new String[] {DocAction};
|
||||
index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx, m_AD_Table_ID,
|
||||
docActionHolder, options);
|
||||
|
||||
MTable table = MTable.get(Env.getCtx(), m_AD_Table_ID);
|
||||
PO po = table.getPO(Record_ID, null);
|
||||
boolean periodOpen = true;
|
||||
if (po instanceof DocAction)
|
||||
periodOpen = MPeriod.isOpen(Env.getCtx(), m_AD_Table_ID, Record_ID, null);
|
||||
|
||||
String[] docActionHolder = new String[] {DocAction};
|
||||
index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx, m_AD_Table_ID,
|
||||
docActionHolder, options, periodOpen);
|
||||
|
||||
if (po instanceof DocOptions)
|
||||
index = ((DocOptions) po).customizeValidActions(DocStatus, Processing, OrderType, IsSOTrx,
|
||||
m_AD_Table_ID, docActionHolder, options, index);
|
||||
|
|
|
@ -39,9 +39,11 @@ import org.compiere.model.MAllocationHdr;
|
|||
import org.compiere.model.MBankStatement;
|
||||
import org.compiere.model.MClientInfo;
|
||||
import org.compiere.model.MDocType;
|
||||
import org.compiere.model.MPeriod;
|
||||
import org.compiere.model.MProduction;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.model.PO;
|
||||
import org.compiere.process.DocAction;
|
||||
import org.compiere.process.DocOptions;
|
||||
import org.compiere.process.DocumentEngine;
|
||||
import org.compiere.util.CLogger;
|
||||
|
@ -66,7 +68,7 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
|||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -1467198100278350775L;
|
||||
private static final long serialVersionUID = -2166149559040327486L;
|
||||
|
||||
private Label lblDocAction;
|
||||
private Label label;
|
||||
|
@ -160,12 +162,16 @@ public class WDocActionPanel extends Window implements EventListener<Event>, Dia
|
|||
* General Actions
|
||||
*/
|
||||
|
||||
String[] docActionHolder = new String[]{DocAction};
|
||||
index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx,
|
||||
m_AD_Table_ID, docActionHolder, options);
|
||||
|
||||
MTable table = MTable.get(Env.getCtx(), m_AD_Table_ID);
|
||||
PO po = table.getPO(gridTab.getRecord_ID(), null);
|
||||
boolean periodOpen = true;
|
||||
if (po instanceof DocAction)
|
||||
periodOpen = MPeriod.isOpen(Env.getCtx(), m_AD_Table_ID, gridTab.getRecord_ID(), null);
|
||||
|
||||
String[] docActionHolder = new String[]{DocAction};
|
||||
index = DocumentEngine.getValidActions(DocStatus, Processing, OrderType, IsSOTrx,
|
||||
m_AD_Table_ID, docActionHolder, options, periodOpen);
|
||||
|
||||
if (po instanceof DocOptions)
|
||||
index = ((DocOptions) po).customizeValidActions(DocStatus, Processing, OrderType, IsSOTrx,
|
||||
m_AD_Table_ID, docActionHolder, options, index);
|
||||
|
|
|
@ -1362,8 +1362,6 @@ public class DB_Oracle implements AdempiereDatabase
|
|||
}
|
||||
rs = stmt.executeQuery();
|
||||
if (rs.next()) {
|
||||
// reload the record being locked - it could have changed in a different thread - IDEMPIERE-2629
|
||||
po.load(po.get_TrxName());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -1089,8 +1089,6 @@ public class DB_PostgreSQL implements AdempiereDatabase
|
|||
|
||||
rs = stmt.executeQuery();
|
||||
if (rs.next()) {
|
||||
// reload the record being locked - it could have changed in a different thread - IDEMPIERE-2629
|
||||
po.load(po.get_TrxName());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
|
@ -47,11 +47,11 @@ import org.w3c.dom.Document;
|
|||
*
|
||||
*/
|
||||
public class GetListLookup extends Lookup {
|
||||
|
||||
/**
|
||||
* generated serial id
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -137206840260406730L;
|
||||
private static final long serialVersionUID = 2582520499473909390L;
|
||||
|
||||
private String filter;
|
||||
private String serviceType;
|
||||
private String endPoint;
|
||||
|
@ -203,6 +203,11 @@ public class GetListLookup extends Lookup {
|
|||
return dataMap.containsKey(key);
|
||||
}
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh & return number of items read.
|
||||
* Get get data of parent lookups
|
||||
|
|
|
@ -51,11 +51,11 @@ import org.w3c.dom.Node;
|
|||
*
|
||||
*/
|
||||
public class QueryDataLookup extends Lookup {
|
||||
|
||||
/**
|
||||
* generated serial id
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -137206840260406730L;
|
||||
private static final long serialVersionUID = -1322365740845617635L;
|
||||
|
||||
private String filter;
|
||||
private String serviceType;
|
||||
private String endPoint;
|
||||
|
@ -219,6 +219,11 @@ public class QueryDataLookup extends Lookup {
|
|||
return dataMap.containsKey(key);
|
||||
}
|
||||
|
||||
public boolean containsKeyNoDirect (Object key)
|
||||
{
|
||||
return containsKey(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh & return number of items read.
|
||||
* Get get data of parent lookups
|
||||
|
|
Loading…
Reference in New Issue