Author: sichen
Date: Mon Jul 10 17:01:22 2006 New Revision: 420664 URL: http://svn.apache.org/viewvc?rev=420664&view=rev Log: Add/delete adjustments to created orders. OFBIZ-55. Thanks go to Ashish Vijaywargiya Modified: incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml incubator/ofbiz/trunk/applications/order/servicedef/services.xml incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl Modified: incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties?rev=420664&r1=420663&r2=420664&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties (original) +++ incubator/ofbiz/trunk/applications/order/config/OrderUiLabels.properties Mon Jul 10 17:01:22 2006 @@ -38,6 +38,7 @@ OrderAddress = Address OrderAddOrderToShoppingList = Add Order Items to Shopping List OrderAdjustment = Adjustment +OrderAdjustmentType = Adjustment Type OrderAdjustments = Adjustments OrderAgent=Order Agent OrderAllowSplit = Allow Split Modified: incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=420664&r1=420663&r2=420664&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml (original) +++ incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml Mon Jul 10 17:01:22 2006 @@ -27,7 +27,7 @@ <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.ofbiz.org/dtds/simple-methods.xsd"> - <simple-method method-name="createOrderAdjustment" short-description="Create a ShipmentReceipt"> + <simple-method method-name="createOrderAdjustment" short-description="Create an OrderAdjustment"> <check-permission permission="ORDERMGR" action="_CREATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunCreateOrderAdjustement"/></check-permission> <check-errors/> @@ -42,7 +42,20 @@ <create-value value-name="newEntity"/> </simple-method> - + <simple-method method-name="updateOrderAdjustment" short-description="Update an OrderAdjustment"> + <check-permission permission="ORDERMGR" action="_UPDATE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunUpdateOrderAdjustement"/></check-permission> + <check-errors/> + <entity-one entity-name="OrderAdjustment" value-name="lookedUpValue"/> + <set-nonpk-fields map-name="parameters" value-name="lookedUpValue"/> + <store-value value-name="lookedUpValue"/> + </simple-method> + <simple-method method-name="deleteOrderAdjustment" short-description="Delete an OrderAdjustment"> + <check-permission permission="ORDERMGR" action="_DELETE"><fail-property resource="OrderErrorUiLabels" property="OrderSecurityErrorToRunDeleteOrderAdjustement"/></check-permission> + <check-errors/> + <entity-one entity-name="OrderAdjustment" value-name="lookedUpValue"/> + <remove-value value-name="lookedUpValue"/> + </simple-method> + <simple-method method-name="createOrderItemBilling" short-description="Create an OrderItemBilling"> <make-value entity-name="OrderItemBilling" value-name="newEntity"/> <set-nonpk-fields map-name="parameters" value-name="newEntity"/> Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?rev=420664&r1=420663&r2=420664&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Mon Jul 10 17:01:22 2006 @@ -161,7 +161,19 @@ <override name="orderAdjustmentTypeId" optional="false"/> <override name="orderId" optional="false"/> </service> - + <service name="updateOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple" + location="org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="updateOrderAdjustment"> + <description>Update an order adjustment record</description> + <auto-attributes mode="IN" include="pk" optional="false"/> + <auto-attributes mode="IN" include="nonpk" optional="true"/> + <override name="orderId" optional="false"/> + </service> + <service name="deleteOrderAdjustment" default-entity-name="OrderAdjustment" engine="simple" + location="org/ofbiz/order/order/OrderSimpleMethods.xml" invoke="deleteOrderAdjustment"> + <description>Delete an order adjustment record</description> + <auto-attributes mode="IN" include="pk" optional="false"/> + </service> + <service name="createPaymentFromPreference" engine="java" location="org.ofbiz.order.order.OrderServices" invoke="createPaymentFromPreference"> <description>Creates a payment using the order payment preference</description> Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=420664&r1=420663&r2=420664&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original) +++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Jul 10 17:01:22 2006 @@ -224,13 +224,25 @@ <response name="success" type="view" value="orderview"/> <response name="error" type="view" value="orderview"/> </request-map> - <request-map uri="addOrderAdjustment"> + <request-map uri="createOrderAdjustment"> <security https="true" auth="true"/> <event type="service" invoke="createOrderAdjustment"/> - <response name="success" type="view" value="orderview"/> - <response name="error" type="view" value="orderview"/> + <response name="success" type="view" value="editorderitems"/> + <response name="error" type="view" value="editorderitems"/> </request-map> - + <request-map uri="updateOrderAdjustment"> + <security https="true" auth="true"/> + <event type="service" invoke="updateOrderAdjustment"/> + <response name="success" type="view" value="editorderitems"/> + <response name="error" type="view" value="editorderitems"/> + </request-map> + <request-map uri="deleteOrderAdjustment"> + <security https="true" auth="true"/> + <event type="service" invoke="deleteOrderAdjustment"/> + <response name="success" type="view" value="editorderitems"/> + <response name="error" type="view" value="editorderitems"/> + </request-map> + <request-map uri="addpromocode"> <security https="true" auth="true"/> <event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="addProductPromoCode"/> Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl?rev=420664&r1=420663&r2=420664&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl (original) +++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/editorderitems.ftl Mon Jul 10 17:01:22 2006 @@ -209,7 +209,6 @@ </#list> </#if> </#list> - <tr> <td align="right" colspan="8"> <input type="submit" value="${uiLabelMap.OrderUpdateItems}"/> @@ -221,70 +220,88 @@ <#list orderHeaderAdjustments as orderHeaderAdjustment> <#assign adjustmentType = orderHeaderAdjustment.getRelatedOne("OrderAdjustmentType")> <#assign adjustmentAmount = Static["org.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(orderHeaderAdjustment, orderSubTotal)> + <#assign orderAdjustmentId = orderHeaderAdjustment.get("orderAdjustmentId")> <#if adjustmentAmount != 0> + <form name="updateOrderAdjustmentForm${orderAdjustmentId}" method="post" action="<@ofbizUrl>updateOrderAdjustment?orderAdjustmentId=${orderAdjustmentId?if_exists}&orderId=${orderId?if_exists}</@ofbizUrl>"> <tr> - <td align="right" colspan="5"> - <div class="tabletext"><b>${adjustmentType.get("description",locale)}</b> : ${orderHeaderAdjustment.comments?if_exists}</div> + <td align="right" colspan="4"> + <div class="tabletext"><b>${adjustmentType.get("description",locale)}</b> ${orderHeaderAdjustment.comments?if_exists} :</div> + </td> + <td align="left" nowrap colspan="2"> + <div class="tabletext"><input type="text" name="description" value="${orderHeaderAdjustment.get("description")?if_exists}" size="30" maxlength="60" class="inputBox"></div> </td> - <td align="right" nowrap> - <div class="tabletext"><@ofbizCurrency amount=adjustmentAmount isoCode=currencyUomId/></div> + <td align="left" nowrap> + <div class="tabletext"><input type="text" name="amount" size="6" value="<@ofbizAmount amount=adjustmentAmount/>" class="inputBox"> + <a href="javascript:document.updateOrderAdjustmentForm${orderAdjustmentId}.submit();" class="buttontext">${uiLabelMap.CommonUpdate}</a><a href="<@ofbizUrl>deleteOrderAdjustment?orderAdjustmentId=${orderAdjustmentId?if_exists}&orderId=${orderId?if_exists}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDelete}</a></div> </td> - <td> </td> </tr> + <input type="image" src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" onClick="javascript:document.updateOrderAdjustmentForm${orderAdjustmentId}.submit();"/> + </form> </#if> </#list> - + <tr><td colspan=1><td colspan="8"><hr class="sepbar"></td></tr> <#-- add new adjustment --> <#if security.hasEntityPermission("ORDERMGR", "_UPDATE", session) && orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_CANCELLED" && orderHeader.statusId != "ORDER_REJECTED"> - <tr> - <form name="addAdjustmentForm" method="post" action="<@ofbizUrl>addOrderAdjustment?${paramString}</@ofbizUrl>"> - <input type="hidden" name="comments" value="Added manually by [${userLogin.userLoginId}]"/> - <td align="right" colspan="5"> + <form name="addAdjustmentForm" method="post" action="<@ofbizUrl>createOrderAdjustment?${paramString}</@ofbizUrl>"> + <input type="hidden" name="comments" value="Added manually by [${userLogin.userLoginId}]"/> + <tr> + <td align="right" colspan="5"><div class="tableheadtext">${uiLabelMap.OrderAdjustmentType} :</div></td> + <td align="left" colspan="2"> <select name="orderAdjustmentTypeId" class="selectBox"> <#list orderAdjustmentTypes as type> - <option value="${type.orderAdjustmentTypeId}">${type.get("description",locale)?default(type.orderAdjustmentTypeId)}</option> + <option value="${type.orderAdjustmentTypeId}">${type.get("description",locale)?default(type.orderAdjustmentTypeId)}</option> </#list> </select> </td> - <td align="right"> - <input type="text" name="amount" size="6" value="<@ofbizAmount amount=0.00/>" class="inputBox"/> + </tr> + <tr> + <td align="right" colspan="5"><div class="tableheadtext">${uiLabelMap.CommonComment} :</div></td> + <td align="left" colspan="2"><div class="tabletext"><input type="text" name="description" value="" size="30" maxlength="60" class="inputBox"></div></td> + </tr> + <tr> + <td align="right" colspan="5"><div class="tableheadtext">${uiLabelMap.CommonAmount} :</div></td> + <td align="left" colspan="2"> + <input type="text" name="amount" size="6" value="<@ofbizAmount amount=0.00/>" class="inputBox"/> </td> - <td align="right" colspan="2"> - <a href="javascript:document.addAdjustmentForm.submit();" class="buttontext">${uiLabelMap.CommonAdd}</a> + </tr> + <tr > + <td align="right" colspan="5"></td> + <td align="left" colspan="3"> + <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonAdd}"/> </td> - </form> - </tr> + </tr> + </form> </#if> <#-- subtotal --> <tr><td colspan=1></td><td colspan="8"><hr class="sepbar"></td></tr> <tr> - <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderItemsSubTotal}</b></div></td> - <td align="right" nowrap><div class="tabletext"><@ofbizCurrency amount=orderSubTotal isoCode=currencyUomId/></div></td> + <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderItemsSubTotal} :</b></div></td> + <td align="left" nowrap><div class="tabletext"><@ofbizCurrency amount=orderSubTotal isoCode=currencyUomId/></div></td> </tr> <#-- other adjustments --> <tr> - <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalOtherOrderAdjustments}</b></div></td> - <td align="right" nowrap><div class="tabletext"><@ofbizCurrency amount=otherAdjAmount isoCode=currencyUomId/></div></td> + <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalOtherOrderAdjustments} :</b></div></td> + <td align="left" nowrap><div class="tabletext"><@ofbizCurrency amount=otherAdjAmount isoCode=currencyUomId/></div></td> </tr> <#-- shipping adjustments --> <tr> - <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalShippingAndHandling}</b></div></td> - <td align="right" nowrap><div class="tabletext"><@ofbizCurrency amount=shippingAmount isoCode=currencyUomId/></div></td> + <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalShippingAndHandling} :</b></div></td> + <td align="left" nowrap><div class="tabletext"><@ofbizCurrency amount=shippingAmount isoCode=currencyUomId/></div></td> </tr> <#-- tax adjustments --> <tr> - <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalSalesTax}</b></div></td> - <td align="right" nowrap><div class="tabletext"><@ofbizCurrency amount=taxAmount isoCode=currencyUomId/></div></td> + <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalSalesTax} :</b></div></td> + <td align="left" nowrap><div class="tabletext"><@ofbizCurrency amount=taxAmount isoCode=currencyUomId/></div></td> </tr> <#-- grand total --> <tr> - <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalDue}</b></div></td> - <td align="right" nowrap> + <td align="right" colspan="5"><div class="tabletext"><b>${uiLabelMap.OrderTotalDue} :</b></div></td> + <td align="left" nowrap> <div class="tabletext"><@ofbizCurrency amount=grandTotal isoCode=currencyUomId/></div> </td> </tr> Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl?rev=420664&r1=420663&r2=420664&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl (original) +++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderitems.ftl Mon Jul 10 17:01:22 2006 @@ -473,7 +473,7 @@ <#if adjustmentAmount != 0> <tr> <td align="right" colspan="5"> - <div class="tabletext"><b>${adjustmentType.get("description",locale)}</b> : ${orderHeaderAdjustment.comments?if_exists}</div> + <div class="tabletext"><b>${adjustmentType.get("description",locale)}</b> ${orderHeaderAdjustment.comments?if_exists} ${orderHeaderAdjustment.get("description")?if_exists} : </div> </td> <td align="right" nowrap> <div class="tabletext"><@ofbizCurrency amount=adjustmentAmount isoCode=currencyUomId/></div> |
Free forum by Nabble | Edit this page |