Skip to content

Commit

Permalink
2101: webui - allow disabling auto-close of picking candidates
Browse files Browse the repository at this point in the history
* PackageableView evaluate SysConfig
`WEBUI_Picking_Close_PickingCandidatesOnWindowClose`
* also move AD_Message constants to existing constant class

Task-Url: metasfresh/metasfresh#2101
  • Loading branch information
metas-ts committed Jul 31, 2017
1 parent 4f12c6f commit 443ff49
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 68 deletions.
12 changes: 12 additions & 0 deletions src/main/java/de/metas/ui/web/picking/PackageableView.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
Expand All @@ -10,9 +11,11 @@

import org.adempiere.ad.dao.IQueryBL;
import org.adempiere.model.InterfaceWrapperHelper;
import org.adempiere.service.ISysConfigBL;
import org.adempiere.util.Services;
import org.adempiere.util.lang.ExtendedMemorizingSupplier;
import org.adempiere.util.lang.impl.TableRecordReference;
import org.compiere.util.Env;
import org.compiere.util.Evaluatee;

import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -150,6 +153,15 @@ public long size()
@Override
public void close()
{
final ISysConfigBL sysConfigBL = Services.get(ISysConfigBL.class);

final Properties ctx = Env.getCtx();
final boolean closeCandidatesNow = sysConfigBL.getBooleanValue("WEBUI_Picking.Close_PickingCandidatesOnWindowClose", false, Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx));
if (!closeCandidatesNow)
{
return; // nothing to do.
}

final List<Integer> shipmentScheduleIds = getRows()
.values().stream()
.map(row -> row.getShipmentScheduleId())
Expand Down
16 changes: 14 additions & 2 deletions src/main/java/de/metas/ui/web/picking/PickingConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-2.0.html>.
* #L%
*/
Expand All @@ -34,4 +34,16 @@ public final class PickingConstants
public static final String WINDOWID_PickingSlotView_String = "pickingSlot";
public static final WindowId WINDOWID_PickingSlotView = WindowId.fromJson(WINDOWID_PickingSlotView_String);

public static final String CFG_WEBUI_PICKING_CLOSE_CANDIDATES_ON_WINDOW_CLOSE = "WEBUI_Picking_Close_PickingCandidatesOnWindowClose";

public static final String MSG_WEBUI_PICKING_NO_PROCESSED_RECORDS = "WEBUI_Picking_No_Processed_Records";
public static final String MSG_WEBUI_PICKING_SELECT_HU = "WEBUI_Picking_SelectHU";
public static final String MSG_WEBUI_PICKING_SELECT_PICKING_SLOT = "WEBUI_Picking_SelectPickingSlot";
public static final String MSG_WEBUI_PICKING_PICK_SOMETHING = "WEBUI_Picking_PickSomething";
public static final String MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS = "WEBUI_Picking_No_Unprocessed_Records";
public static final String MSG_WEBUI_PICKING_NOT_TOP_LEVEL_HU = "WEBUI_Picking_Not_TopLevelHU";
public static final String MSG_WEBUI_PICKING_WRONG_HU_STATUS_3P = "WEBUI_Picking_Wrong_HU_Status";
public static final String MSG_WEBUI_PICKING_ALREADY_SHIPPED_2P = "WEBUI_Picking_Already_Shipped";
public static final String MSG_WEBUI_PICKING_DIVERGING_LOCATIONS = "WEBUI_Picking_Diverging_Locations";
public static final String MSG_WEBUI_PICKING_TOO_MANY_PACKAGEABLES_1P = "WEBUI_Picking_Too_Many_Packageables";
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_PICKING_SLOT;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_SELECT_PICKING_SLOT;

import org.springframework.beans.factory.annotation.Autowired;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_PICK_SOMETHING;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_HU;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_PICK_SOMETHING;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_SELECT_HU;
import static org.adempiere.model.InterfaceWrapperHelper.load;
import static org.adempiere.model.InterfaceWrapperHelper.loadOutOfTrx;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_ALREADY_SHIPPED_2P;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_NO_PROCESSED_RECORDS;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_HU;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_WRONG_HU_STATUS_3P;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_ALREADY_SHIPPED_2P;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_NO_PROCESSED_RECORDS;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_SELECT_HU;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_WRONG_HU_STATUS_3P;
import static org.adempiere.model.InterfaceWrapperHelper.delete;
import static org.adempiere.model.InterfaceWrapperHelper.load;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_NOT_TOP_LEVEL_HU;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_NOT_TOP_LEVEL_HU;

import org.adempiere.exceptions.AdempiereException;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_HU;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_SELECT_HU;

import java.math.BigDecimal;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_SELECT_PICKING_SLOT;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_SELECT_PICKING_SLOT;

import java.math.BigDecimal;
import java.util.Objects;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.*;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_NO_UNPROCESSED_RECORDS;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_SELECT_HU;

import org.springframework.beans.factory.annotation.Autowired;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.metas.ui.web.picking.process;

import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_DIVERGING_LOCATIONS;
import static de.metas.ui.web.picking.process.AD_Message_Values.MSG_WEBUI_PICKING_TOO_MANY_PACKAGEABLES_1P;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_DIVERGING_LOCATIONS;
import static de.metas.ui.web.picking.PickingConstants.MSG_WEBUI_PICKING_TOO_MANY_PACKAGEABLES_1P;

import java.util.List;
import java.util.Set;
Expand Down

0 comments on commit 443ff49

Please sign in to comment.