Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Fix order edit and table view shipping info
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Oct 2, 2019
1 parent 41fc5b2 commit d725107
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
return !line.is_shipping;
});
},
shippingLine() {
return _.find(this.order.lines.data, line => {
return line.is_shipping && !line.is_manual;
});
},
shipping() {
return _.filter(this.order.lines.data, line => {
return line.is_shipping;
Expand Down Expand Up @@ -322,13 +327,13 @@
<div class="col-md-4">
<h4>Shipping Method</h4>
<strong class="text-info">
{{ order.shipping_details.method }}
{{ shippingLine.description }}
</strong>
</div>
<div class="col-md-4">
<h4>Shipping Zone</h4>
<strong class="text-info">
{{ order.shipping.option }}
{{ shippingLine.option }}
</strong>
</div>
<div class="col-md-4" v-if="order.shipping_preference">
Expand All @@ -338,6 +343,11 @@
</strong>
</div>
</div>
<article v-if="order.notes">
<h3>Order Notes</h3>
<p>{{ order.notes }}</p>
</article>

<hr>
<table class="table table-bordered">
<thead>
Expand All @@ -356,7 +366,7 @@
</thead>
<tfoot>
<tr>
<td colspan="6"></td>
<td colspan="7"></td>
<td colspan="2" align="right"><strong>Sub total (Excl VAT)</strong></td>
<td v-html="currencySymbol(order.sub_total)"></td>
</tr>
Expand All @@ -367,10 +377,10 @@
{{ line.description }}
</td>
<td>
{{ line.variant_name }}
{{ line.variant_name ? line.variant_name : '-' }}
</td>
<td>-</td>
<td v-html="currencySymbol(line.unit_cost)" v-if="line.unit_cost"></td>
<td>{{ line.quantity }}</td>
<td v-html="currencySymbol(line.unit_price)" v-if="line.unit_price"></td>
<td v-else>1</td>
<td>-</td>
<td v-html="currencySymbol(line.discount_total ? line.discount_total : 0)"></td>
Expand Down Expand Up @@ -464,11 +474,6 @@
</table>
</div>
</div>
<article v-if="order.notes">
<h3>Order Notes</h3>
<p>{{ order.notes }}</p>
</article>

<div class="row" v-if="order.discounts.data && order.discounts.data.length">
<div class="col-md-12">
<h3>Discounts Applied</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
zone(order) {
let shipping = _.find(order.lines.data, line => {
return line.is_shipping;
return line.is_shipping && !line.is_manual;
});
return shipping ? shipping.option : null;
},
Expand Down

0 comments on commit d725107

Please sign in to comment.