Skip to content

Commit

Permalink
COM-4524: Fixed backorder count issue due to transfer location invent…
Browse files Browse the repository at this point in the history
…ory (#375)
  • Loading branch information
atul-chavan committed Oct 12, 2021
1 parent 1c37915 commit 8904b83
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
12 changes: 8 additions & 4 deletions templates/modules/common/order-summary.hypr.live
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
 <table class="mz-ordersummary">
<table class="mz-ordersummary">
<thead>
<tr>
<th class="mz-ordersummary-header-product">{{ labels.product }}</th>
Expand Down Expand Up @@ -35,10 +35,14 @@
{% endfor %}
</dl>
{% else %}
{% if item.product.stock and item.product.stock.isOnBackOrder and item.product.stock.manageStock %}
{% if item.product.stock and item.product.stock.isOnBackOrder and item.product.stock.manageStock and Math.max(item.product.stock.aggregateInventory, item.product.stock.stockAvailable) < item.quantity %}
<div class="mz-product-backorder">
<div class="is-warning mz-product-backorder-warning">
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.stockAvailable) }} {{ labels.itemOnBackorder }}
<div class="is-warning mz-product-backorder-warning">
{% if item.product.stock.aggregateInventory > item.product.stock.stockAvailable %}
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.aggregateInventory) }} {{ labels.itemOnBackorder }}
{% else %}
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.stockAvailable) }} {{ labels.itemOnBackorder }}
{% endif %}
{% if item.product.stock.availableDate %}
.<br /> {{ labels.productBackorderAvailableDate }} {{item.product.stock.availableDate | date("m/d/Y")}}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@
{% endfor %}
</dl>
{% else %}
{% if item.product.stock and item.product.stock.isOnBackOrder and item.product.stock.manageStock %}
{% if item.product.stock and item.product.stock.isOnBackOrder and item.product.stock.manageStock and Math.max(item.product.stock.aggregateInventory, item.product.stock.stockAvailable) < item.quantity %}
<div class="mz-product-backorder">
<div class="is-warning mz-product-backorder-warning">
{% if item.product.stock.aggregateInventory > item.product.stock.stockAvailable %}
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.aggregateInventory) }} {{ labels.itemOnBackorder }}
{% else %}
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.stockAvailable) }} {{ labels.itemOnBackorder }}
{% if item.product.stock.availableDate %}
.<br /> {{ labels.productBackorderAvailableDate }} {{item.product.stock.availableDate | date("m/d/Y")}}
{% endif %}
{% endif %}
{% if item.product.stock.availableDate %}
.<br /> {{ labels.productBackorderAvailableDate }} {{item.product.stock.availableDate | date("m/d/Y")}}
{% endif %}
</div>
</div>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,15 @@
{% endfor %}
</dl>
{% else %}
{% if item.product.stock and item.product.stock.isOnBackOrder and item.product.stock.manageStock %}
{% if item.product.stock and item.product.stock.isOnBackOrder and item.product.stock.manageStock and Math.max(item.product.stock.aggregateInventory, item.product.stock.stockAvailable) < item.quantity%}
<div class="mz-product-backorder">
<div class="is-warning mz-product-backorder-warning">
{% if item.product.stock.aggregateInventory > item.product.stock.stockAvailable %}
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.aggregateInventory) }} {{ labels.itemOnBackorder }}
{% else %}
{{ labels.qty }} {{ item.quantity|subtract(item.product.stock.stockAvailable) }} {{ labels.itemOnBackorder }}
{% if item.product.stock.availableDate %}
{% endif %}
{% if item.product.stock.availableDate %}
.<br /> {{ labels.productBackorderAvailableDate }} {{item.product.stock.availableDate | date("m/d/Y")}}
{% endif %}
</div>
Expand Down

0 comments on commit 8904b83

Please sign in to comment.