@fleetbase/fleetops-engine 0.6.46 → 0.6.47
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/order/form/details.hbs +1 -2
- package/addon/components/order/form/details.js +6 -0
- package/addon/components/order/form/route.js +9 -1
- package/addon/controllers/settings/payments/index.js +1 -1
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +3 -3
- package/pnpm-workspace.yaml +7 -0
- package/server/src/Http/Controllers/Internal/v1/OrderController.php +29 -0
|
@@ -43,8 +43,7 @@
|
|
|
43
43
|
@renderInPlace={{true}}
|
|
44
44
|
@allowClear={{true}}
|
|
45
45
|
@disabled={{or @resource.hasWaypoints (cannot-write @resource)}}
|
|
46
|
-
@onChange={{
|
|
47
|
-
@onChangeId={{fn (mut @resource.customer_uuid)}}
|
|
46
|
+
@onChange={{this.selectCustomer}}
|
|
48
47
|
as |model|
|
|
49
48
|
>
|
|
50
49
|
<div class="flex items-center">
|
|
@@ -25,6 +25,12 @@ export default class OrderFormDetailsComponent extends Component {
|
|
|
25
25
|
this.args.resource.set('driver', null);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
@action selectCustomer(model) {
|
|
29
|
+
this.args.resource.set('customer', model);
|
|
30
|
+
this.args.resource.set('customer_uuid', model?.uuid ?? model?.id ?? null);
|
|
31
|
+
this.args.resource.set('customer_type', model?.customer_type ? `fleet-ops:${model.customer_type}` : null);
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
@task *selectOrderConfig(orderConfig) {
|
|
29
35
|
if (!orderConfig) return;
|
|
30
36
|
this.args.resource.setProperties({
|
|
@@ -113,7 +113,15 @@ export default class OrderFormRouteComponent extends Component {
|
|
|
113
113
|
if (!this.args.resource.payload.waypoints[index]) return;
|
|
114
114
|
|
|
115
115
|
this.args.resource.payload.waypoints[index].place = place;
|
|
116
|
-
this.args.resource.payload.waypoints[index]?.setProperties(
|
|
116
|
+
this.args.resource.payload.waypoints[index]?.setProperties({
|
|
117
|
+
street1: place.street1,
|
|
118
|
+
street2: place.street2,
|
|
119
|
+
city: place.city,
|
|
120
|
+
province: place.province,
|
|
121
|
+
postal_code: place.postal_code,
|
|
122
|
+
country: place.country,
|
|
123
|
+
location: place.location,
|
|
124
|
+
});
|
|
117
125
|
this.previewRoute();
|
|
118
126
|
}
|
|
119
127
|
|
|
@@ -46,7 +46,7 @@ export default class SettingsPaymentsIndexController extends Controller {
|
|
|
46
46
|
];
|
|
47
47
|
|
|
48
48
|
get isStripeEnabled() {
|
|
49
|
-
return
|
|
49
|
+
return !isEmpty(config.stripe.publishableKey);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
@task *lookupStripeConnectAccount() {
|
package/composer.json
CHANGED
package/extension.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fleetbase/fleetops-engine",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.47",
|
|
4
4
|
"description": "Fleet & Transport Management Extension for Fleetbase",
|
|
5
5
|
"fleetbase": {
|
|
6
6
|
"route": "fleet-ops"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@babel/core": "^7.23.2",
|
|
45
|
-
"@fleetbase/ember-core": "^0.3.
|
|
45
|
+
"@fleetbase/ember-core": "^0.3.19",
|
|
46
46
|
"@fleetbase/ember-ui": "^0.3.29",
|
|
47
|
-
"@fleetbase/fleetops-data": "^0.1.
|
|
47
|
+
"@fleetbase/fleetops-data": "^0.1.32",
|
|
48
48
|
"@fleetbase/leaflet-routing-machine": "^3.2.17",
|
|
49
49
|
"@fortawesome/ember-fontawesome": "^2.0.0",
|
|
50
50
|
"@fortawesome/fontawesome-svg-core": "6.4.0",
|
|
@@ -97,6 +97,8 @@ class OrderController extends FleetOpsController
|
|
|
97
97
|
function ($request, &$input) {
|
|
98
98
|
$serviceQuote = ServiceQuote::resolveFromRequest($request);
|
|
99
99
|
|
|
100
|
+
$this->normalizeCustomerType($input);
|
|
101
|
+
|
|
100
102
|
// if service quote is applied, resolve it
|
|
101
103
|
if ($serviceQuote instanceof ServiceQuote && $serviceQuote->fromIntegratedVendor()) {
|
|
102
104
|
// create order with integrated vendor, then resume fleetbase order creation
|
|
@@ -218,6 +220,33 @@ class OrderController extends FleetOpsController
|
|
|
218
220
|
}
|
|
219
221
|
}
|
|
220
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Resolve the concrete polymorphic customer type from the submitted UUID.
|
|
225
|
+
*/
|
|
226
|
+
protected function normalizeCustomerType(array &$input): void
|
|
227
|
+
{
|
|
228
|
+
$customerUuid = data_get($input, 'customer_uuid') ?? data_get($input, 'customer.uuid');
|
|
229
|
+
if (!$customerUuid) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
$customer = Utils::getUuid(
|
|
234
|
+
['contacts', 'vendors'],
|
|
235
|
+
[
|
|
236
|
+
'uuid' => $customerUuid,
|
|
237
|
+
'company_uuid' => session('company'),
|
|
238
|
+
],
|
|
239
|
+
[
|
|
240
|
+
'with_table' => true,
|
|
241
|
+
]
|
|
242
|
+
);
|
|
243
|
+
|
|
244
|
+
if (is_array($customer)) {
|
|
245
|
+
$input['customer_uuid'] = Utils::get($customer, 'uuid');
|
|
246
|
+
$input['customer_type'] = Utils::getModelClassName(Utils::get($customer, 'table'));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
221
250
|
/**
|
|
222
251
|
* Route which enables editing of an order route.
|
|
223
252
|
*
|