-
Notifications
You must be signed in to change notification settings - Fork 568
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Not all picking slots are released (#17817)
refs: #17813
- Loading branch information
Showing
6 changed files
with
190 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...esources/de/metas/cucumber/features/workflow/picking_abortPickingJobAfterShipment.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@from:cucumber | ||
@ghActions:run_on_executor7 | ||
Feature: Picking workflow - abort not started picking jobs after shipment | ||
|
||
Background: | ||
Given infrastructure and metasfresh are running | ||
And the existing user with login 'metasfresh' receives a random a API token for the existing role with name 'WebUI' | ||
And metasfresh has date and time 2022-08-18T13:30:13+01:00[Europe/Berlin] | ||
And set sys config boolean value true for sys config SKIP_WP_PROCESSOR_FOR_AUTOMATION | ||
And metasfresh contains M_PricingSystems | ||
| Identifier | Name | Value | OPT.Description | OPT.IsActive | | ||
| picking_pricing_system_17813 | picking_pricing_system_17813Name | picking_pricing_system_17813Value | picking_pricing_system_17813Description | true | | ||
And metasfresh contains M_PriceLists | ||
| Identifier | M_PricingSystem_ID.Identifier | OPT.C_Country.CountryCode | C_Currency.ISO_Code | Name | OPT.Description | SOTrx | IsTaxIncluded | PricePrecision | OPT.IsActive | | ||
| picking_picelist_17813 | picking_pricing_system_17813 | DE | EUR | picking_pricelist_17813 | null | true | false | 2 | true | | ||
And metasfresh contains M_PriceList_Versions | ||
| Identifier | M_PriceList_ID.Identifier | Name | ValidFrom | | ||
| picking_pricelistversion_17813 | picking_picelist_17813 | picking_pricelistversion_17813Name | 2021-04-01 | | ||
And metasfresh contains M_Products: | ||
| Identifier | Name | | ||
| picking_product_17813 | picking_product_17813 | | ||
And metasfresh contains M_ProductPrices | ||
| Identifier | M_PriceList_Version_ID.Identifier | M_Product_ID.Identifier | PriceStd | C_UOM_ID.X12DE355 | C_TaxCategory_ID.InternalName | | ||
| workflowProductPrice | picking_pricelistversion_17813 | picking_product_17813 | 5.0 | PCE | Normal | | ||
|
||
And set mobile UI picking profile | ||
| IsAllowPickingAnyHU | CreateShipmentPolicy | | ||
| Y | CREATE_AND_COMPLETE | | ||
And metasfresh contains C_BPartners without locations: | ||
| Identifier | Name | OPT.IsVendor | OPT.IsCustomer | M_PricingSystem_ID.Identifier | | ||
| pickingCustomer_17813 | pickingCustomer_17813 | N | Y | picking_pricing_system_17813 | | ||
And metasfresh contains C_BPartner_Locations: | ||
| Identifier | GLN | C_BPartner_ID.Identifier | OPT.IsBillToDefault | OPT.IsShipTo | | ||
| pickingCustomer_17813Location | picking_GLN_17813 | pickingCustomer_17813 | true | true | | ||
|
||
And metasfresh contains C_Orders: | ||
| Identifier | IsSOTrx | C_BPartner_ID.Identifier | DateOrdered | | ||
| salesOrder_17813 | true | pickingCustomer_17813 | 2021-04-15 | | ||
And metasfresh contains C_OrderLines: | ||
| Identifier | C_Order_ID.Identifier | M_Product_ID.Identifier | QtyEntered | | ||
| salesOrder_17813Line | salesOrder_17813 | picking_product_17813 | 10 | | ||
|
||
And the order identified by salesOrder_17813 is completed | ||
|
||
And after not more than 60s, M_ShipmentSchedules are found: | ||
| Identifier | C_OrderLine_ID.Identifier | IsToRecompute | | ||
| pickingShipmentSchedule | salesOrder_17813Line | N | | ||
|
||
|
||
@from:cucumber | ||
Scenario: Abort not started picking jobs after shipment | ||
Given start picking job for sales order identified by salesOrder_17813 | ||
And metasfresh contains M_PickingSlot: | ||
| Identifier | PickingSlot | IsDynamic | | ||
| 300.0 | 300.0 | Y | | ||
And scan picking slot identified by 300.0 | ||
And validate M_PickingSlot: | ||
| M_PickingSlot_ID.Identifier | C_BPartner_ID.Identifier | C_BPartner_Location_ID.Identifier | | ||
| 300.0 | pickingCustomer_17813 | pickingCustomer_17813Location | | ||
When 'generate shipments' process is invoked | ||
| M_ShipmentSchedule_ID.Identifier | QuantityType | IsCompleteShipments | IsShipToday | | ||
| pickingShipmentSchedule | D | true | false | | ||
Then validate M_PickingSlot: | ||
| M_PickingSlot_ID.Identifier | IsAllocated | | ||
| 300.0 | N | | ||
|
50 changes: 50 additions & 0 deletions
50
....handlingunits.base/src/main/java/de/metas/handlingunits/picking/interceptor/M_InOut.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* #%L | ||
* de.metas.handlingunits.base | ||
* %% | ||
* Copyright (C) 2024 metas GmbH | ||
* %% | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as | ||
* published by the Free Software Foundation, either version 2 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* 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 | ||
* 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 | ||
* <http://www.gnu.org/licenses/gpl-2.0.html>. | ||
* #L% | ||
*/ | ||
|
||
package de.metas.handlingunits.picking.interceptor; | ||
|
||
import de.metas.handlingunits.picking.job.service.PickingJobService; | ||
import de.metas.inoutcandidate.api.IShipmentScheduleAllocDAO; | ||
import de.metas.util.Services; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
import org.adempiere.ad.modelvalidator.annotations.DocValidate; | ||
import org.adempiere.ad.modelvalidator.annotations.Interceptor; | ||
import org.compiere.model.I_M_InOut; | ||
import org.compiere.model.ModelValidator; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Interceptor(I_M_InOut.class) | ||
@Component | ||
@RequiredArgsConstructor | ||
public class M_InOut | ||
{ | ||
private final IShipmentScheduleAllocDAO shipmentScheduleAllocDAO = Services.get(IShipmentScheduleAllocDAO.class); | ||
|
||
private final PickingJobService pickingJobService; | ||
|
||
@DocValidate(timings = ModelValidator.TIMING_AFTER_COMPLETE) | ||
public void afterComplete(@NonNull final I_M_InOut shipment) | ||
{ | ||
shipmentScheduleAllocDAO.retrieveOrderIds(shipment).forEach(pickingJobService::abortNotStartedForSalesOrderId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters