Author: ashish
Date: Wed Dec 12 08:13:03 2007 New Revision: 603655 URL: http://svn.apache.org/viewvc?rev=603655&view=rev Log: Applied patch from JIRA Issue # OFBIZ-1498. Thanks Vikas Mayur for your patch. Modified: ofbiz/trunk/specialpurpose/oagis/config/oagis.properties ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Modified: ofbiz/trunk/specialpurpose/oagis/config/oagis.properties URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/config/oagis.properties?rev=603655&r1=603654&r2=603655&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/config/oagis.properties (original) +++ ofbiz/trunk/specialpurpose/oagis/config/oagis.properties Wed Dec 12 08:13:03 2007 @@ -1,57 +1,59 @@ -############################################################################### -# 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. -############################################################################### - -# -- logical location of server (10 char max) -CNTROLAREA.SENDER.LOGICALID=1234567890 - -# -- auth id is required to access machine that generated the BOD (50 char max) -CNTROLAREA.SENDER.AUTHID=OFBiz - -# if these are set to true the XML content of the messages will be saved to OagisMessageInfo.fullMessageXml -Oagis.Debug.Save.Xml.Out=true -Oagis.Debug.Save.Xml.In=true - -Oagis.Template.ConfirmBod=component://oagis/widget/MessageInfoScreens.xml#ConfirmBod -Oagis.Template.ReceiveDelivery=component://oagis/widget/MessageInfoScreens.xml#ReceiveDelivery -Oagis.Template.ProcessShipment=component://oagis/widget/MessageInfoScreens.xml#ProcessShipment - -Oagis.Warehouse.PoReceiptFacilityId=WebStoreWarehouse - -Oagis.Warehouse.ReturnReceiptFacilityId=WebStoreWarehouse -Oagis.Warehouse.ReturnReceiptLocationSeqId= - -Oagis.Warehouse.SyncInventoryFacilityId=WebStoreWarehouse -Oagis.Warehouse.SyncInventoryProductStoreId=9001 - -# email notification -#oagis.notification.email.sendTo= - -# Client Cert, etc settings -#auth.client.certificate.alias=testrpckey -#auth.basic.username=foo -#auth.basic.password=bar - -# URLs for outgoing messages -#url.send.processShipment=https://foo.bar.com/receive -#url.send.confirmBod=https://foo.bar.com/receive -#url.send.receiveDelivery=https://foo.bar.com/receive - -# if the test.save.outgoing.directory is specified the files will be saved there but not sent to any URL that might be specified -#test.save.outgoing.directory= -#test.save.outgoing.filename.base= +############################################################################### +# 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. +############################################################################### + +# -- logical location of server (10 char max) +CNTROLAREA.SENDER.LOGICALID=1234567890 + +# -- auth id is required to access machine that generated the BOD (50 char max) +CNTROLAREA.SENDER.AUTHID=OFBiz + +# if these are set to true the XML content of the messages will be saved to OagisMessageInfo.fullMessageXml +Oagis.Debug.Save.Xml.Out=true +Oagis.Debug.Save.Xml.In=true + +Oagis.Template.ConfirmBod=component://oagis/widget/MessageInfoScreens.xml#ConfirmBod +Oagis.Template.ReceiveDelivery=component://oagis/widget/MessageInfoScreens.xml#ReceiveDelivery +Oagis.Template.ProcessShipment=component://oagis/widget/MessageInfoScreens.xml#ProcessShipment + +Oagis.Warehouse.PoReceiptFacilityId=WebStoreWarehouse + +Oagis.Warehouse.ReturnReceiptFacilityId=WebStoreWarehouse +Oagis.Warehouse.ReturnReceiptLocationSeqId= + +Oagis.Warehouse.SyncInventoryFacilityId=WebStoreWarehouse +Oagis.Warehouse.SyncInventoryProductStoreId=9001 + +Oagis.Order.ValidProductStores=9001 + +# email notification +#oagis.notification.email.sendTo= + +# Client Cert, etc settings +#auth.client.certificate.alias=testrpckey +#auth.basic.username=foo +#auth.basic.password=bar + +# URLs for outgoing messages +#url.send.processShipment=https://foo.bar.com/receive +#url.send.confirmBod=https://foo.bar.com/receive +#url.send.receiveDelivery=https://foo.bar.com/receive + +# if the test.save.outgoing.directory is specified the files will be saved there but not sent to any URL that might be specified +#test.save.outgoing.directory= +#test.save.outgoing.filename.base= Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?rev=603655&r1=603654&r2=603655&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Wed Dec 12 08:13:03 2007 @@ -43,6 +43,7 @@ import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.collections.MapStack; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -738,9 +739,15 @@ return ServiceUtil.returnError("Could not find OrderHeader with ID [" + orderId + "]"); } + List validStores = StringUtil.split(UtilProperties.getPropertyValue("oagis.properties", "Oagis.Order.ValidProductStores"), ","); + if (UtilValidate.isNotEmpty(validStores)) { + if (!validStores.contains(orderHeader.getString("productStoreId"))) { + return ServiceUtil.returnSuccess("Order [" + orderId + "] placed is not for valid Store(s)"); + } + } String orderStatusId = orderHeader.getString("statusId"); if (!"ORDER_APPROVED".equals(orderStatusId)) { - return ServiceUtil.returnError("OrderHeader not in the approved status (ORDER_APPROVED) with ID [" + orderId + "], is in the [" + orderStatusId + "] status"); + return ServiceUtil.returnSuccess("OrderHeader not in the approved status (ORDER_APPROVED) with ID [" + orderId + "], is in the [" + orderStatusId + "] status"); } if (!"SALES_ORDER".equals(orderHeader.getString("orderTypeId"))) { return ServiceUtil.returnError("OrderHeader not a sales order (SALES_ORDER) with ID [" + orderId + "]"); |
Free forum by Nabble | Edit this page |