This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 73f7057bdc Fixed: Disable 'New Shipment For Ship Group' buttons for 
purchase orders that are not approved (OFBIZ-13337) (#935)
73f7057bdc is described below

commit 73f7057bdcc04ca6cb2894160cdc7dfcd325f51b
Author: Anahita Goljahani <[email protected]>
AuthorDate: Mon Jan 12 17:32:09 2026 +0100

    Fixed: Disable 'New Shipment For Ship Group' buttons for purchase orders 
that are not approved (OFBIZ-13337) (#935)
    
    Explanation: When a PO is created but not yet approved, the Order
    Details screen displays the “New Shipment For Ship Group” buttons, which
    allows shipments to be created prior to order approval. This PR fixes
    this behavior by hiding the buttons until the order has been approved.
    
    This is one of the issues reported in [Step-by-step workflow: purchase
    orders with multiple shipments and
    
invoices](https://cwiki.apache.org/confluence/display/OFBENDUSER/Step-by-step+workflow%3A+purchase+orders+with+multiple+shipments+and+invoices)
---
 applications/order/template/order/OrderShippingInfo.ftl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/applications/order/template/order/OrderShippingInfo.ftl 
b/applications/order/template/order/OrderShippingInfo.ftl
index 4d452f59b4..1772cae0ca 100644
--- a/applications/order/template/order/OrderShippingInfo.ftl
+++ b/applications/order/template/order/OrderShippingInfo.ftl
@@ -801,7 +801,8 @@ under the License.
                  </#if>
                <#else>
                  <#assign facilities = 
facilitiesForShipGroup.get(shipGroup.shipGroupSeqId)>
-                 <#if facilities?has_content>
+                 <#if "ORDER_APPROVED" == orderHeader.statusId>
+                   <#if facilities?has_content>
                      <div>
                       <form name="createShipment2_${shipGroup.shipGroupSeqId}" 
method="post" action="/facility/control/createShipment">
                          <input type="hidden" name="primaryOrderId" 
value="${orderId}"/>
@@ -819,7 +820,7 @@ under the License.
                          <input type="submit" class="smallSubmit" 
value="${uiLabelMap.OrderNewShipmentForShipGroup} 
[${shipGroup.shipGroupSeqId}]"/>
                       </form>
                       </div>
-                 <#else>
+                   <#else>
                      <a 
href="javascript:document.quickDropShipOrder_${shipGroup_index}.submit();" 
class="buttontext">${uiLabelMap.ProductShipmentQuickComplete}</a>
                      <a 
href="javascript:document.createShipment3_${shipGroup.shipGroupSeqId}.submit();"
 class="buttontext">${uiLabelMap.OrderNewDropShipmentForShipGroup} 
[${shipGroup.shipGroupSeqId}]</a>
                      <form name="quickDropShipOrder_${shipGroup_index}" 
method="post" action="<@ofbizUrl>quickDropShipOrder</@ofbizUrl>">
@@ -834,6 +835,7 @@ under the License.
                           <input type="hidden" name="statusId" 
value="PURCH_SHIP_CREATED" />
                           <input type="hidden" name="externalLoginKey" 
value="${externalLoginKey}" />
                       </form>
+                   </#if>
                  </#if>
                </#if>
               </td>

Reply via email to