Author: mor
Date: Tue Jul 14 09:19:40 2009 New Revision: 793824 URL: http://svn.apache.org/viewvc?rev=793824&view=rev Log: Misc. fixes to the Weigh Packages Only screen. This screen is part of Facility > Packing. Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl ofbiz/trunk/applications/product/webapp/facility/shipment/WeightPackage.ftl Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=793824&r1=793823&r2=793824&view=diff ============================================================================== --- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original) +++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Tue Jul 14 09:19:40 2009 @@ -20044,6 +20044,9 @@ <value xml:lang="th">à¹à¸§à¹à¸à¹à¸à¸à¹</value> <value xml:lang="zh">ç½ç«</value> </property> + <property key="ProductWeighPackageOnly"> + <value xml:lang="en">Weigh Packages Only</value> + </property> <property key="ProductWeight"> <value xml:lang="de">Gewicht</value> <value xml:lang="en">Weight</value> @@ -20063,9 +20066,6 @@ <value xml:lang="ru">ÐеÑовой поÑог</value> <value xml:lang="th">รหัสà¸à¹à¸³à¸«à¸à¸±à¸à¸à¸µà¹à¹à¸à¸´à¸à¹à¸à¸¢</value> </property> - <property key="ProductWeightPackageOnly"> - <value xml:lang="en">Weight Package Only</value> - </property> <property key="ProductWeightTitle1"> <value xml:lang="en">Weight charge</value> <value xml:lang="fr">Frais lié au poids</value> Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java?rev=793824&r1=793823&r2=793824&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/weightPackage/WeightPackageSession.java Tue Jul 14 09:19:40 2009 @@ -35,6 +35,7 @@ import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.service.GenericDispatcher; import org.ofbiz.service.LocalDispatcher; @@ -526,4 +527,18 @@ this.upsShipmentConfirm(); } } + + protected Integer getOrderedQuantity(String orderId) { + BigDecimal orderedQuantity = ZERO; + try { + List<GenericValue> orderItems = getDelegator().findByAnd("OrderItem", UtilMisc.toMap("orderId", orderId)); + for (GenericValue orderItem : orderItems) { + orderedQuantity = orderedQuantity.add(orderItem.getBigDecimal("quantity")); + } + } catch (GenericEntityException e) { + Debug.logError(e, module); + } + return orderedQuantity.intValue(); + } + } \ No newline at end of file Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy?rev=793824&r1=793823&r2=793824&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/WeightPackage.groovy Tue Jul 14 09:19:40 2009 @@ -154,6 +154,7 @@ request.setAttribute("_ERROR_MESSAGE_", UtilProperties.getMessage("OrderErrorUiLabels", "OrderErrorOrderIdNotFound", [orderId : orderId], locale)); orderId = null; } + context.orderedQuantity = weightPackageSession.getOrderedQuantity(orderId); } weightPackageSession.setCarrierPartyId(carrierPartyId); context.orderId = orderId; Modified: ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl?rev=793824&r1=793823&r2=793824&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl Tue Jul 14 09:19:40 2009 @@ -88,7 +88,7 @@ <td colspan="2"> <input type="image" src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" onClick="javascript:document.selectOrderForm.submit();"> <a href="javascript:document.selectOrderForm.submit();" class="buttontext">${uiLabelMap.ProductPackOrder}</a> - <a href="javascript:document.selectOrderForm.action='<@ofbizUrl>WeightPackageOnly</@ofbizUrl>';document.selectOrderForm.submit();" class="buttontext">${uiLabelMap.ProductWeightPackageOnly}</a> + <a href="javascript:document.selectOrderForm.action='<@ofbizUrl>WeightPackageOnly</@ofbizUrl>';document.selectOrderForm.submit();" class="buttontext">${uiLabelMap.ProductWeighPackageOnly}</a> </td> </tr> </table> @@ -113,7 +113,7 @@ <td colspan="1"> <input type="image" src="<@ofbizContentUrl>/images/spacer.gif</@ofbizContentUrl>" onClick="javascript:document.selectPicklistBinForm.submit();"> <a href="javascript:document.selectPicklistBinForm.submit();" class="buttontext">${uiLabelMap.ProductPackOrder}</a> - <a href="javascript:document.selectPicklistBinForm.action='<@ofbizUrl>WeightPackageOnly</@ofbizUrl>';document.selectPicklistBinForm.submit();" class="buttontext">${uiLabelMap.ProductWeightPackageOnly}</a> + <a href="javascript:document.selectPicklistBinForm.action='<@ofbizUrl>WeightPackageOnly</@ofbizUrl>';document.selectPicklistBinForm.submit();" class="buttontext">${uiLabelMap.ProductWeighPackageOnly}</a> </td> </tr> </table> Modified: ofbiz/trunk/applications/product/webapp/facility/shipment/WeightPackage.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/WeightPackage.ftl?rev=793824&r1=793823&r2=793824&view=diff ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/shipment/WeightPackage.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/shipment/WeightPackage.ftl Tue Jul 14 09:19:40 2009 @@ -80,7 +80,7 @@ <td colspan="2"> </td> <td colspan="2"> <a href="javascript:document.selectOrderForm.action='<@ofbizUrl>PackOrder</@ofbizUrl>';document.selectOrderForm.submit();" class="buttontext">${uiLabelMap.ProductPackOrder}</a> - <a href="javascript:document.selectOrderForm.submit();" class="buttontext">${uiLabelMap.ProductWeightPackageOnly}</a> + <a href="javascript:document.selectOrderForm.submit();" class="buttontext">${uiLabelMap.ProductWeighPackageOnly}</a> </td> </tr> </table> @@ -102,7 +102,7 @@ <td colspan="2"> </td> <td colspan="1"> <a href="javascript:document.selectPicklistBinForm.action='<@ofbizUrl>PackOrder</@ofbizUrl>';document.selectPicklistBinForm.submit();" class="buttontext">${uiLabelMap.ProductPackOrder}</a> - <a href="javascript:document.selectPicklistBinForm.submit();" class="buttontext">${uiLabelMap.ProductWeightPackageOnly}</a> + <a href="javascript:document.selectPicklistBinForm.submit();" class="buttontext">${uiLabelMap.ProductWeighPackageOnly}</a> </td> </tr> </table> @@ -177,6 +177,7 @@ <input type="hidden" name="newEstimatedShippingCost" value="${newEstimatedShippingCost?if_exists}"/> </form> </#if> + <#if (orderedQuantity > packedLines.size())> <table class="basic-table" cellpadding="2" cellspacing='0'> <form name="weightPackageForm" method ="post" action="<@ofbizUrl>setPackageInfo</@ofbizUrl>"> <input type="hidden" name = "shipGroupSeqId" value = "${shipGroupSeqId?if_exists}"/> @@ -217,6 +218,7 @@ </tr> </form> </table> + </#if> <#else> <table class="basic-table" cellpadding="2" cellspacing='0'> <tr> |
Free forum by Nabble | Edit this page |