svn commit: r928974 - in /ofbiz/trunk/applications/order: config/OrderErrorUiLabels.xml script/org/ofbiz/order/request/CustRequestServices.xml servicedef/services_request.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r928974 - in /ofbiz/trunk/applications/order: config/OrderErrorUiLabels.xml script/org/ofbiz/order/request/CustRequestServices.xml servicedef/services_request.xml

hansbak-2
Author: hansbak
Date: Tue Mar 30 04:15:24 2010
New Revision: 928974

URL: http://svn.apache.org/viewvc?rev=928974&view=rev
Log:
add delete customer request in draft status service

Modified:
    ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
    ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
    ofbiz/trunk/applications/order/servicedef/services_request.xml

Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=928974&r1=928973&r2=928974&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Tue Mar 30 04:15:24 2010
@@ -19,10 +19,6 @@
     under the License.
 -->
 <resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <property key="CheckCustRequest">
-        <value xml:lang="en">Can't only update CustRequest, when status is in-process...is now: ${custRequest.statusId}</value>
-        <value xml:lang="pt_BR">Não se pode apenas atualizar CustRequest, quando o estado está "em processamento"... é agora: ${custRequest.statusId}</value>
-    </property>
     <property key="OrderAProductStoreMustBeSelectedForASalesOrder">
         <value xml:lang="en">A Product Store MUST be selected for a Sales Order. </value>
         <value xml:lang="es">Se debe seleccionar una tienda para un pedido de venta</value>
@@ -205,6 +201,13 @@
         <value xml:lang="th">การอัพเดทบนบัตรพบว่ามีข้อยกเว้นการวิเคราะห์</value>
         <value xml:lang="zh">更新购物车时发生解析错误。 </value>
     </property>
+    <property key="OrderCheckCustRequest">
+        <value xml:lang="en">Can only update customer request, when status is in-process...is now: ${custRequest.statusId}</value>
+        <value xml:lang="pt_BR">Não se pode apenas atualizar CustRequest, quando o estado está "em processamento"... é agora: ${custRequest.statusId}</value>
+    </property>
+    <property key="OrderCheckCustRequestDraftStatusForDelete">
+        <value xml:lang="en">Can only delete customer request in 'draft' status, status is now however: ${custRequest.statusId}</value>
+    </property>
     <property key="OrderCouldNotFindOrderHeaderForOrderIdInGetProductStoreFromOrderReturningNull">
         <value xml:lang="en">Could not find OrderHeader for orderId [ ${orderId} ] in getProductStoreFromOrder, returning null</value>
         <value xml:lang="es">No se pudo obtener encabezado del pedido para el código [ ${orderId} ] en la obtención de la tienda para los productos del pedido, retornando un valor nulo.</value>

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml?rev=928974&r1=928973&r2=928974&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/request/CustRequestServices.xml Tue Mar 30 04:15:24 2010
@@ -101,6 +101,19 @@ under the License.
         
     </simple-method>
 
+    <simple-method method-name="deleteCustRequest" short-description="Delete a draft Customer Request with no relations yet">
+        <entity-one value-field="custRequest" entity-name="CustRequest"/>
+        <if-compare operator="not-equals" value="CRQ_DRAFT" field="custRequest.statusId">
+            <add-error ><fail-property resource="OrderErrorUiLabels" property="OrderCheckCustRequestDraftStatusForDelete"/></add-error>
+        </if-compare>
+        <check-errors/>
+        <!-- delete attached content/roles first -->
+        <remove-related relation-name="CustRequestContent" value-field="custRequest"/>
+        <remove-related relation-name="CustRequestParty" value-field="custRequest"/>
+        <remove-related relation-name="CustRequestStatus" value-field="custRequest"/>
+        <remove-value value-field="custRequest"/>
+    </simple-method>
+
     <simple-method method-name="updateCustRequest" short-description="Update Customer Request">
         <call-simple-method method-name="checkStatusCustRequest"/>
         <set field="oldStatusId" from-field="custRequest.statusId"/>
@@ -184,8 +197,8 @@ under the License.
                 </or>
             </condition>
             <then>      
-                <add-error><fail-property resource="OrderErrorUiLabels" property="CheckCustRequest"/></add-error>
-                <log level="info" message="Can't only update CustRequest, when status is in-process...is now: ${custRequest.statusId}"/>                    
+                <add-error><fail-property resource="OrderErrorUiLabels" property="OrderCheckCustRequest"/></add-error>
+                <log level="info" message="Can only update CustRequest, when status is in-process...is now: ${custRequest.statusId}"/>                    
                 <check-errors/>
             </then>
         </if>
@@ -503,7 +516,7 @@ under the License.
     </simple-method>
 
     <!-- Create/Delete  CustRequest Content -->
-    <simple-method method-name="createCustRequestContent" short-description="Create Work Effort Content">
+    <simple-method method-name="createCustRequestContent" short-description="Create Customer request Content">
         <call-simple-method method-name="checkStatusCustRequest"/>        
         <make-value entity-name="CustRequestContent" value-field="newEntity"/>
         <set-nonpk-fields map="parameters" value-field="newEntity"/>

Modified: ofbiz/trunk/applications/order/servicedef/services_request.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_request.xml?rev=928974&r1=928973&r2=928974&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_request.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_request.xml Tue Mar 30 04:15:24 2010
@@ -56,6 +56,12 @@ under the License.
         <override name="description" allow-html="safe"/>
     </service>
 
+    <service name="deleteCustRequest" engine="simple" default-entity-name="CustRequest"
+            location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml" invoke="deleteCustRequest" auth="true">
+        <description>Delete a custRequest record in draft status</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+
     <service name="createCustRequestAttribute" engine="simple"
             location="component://order/script/org/ofbiz/order/request/CustRequestServices.xml" invoke="createCustRequestAttribute" auth="true">
         <description>Create CustRequestAttribute record</description>