@lancom/shared 0.0.111 → 0.0.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,9 +34,21 @@ export default {
34
34
  saveOrder(order) {
35
35
  return order._id ? _put(`admin/order/${order._id}`, order) : _post('admin/order', order);
36
36
  },
37
+ createOrderSubsequentInvoice(order, invoice) {
38
+ return _post(`admin/shop/${order.shop}/order/${order._id}/invoice`, invoice);
39
+ },
40
+ sendOrderSubsequentInvoice(order, invoice) {
41
+ return _post(`admin/shop/${order.shop}/order/${order._id}/invoice/${invoice}/send`);
42
+ },
37
43
  exportOrderToStarshipit(order, shipment) {
38
44
  return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-starshipit`, shipment);
39
45
  },
46
+ markShipmentAsDispatched(order, shipment) {
47
+ return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
48
+ },
49
+ removeShipmentFromStarshipit(order, shipment) {
50
+ return _delete(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
51
+ },
40
52
  calculateShipmentRates(order, shipment) {
41
53
  return _get(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/calculate-shipping`);
42
54
  },
@@ -121,6 +133,9 @@ export default {
121
133
  fetchInventoryHistory(params) {
122
134
  return _get('admin/inventory-history', params);
123
135
  },
136
+ fetchInventoryCommitted(params) {
137
+ return _get('admin/inventory/committed', params);
138
+ },
124
139
  fetchInventory(params) {
125
140
  return _get('admin/inventory');
126
141
  },
@@ -81,11 +81,12 @@ const api = {
81
81
  deleteOrder(token) {
82
82
  return _delete(`order/${token}`);
83
83
  },
84
- fetchOrderByToken(token) {
85
- return _get(`order/token/${token}`);
84
+ fetchOrderByToken(token, params) {
85
+ return _get(`order/token/${token}`, params);
86
86
  },
87
- createOrderPayment(id, card, shop) {
88
- return _post(`shop/${shop}/order/${id}/payment`, card);
87
+ createOrderPayment(id, card, shop, invoiceId) {
88
+ const url = invoiceId ? `shop/${shop}/order/${id}/invoice/${invoiceId}/payment` : `shop/${shop}/order/${id}/payment`;
89
+ return _post(url, card);
89
90
  },
90
91
  addOrderTimeline(id, item) {
91
92
  return _post(`order/${id}/timeline`, item);
@@ -12,8 +12,11 @@
12
12
  :address="order.shippingAddress"
13
13
  :without-additional-info="true" />
14
14
  </div>
15
+ <div class="Cart__quantity-errors">
16
+ <cart-quantity-errors />
17
+ </div>
15
18
  <progress-steps-controls
16
- :disabled-next="isSubmit && invalid"
19
+ :disabled-next="(isSubmit && invalid) || isNotValidQuantity"
17
20
  @prev="$emit('prev')"
18
21
  @next="submit" />
19
22
  </validation-observer>
@@ -22,12 +25,16 @@
22
25
  </template>
23
26
 
24
27
  <script>
28
+ import CartQuantityErrors from '@lancom/shared/components/checkout/cart/cart_quantity_errors/cart-quantity-errors';
29
+ import CartMixin from '@lancom/shared/components/checkout/cart/cart.mixin';
25
30
  import AddressForm from '@lancom/shared/components/checkout/order/address-form/address-form';
26
31
  import ProgressStepsControls from '@lancom/shared/components/common/progress_steps/progress_steps_controls/progress-steps-controls';
27
32
 
28
33
  export default {
29
34
  name: 'OrderBillingInformation',
35
+ mixins: [CartMixin],
30
36
  components: {
37
+ CartQuantityErrors,
31
38
  AddressForm,
32
39
  ProgressStepsControls
33
40
  },
@@ -2,14 +2,14 @@
2
2
  <div class="PaymentSuccess__wrapper">
3
3
  <div class="PaymentSuccess__icon"></div>
4
4
  <div class="lc_semibold22">
5
- {{ !order.paid ? 'Order Received' : 'Order paid successfully' }}!
5
+ {{ label }} {{ !model.paid ? ' Received' : ' paid successfully' }}!
6
6
  </div>
7
7
  <div class="lc_regular18 lc_grey1 mt-5">
8
- Order {{ order.code }}
8
+ {{ label }} {{ model.code }}
9
9
  </div>
10
10
  <div class="lc_regular16 lc_grey1 mt-5">
11
11
  {{
12
- !order.paid
12
+ !model.paid
13
13
  ? 'Our team will advise cost and the next steps. Please except a call or email from us after we review.'
14
14
  : 'The charge line will appear on your card as "Wholesale Apparel & Workwear"'
15
15
  }}
@@ -31,10 +31,21 @@ export default {
31
31
  type: Object,
32
32
  required: true
33
33
  },
34
+ invoice: {
35
+ type: Object
36
+ },
34
37
  btnLabel: {
35
38
  type: String,
36
39
  default: 'Back to editor'
37
40
  }
41
+ },
42
+ computed: {
43
+ model() {
44
+ return this.invoice || this.order
45
+ },
46
+ label() {
47
+ return this.invoice ? 'Invoice' : 'Order';
48
+ }
38
49
  }
39
50
  };
40
51
  </script>
@@ -0,0 +1,236 @@
1
+ <template>
2
+ <div class="FAQ__wrapper view-transition">
3
+ <slot name="header">
4
+ <div class="FAQ__header">
5
+ <h1 class="lc_h1--white">
6
+ Frequently asked questions
7
+ </h1>
8
+ <span class="lc_subtitle1--strong-white FAQ__subtitle">
9
+ Here you can find all the questions you need answered
10
+ </span>
11
+ </div>
12
+ </slot>
13
+ <div class="content-inner">
14
+ <div class="row FAQ__content-wrapper">
15
+ <div class="FAQ__content col-md-10 col-12 mr-auto ml-auto">
16
+ <div
17
+ v-for="group in groups"
18
+ :key="group.type"
19
+ class="FAQ__group">
20
+ <div
21
+ :ref="group.type"
22
+ class="FAQ__group-header"
23
+ @click="togable && toggleGroup(group)">
24
+ <div
25
+ class="FAQ__group-title"
26
+ :class="group.type">
27
+ {{ group.name }}
28
+ </div>
29
+ <i
30
+ v-if="togable"
31
+ class="icon-cancel FAQ__group-caret"
32
+ :class="{ active: openedGroup === group.type }"></i>
33
+ </div>
34
+ <transition
35
+ name="fade"
36
+ appear>
37
+ <div
38
+ v-if="openedGroup === group.type"
39
+ class="FAQ__group-content view-transition">
40
+ <div
41
+ v-for="entity in group.entities"
42
+ :key="entity._id"
43
+ :ref="entity._id"
44
+ class="FAQ__entity">
45
+ <div
46
+ class="FAQ__entity-header"
47
+ @click="toggleEntity(entity)">
48
+ <div class="FAQ__entity-title">
49
+ {{ entity.question }}
50
+ </div>
51
+ <i
52
+ class="icon-angle-down FAQ__entity-header-caret"
53
+ :class="{ active: openedEntities.includes(entity._id) }"></i>
54
+ </div>
55
+ <transition
56
+ name="fade"
57
+ appear>
58
+ <div
59
+ v-if="openedEntities.includes(entity._id)"
60
+ class="FAQ__entity-body view-transition"
61
+ v-html="entity.answer">
62
+ </div>
63
+ </transition>
64
+ </div>
65
+ </div>
66
+ </transition>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ </div>
72
+ </template>
73
+
74
+ <script>
75
+ export default {
76
+ name: 'FAQ',
77
+ props: {
78
+ groups: {
79
+ type: Array,
80
+ required: true
81
+ },
82
+ togable: {
83
+ type: Boolean,
84
+ default: true
85
+ },
86
+ preopenedGroup: {
87
+ type: Object
88
+ },
89
+ preopenedEntity: {
90
+ type: String
91
+ }
92
+ },
93
+ data() {
94
+ return {
95
+ openedGroup: null,
96
+ openedEntities: []
97
+ };
98
+ },
99
+ mounted() {
100
+ if (this.preopenedGroup) {
101
+ this.toggleGroup({ type: this.preopenedGroup });
102
+ }
103
+ if (this.preopenedEntity) {
104
+ this.toggleEntity({ _id: this.preopenedEntity });
105
+ }
106
+ },
107
+ methods: {
108
+ toggleGroup({ type }) {
109
+ this.openedGroup = this.openedGroup === type ? null : type;
110
+ },
111
+ toggleEntity({ _id }) {
112
+ const index = this.openedEntities.indexOf(_id);
113
+ if (~index) {
114
+ this.$delete(this.openedEntities, index);
115
+ } else {
116
+ this.openedEntities.push(_id);
117
+ }
118
+ }
119
+ }
120
+ };
121
+ </script>
122
+
123
+ <style lang="scss">
124
+ @import "@lancom/shared/assets/scss/variables";
125
+ $types: delivery, general, other, printing, garments;
126
+ .FAQ {
127
+ &__wrapper {
128
+ margin-top: 20px;
129
+ }
130
+ &__header {
131
+ text-align: center;
132
+ background-color: $dark_blue;
133
+ padding: 70px 0 86px 0;
134
+ }
135
+ &__subtitle {
136
+ font-size: 25px;
137
+ font-weight: normal;
138
+ line-height: 35px;
139
+ letter-spacing: 0.02em;
140
+ }
141
+ &__content {
142
+ padding: 100px 0 180px 0;
143
+ }
144
+ &__group {
145
+ background-color: $light_gray;
146
+ & + & {
147
+ margin-top: 16px;
148
+ }
149
+ &-header {
150
+ padding: 22px 45px;
151
+ display: flex;
152
+ align-items: center;
153
+ justify-content: space-between;
154
+ cursor: pointer;
155
+ text-transform: uppercase;
156
+ }
157
+ &-title {
158
+ font-weight: 500;
159
+ font-size: 22px;
160
+ line-height: 29px;
161
+ letter-spacing: 0.02em;
162
+ color: $dark_blue;
163
+ line-height: 41px;
164
+ padding-left: 62px;
165
+ position: relative;
166
+ &:before {
167
+ content: '';
168
+ width: 40px;
169
+ height: 40px;
170
+ position: absolute;
171
+ left: 0;
172
+ top: 50%;
173
+ transform: translateY(-50%);
174
+ background-size: cover;
175
+ }
176
+ @each $type in $types {
177
+ &.#{$type}:before {
178
+ background-image: url(~static/icons/#{$type}.svg);
179
+ }
180
+ }
181
+ }
182
+ &-caret {
183
+ font-size: 16px;
184
+ &:before {
185
+ transform: rotate(45deg);
186
+ transition: transform .22s ease-in-out;
187
+ }
188
+ &.active:before {
189
+ transform: rotate(0);
190
+ }
191
+ }
192
+ &-content {
193
+ padding: 22px 45px 60px 45px;
194
+ }
195
+ }
196
+ &__entity {
197
+ background-color: #FFFFFF;
198
+ & + & {
199
+ margin-top: 10px;
200
+ }
201
+ &-header {
202
+ padding: 18px 30px;
203
+ position: relative;
204
+ cursor: pointer;
205
+ &-caret {
206
+ font-size: 28px;
207
+ position: absolute;
208
+ top: 50%;
209
+ right: 30px;
210
+ transform: translateY(-50%);
211
+ &:before {
212
+ transform: rotate(0);
213
+ transition: transform .22s ease-in-out;
214
+ }
215
+ &.active:before {
216
+ transform: rotate(180deg);
217
+ }
218
+ }
219
+ }
220
+ &-title {
221
+ font-weight: 500;
222
+ font-size: 18px;
223
+ line-height: 25px;
224
+ letter-spacing: 0.02em;
225
+ color: $dark_blue;
226
+ }
227
+ &-body {
228
+ padding: 6px 30px 24px 30px;
229
+ line-height: 27px;
230
+ color: $gray;
231
+ overflow: hidden;
232
+ @import "@lancom/shared/assets/scss/normalize";
233
+ }
234
+ }
235
+ }
236
+ </style>
@@ -1,11 +1,12 @@
1
1
  <template>
2
2
  <div class="OrderPayment__wrapper">
3
3
  <h4 class="lc_h1 mt-10 mb-10">
4
- Payment Order #{{order.code}}
4
+ Payment {{ invoice ? 'Invoice' : 'Order'}} #{{model.code}}
5
5
  </h4>
6
6
  <payment-success
7
- v-if="order.paid"
8
- :order="order">
7
+ v-if="model.paid"
8
+ :order="order"
9
+ :invoice="invoice">
9
10
  <template slot="back-btn">
10
11
  <div class="d-flex">
11
12
  <btn
@@ -25,7 +26,7 @@
25
26
  <div>
26
27
  <payment-cart
27
28
  ref="paymentCart"
28
- :amount="order.totalGST"
29
+ :amount="model.totalGST"
29
30
  :has-spinner="false"
30
31
  :payment-data="order.shippingAddress">
31
32
  </payment-cart>
@@ -63,7 +64,11 @@ export default {
63
64
  order: {
64
65
  type: Object,
65
66
  required: true
66
- }
67
+ },
68
+ invoice: {
69
+ type: Object,
70
+ required: true
71
+ },
67
72
  },
68
73
  data() {
69
74
  return {
@@ -72,7 +77,10 @@ export default {
72
77
  };
73
78
  },
74
79
  computed: {
75
- ...mapGetters(['shop'])
80
+ ...mapGetters(['shop']),
81
+ model() {
82
+ return this.invoice || this.order;
83
+ }
76
84
  },
77
85
  methods: {
78
86
  handleErrors(err) {
@@ -86,8 +94,9 @@ export default {
86
94
  this.processing = true;
87
95
  const card = await this.$refs.paymentCart.tokenize();
88
96
  if (card) {
89
- const { paid } = await api.createOrderPayment(this.order._id, card, this.shop._id);
90
- this.order.paid = paid;
97
+ const { _id: invoiceId } = this.invoice || {};
98
+ const { paid } = await api.createOrderPayment(this.order._id, card, this.shop._id, invoiceId);
99
+ this.model.paid = paid;
91
100
  }
92
101
  } catch (e) {
93
102
  if (e.response) {
@@ -16,11 +16,17 @@ export default {
16
16
  order: {
17
17
  type: Object,
18
18
  required: true
19
- }
19
+ },
20
+ invoice: {
21
+ type: Object
22
+ },
20
23
  },
21
24
  computed: {
25
+ model() {
26
+ return this.invoice || this.order;
27
+ },
22
28
  isPaid() {
23
- return this.order.paymentStatus === 'paid';
29
+ return this.model.paymentStatus === 'paid';
24
30
  },
25
31
  orderId() {
26
32
  return `${this.order.code}`.replace('ORDER', '');
@@ -45,7 +51,7 @@ export default {
45
51
  return this.order.shop.settings?.pricing?.gstTax || 0;
46
52
  },
47
53
  gstTotal() {
48
- return tax(this.order.total, this.gstTax) - this.order.total;
54
+ return tax(this.model.total, this.gstTax) - this.model.total;
49
55
  }
50
56
  }
51
57
  };
@@ -17,7 +17,7 @@
17
17
  </h4>
18
18
  </div>
19
19
  <h1 class="text-secondary lc_h1">
20
- {{ order.paymentMethod === 'deposit' ? 'Proforma Invoice' : 'Tax invoice' }}
20
+ {{ model.paymentMethod === 'deposit' ? 'Proforma Invoice' : 'Tax invoice' }}
21
21
  </h1>
22
22
  </div>
23
23
  <div class="OrderView__info">
@@ -34,13 +34,13 @@
34
34
  </div>
35
35
  <div>
36
36
  <div class="lc_regular16">
37
- DATE: {{ order.createdAt | shortDate }}
37
+ DATE: {{ model.createdAt | shortDate }}
38
38
  </div>
39
39
  <div class="lc_regular16">
40
40
  Order ID: {{ orderId }}
41
41
  </div>
42
42
  <div class="lc_regular16">
43
- Invoice ID: INV{{ orderId.replace('ORD', '') }}-01
43
+ Invoice ID: {{ invoice ? invoice.code : `INV${orderId.replace('ORD', '')}-01` }}
44
44
  </div>
45
45
  </div>
46
46
  </div>
@@ -74,17 +74,17 @@
74
74
  </div>
75
75
  </td>
76
76
  <td
77
- v-if="order.paid"
77
+ v-if="model.paid"
78
78
  class="w-50">
79
79
  <div class="lc_regular16">
80
80
  <b>PAID VIA CREDIT CARD</b>
81
81
  </div>
82
- <div v-if="order.charge && order.charge.card">
82
+ <div v-if="model.charge && model.charge.card">
83
83
  <div class="lc_regular16">
84
- Card: {{ order.charge.card.display_number }}
84
+ Card: {{ model.charge.card.display_number }}
85
85
  </div>
86
86
  <div class="lc_regular16">
87
- Scheme: {{ order.charge.card.scheme }}
87
+ Scheme: {{ model.charge.card.scheme }}
88
88
  </div>
89
89
  </div>
90
90
  </td>
@@ -111,9 +111,11 @@
111
111
  </table>
112
112
  <div class="mt-3">
113
113
  <div class="OrderView__products-wrapper">
114
- <div class="OrderView__products">
114
+ <div
115
+ v-if="model.products.length > 0"
116
+ class="OrderView__products">
115
117
  <order-view-product
116
- v-for="product of order.products"
118
+ v-for="product of model.products"
117
119
  :key="product._id"
118
120
  :product="product"
119
121
  :responsive="responsive"
@@ -125,22 +127,22 @@
125
127
  'OrderView__totals--paid': isPaid
126
128
  }">
127
129
  <div class="lc_regular16">
128
- Products Total: <b>{{ order.productsTotal | price }}</b>
130
+ Products Total: <b>{{ model.productsTotal | price }}</b>
129
131
  </div>
130
132
  <div class="lc_regular16">
131
- Prints Total: <b>{{ order.printsTotal | price }}</b>
133
+ Prints Total: <b>{{ model.printsTotal | price }}</b>
132
134
  </div>
133
135
  <div class="lc_regular16">
134
- Shipping Total: <b>{{ order.shippingTotal | price }}</b>
136
+ Shipping Total: <b>{{ model.shippingTotal | price }}</b>
135
137
  </div>
136
138
  <div class="lc_regular16">
137
- Total ex GST: <b>{{ order.total | price }}</b>
139
+ Total ex GST: <b>{{ model.total | price }}</b>
138
140
  </div>
139
141
  <div class="lc_regular16">
140
- GST: <b>{{ order.totalGST - order.total | price }}</b>
142
+ GST: <b>{{ model.totalGST - model.total | price }}</b>
141
143
  </div>
142
144
  <div class="lc_regular16">
143
- Total inc GST: <b>{{ order.totalGST | price }}</b>
145
+ Total inc GST: <b>{{ model.totalGST | price }}</b>
144
146
  </div>
145
147
  </div>
146
148
  </div>
@@ -47,7 +47,7 @@ export default {
47
47
  label: ' high to low'
48
48
  }];
49
49
  return {
50
- sortBy: sortByOptions.find(({ value }) => value === this.$route.query.sort),
50
+ sortBy: sortByOptions.find(({ value }) => value === this.$route.query.sort) || sortByOptions[0],
51
51
  search: this.$route.query.text || '',
52
52
  sortByOptions
53
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.111",
3
+ "version": "0.0.114",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {