@fleetbase/storefront-engine 0.4.4 → 0.4.6
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.
- package/addon/components/modals/create-gateway.hbs +13 -27
- package/addon/components/schedule-manager.hbs +24 -20
- package/addon/components/settings-container.hbs +3 -2
- package/addon/components/widget/customers.hbs +56 -78
- package/addon/components/widget/orders.hbs +281 -303
- package/addon/components/widget/storefront-key-metrics.hbs +1 -1
- package/addon/components/widget/storefront-metrics.hbs +2 -2
- package/addon/controllers/settings.js +36 -0
- package/addon/services/storefront.js +6 -1
- package/addon/templates/settings/gateways.hbs +3 -3
- package/addon/templates/settings/index.hbs +322 -321
- package/addon/templates/settings/locations.hbs +2 -2
- package/addon/templates/settings.hbs +8 -30
- package/addon/utils/get-gateway-schemas.js +2 -0
- package/app/controllers/settings.js +1 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +2 -2
- package/server/config/storefront.php +11 -1
- package/server/src/Http/Controllers/v1/CheckoutController.php +42 -11
- package/server/src/Http/Controllers/v1/CustomerController.php +1 -1
- package/server/src/Http/Controllers/v1/OrderController.php +206 -1
- package/server/src/Http/Filter/OrderFilter.php +35 -29
- package/server/src/Http/Middleware/ThrottleRequests.php +16 -0
- package/server/src/Models/Cart.php +1 -1
- package/server/src/Models/FoodTruck.php +1 -1
- package/server/src/Providers/StorefrontServiceProvider.php +1 -1
- package/server/src/Support/QPay.php +78 -0
- package/server/src/routes.php +1 -0
|
@@ -1,329 +1,307 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
</a>
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
1
|
+
<ContentPanel
|
|
2
|
+
@title={{this.title}}
|
|
3
|
+
@titleStatusRight={{this.orders.length}}
|
|
4
|
+
@titleStatuRightClass="info-status-badge"
|
|
5
|
+
@hideStatusDot={{true}}
|
|
6
|
+
@open={{this.loaded}}
|
|
7
|
+
@isLoading={{this.loadOrders.isRunning}}
|
|
8
|
+
@pad={{false}}
|
|
9
|
+
@wrapperClass={{@wrapperClass}}
|
|
10
|
+
@panelBodyClass="p-0i"
|
|
11
|
+
>
|
|
12
|
+
<div class="flex justify-end px-4 pt-2 space-x-2">
|
|
13
|
+
<Button @icon="refresh" @size="xs" @onClick={{perform this.loadOrders}} />
|
|
14
|
+
<Toggle @label="Active Orders Filter" @isToggled={{this.activeFilter}} @onToggle={{this.toggleActiveFilter}} />
|
|
21
15
|
</div>
|
|
22
|
-
{{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
@wrapperClass={{@wrapperClass}}
|
|
32
|
-
>
|
|
33
|
-
<div class="flex justify-end px-4 py-2 space-x-2">
|
|
34
|
-
<Button @icon="refresh" @size="xs" @onClick={{perform this.loadOrders}} />
|
|
35
|
-
<Toggle @label="Active Orders Filter" @isToggled={{this.activeFilter}} @onToggle={{this.toggleActiveFilter}} />
|
|
36
|
-
</div>
|
|
37
|
-
{{#if (media "isMobile")}}
|
|
38
|
-
<div class="flex flex-col p-3 space-y-3">
|
|
39
|
-
{{#each this.orders as |order|}}
|
|
40
|
-
<div class="py-2 px-3 rounded-md border border-gray-400 dark:border-gray-700">
|
|
41
|
-
<div class="flex flex-row mb-2">
|
|
42
|
-
<div class="flex-1">
|
|
43
|
-
<a href="javascript:;" {{on "click" (fn this.viewOrder order)}} class="text-sm font-semibold">{{order.public_id}}</a>
|
|
44
|
-
<div class="text-xs">{{order.createdAt}}</div>
|
|
45
|
-
<div class="text-xs">{{order.createdAgo}}</div>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="flex-shrink-0 flex flex-col text-right">
|
|
48
|
-
<Badge class="mb-1" @status={{order.status}} />
|
|
49
|
-
{{#if order.meta.is_pickup}}
|
|
50
|
-
<Badge class="mb-1" @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
|
|
51
|
-
"storefront.component.widget.orders.pickup-order"
|
|
52
|
-
}}</Badge>
|
|
53
|
-
{{/if}}
|
|
54
|
-
<div class="text-sm">{{format-currency order.meta.total order.meta.currency}}</div>
|
|
55
|
-
</div>
|
|
16
|
+
{{#if (media "isMobile")}}
|
|
17
|
+
<div class="flex flex-col p-3 space-y-3">
|
|
18
|
+
{{#each this.orders as |order|}}
|
|
19
|
+
<div class="py-2 px-3 rounded-md border border-gray-400 dark:border-gray-700">
|
|
20
|
+
<div class="flex flex-row mb-2">
|
|
21
|
+
<div class="flex-1">
|
|
22
|
+
<a href="javascript:;" {{on "click" (fn this.viewOrder order)}} class="text-sm font-semibold">{{order.public_id}}</a>
|
|
23
|
+
<div class="text-xs">{{order.createdAt}}</div>
|
|
24
|
+
<div class="text-xs">{{order.createdAgo}}</div>
|
|
56
25
|
</div>
|
|
57
|
-
<div class="flex
|
|
26
|
+
<div class="flex-shrink-0 flex flex-col text-right">
|
|
27
|
+
<Badge class="mb-1" @status={{order.status}} />
|
|
28
|
+
{{#if order.meta.is_pickup}}
|
|
29
|
+
<Badge class="mb-1" @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
|
|
30
|
+
"storefront.component.widget.orders.pickup-order"
|
|
31
|
+
}}</Badge>
|
|
32
|
+
{{/if}}
|
|
33
|
+
<div class="text-sm">{{format-currency order.meta.total order.meta.currency}}</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class="flex flex-col space-y-2 flex-wrap mb-2">
|
|
37
|
+
<Button
|
|
38
|
+
@wrapperClass="w-full"
|
|
39
|
+
class="btn-block w-full"
|
|
40
|
+
@size="xs"
|
|
41
|
+
@type="primary"
|
|
42
|
+
@icon="eye"
|
|
43
|
+
@text={{t "storefront.common.view"}}
|
|
44
|
+
@onClick={{fn this.viewOrder order}}
|
|
45
|
+
/>
|
|
46
|
+
{{#unless order.meta.is_pickup}}
|
|
47
|
+
<Button
|
|
48
|
+
@wrapperClass="w-full"
|
|
49
|
+
class="btn-block w-full"
|
|
50
|
+
@size="xs"
|
|
51
|
+
@type="default"
|
|
52
|
+
@icon="id-card"
|
|
53
|
+
@text={{if order.has_driver_assigned (t "storefront.component.widget.orders.change-driver") (t "storefront.component.widget.orders.assign-driver")}}
|
|
54
|
+
@onClick={{fn this.assignDriver order}}
|
|
55
|
+
/>
|
|
56
|
+
{{/unless}}
|
|
57
|
+
{{#if order.isFresh}}
|
|
58
|
+
<Button
|
|
59
|
+
@wrapperClass="w-full"
|
|
60
|
+
class="btn-block w-full"
|
|
61
|
+
@size="xs"
|
|
62
|
+
@type="success"
|
|
63
|
+
@iconPrefix="fas"
|
|
64
|
+
@icon="check"
|
|
65
|
+
@text={{t "storefront.component.widget.orders.accept-order"}}
|
|
66
|
+
@onClick={{fn this.acceptOrder order}}
|
|
67
|
+
/>
|
|
68
|
+
{{/if}}
|
|
69
|
+
{{#if (eq order.status "started")}}
|
|
70
|
+
<Button
|
|
71
|
+
@wrapperClass="w-full"
|
|
72
|
+
class="btn-block w-full"
|
|
73
|
+
@size="xs"
|
|
74
|
+
@type="success"
|
|
75
|
+
@icon="bell-concierge"
|
|
76
|
+
@text={{t "storefront.component.widget.orders.mark-as-preparing"}}
|
|
77
|
+
@onClick={{fn this.markAsPreparing order}}
|
|
78
|
+
/>
|
|
79
|
+
{{/if}}
|
|
80
|
+
{{#if (eq order.status "accepted")}}
|
|
58
81
|
<Button
|
|
59
82
|
@wrapperClass="w-full"
|
|
60
83
|
class="btn-block w-full"
|
|
61
84
|
@size="xs"
|
|
62
|
-
@type="
|
|
63
|
-
@icon="
|
|
64
|
-
@text={{t "storefront.
|
|
65
|
-
@onClick={{fn this.
|
|
85
|
+
@type={{if order.meta.is_pickup "success" "magic"}}
|
|
86
|
+
@icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
|
|
87
|
+
@text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
|
|
88
|
+
@onClick={{fn this.markAsReady order}}
|
|
66
89
|
/>
|
|
90
|
+
{{/if}}
|
|
91
|
+
{{#if order.isPickupReady}}
|
|
92
|
+
<Button
|
|
93
|
+
@wrapperClass="w-full"
|
|
94
|
+
class="btn-block w-full"
|
|
95
|
+
@size="xs"
|
|
96
|
+
@type="success"
|
|
97
|
+
@icon="check"
|
|
98
|
+
@text={{t "storefront.component.widget.orders.mark-as-completed"}}
|
|
99
|
+
@onClick={{fn this.markAsCompleted order}}
|
|
100
|
+
/>
|
|
101
|
+
{{/if}}
|
|
102
|
+
{{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
|
|
103
|
+
<Button
|
|
104
|
+
@wrapperClass="w-full"
|
|
105
|
+
class="btn-block w-full"
|
|
106
|
+
@size="xs"
|
|
107
|
+
@type="danger"
|
|
108
|
+
@icon="ban"
|
|
109
|
+
@text={{t "storefront.component.widget.orders.cancel-order"}}
|
|
110
|
+
@onClick={{fn this.cancelOrder order}}
|
|
111
|
+
/>
|
|
112
|
+
{{/if}}
|
|
113
|
+
</div>
|
|
114
|
+
<ContentPanel @title={{t "storefront.component.widget.orders.more-details"}}>
|
|
115
|
+
<div class="p-2 space-y-2">
|
|
67
116
|
{{#unless order.meta.is_pickup}}
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
class="
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
@text={{if order.has_driver_assigned (t "storefront.component.widget.orders.change-driver") (t "storefront.component.widget.orders.assign-driver")}}
|
|
75
|
-
@onClick={{fn this.assignDriver order}}
|
|
76
|
-
/>
|
|
77
|
-
{{/unless}}
|
|
78
|
-
{{#if order.isFresh}}
|
|
79
|
-
<Button
|
|
80
|
-
@wrapperClass="w-full"
|
|
81
|
-
class="btn-block w-full"
|
|
82
|
-
@size="xs"
|
|
83
|
-
@type="success"
|
|
84
|
-
@iconPrefix="fas"
|
|
85
|
-
@icon="check"
|
|
86
|
-
@text={{t "storefront.component.widget.orders.accept-order"}}
|
|
87
|
-
@onClick={{fn this.acceptOrder order}}
|
|
88
|
-
/>
|
|
89
|
-
{{/if}}
|
|
90
|
-
{{#if (eq order.status "started")}}
|
|
91
|
-
<Button
|
|
92
|
-
@wrapperClass="w-full"
|
|
93
|
-
class="btn-block w-full"
|
|
94
|
-
@size="xs"
|
|
95
|
-
@type="success"
|
|
96
|
-
@icon="bell-concierge"
|
|
97
|
-
@text={{t "storefront.component.widget.orders.mark-as-preparing"}}
|
|
98
|
-
@onClick={{fn this.markAsPreparing order}}
|
|
99
|
-
/>
|
|
100
|
-
{{/if}}
|
|
101
|
-
{{#if (eq order.status "accepted")}}
|
|
102
|
-
<Button
|
|
103
|
-
@wrapperClass="w-full"
|
|
104
|
-
class="btn-block w-full"
|
|
105
|
-
@size="xs"
|
|
106
|
-
@type={{if order.meta.is_pickup "success" "magic"}}
|
|
107
|
-
@icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
|
|
108
|
-
@text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
|
|
109
|
-
@onClick={{fn this.markAsReady order}}
|
|
110
|
-
/>
|
|
111
|
-
{{/if}}
|
|
112
|
-
{{#if order.isPickupReady}}
|
|
113
|
-
<Button
|
|
114
|
-
@wrapperClass="w-full"
|
|
115
|
-
class="btn-block w-full"
|
|
116
|
-
@size="xs"
|
|
117
|
-
@type="success"
|
|
118
|
-
@icon="check"
|
|
119
|
-
@text={{t "storefront.component.widget.orders.mark-as-completed"}}
|
|
120
|
-
@onClick={{fn this.markAsCompleted order}}
|
|
121
|
-
/>
|
|
122
|
-
{{/if}}
|
|
123
|
-
{{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
|
|
124
|
-
<Button
|
|
125
|
-
@wrapperClass="w-full"
|
|
126
|
-
class="btn-block w-full"
|
|
127
|
-
@size="xs"
|
|
128
|
-
@type="danger"
|
|
129
|
-
@icon="ban"
|
|
130
|
-
@text={{t "storefront.component.widget.orders.cancel-order"}}
|
|
131
|
-
@onClick={{fn this.cancelOrder order}}
|
|
132
|
-
/>
|
|
133
|
-
{{/if}}
|
|
134
|
-
</div>
|
|
135
|
-
<ContentPanel @title={{t "storefront.component.widget.orders.more-details"}}>
|
|
136
|
-
<div class="p-2 space-y-2">
|
|
137
|
-
{{#unless order.meta.is_pickup}}
|
|
138
|
-
<div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
|
|
139
|
-
<h5 class="dark:text-gray-100 font-semibold">{{t "storefront.component.modals.incoming-order.assigned"}}</h5>
|
|
140
|
-
<div class="flex flex-col space-y-4">
|
|
141
|
-
{{#if order.driver_assigned.id}}
|
|
142
|
-
<div class="flex items-center">
|
|
143
|
-
<Image src={{order.driver_assigned.photoUrl}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.driver_assigned.name}} />
|
|
144
|
-
<div>
|
|
145
|
-
<h5 class="font-semibold dark:text-white text-xs">{{n-a order.driver_assigned.displayName}}</h5>
|
|
146
|
-
<div class="font-semibold dark:text-gray-100 text-xs">{{n-a
|
|
147
|
-
order.driver_assigned.phone
|
|
148
|
-
(t "storefront.component.modals.incoming-order.no-phone")
|
|
149
|
-
}}</div>
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
{{else}}
|
|
117
|
+
<div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
|
|
118
|
+
<h5 class="dark:text-gray-100 font-semibold">{{t "storefront.component.modals.incoming-order.assigned"}}</h5>
|
|
119
|
+
<div class="flex flex-col space-y-4">
|
|
120
|
+
{{#if order.driver_assigned.id}}
|
|
121
|
+
<div class="flex items-center">
|
|
122
|
+
<Image src={{order.driver_assigned.photoUrl}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.driver_assigned.name}} />
|
|
153
123
|
<div>
|
|
154
|
-
<h5 class="text-
|
|
124
|
+
<h5 class="font-semibold dark:text-white text-xs">{{n-a order.driver_assigned.displayName}}</h5>
|
|
125
|
+
<div class="font-semibold dark:text-gray-100 text-xs">{{n-a
|
|
126
|
+
order.driver_assigned.phone
|
|
127
|
+
(t "storefront.component.modals.incoming-order.no-phone")
|
|
128
|
+
}}</div>
|
|
155
129
|
</div>
|
|
156
|
-
|
|
130
|
+
</div>
|
|
131
|
+
{{else}}
|
|
157
132
|
<div>
|
|
158
|
-
<
|
|
159
|
-
@size="xs"
|
|
160
|
-
@type="default"
|
|
161
|
-
@icon="id-card"
|
|
162
|
-
@text={{if
|
|
163
|
-
order.has_driver_assigned
|
|
164
|
-
(t "storefront.component.modals.incoming-order.change-driver")
|
|
165
|
-
(t "storefront.component.modals.incoming-order.assign-driver")
|
|
166
|
-
}}
|
|
167
|
-
@onClick={{this.assignDriver order}}
|
|
168
|
-
/>
|
|
133
|
+
<h5 class="text-red-500 text-sm">{{t "storefront.component.modals.incoming-order.not-assigned"}}</h5>
|
|
169
134
|
</div>
|
|
135
|
+
{{/if}}
|
|
136
|
+
<div>
|
|
137
|
+
<Button
|
|
138
|
+
@size="xs"
|
|
139
|
+
@type="default"
|
|
140
|
+
@icon="id-card"
|
|
141
|
+
@text={{if
|
|
142
|
+
order.has_driver_assigned
|
|
143
|
+
(t "storefront.component.modals.incoming-order.change-driver")
|
|
144
|
+
(t "storefront.component.modals.incoming-order.assign-driver")
|
|
145
|
+
}}
|
|
146
|
+
@onClick={{this.assignDriver order}}
|
|
147
|
+
/>
|
|
170
148
|
</div>
|
|
171
149
|
</div>
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<div>
|
|
181
|
-
<div class="text-xs font-bold dark:text-gray-100">{{order.customer.name}}</div>
|
|
182
|
-
<div class="text-xs dark:text-gray-100">{{order.customer.email}}</div>
|
|
183
|
-
<div class="text-xs dark:text-gray-100">{{order.customer.phone}}</div>
|
|
184
|
-
</div>
|
|
150
|
+
</div>
|
|
151
|
+
{{/unless}}
|
|
152
|
+
<div class="bg-gray-100 border border-gray-200 dark:bg-gray-800 dark:border-gray-700 rounded-md px-4 py-2 space-y-2 h-full">
|
|
153
|
+
<h5 class="dark:text-gray-100 font-semibold">{{t "storefront.common.customer"}}</h5>
|
|
154
|
+
<div class="">
|
|
155
|
+
<div class="flex flex-row">
|
|
156
|
+
<div>
|
|
157
|
+
<Image src={{avatar-url order.customer.photo_url}} class="w-12 h-12 rounded-md shadow-sm mr-4" alt={{order.customer.name}} />
|
|
185
158
|
</div>
|
|
186
|
-
|
|
187
|
-
<div class="
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
159
|
+
<div>
|
|
160
|
+
<div class="text-xs font-bold dark:text-gray-100">{{order.customer.name}}</div>
|
|
161
|
+
<div class="text-xs dark:text-gray-100">{{order.customer.email}}</div>
|
|
162
|
+
<div class="text-xs dark:text-gray-100">{{order.customer.phone}}</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
{{#unless order.meta.is_pickup}}
|
|
166
|
+
<div class="mt-2">
|
|
167
|
+
<h5 class="dark:text-gray-100 font-semibold text-xs truncate">{{t "storefront.component.modals.incoming-order.address"}}</h5>
|
|
168
|
+
<div class="flex flex-row mt-1">
|
|
169
|
+
<div class="flex items-center justify-center rounded-full bg-blue-500 w-8 h-8 mr-3">
|
|
170
|
+
<FaIcon @icon="map-marker-alt" class="text-white" />
|
|
171
|
+
</div>
|
|
172
|
+
<div class="truncate">
|
|
173
|
+
<DisplayPlace @place={{order.payload.dropoff}} @type="dropoff" @addressClass="text-xs dark:text-gray-100" @noAddressClass="text-xs" />
|
|
196
174
|
</div>
|
|
197
175
|
</div>
|
|
198
|
-
|
|
199
|
-
|
|
176
|
+
</div>
|
|
177
|
+
{{/unless}}
|
|
200
178
|
</div>
|
|
201
179
|
</div>
|
|
202
|
-
|
|
180
|
+
</div>
|
|
181
|
+
<div class="py-2 mt-2 space-y-2 border-t dark:border-gray-800">
|
|
182
|
+
<div class="flex items-center justify-between px-3 text-xs">
|
|
183
|
+
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.subtotal"}}</span>
|
|
184
|
+
<span class="dark:text-gray-50">{{format-currency order.meta.subtotal order.meta.currency}}</span>
|
|
185
|
+
</div>
|
|
186
|
+
{{#unless order.meta.is_pickup}}
|
|
203
187
|
<div class="flex items-center justify-between px-3 text-xs">
|
|
204
|
-
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.
|
|
205
|
-
<span class="dark:text-gray-50">{{format-currency order.meta.
|
|
188
|
+
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-fee"}}</span>
|
|
189
|
+
<span class="dark:text-gray-50">{{format-currency order.meta.delivery_fee order.meta.currency}}</span>
|
|
206
190
|
</div>
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
</
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.tip"}}</span>
|
|
216
|
-
<span class="dark:text-gray-50">{{get-tip-amount order.meta.tip order.meta.subtotal order.meta.currency}}</span>
|
|
217
|
-
</div>
|
|
218
|
-
{{/if}}
|
|
219
|
-
{{#if order.meta.delivery_tip}}
|
|
220
|
-
<div class="flex items-center justify-between px-3 text-xs">
|
|
221
|
-
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-tip"}}</span>
|
|
222
|
-
<span class="dark:text-gray-50">{{get-tip-amount order.meta.delivery_tip order.meta.subtotal order.meta.currency}}</span>
|
|
223
|
-
</div>
|
|
224
|
-
{{/if}}
|
|
191
|
+
{{/unless}}
|
|
192
|
+
{{#if order.meta.tip}}
|
|
193
|
+
<div class="flex items-center justify-between px-3 py-2 text-xs">
|
|
194
|
+
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.tip"}}</span>
|
|
195
|
+
<span class="dark:text-gray-50">{{get-tip-amount order.meta.tip order.meta.subtotal order.meta.currency}}</span>
|
|
196
|
+
</div>
|
|
197
|
+
{{/if}}
|
|
198
|
+
{{#if order.meta.delivery_tip}}
|
|
225
199
|
<div class="flex items-center justify-between px-3 text-xs">
|
|
226
|
-
<span class="dark:text-gray-50
|
|
227
|
-
<span class="dark:text-gray-50
|
|
200
|
+
<span class="dark:text-gray-50">{{t "storefront.component.widget.orders.delivery-tip"}}</span>
|
|
201
|
+
<span class="dark:text-gray-50">{{get-tip-amount order.meta.delivery_tip order.meta.subtotal order.meta.currency}}</span>
|
|
228
202
|
</div>
|
|
203
|
+
{{/if}}
|
|
204
|
+
<div class="flex items-center justify-between px-3 text-xs">
|
|
205
|
+
<span class="dark:text-gray-50 font-bold">{{t "storefront.component.widget.orders.total"}}</span>
|
|
206
|
+
<span class="dark:text-gray-50 font-bold">{{format-currency order.meta.total order.meta.currency}}</span>
|
|
229
207
|
</div>
|
|
230
|
-
</
|
|
231
|
-
</
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
</
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
<td><a href="javascript:;" {{on "click" (fn this.viewOrder order)}}>{{order.public_id}}</a></td>
|
|
252
|
-
<td>{{format-currency order.meta.total order.meta.currency}}</td>
|
|
253
|
-
<td>{{n-a order.customer.name}}</td>
|
|
254
|
-
<td>
|
|
255
|
-
{{#if order.meta.is_pickup}}
|
|
256
|
-
<Badge @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
|
|
257
|
-
"storefront.component.widget.orders.pickup-order"
|
|
258
|
-
}}</Badge>
|
|
259
|
-
{{else}}
|
|
260
|
-
{{n-a order.driver_assigned.name}}
|
|
261
|
-
{{/if}}
|
|
262
|
-
</td>
|
|
263
|
-
<td>{{order.createdAgo}}</td>
|
|
264
|
-
<td>
|
|
265
|
-
<Badge @status={{order.status}} />
|
|
266
|
-
</td>
|
|
267
|
-
<td>
|
|
268
|
-
<div class="flex flex-row justify-end space-x-2">
|
|
269
|
-
{{#if order.isFresh}}
|
|
270
|
-
<Button
|
|
271
|
-
@size="xs"
|
|
272
|
-
@type="success"
|
|
273
|
-
@iconPrefix="fas"
|
|
274
|
-
@icon="check"
|
|
275
|
-
@text={{t "storefront.component.widget.orders.accept-order"}}
|
|
276
|
-
@onClick={{fn this.acceptOrder order}}
|
|
277
|
-
/>
|
|
278
|
-
{{/if}}
|
|
279
|
-
{{#if (eq order.status "started")}}
|
|
280
|
-
<Button
|
|
281
|
-
@size="xs"
|
|
282
|
-
@type="success"
|
|
283
|
-
@icon="hourglass-start"
|
|
284
|
-
@text={{t "storefront.component.widget.orders.mark-as-preparing"}}
|
|
285
|
-
@onClick={{fn this.markAsPreparing order}}
|
|
286
|
-
/>
|
|
287
|
-
{{/if}}
|
|
288
|
-
{{#if (eq order.status "accepted")}}
|
|
289
|
-
<Button
|
|
290
|
-
@size="xs"
|
|
291
|
-
@type={{if order.meta.is_pickup "success" "magic"}}
|
|
292
|
-
@icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
|
|
293
|
-
@text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
|
|
294
|
-
@onClick={{fn this.markAsReady order}}
|
|
295
|
-
/>
|
|
296
|
-
{{/if}}
|
|
297
|
-
{{#if order.isPickupReady}}
|
|
298
|
-
<Button
|
|
299
|
-
@size="xs"
|
|
300
|
-
@type="success"
|
|
301
|
-
@icon="check"
|
|
302
|
-
@text={{t "storefront.component.widget.orders.mark-as-completed"}}
|
|
303
|
-
@onClick={{fn this.markAsCompleted order}}
|
|
304
|
-
/>
|
|
305
|
-
{{/if}}
|
|
306
|
-
{{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
|
|
307
|
-
<Button
|
|
308
|
-
@size="xs"
|
|
309
|
-
@type="danger"
|
|
310
|
-
@icon="ban"
|
|
311
|
-
@helpText={{t "storefront.component.widget.orders.cancel-order"}}
|
|
312
|
-
@onClick={{fn this.cancelOrder order}}
|
|
313
|
-
/>
|
|
314
|
-
{{/if}}
|
|
315
|
-
</div>
|
|
316
|
-
</td>
|
|
317
|
-
</tr>
|
|
318
|
-
{{/each}}
|
|
319
|
-
|
|
208
|
+
</div>
|
|
209
|
+
</ContentPanel>
|
|
210
|
+
</div>
|
|
211
|
+
{{/each}}
|
|
212
|
+
</div>
|
|
213
|
+
{{else}}
|
|
214
|
+
<div class="table-wrapper table-fluid">
|
|
215
|
+
<table class="storefront-widget-table">
|
|
216
|
+
<thead>
|
|
217
|
+
<tr class="h-12 text-left py-1">
|
|
218
|
+
<th style={{"width: 15%"}}>{{t "storefront.component.widget.orders.id-column"}}</th>
|
|
219
|
+
<th style={{"width: 10%"}}>{{t "storefront.common.amount"}}</th>
|
|
220
|
+
<th style={{"width: 14%"}}>{{t "storefront.common.customer"}}</th>
|
|
221
|
+
<th style={{"width: 14%"}}>{{t "storefront.common.driver"}}</th>
|
|
222
|
+
<th style={{"width: 10%"}}>{{t "storefront.common.created"}}</th>
|
|
223
|
+
<th style={{"width: 15%"}}>{{t "storefront.common.status"}}</th>
|
|
224
|
+
<th style={{"width: 24%"}}></th>
|
|
225
|
+
</tr>
|
|
226
|
+
</thead>
|
|
227
|
+
<tbody>
|
|
228
|
+
{{#each this.orders as |order|}}
|
|
320
229
|
<tr class="h-12">
|
|
321
|
-
<td><
|
|
322
|
-
<td
|
|
230
|
+
<td><a href="javascript:;" {{on "click" (fn this.viewOrder order)}}>{{order.public_id}}</a></td>
|
|
231
|
+
<td>{{format-currency order.meta.total order.meta.currency}}</td>
|
|
232
|
+
<td>{{n-a order.customer.name}}</td>
|
|
233
|
+
<td>
|
|
234
|
+
{{#if order.meta.is_pickup}}
|
|
235
|
+
<Badge @hideStatusDot={{true}} @status="info"><FaIcon @icon="hand-holding-dollar" class="mr-1" />{{t
|
|
236
|
+
"storefront.component.widget.orders.pickup-order"
|
|
237
|
+
}}</Badge>
|
|
238
|
+
{{else}}
|
|
239
|
+
{{n-a order.driver_assigned.name}}
|
|
240
|
+
{{/if}}
|
|
241
|
+
</td>
|
|
242
|
+
<td>{{order.createdAgo}}</td>
|
|
243
|
+
<td>
|
|
244
|
+
<Badge @status={{order.status}} />
|
|
245
|
+
</td>
|
|
246
|
+
<td>
|
|
247
|
+
<div class="flex flex-row justify-end space-x-2">
|
|
248
|
+
{{#if order.isFresh}}
|
|
249
|
+
<Button
|
|
250
|
+
@size="xs"
|
|
251
|
+
@type="success"
|
|
252
|
+
@iconPrefix="fas"
|
|
253
|
+
@icon="check"
|
|
254
|
+
@text={{t "storefront.component.widget.orders.accept-order"}}
|
|
255
|
+
@onClick={{fn this.acceptOrder order}}
|
|
256
|
+
/>
|
|
257
|
+
{{/if}}
|
|
258
|
+
{{#if (eq order.status "started")}}
|
|
259
|
+
<Button
|
|
260
|
+
@size="xs"
|
|
261
|
+
@type="success"
|
|
262
|
+
@icon="hourglass-start"
|
|
263
|
+
@text={{t "storefront.component.widget.orders.mark-as-preparing"}}
|
|
264
|
+
@onClick={{fn this.markAsPreparing order}}
|
|
265
|
+
/>
|
|
266
|
+
{{/if}}
|
|
267
|
+
{{#if (eq order.status "accepted")}}
|
|
268
|
+
<Button
|
|
269
|
+
@size="xs"
|
|
270
|
+
@type={{if order.meta.is_pickup "success" "magic"}}
|
|
271
|
+
@icon={{if order.meta.is_pickup "bell-concierge" "paper-plane"}}
|
|
272
|
+
@text={{if order.meta.is_pickup (t "storefront.component.widget.orders.mark-as-ready") (t "storefront.component.widget.orders.dispatch")}}
|
|
273
|
+
@onClick={{fn this.markAsReady order}}
|
|
274
|
+
/>
|
|
275
|
+
{{/if}}
|
|
276
|
+
{{#if order.isPickupReady}}
|
|
277
|
+
<Button
|
|
278
|
+
@size="xs"
|
|
279
|
+
@type="success"
|
|
280
|
+
@icon="check"
|
|
281
|
+
@text={{t "storefront.component.widget.orders.mark-as-completed"}}
|
|
282
|
+
@onClick={{fn this.markAsCompleted order}}
|
|
283
|
+
/>
|
|
284
|
+
{{/if}}
|
|
285
|
+
{{#if (not (or order.isCanceled (eq order.status "order_canceled")))}}
|
|
286
|
+
<Button
|
|
287
|
+
@size="xs"
|
|
288
|
+
@type="danger"
|
|
289
|
+
@icon="ban"
|
|
290
|
+
@helpText={{t "storefront.component.widget.orders.cancel-order"}}
|
|
291
|
+
@onClick={{fn this.cancelOrder order}}
|
|
292
|
+
/>
|
|
293
|
+
{{/if}}
|
|
294
|
+
</div>
|
|
295
|
+
</td>
|
|
323
296
|
</tr>
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
297
|
+
{{/each}}
|
|
298
|
+
|
|
299
|
+
<tr class="h-12">
|
|
300
|
+
<td><div class="font-semibold text-green-500">TOTAL</div></td>
|
|
301
|
+
<td colspan="6"><div class="flex justify-start text-green-500 font-semibold">{{format-currency this.total this.currency}}</div></td>
|
|
302
|
+
</tr>
|
|
303
|
+
</tbody>
|
|
304
|
+
</table>
|
|
305
|
+
</div>
|
|
306
|
+
{{/if}}
|
|
307
|
+
</ContentPanel>
|