Author: mor
Date: Sat Apr 4 12:55:23 2009 New Revision: 761922 URL: http://svn.apache.org/viewvc?rev=761922&view=rev Log: New screen in facility - "Verify Pick" to allow user to verify a pick. Applied patch from jira issue OFBIZ-2226 (https://issues.apache.org/jira/browse/OFBIZ-2226) Thanks Akash Jain and Pranay Pandey! Added: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java (with props) ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java (with props) ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java (with props) ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy (with props) ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl (with props) Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml ofbiz/trunk/applications/product/servicedef/services_shipment.xml ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml ofbiz/trunk/applications/product/widget/facility/Menus.xml ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=761922&r1=761921&r2=761922&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Sat Apr 4 12:55:23 2009 @@ -19786,6 +19786,15 @@ <value xml:lang="it">Spedizionieri del Fornitore</value> <value xml:lang="th">à¸à¸²à¸£à¸à¸à¸ªà¹à¸à¸à¸¹à¹à¸à¸³à¸«à¸à¹à¸²à¸¢</value> </property> + <property key="ProductVerified"> + <value xml:lang="en">Verified</value> + </property> + <property key="ProductVerify"> + <value xml:lang="en">Verify</value> + </property> + <property key="ProductVerifyPick"> + <value xml:lang="en">Verify Pick</value> + </property> <property key="ProductViewEstimates"> <value xml:lang="en">Shipping Estimates</value> <value xml:lang="es">Ver estimaciones</value> Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=761922&r1=761921&r2=761922&view=diff ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Sat Apr 4 12:55:23 2009 @@ -439,7 +439,49 @@ <attribute name="totalIssuedQty" type="BigDecimal" mode="IN" optional="false"/> <attribute name="itemIssuanceId" type="String" mode="OUT" optional="false"/> </service> - + + <!-- Pick Verify Services --> + <service name="verifySingleItem" engine="java" + location="org.ofbiz.shipment.verify.VerifyPickServices" invoke="verifySingleItem" auth="true"> + <description>Verify Single Item</description> + <attribute name="verifyPickSession" type="org.ofbiz.shipment.verify.VerifyPickSession" mode="IN" optional="false"/> + <attribute name="productId" type="String" mode="IN" optional="false"/> + <attribute name="orderId" type="String" mode="IN" optional="true"/> + <attribute name="shipGroupSeqId" type="String" mode="IN" optional="true"/> + <attribute name="quantity" type="BigDecimal" mode="IN" optional="true"/> + </service> + + <service name="verifyBulkItem" engine="java" + location="org.ofbiz.shipment.verify.VerifyPickServices" invoke="verifyBulkItem" auth="true"> + <description>Verify Multiple Items</description> + <attribute name="verifyPickSession" type="org.ofbiz.shipment.verify.VerifyPickSession" mode="IN" optional="false"/> + <attribute name="orderId" type="String" mode="IN" optional="false"/> + <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/> + <attribute name="facilityId" type="String" mode="IN" optional="true"/> + <attribute name="pickerPartyId" type="String" mode="IN" optional="true"/> + <attribute name="productMap" type="Map" string-map-prefix="prd_" mode="IN" optional="true"/> + <attribute name="quantityMap" type="Map" string-map-prefix="qty_" mode="IN" optional="true"/> + <attribute name="selectedMap" type="Map" string-map-prefix="sel_" mode="IN" optional="true"/> + <attribute name="itemMap" type="Map" string-map-prefix="ite_" mode="IN" optional="true"/> + </service> + + <service name="cancelAllRows" engine="java" + location="org.ofbiz.shipment.verify.VerifyPickServices" invoke="cancelAllRows" auth="true"> + <description>Clear the current picking session</description> + <attribute name="verifyPickSession" type="org.ofbiz.shipment.verify.VerifyPickSession" mode="IN" optional="false"/> + </service> + + <service name="completeVerifiedPick" engine="java" + location="org.ofbiz.shipment.verify.VerifyPickServices" invoke="completeVerifiedPick" auth="true"> + <description>Complete the picking and set the shipment to PICKED</description> + <attribute name="verifyPickSession" type="org.ofbiz.shipment.verify.VerifyPickSession" mode="IN" optional="false"/> + <attribute name="orderId" type="String" mode="IN" optional="false"/> + <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/> + <attribute name="facilityId" type="String" mode="IN" optional="true"/> + <attribute name="pickerPartyId" type="String" mode="IN" optional="true"/> + <attribute name="shipmentId" type="String" mode="INOUT" optional="true"/> + </service> + <!-- Pack Order Services --> <service name="packSingleItem" engine="java" location="org.ofbiz.shipment.packing.PackingServices" invoke="addPackLine" auth="true"> Added: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java?rev=761922&view=auto ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java (added) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java Sat Apr 4 12:55:23 2009 @@ -0,0 +1,181 @@ +/******************************************************************************* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + *******************************************************************************/ + +package org.ofbiz.shipment.verify; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import javolution.util.FastList; +import javolution.util.FastMap; + +import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilGenerics; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.ServiceUtil; +import org.ofbiz.service.LocalDispatcher; + +public class VerifyPickServices { + + private static BigDecimal ZERO = BigDecimal.ZERO; + + public static Map<String, Object> verifySingleItem(DispatchContext dctx, Map<String, ? extends Object> context) { + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + VerifyPickSession pickSession = (VerifyPickSession) context.get("verifyPickSession"); + String orderId = (String) context.get("orderId"); + String facilityId = (String) context.get("facilityId"); + String shipGroupSeqId = (String) context.get("shipGroupSeqId"); + String productId = (String) context.get("productId"); + BigDecimal quantity = (BigDecimal) context.get("quantity"); + List<String> orderItemSeqIds = FastList.newInstance(); + boolean isProductId = false; + BigDecimal qtyToVerify = ZERO; + BigDecimal qtyToVerified = ZERO; + BigDecimal verifiedQuantity = ZERO; + BigDecimal readyToVerifyQty = ZERO; + int counter = 0; + try { + List<GenericValue> orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId)); + for (GenericValue orderItem : orderItems) { + if (productId.equals(orderItem.getString("productId"))) { + orderItemSeqIds.add(orderItem.getString("orderItemSeqId")); + isProductId = true; + } + } + if (isProductId) { + for (String orderItemSeqId : orderItemSeqIds) { + counter++; + if (quantity.compareTo(ZERO) > 0) { + GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId , "orderItemSeqId", orderItemSeqId), false); + BigDecimal orderedQuantity = orderItem.getBigDecimal("quantity"); + List<GenericValue> shipments = delegator.findByAnd("Shipment", UtilMisc.toMap("primaryOrderId", orderId , "statusId", "SHIPMENT_PICKED")); + for(GenericValue shipment : shipments) { + List<GenericValue> orderShipments = shipment.getRelatedByAnd("OrderShipment" , UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId)); + for(GenericValue orderShipment : orderShipments) { + verifiedQuantity = verifiedQuantity.add(orderShipment.getBigDecimal("quantity")); + } + } + qtyToVerify = orderedQuantity.subtract(verifiedQuantity); + if (qtyToVerify.compareTo(quantity) > -1) { + readyToVerifyQty = pickSession.getReadyToVerifyQuantity(orderId, orderItemSeqId); + qtyToVerified = orderedQuantity.subtract(readyToVerifyQty); + if (qtyToVerified.compareTo(quantity) > -1) { + pickSession.createRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, facilityId, orderItem); + counter--; + break; + } else if (orderItems.size() == counter) { + throw new GeneralException("No valid order item found for product ["+productId+"] with quantity: "+quantity); + } + } else if (orderItemSeqIds.size() == counter) { + throw new GeneralException("No valid order item found for product ["+productId+"] with quantity: "+quantity); + } + } + } + } else { + throw new GeneralException("No valid order item found for product ["+productId+"] with quantity: "+quantity); + } + } catch(Exception ex) { + return ServiceUtil.returnError(ex.getMessage()); + } + return ServiceUtil.returnSuccess(); + } + + public static Map<String, Object> verifyBulkItem(DispatchContext dctx, Map<String, ? extends Object> context) { + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + VerifyPickSession pickSession = (VerifyPickSession) context.get("verifyPickSession"); + String orderId = (String) context.get("orderId"); + String facilityId = (String) context.get("facilityId"); + String shipGroupSeqId = (String) context.get("shipGroupSeqId"); + GenericValue userLogin = (GenericValue) context.get("userLogin"); + Map<String, ?> selectedMap = UtilGenerics.checkMap(context.get("selectedMap")); + Map<String, String> itemMap = UtilGenerics.checkMap(context.get("itemMap")); + Map<String, String> productMap = UtilGenerics.checkMap(context.get("productMap")); + Map<String, String> quantityMap = UtilGenerics.checkMap(context.get("quantityMap")); + if (selectedMap != null) { + for (String rowKey : selectedMap.keySet()) { + String orderItemSeqId = itemMap.get(rowKey); + String productId = productMap.get(rowKey); + BigDecimal qtyToVerify = ZERO; + BigDecimal qtyToVerified = ZERO; + BigDecimal verifiedQuantity = ZERO; + BigDecimal readyToVerifyQty = ZERO; + BigDecimal quantity = new BigDecimal(quantityMap.get(rowKey)); + if (quantity.compareTo(ZERO) > 0) { + try { + GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId , "orderItemSeqId", orderItemSeqId), false); + BigDecimal orderedQuantity = orderItem.getBigDecimal("quantity"); + List<GenericValue> shipments = delegator.findByAnd("Shipment", UtilMisc.toMap("primaryOrderId", orderId , "statusId", "SHIPMENT_PICKED")); + for(GenericValue shipment : shipments) { + List<GenericValue> orderShipments = shipment.getRelatedByAnd("OrderShipment" , UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId)); + for(GenericValue orderShipment : orderShipments) { + verifiedQuantity = verifiedQuantity.add(orderShipment.getBigDecimal("quantity")); + } + } + qtyToVerify = orderedQuantity.subtract(verifiedQuantity); + if (qtyToVerify.compareTo(quantity) > -1) { + readyToVerifyQty = pickSession.getReadyToVerifyQuantity(orderId,orderItemSeqId); + qtyToVerified = orderedQuantity.subtract(readyToVerifyQty); + if (qtyToVerified.compareTo(quantity) > -1) { + pickSession.createRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, facilityId, orderItem); + } else { + throw new GeneralException("Quantity to Verify is more than the Quantity left to Verify (orderedQuantity - readyToVerifiedQty)"); + } + } else { + throw new GeneralException("Quantity to Verify is more than the Quantity left to Verify (orderedQuantity - verifiedQuantity)"); + } + } catch (Exception ex) { + return ServiceUtil.returnError(ex.getMessage()); + } + } + } + } + return ServiceUtil.returnSuccess(); + } + + public static Map<String, Object> completeVerifiedPick(DispatchContext dctx, Map<String, ? extends Object> context) { + GenericDelegator delegator = dctx.getDelegator(); + LocalDispatcher dispatcher = dctx.getDispatcher(); + String shipmentId = null; + VerifyPickSession pickSession = (VerifyPickSession) context.get("verifyPickSession"); + String orderId = (String) context.get("orderId"); + String facilityId = (String) context.get("facilityId"); + String shipGroupSeqId = (String) context.get("shipGroupSeqId"); + GenericValue userLogin = (GenericValue) context.get("userLogin"); + try { + shipmentId = pickSession.complete(orderId); + Map<String, Object> shipment = FastMap.newInstance(); + shipment.put("shipmentId", shipmentId); + pickSession.clearAllRows(); + return shipment; + } catch (GeneralException ex) { + return ServiceUtil.returnError(ex.getMessage(), ex.getMessageList()); + } + } + + public static Map<String, Object> cancelAllRows(DispatchContext dctx, Map<String, ? extends Object> context) { + VerifyPickSession session = (VerifyPickSession) context.get("verifyPickSession"); + session.clearAllRows(); + return ServiceUtil.returnSuccess(); + } +} \ No newline at end of file Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickServices.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java?rev=761922&view=auto ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java (added) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java Sat Apr 4 12:55:23 2009 @@ -0,0 +1,238 @@ +/******************************************************************************* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + *******************************************************************************/ + +package org.ofbiz.shipment.verify; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import javolution.util.FastList; +import javolution.util.FastMap; + +import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.service.GenericDispatcher; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ServiceUtil; + +public class VerifyPickSession implements Serializable { + + protected GenericValue userLogin = null; + protected String dispatcherName = null; + protected String delegatorName = null; + protected int rowItems = 1; + protected List<VerifyPickSessionRow> pickRows = null; + + private transient GenericDelegator _delegator = null; + private transient LocalDispatcher _dispatcher = null; + + public VerifyPickSession() { + } + + public VerifyPickSession(LocalDispatcher dispatcher, GenericValue userLogin) { + this._dispatcher = dispatcher; + this.dispatcherName = dispatcher.getName(); + this._delegator = _dispatcher.getDelegator(); + this.delegatorName = _delegator.getDelegatorName(); + this.userLogin = userLogin; + this.pickRows = FastList.newInstance(); + } + + public LocalDispatcher getDispatcher() { + if (_dispatcher == null) { + _dispatcher = GenericDispatcher.getLocalDispatcher(dispatcherName, this.getDelegator()); + } + return _dispatcher; + } + + public GenericDelegator getDelegator() { + if (_delegator == null) { + _delegator = GenericDelegator.getGenericDelegator(delegatorName); + } + return _delegator; + } + + public void createRow(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, String facilityId, GenericValue orderItem) { + int rowItem = this.getRowNo(); + int counter = 1; + BigDecimal readyToVerify = null; + if (rowItem > 1) { + List<VerifyPickSessionRow> rows = this.getPickRows(); + for (VerifyPickSessionRow row : rows) { + counter++; + if ((orderId.equals(row.getOrderId())) && (orderItemSeqId.equals(row.getOrderSeqId()))) { + readyToVerify = quantity.add(row.getReadyToVerifyQty()); + row.setReadyToVerifyQty(readyToVerify); + break; + } else if(counter == rowItem) { + this.createRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, facilityId, orderItem, rowItem); + } + } + } else { + this.createRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, facilityId, orderItem, rowItem); + } + } + + public void createRow(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, String facilityId, GenericValue orderItem, int rowItem) { + pickRows.add(new VerifyPickSessionRow(orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, facilityId, orderItem, rowItem)); + this.setRowNo(); + } + + public int getRowNo() { + return this.rowItems; + } + + public GenericValue getUserLogin() { + return this.userLogin; + } + + public void setRowNo() { + this.rowItems = (this.getRowNo()) + 1; + } + + public List<VerifyPickSessionRow> getPickRows() { + return this.pickRows; + } + + public List<VerifyPickSessionRow> getPickRows(String orderId) { + List<VerifyPickSessionRow> pickVerifyRows = FastList.newInstance(); + for (VerifyPickSessionRow line: this.getPickRows()) { + if (orderId.equals(line.getOrderId())) { + pickVerifyRows.add(line); + } + } + return pickVerifyRows; + } + + public BigDecimal getReadyToVerifyQuantity(String orderId, String orderSeqId) throws GeneralException { + BigDecimal readyToVerifyQty = BigDecimal.ZERO; + for (VerifyPickSessionRow line: this.getPickRows()) { + if ((orderId.equals(line.getOrderId())) && (orderSeqId.equals(line.getOrderSeqId()))) { + readyToVerifyQty = readyToVerifyQty.add(line.getReadyToVerifyQty()); + } + } + return readyToVerifyQty; + } + + public void clearAllRows() { + this.pickRows.clear(); + this.rowItems = 1; + } + + public String complete(String orderId) throws GeneralException { + String shipmentId = null; + String shipmentItemSeqId = null; + String invoiceId = null; + String invoiceItemSeqId = null; + for (VerifyPickSessionRow line: this.getPickRows(orderId)) { + shipmentId = this.createShipment(line); + break; + } + for (VerifyPickSessionRow line: this.getPickRows(orderId)) { + shipmentItemSeqId = this.createShipmentItem(line,shipmentId); + line.setShipmentItemSeqId(shipmentItemSeqId); + } + invoiceId = this.createInvoice(orderId); + for (VerifyPickSessionRow line: this.getPickRows(orderId)) { + invoiceItemSeqId = this.createInvoiceItem(line, invoiceId, shipmentId); + line.setInvoiceItemSeqId(invoiceItemSeqId); + } + return shipmentId; + } + + protected String createShipment(VerifyPickSessionRow line) throws GeneralException { + Map<String, Object> newShipment = FastMap.newInstance(); + newShipment.put("originFacilityId", line.getFacilityId()); + newShipment.put("primaryShipGroupSeqId", line.getShipGroupSeqId()); + newShipment.put("primaryOrderId", line.getOrderId()); + newShipment.put("shipmentTypeId", "OUTGOING_SHIPMENT"); + newShipment.put("statusId", "SHIPMENT_PICKED"); + newShipment.put("userLogin", this.getUserLogin()); + Map<String, Object> newShipResp = this.getDispatcher().runSync("createShipment", newShipment); + if (ServiceUtil.isError(newShipResp)) { + throw new GeneralException(ServiceUtil.getErrorMessage(newShipResp)); + } + String shipmentId = (String) newShipResp.get("shipmentId"); + return shipmentId; + } + + protected String createShipmentItem(VerifyPickSessionRow line,String shipmentId) throws GeneralException { + Map<String, Object> newShipmentItem = FastMap.newInstance(); + newShipmentItem.put("shipmentId", shipmentId); + newShipmentItem.put("productId", line.getProductId()); + newShipmentItem.put("userLogin", this.getUserLogin()); + newShipmentItem.put("quantity", line.getReadyToVerifyQty()); + Map<String, Object> newShipItem = this.getDispatcher().runSync("createShipmentItem", newShipmentItem); + if (ServiceUtil.isError(newShipItem)) { + throw new GeneralException(ServiceUtil.getErrorMessage(newShipItem)); + } + String shipmentItemSeqId = (String) newShipItem.get("shipmentItemSeqId"); + Map<String, Object> newOrderShipment = FastMap.newInstance(); + newOrderShipment.put("shipmentId", shipmentId); + newOrderShipment.put("shipmentItemSeqId", shipmentItemSeqId); + newOrderShipment.put("orderId", line.getOrderId()); + newOrderShipment.put("orderItemSeqId", line.getOrderSeqId()); + newOrderShipment.put("quantity", line.getReadyToVerifyQty()); + newOrderShipment.put("userLogin", this.getUserLogin()); + Map<String, Object> newOrderShip = this.getDispatcher().runSync("createOrderShipment", newOrderShipment); + if (ServiceUtil.isError(newOrderShip)) { + throw new GeneralException(ServiceUtil.getErrorMessage(newOrderShip)); + } + return shipmentItemSeqId; + } + + protected String createInvoice(String orderId) throws GeneralException { + Map createInvoiceContext = FastMap.newInstance(); + createInvoiceContext.put("partyId", (EntityUtil.getFirst(this.getDelegator().findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "BILL_TO_CUSTOMER")))).getString("partyId")); + createInvoiceContext.put("partyIdFrom", (EntityUtil.getFirst(this.getDelegator().findByAnd("OrderRole", UtilMisc.toMap("orderId", orderId, "roleTypeId", "BILL_FROM_VENDOR")))).getString("partyId")); + createInvoiceContext.put("invoiceTypeId", "SALES_INVOICE"); + createInvoiceContext.put("statusId", "INVOICE_IN_PROCESS"); + createInvoiceContext.put("userLogin", this.getUserLogin()); + Map createInvoiceResult = this.getDispatcher().runSync("createInvoice", createInvoiceContext); + if (ServiceUtil.isError(createInvoiceResult)) { + throw new GeneralException(ServiceUtil.getErrorMessage(createInvoiceResult)); + } + String invoiceId = (String) createInvoiceResult.get("invoiceId"); + return invoiceId; + } + + protected String createInvoiceItem(VerifyPickSessionRow line, String invoiceId, String shipmentId) throws GeneralException { + Map createInvoiceItemContext = FastMap.newInstance(); + createInvoiceItemContext.put("invoiceId", invoiceId); + createInvoiceItemContext.put("orderId", line.getOrderId()); + createInvoiceItemContext.put("invoiceItemTypeId", "INV_FPROD_ITEM"); + createInvoiceItemContext.put("productId", line.getProductId()); + createInvoiceItemContext.put("quantity", line.getReadyToVerifyQty()); + createInvoiceItemContext.put("userLogin", this.getUserLogin()); + Map createInvoiceItemResult = this.getDispatcher().runSync("createInvoiceItem", createInvoiceItemContext); + if (ServiceUtil.isError(createInvoiceItemResult)) { + throw new GeneralException(ServiceUtil.getErrorMessage(createInvoiceItemResult)); + } + String invoiceItemSeqId = (String) createInvoiceItemResult.get("invoiceItemSeqId"); + GenericValue shipmentItemBilling = this.getDelegator().makeValue("ShipmentItemBilling", UtilMisc.toMap("invoiceId", invoiceId, "invoiceItemSeqId", invoiceItemSeqId)); + shipmentItemBilling.put("shipmentId", shipmentId); + shipmentItemBilling.put("shipmentItemSeqId", line.getShipmentItemSeqId()); + shipmentItemBilling.create(); + return invoiceItemSeqId; + } +} \ No newline at end of file Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSession.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java?rev=761922&view=auto ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java (added) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java Sat Apr 4 12:55:23 2009 @@ -0,0 +1,102 @@ +/******************************************************************************* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + *******************************************************************************/ + +package org.ofbiz.shipment.verify; + +import java.io.Serializable; +import java.math.BigDecimal; + +import org.ofbiz.entity.GenericValue; + +public class VerifyPickSessionRow implements Serializable { + + protected String orderId = null; + protected String orderItemSeqId = null; + protected String shipGroupSeqId = null; + protected String productId = null; + protected String facilityId = null; + protected BigDecimal readyToVerifyQty = BigDecimal.ZERO; + protected GenericValue orderItem = null; + protected int rowItem = 0; + protected String shipmentItemSeqId = null; + protected String invoiceItemSeqId = null; + + public VerifyPickSessionRow() { + } + + public VerifyPickSessionRow(String orderId, String orderItemSeqId, String shipGroupSeqId, String productId, BigDecimal quantity, String facilityId, GenericValue orderItem, int rowItem) { + this.orderId = orderId; + this.orderItemSeqId = orderItemSeqId; + this.shipGroupSeqId = shipGroupSeqId; + this.productId = productId; + this.readyToVerifyQty = quantity; + this.facilityId = facilityId; + this.orderItem = orderItem; + this.rowItem = rowItem; + this.shipmentItemSeqId = null; + } + + public String getOrderId() { + return this.orderId; + } + + public String getOrderSeqId() { + return this.orderItemSeqId; + } + + public String getShipGroupSeqId() { + return this.shipGroupSeqId; + } + + public String getProductId() { + return this.productId; + } + + public String getFacilityId() { + return this.facilityId; + } + + public BigDecimal getReadyToVerifyQty() { + return this.readyToVerifyQty; + } + + public void setReadyToVerifyQty(BigDecimal readyToVerifyQty) { + this.readyToVerifyQty = readyToVerifyQty; + } + + public void setShipmentItemSeqId(String shipmentItemSeqId) { + this.shipmentItemSeqId = shipmentItemSeqId; + } + + public String getShipmentItemSeqId() { + return this.shipmentItemSeqId; + } + + public void setInvoiceItemSeqId(String invoiceItemSeqId) { + this.invoiceItemSeqId = invoiceItemSeqId; + } + + public String getInvoiceItemSeqId() { + return this.invoiceItemSeqId; + } + + public GenericValue getOrderItem() { + return this.orderItem; + } +} \ No newline at end of file Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/verify/VerifyPickSessionRow.java ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy?rev=761922&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy (added) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy Sat Apr 4 12:55:23 2009 @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.order.order.OrderReadHelper; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.shipment.verify.VerifyPickSession; + +verifyPickSession = session.getAttribute("verifyPickSession"); +if (!verifyPickSession) { + verifyPickSession = new VerifyPickSession(dispatcher, userLogin); + session.setAttribute("verifyPickSession", verifyPickSession); +} + +shipmentId = parameters.shipmentId; +if (!shipmentId) { + shipmentId = request.getAttribute("shipmentId"); +} +context.shipmentId = shipmentId; + +if (shipmentId) { + context.orderId = null; + shipment = delegator.findOne("Shipment", [shipmentId : shipmentId], false); + if (shipment) { + shipmentItemBillingList = shipment.getRelated("ShipmentItemBilling"); + invoiceIds = EntityUtil.getFieldListFromEntityList(shipmentItemBillingList, "invoiceId", true); + if (invoiceIds) { + context.invoiceIds = invoiceIds; + } + } +} + +facilityId = parameters.facilityId; +if (facilityId) { + facility = delegator.findOne("Facility", [facilityId : facilityId], false); + context.facility = facility; +} +orderId = parameters.orderId; +shipGroupSeqId = parameters.shipGroupSeqId; + +if (orderId && !shipGroupSeqId && orderId.indexOf("/") > -1) { + idArray = orderId.split("\\/"); + orderId = idArray[0]; + shipGroupSeqId = idArray[1]; +} else if (orderId && !shipGroupSeqId) { + shipGroupSeqId = "00001"; +} + +picklistBinId = parameters.picklistBinId; +if (picklistBinId) { + picklistBin = delegator.findOne("PicklistBin", [picklistBinId : picklistBinId], false); + if (picklistBin) { + orderId = picklistBin.primaryOrderId; + shipGroupSeqId = picklistBin.primaryShipGroupSeqId; + } +} + +context.orderId = orderId; +context.shipGroupSeqId = shipGroupSeqId; +context.picklistBinId = picklistBinId; + +if (orderId) { + orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false); + if (orderHeader) { + OrderReadHelper orh = new OrderReadHelper(orderHeader); + context.orderId = orderId; + context.orderHeader = orderHeader; + context.orderReadHelper = orh; + orderItemShipGroup = orh.getOrderItemShipGroup(shipGroupSeqId); + context.orderItemShipGroup = orderItemShipGroup; + orderItems = orh.getOrderItems(); + context.orderItems = orderItems; + if ("ORDER_APPROVED".equals(orderHeader.statusId)) { + if (shipGroupSeqId) { + productStoreId = orh.getProductStoreId(); + context.productStoreId = productStoreId; + } else { + request.setAttribute("errorMessageList", ['No ship group sequence ID. Cannot process.']); + } + } else { + request.setAttribute("errorMessageList", ["Order #" + orderId + " is not approved for picking."]); + } + } else { + request.setAttribute("errorMessageList", ["Order #" + orderId + " cannot be found."]); + } +} +context.verifyPickSession = verifyPickSession; \ No newline at end of file Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=761922&r1=761921&r2=761922&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Sat Apr 4 12:55:23 2009 @@ -642,6 +642,40 @@ <response name="error" type="view" value="PickMoveStock"/> </request-map> + <!-- ================ Picking Verify Requests ================= --> + <request-map uri="VerifyPick"> + <security https="true" auth="true"/> + <response name="success" type="view" value="VerifyPick"/> + </request-map> + + <request-map uri="processVerifyPick"> + <security https="true" auth="true"/> + <event type="service" invoke="verifySingleItem"/> + <response name="success" type="view" value="VerifyPick"/> + <response name="error" type="view" value="VerifyPick"/> + </request-map> + + <request-map uri="processBulkVerifyPick"> + <security https="true" auth="true"/> + <event type="service" invoke="verifyBulkItem"/> + <response name="success" type="view" value="VerifyPick"/> + <response name="error" type="view" value="VerifyPick"/> + </request-map> + + <request-map uri="cancelAllRows"> + <security https="true" auth="true"/> + <event type="service" invoke="cancelAllRows"/> + <response name="success" type="view" value="VerifyPick"/> + <response name="error" type="view" value="VerifyPick"/> + </request-map> + + <request-map uri="completeVerifiedPick"> + <security https="true" auth="true"/> + <event type="service" invoke="completeVerifiedPick"/> + <response name="success" type="view" value="VerifyPick"/> + <response name="error" type="view" value="VerifyPick"/> + </request-map> + <!-- ============= Packing Wizard Requests ============== --> <request-map uri="PackOrder"> <security https="true" auth="true"/> @@ -1185,6 +1219,8 @@ <view-map name="ShipmentBarCode.pdf" type="screenfop" page="component://product/widget/facility/ShipmentScreens.xml#ShipmentBarCode.fo" content-type="application/pdf" encoding="none"/> <view-map name="ShipmentManifest.pdf" type="screenfop" page="component://product/widget/facility/ShipmentScreens.xml#ShipmentManifest.fo" content-type="application/pdf" encoding="none"/> + <view-map name="VerifyPick" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#VerifyPick"/> + <view-map name="ScheduleShipmentRouteSegment" type="screen" page="component://product/widget/facility/FacilityScreens.xml#ScheduleShipmentRouteSegment"/> <view-map name="Labels" type="screen" page="component://product/widget/facility/FacilityScreens.xml#Labels"/> <view-map name="BatchPrintShippingLabels" type="screenfop" page="component://product/widget/facility/FacilityScreens.xml#BatchPrintShippingLabels" content-type="application/pdf" encoding="none"/> Added: ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl?rev=761922&view=auto ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl (added) +++ ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl Sat Apr 4 12:55:23 2009 @@ -0,0 +1,332 @@ +<#-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +<#if security.hasEntityPermission("FACILITY", "_VIEW", session)> + <#assign showInput = "Y"> + <div class="screenlet"> + <div class="screenlet-title-bar"> + <ul> + <li class="h3">${uiLabelMap.ProductVerify} ${uiLabelMap.OrderOrder} ${uiLabelMap.CommonIn} ${facility.facilityName?if_exists} [${facility.facilityId?if_exists}]</li> + </ul> + <br class="clear"/> + </div> + <#if shipmentId?has_content> + <#assign showInput = "N"> + </#if> + <#if shipmentId?has_content> + <div> + ${uiLabelMap.ProductShipmentId} <a href="<@ofbizUrl>/ViewShipment?shipmentId=${shipmentId}</@ofbizUrl>" class="buttontext">${shipmentId}</a> + </div> + <#if invoiceIds?exists && invoiceIds?has_content> + <div> + <p>${uiLabelMap.AccountingInvoices}:</p> + <ul> + <#list invoiceIds as invoiceId> + <li> + #<a href="/accounting/control/invoiceOverview?invoiceId=${invoiceId}&externalLoginKey=${externalLoginKey}" target="_blank" class="buttontext">${invoiceId}</a> + (<a href="/accounting/control/invoice.pdf?invoiceId=${invoiceId}&externalLoginKey=${externalLoginKey}" target="_blank" class="buttontext">PDF</a>) + </li> + </#list> + </ul> + </div> + </#if> + </#if> + <br/> + <div class="screenlet-body"> + <form name="selectOrderForm" method="post" action="<@ofbizUrl>VerifyPick</@ofbizUrl>"> + <input type="hidden" name="facilityId" value="${facility.facilityId?if_exists}"/> + <table cellspacing="0" class="basic-table"> + <tr> + <td width="25%" align="right"><span class="label">${uiLabelMap.ProductOrderId}</span></td> + <td width="1"> </td> + <td width="25%"> + <#if shipmentId?has_content> + <input type="text" name="orderId" size="20" maxlength="20" value=""/> + <#else> + <input type="text" name="orderId" size="20" maxlength="20" value="${orderId?if_exists}"/> + </#if> + / + <input type="text" name="shipGroupSeqId" size="6" maxlength="6" value="${shipGroupSeqId?default("00001")}"/> + </td> + <td> </td> + </tr> + <tr> + <td colspan="2"> </td> + <td colspan="2"> + <input type="submit" value="${uiLabelMap.ProductVerify} ${uiLabelMap.OrderOrder}"/> + </td> + </tr> + </table> + </form> + <br/> + <!-- select picklist bin form --> + <form name="selectPicklistBinForm" method="post" action="<@ofbizUrl>VerifyPick</@ofbizUrl>" style="margin: 0;"> + <input type="hidden" name="facilityId" value="${facility.facilityId?if_exists}"/> + <table cellspacing="0" class="basic-table"> + <tr> + <td width="25%" align='right'><span class="label">${uiLabelMap.FormFieldTitle_picklistBinId}</span></td> + <td width="1"> </td> + <td width="25%"> + <input type="text" name="picklistBinId" size="29" maxlength="60" value="${picklistBinId?if_exists}"/> + </td> + <td> </td> + </tr> + <tr> + <td colspan="2"> </td> + <td colspan="1"> + <input type="submit" value="${uiLabelMap.ProductVerify} ${uiLabelMap.OrderOrder}"/> + </td> + </tr> + </table> + </form> + <form name="clearPickForm" method="post" action="<@ofbizUrl>cancelAllRows</@ofbizUrl>"> + <input type="hidden" name="orderId" value="${orderId?if_exists}"/> + <input type="hidden" name="shipGroupSeqId" value="${shipGroupSeqId?if_exists}"/> + <input type="hidden" name="facilityId" value="${facility.facilityId?if_exists}"/> + </form> + </div> + </div> + <#if showInput != "N" && orderHeader?exists && orderHeader?has_content> + <div class="screenlet"> + <div class="screenlet-title-bar"> + <ul> + <li class="h3">${uiLabelMap.ProductOrderId} #<a href="/ordermgr/control/orderview?orderId=${orderId}">${orderId}</a> / ${uiLabelMap.ProductOrderShipGroupId} #${shipGroupSeqId}</li> + </ul> + <br class="clear"/> + </div> + <div class="screenlet-body"> + <#if orderItemShipGroup?has_content> + <#assign postalAddress = orderItemShipGroup.getRelatedOne("PostalAddress")> + <#assign carrier = orderItemShipGroup.carrierPartyId?default("N/A")> + <table cellpadding="4" cellspacing="4" class="basic-table"> + <tr> + <td valign="top"> + <span class="label">${uiLabelMap.ProductShipToAddress}</span> + <br/> + ${uiLabelMap.CommonTo}: ${postalAddress.toName?default("")} + <br/> + <#if postalAddress.attnName?has_content> + ${uiLabelMap.CommonAttn}: ${postalAddress.attnName} + <br/> + </#if> + ${postalAddress.address1} + <br/> + <#if postalAddress.address2?has_content> + ${postalAddress.address2} + <br/> + </#if> + ${postalAddress.city?if_exists}, ${postalAddress.stateProvinceGeoId?if_exists} ${postalAddress.postalCode?if_exists} + <br/> + ${postalAddress.countryGeoId} + <br/> + </td> + <td> </td> + <td valign="top"> + <span class="label">${uiLabelMap.ProductCarrierShipmentMethod}</span> + <br/> + <#if carrier == "USPS"> + <#assign color = "red"> + <#elseif carrier == "UPS"> + <#assign color = "green"> + <#else> + <#assign color = "black"> + </#if> + <#if carrier != "_NA_"> + <font color="${color}">${carrier}</font> + + </#if> + ${orderItemShipGroup.shipmentMethodTypeId?default("??")} + </td> + <td> </td> + <td valign="top"> + <span class="label">${uiLabelMap.OrderInstructions}</span> + <br/> + ${orderItemShipGroup.shippingInstructions?default("(${uiLabelMap.CommonNone})")} + </td> + </tr> + </table> + </#if> + <hr/> + <form name="singlePickForm" method="post" action="<@ofbizUrl>processVerifyPick</@ofbizUrl>"> + <input type="hidden" name="orderId" value="${orderId?if_exists}"/> + <input type="hidden" name="shipGroupSeqId" value="${shipGroupSeqId?if_exists}"/> + <input type="hidden" name="facilityId" value="${facility.facilityId?if_exists}"/> + <table cellpadding="2" cellspacing="0" class="basic-table"> + <tr> + <td> + <div> + <span class="label">${uiLabelMap.ProductProductNumber}</span> + <input type="text" name="productId" size="20" maxlength="20" value=""/> + @ + <input type="text" name="quantity" size="6" maxlength="6" value="1"/> + <input type="submit" value="${uiLabelMap.ProductVerify} ${uiLabelMap.OrderItem}"/> + </div> + </td> + </tr> + </table> + </form> + <br/> + <#assign orderItems = orderItems?if_exists> + <form name="multiPickForm" method="post" action="<@ofbizUrl>processBulkVerifyPick</@ofbizUrl>"> + <input type="hidden" name="facilityId" value="${facility.facilityId?if_exists}"/> + <input type="hidden" name="userLoginId" value="${userLoginId?if_exists}"/> + <input type="hidden" name="orderId" value="${orderId?if_exists}"/> + <input type="hidden" name="shipGroupSeqId" value="${shipGroupSeqId?if_exists}"/> + <table class="basic-table" cellspacing='0'> + <tr class="header-row"> + <td> </td> + <td>${uiLabelMap.ProductItem} #</td> + <td>${uiLabelMap.ProductProductId}</td> + <td>${uiLabelMap.ProductInternalName}</td> + <td align="right">${uiLabelMap.ProductOrderedQuantity}</td> + <td align="right">${uiLabelMap.ProductVerified} ${uiLabelMap.CommonQuantity}</td> + <td> </td> + <td align="right">${uiLabelMap.CommonReady} ${uiLabelMap.CommonTo} ${uiLabelMap.ProductVerify}</td> + <td align="center">${uiLabelMap.CommonQty} ${uiLabelMap.CommonTo} ${uiLabelMap.ProductVerify}</td> + </tr> + <#if orderItems?has_content> + <#assign rowKey = 1> + <#assign counter = 1> + <#assign isShowVerifyItemButton = "false"> + <#list orderItems as orderItem> + <#assign orderItemSeqId = orderItem.orderItemSeqId?if_exists> + <#assign readyToVerify = verifyPickSession.getReadyToVerifyQuantity(orderId,orderItemSeqId)> + <#assign orderItemQuantity = orderItem.getBigDecimal("quantity")> + <#assign verifiedQuantity = 0.000000> + <#assign shipments = delegator.findByAnd("Shipment", Static["org.ofbiz.base.util.UtilMisc"].toMap("primaryOrderId", orderItem.getString("orderId"), "statusId", "SHIPMENT_PICKED"))> + <#if (shipments?has_content)> + <#list shipments as shipment> + <#assign orderShipments = shipment.getRelatedByAnd("OrderShipment", Static["org.ofbiz.base.util.UtilMisc"].toMap("orderId", "${orderId}", "orderItemSeqId", orderItemSeqId))> + <#if orderShipments?has_content> + <#list orderShipments as orderShipment> + <#assign verifiedQuantity = verifiedQuantity + orderShipment.getBigDecimal("quantity")> + </#list> + </#if> + </#list> + </#if> + <#if verifiedQuantity == orderItemQuantity> + <#assign counter = counter +1> + </#if> + <#assign orderItemQuantity = orderItemQuantity.subtract(verifiedQuantity)> + <#assign orderProduct = orderItem.getRelatedOne("Product")?if_exists/> + <tr> + <#if (orderItemQuantity.compareTo(readyToVerify) > 0) > + <td><input type="checkbox" name="sel_${rowKey}" value="Y" checked=""/></td> + <#assign isShowVerifyItemButton = "true"> + <#else> + <td> </td> + </#if> + <td>${orderItemSeqId?if_exists}</td> + <td>${orderProduct.productId?default("N/A")}</td> + <td> + <a href="/catalog/control/EditProduct?productId=${orderProduct.productId?if_exists}${externalKeyParam}" class="buttontext" target="_blank">${(orderProduct.internalName)?if_exists}</a> + </td> + <td align="right">${orderItemQuantity?if_exists}</td> + <td align="right">${verifiedQuantity?if_exists}</td> + <td> </td> + <td align="right">${readyToVerify?if_exists}</td> + <td align="center"> + <#if (orderItemQuantity.compareTo(readyToVerify) > 0)> + <#assign qtyToVerify = orderItemQuantity.subtract(readyToVerify) > + <input type="text" size="7" name="qty_${rowKey}" value="${qtyToVerify?if_exists}"/> + <#else> + 0 + </#if> + </td> + <input type="hidden" name="prd_${rowKey}" value="${(orderItem.productId)?if_exists}"/> + <input type="hidden" name="ite_${rowKey}" value="${(orderItem.orderItemSeqId)?if_exists}"/> + </tr> + <#assign rowKey = rowKey + 1> + </#list> + </#if> + <tr> + <td colspan="10"> </td> + </tr> + <tr> + <td colspan="12" align="right"> + <#if isShowVerifyItemButton == "true"> + <input type="submit" value="${uiLabelMap.ProductVerify} ${uiLabelMap.OrderItems}"/> + </#if> + + <#if rowKey != counter> + <input type="button" value="${uiLabelMap.CommonCancel}" onclick="javascript:document.clearPickForm.submit();"/> + </#if> + </td> + </tr> + </table> + </form> + <br/> + </div> + </div> + <#assign orderId = orderId?if_exists > + <#assign pickRows = verifyPickSession.getPickRows(orderId)?if_exists> + <form name="completePickForm" method="post" action="<@ofbizUrl>completeVerifiedPick</@ofbizUrl>"> + <input type="hidden" name="orderId" value="${orderId?if_exists}"/> + <input type="hidden" name="shipGroupSeqId" value="${shipGroupSeqId?if_exists}"/> + <input type="hidden" name="facilityId" value="${facility.facilityId?if_exists}"/> + <input type="hidden" name="userLoginId" value="${userLoginId?if_exists}"/> + <#if pickRows?has_content> + <div class="screenlet"> + <div class="screenlet-title-bar"> + <ul> + <li class="h3">${uiLabelMap.ProductVerified} ${uiLabelMap.OrderItems} : ${pickRows.size()?if_exists}</li> + </ul> + <br class="clear"/> + </div> + <div class="screenlet-body"> + <table class="basic-table" cellspacing='0'> + <tr class="header-row"> + <td>${uiLabelMap.ProductItem} #</td> + <td>${uiLabelMap.ProductProductId}</td> + <td align="right">${uiLabelMap.ProductVerify} ${uiLabelMap.CommonQty}</td> + <td> </td> + </tr> + <#list pickRows as pickRow> + <#if (pickRow.getOrderId()?if_exists).equals(orderId)> + <tr> + <td>${pickRow.getOrderSeqId()?if_exists}</td> + <td>${pickRow.getProductId()?if_exists}</td> + <td align="right">${pickRow.getReadyToVerifyQty()?if_exists}</td> + </tr> + </#if> + </#list> + </table> + <input type="submit" value="${uiLabelMap.ProductComplete}"/> + </div> + </div> + </#if> + </form> + </#if> + <#if orderId?has_content> + <script language="javascript"> + document.singlePickForm.productId.focus(); + </script> + <#else> + <script language="javascript"> + document.selectOrderForm.orderId.focus(); + </script> + </#if> + <#if shipmentId?has_content> + <script language="javascript"> + document.selectOrderForm.orderId.focus(); + </script> + </#if> +<#else> + <h3>${uiLabelMap.ProductFacilityViewPermissionError}</h3> +</#if> \ No newline at end of file Propchange: ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/applications/product/webapp/facility/shipment/VerifyPick.ftl ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/product/widget/facility/Menus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/Menus.xml?rev=761922&r1=761921&r2=761922&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/facility/Menus.xml (original) +++ ofbiz/trunk/applications/product/widget/facility/Menus.xml Sat Apr 4 12:55:23 2009 @@ -118,6 +118,11 @@ <parameter param-name="facilityId" from-field="facilityId"/> </link> </menu-item> + <menu-item name="VerifyPick" title="${uiLabelMap.ProductVerifyPick}"> + <link target="VerifyPick"> + <parameter param-name="facilityId" from-field="facilityId"/> + </link> + </menu-item> <menu-item name="PackOrder" title="${uiLabelMap.ProductPacking}"> <link target="PackOrder"> <parameter param-name="facilityId" from-field="facilityId"/> Modified: ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml?rev=761922&r1=761921&r2=761922&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml Sat Apr 4 12:55:23 2009 @@ -260,6 +260,25 @@ </section> </screen> + <screen name="VerifyPick"> + <section> + <actions> + <set field="titleProperty" value="ProductVerifyPick"/> + <set field="headerItem" value="shipment"/> + <script location="component://product/webapp/facility/WEB-INF/actions/shipment/VerifyPick.groovy"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="body"> + <platform-specific> + <html><html-template location="component://product/webapp/facility/shipment/VerifyPick.ftl"/></html> + </platform-specific> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="PackOrder"> <section> <actions> |
Free forum by Nabble | Edit this page |