Merge release-2.0 into development

This commit is contained in:
Heng Sin Low 2014-07-04 20:08:00 +08:00
commit 68b8172603
4 changed files with 25 additions and 20 deletions

View File

@ -525,6 +525,10 @@ public class InOutGenerate extends SvrProcess
MInOutLine line = new MInOutLine (m_shipment);
line.setOrderLine(orderLine, 0, order.isSOTrx() ? toDeliver : Env.ZERO);
line.setQty(toDeliver);
if (orderLine.getQtyEntered().compareTo(orderLine.getQtyOrdered()) != 0)
line.setQtyEntered(line.getMovementQty().multiply(orderLine.getQtyEntered())
.divide(orderLine.getQtyOrdered(), 12, BigDecimal.ROUND_HALF_UP));
line.setLine(m_line + orderLine.getLine());
if (!line.save())
throw new IllegalStateException("Could not create Shipment Line");

View File

@ -1395,7 +1395,7 @@ public class MInOut extends X_M_InOut implements DocAction
}
}
if (oLine!=null && mtrx!=null)
if (oLine!=null && mtrx!=null && oLine.getQtyOrdered().signum() > 0)
{
if (sLine.getC_OrderLine_ID() != 0)
{
@ -1434,7 +1434,7 @@ public class MInOut extends X_M_InOut implements DocAction
m_processMsg = "Cannot correct Inventory OnHand [" + product.getValue() + "] - " + lastError;
return DocAction.STATUS_Invalid;
}
if (oLine!=null)
if (oLine!=null && oLine.getQtyOrdered().signum() > 0)
{
if (!MStorageReservation.add(getCtx(), oLine.getM_Warehouse_ID(),
sLine.getM_Product_ID(),

View File

@ -1722,7 +1722,7 @@ public class MOrder extends X_C_Order implements DocAction
BigDecimal difference = target
.subtract(line.getQtyReserved())
.subtract(line.getQtyDelivered());
if (difference.signum() == 0)
if (difference.signum() <= 0)
{
MProduct product = line.getProduct();
if (product != null)

View File

@ -442,7 +442,8 @@ public final class WAccountDialog extends Window
// Finish
m_query = new MQuery();
m_query.addRestriction("C_AcctSchema_ID", MQuery.EQUAL, m_C_AcctSchema_ID);
m_query.addRestriction("IsFullyQualified", MQuery.EQUAL, "Y");
//action_save doesn't filter by IsFullyQualified
// m_query.addRestriction("IsFullyQualified", MQuery.EQUAL, "Y");
if (m_mAccount.C_ValidCombination_ID == 0)
m_mTab.setQuery(MQuery.getEqualQuery("1", "2"));
else
@ -676,7 +677,7 @@ public final class WAccountDialog extends Window
else
query = new MQuery();
// Alias
if (includeAliasCombination && f_Alias != null && f_Alias.getValue().toString().length() > 0)
if (includeAliasCombination && f_Alias != null && !isEmpty(f_Alias))
{
String value = f_Alias.getValue().toString().toUpperCase();
if (!value.endsWith("%"))
@ -684,7 +685,7 @@ public final class WAccountDialog extends Window
query.addRestriction("UPPER(Alias)", MQuery.LIKE, value);
}
// Combination (mandatory)
if (includeAliasCombination && f_Combination.getValue().toString().length() > 0)
if (includeAliasCombination && !isEmpty(f_Combination.getValue()))
{
String value = f_Combination.getValue().toString().toUpperCase();
if (!value.endsWith("%"))
@ -692,46 +693,46 @@ public final class WAccountDialog extends Window
query.addRestriction("UPPER(Combination)", MQuery.LIKE, value);
}
// Org (mandatory)
if (f_AD_Org_ID != null && f_AD_Org_ID.getValue() != null)
if (f_AD_Org_ID != null && !isEmpty(f_AD_Org_ID.getValue()))
query.addRestriction("AD_Org_ID", MQuery.EQUAL, f_AD_Org_ID.getValue());
// Account (mandatory)
if (f_Account_ID != null && f_Account_ID.getValue() != null)
if (f_Account_ID != null && !isEmpty(f_Account_ID.getValue()))
query.addRestriction("Account_ID", MQuery.EQUAL, f_Account_ID.getValue());
if (f_SubAcct_ID != null && f_SubAcct_ID.getValue() != null)
if (f_SubAcct_ID != null && !isEmpty(f_SubAcct_ID.getValue()))
query.addRestriction("C_SubAcct_ID", MQuery.EQUAL, f_SubAcct_ID.getValue());
// Product
if (f_M_Product_ID != null && f_M_Product_ID.getValue() != null)
if (f_M_Product_ID != null && !isEmpty(f_M_Product_ID.getValue()))
query.addRestriction("M_Product_ID", MQuery.EQUAL, f_M_Product_ID.getValue());
// BPartner
if (f_C_BPartner_ID != null && f_C_BPartner_ID.getValue() != null)
if (f_C_BPartner_ID != null && !isEmpty(f_C_BPartner_ID.getValue()))
query.addRestriction("C_BPartner_ID", MQuery.EQUAL, f_C_BPartner_ID.getValue());
// Campaign
if (f_C_Campaign_ID != null && f_C_Campaign_ID.getValue() != null)
if (f_C_Campaign_ID != null && !isEmpty(f_C_Campaign_ID.getValue()))
query.addRestriction("C_Campaign_ID", MQuery.EQUAL, f_C_Campaign_ID.getValue());
// Loc From
if (f_C_LocFrom_ID != null && f_C_LocFrom_ID.getValue() != null)
if (f_C_LocFrom_ID != null && !isEmpty(f_C_LocFrom_ID.getValue()))
query.addRestriction("C_LocFrom_ID", MQuery.EQUAL, f_C_LocFrom_ID.getValue());
// Loc To
if (f_C_LocTo_ID != null && f_C_LocTo_ID.getValue() != null)
if (f_C_LocTo_ID != null && !isEmpty(f_C_LocTo_ID.getValue()))
query.addRestriction("C_LocTo_ID", MQuery.EQUAL, f_C_LocTo_ID.getValue());
// Project
if (f_C_Project_ID != null && f_C_Project_ID.getValue() != null)
if (f_C_Project_ID != null && !isEmpty(f_C_Project_ID.getValue()))
query.addRestriction("C_Project_ID", MQuery.EQUAL, f_C_Project_ID.getValue());
// SRegion
if (f_C_SalesRegion_ID != null && f_C_SalesRegion_ID.getValue() != null)
if (f_C_SalesRegion_ID != null && !isEmpty(f_C_SalesRegion_ID.getValue()))
query.addRestriction("C_SalesRegion_ID", MQuery.EQUAL, f_C_SalesRegion_ID.getValue());
// Org Trx
if (f_AD_OrgTrx_ID != null && f_AD_OrgTrx_ID.getValue() != null)
if (f_AD_OrgTrx_ID != null && !isEmpty(f_AD_OrgTrx_ID.getValue()))
query.addRestriction("AD_OrgTrx_ID", MQuery.EQUAL, f_AD_OrgTrx_ID.getValue());
// Activity
if (f_C_Activity_ID != null && f_C_Activity_ID.getValue() != null)
if (f_C_Activity_ID != null && !isEmpty(f_C_Activity_ID.getValue()))
query.addRestriction("C_Activity_ID", MQuery.EQUAL, f_C_Activity_ID.getValue());
// User 1
if (f_User1_ID != null && f_User1_ID.getValue() != null)
if (f_User1_ID != null && !isEmpty(f_User1_ID.getValue()))
query.addRestriction("User1_ID", MQuery.EQUAL, f_User1_ID.getValue());
// User 2
if (f_User2_ID != null && f_User2_ID.getValue() != null)
if (f_User2_ID != null && !isEmpty(f_User2_ID.getValue()))
query.addRestriction("User2_ID", MQuery.EQUAL, f_User2_ID.getValue());
// Query