Please review

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

Please review

Jacopo Cappellato
What do you think about this patch?
I've replaced the three secas that call the "processOrderPayments"
service from "appendOrderItem", "cancelOrderItem", "updateOrderItem" to
the service "resetGrandTotal".

Is it correct to call the "processOrderPayments" service everytime the
grand total is recomputed instead of just calling it when an order item
is modified? (I guess it is)

Jacopo

Index: applications/order/servicedef/secas.xml
===================================================================
--- applications/order/servicedef/secas.xml (revision 538906)
+++ applications/order/servicedef/secas.xml (working copy)
@@ -97,15 +97,9 @@
         <action service="resetGrandTotal" mode="sync"/>
         <action service="sendOrderChangeNotification" mode="async" persist="true"/>
     </eca>
-    <eca service="updateOrderItems" event="return">
-        <action service="processOrderPayments" mode="sync"/>
-    </eca>
     <eca service="appendOrderItem" event="commit">
         <action service="resetGrandTotal" mode="sync"/>
     </eca>
-    <eca service="appendOrderItem" event="return">
-        <action service="processOrderPayments" mode="sync"/>
-    </eca>
 
     <!-- cancel order items -->
     <eca service="cancelOrderItem" event="commit">
@@ -113,10 +107,12 @@
         <action service="resetGrandTotal" mode="sync"/>
         <action service="sendOrderChangeNotification" mode="async" persist="true"/>
     </eca>
-    <eca service="cancelOrderItem" event="return">
+
+    <!-- order grand total -->
+    <eca service="resetGrandTotal" event="return">
         <action service="processOrderPayments" mode="sync"/>
     </eca>
-
+    
     <!-- order confirmation/notification email ECAs -->
     <eca service="sendOrderConfirmation" event="commit">
         <action service="createOrderNotificationLog" mode="sync"/>
Reply | Threaded
Open this post in threaded view
|

Re: Please review

Jacopo Cappellato
And also, the following ecas is wrong, isn't it?

<eca service="updateReturnItem" event="commit">
     <condition field-name="statusId" operator="equals"
value="RETURN_RECEIVED"/>
     <condition field-name="currentStatusId" operator="not-equals"
value="RETURN_RECEIVED"/>
     <action service="resetGrandTotal" mode="sync"/>
</eca>

Can I remove it?

Jacopo

Jacopo Cappellato wrote:

> What do you think about this patch?
> I've replaced the three secas that call the "processOrderPayments"
> service from "appendOrderItem", "cancelOrderItem", "updateOrderItem" to
> the service "resetGrandTotal".
>
> Is it correct to call the "processOrderPayments" service everytime the
> grand total is recomputed instead of just calling it when an order item
> is modified? (I guess it is)
>
> Jacopo
>
>
> ------------------------------------------------------------------------
>
> Index: applications/order/servicedef/secas.xml
> ===================================================================
> --- applications/order/servicedef/secas.xml (revision 538906)
> +++ applications/order/servicedef/secas.xml (working copy)
> @@ -97,15 +97,9 @@
>          <action service="resetGrandTotal" mode="sync"/>
>          <action service="sendOrderChangeNotification" mode="async" persist="true"/>
>      </eca>
> -    <eca service="updateOrderItems" event="return">
> -        <action service="processOrderPayments" mode="sync"/>
> -    </eca>
>      <eca service="appendOrderItem" event="commit">
>          <action service="resetGrandTotal" mode="sync"/>
>      </eca>
> -    <eca service="appendOrderItem" event="return">
> -        <action service="processOrderPayments" mode="sync"/>
> -    </eca>
>  
>      <!-- cancel order items -->
>      <eca service="cancelOrderItem" event="commit">
> @@ -113,10 +107,12 @@
>          <action service="resetGrandTotal" mode="sync"/>
>          <action service="sendOrderChangeNotification" mode="async" persist="true"/>
>      </eca>
> -    <eca service="cancelOrderItem" event="return">
> +
> +    <!-- order grand total -->
> +    <eca service="resetGrandTotal" event="return">
>          <action service="processOrderPayments" mode="sync"/>
>      </eca>
> -
> +    
>      <!-- order confirmation/notification email ECAs -->
>      <eca service="sendOrderConfirmation" event="commit">
>          <action service="createOrderNotificationLog" mode="sync"/>