diff --git a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java index 46e941005c..3e3c1d4d42 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InOutGenerate.java @@ -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"); diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 5d358d8bf8..0c483f3fb2 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -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(), diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index bf9ac17089..12bb387894 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -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) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java index 9eaaa3bc2f..4261639da8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/WAccountDialog.java @@ -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