@fleetbase/fleetops-engine 0.6.54 → 0.6.56
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/admin/map-settings.hbs +1 -1
- package/addon/components/admin/routing-settings.hbs +2 -1
- package/addon/components/cell/attached-vehicle.hbs +10 -0
- package/addon/components/cell/attached-vehicle.js +58 -0
- package/addon/components/cell/device-identity.hbs +24 -0
- package/addon/components/cell/device-identity.js +129 -0
- package/addon/components/cell/driver-identity.hbs +33 -0
- package/addon/components/cell/driver-identity.js +143 -0
- package/addon/components/cell/equipment-identity.hbs +5 -0
- package/addon/components/cell/equipment-identity.js +48 -0
- package/addon/components/cell/part-identity.hbs +5 -0
- package/addon/components/cell/part-identity.js +63 -0
- package/addon/components/cell/telematic-device.hbs +38 -0
- package/addon/components/cell/telematic-device.js +44 -0
- package/addon/components/cell/telematic-provider.hbs +33 -16
- package/addon/components/cell/telematic-provider.js +50 -8
- package/addon/components/cell/vehicle-identity.hbs +33 -0
- package/addon/components/cell/vehicle-identity.js +138 -0
- package/addon/components/device/details.js +1 -1
- package/addon/components/device/form.hbs +2 -2
- package/addon/components/device/form.js +7 -0
- package/addon/components/device/panel-header.hbs +45 -20
- package/addon/components/device/panel-header.js +49 -1
- package/addon/components/device/panel-tabs/events.hbs +30 -0
- package/addon/components/device/panel-tabs/events.js +128 -0
- package/addon/components/device/panel-tabs/sensors.hbs +30 -0
- package/addon/components/device/panel-tabs/sensors.js +93 -0
- package/addon/components/device/panel-tabs/vehicle.hbs +68 -0
- package/addon/components/device/panel-tabs/vehicle.js +90 -0
- package/addon/components/device-event/details.hbs +192 -0
- package/addon/components/device-event/details.js +151 -0
- package/addon/components/driver/schedule.js +1 -1
- package/addon/components/equipment/form.js +8 -1
- package/addon/components/layout/fleet-ops-sidebar.hbs +1 -1
- package/addon/components/layout/fleet-ops-sidebar.js +20 -6
- package/addon/components/map/drawer/device-event-listing.js +2 -0
- package/addon/components/map/drawer/driver-listing.js +2 -0
- package/addon/components/map/drawer/place-listing.js +2 -0
- package/addon/components/map/drawer/position-listing.hbs +11 -6
- package/addon/components/map/drawer/position-listing.js +17 -4
- package/addon/components/map/drawer/vehicle-listing.js +2 -0
- package/addon/components/sensor/panel-header.hbs +47 -15
- package/addon/components/sensor/panel-header.js +59 -1
- package/addon/components/table/cell/dropdown/action-item.hbs +31 -0
- package/addon/components/table/cell/dropdown/action-item.js +62 -0
- package/addon/components/table/cell/dropdown.hbs +28 -0
- package/addon/components/table/cell/dropdown.js +91 -0
- package/addon/components/telematic/details.hbs +1 -1
- package/addon/components/telematic/form.hbs +2 -2
- package/addon/components/telematic/settings.hbs +1 -1
- package/addon/components/vendor/panel-header.hbs +82 -0
- package/addon/components/vendor/panel-header.js +48 -0
- package/addon/controllers/connectivity/devices/index/details/events.js +1 -1
- package/addon/controllers/connectivity/devices/index/details/vehicle.js +50 -2
- package/addon/controllers/connectivity/devices/index.js +144 -129
- package/addon/controllers/connectivity/events/details.js +70 -0
- package/addon/controllers/connectivity/events/index.js +187 -11
- package/addon/controllers/connectivity/sensors/index.js +160 -14
- package/addon/controllers/connectivity/telematics/details/devices.js +126 -134
- package/addon/controllers/connectivity/telematics/details/events.js +1 -1
- package/addon/controllers/connectivity/telematics/details/sensors.js +4 -0
- package/addon/controllers/maintenance/equipment/index.js +1 -2
- package/addon/controllers/maintenance/parts/index.js +1 -2
- package/addon/controllers/management/drivers/index.js +82 -42
- package/addon/controllers/management/fuel-reports/index.js +63 -4
- package/addon/controllers/management/issues/index.js +63 -4
- package/addon/controllers/management/vehicles/index.js +33 -6
- package/addon/controllers/settings/map.js +15 -0
- package/addon/instance-initializers/register-vroom-allocation.js +1 -1
- package/addon/routes/connectivity/devices/index/details/vehicle.js +24 -2
- package/addon/routes/connectivity/devices/index.js +7 -0
- package/addon/routes/connectivity/events/details.js +28 -0
- package/addon/routes/connectivity/events/index.js +6 -2
- package/addon/routes/connectivity/sensors/index.js +7 -2
- package/addon/routes/connectivity/telematics/details/devices.js +2 -0
- package/addon/routes/management/vehicles/index/details.js +3 -1
- package/addon/services/device-actions.js +30 -0
- package/addon/services/device-event-actions.js +1 -1
- package/addon/services/equipment-actions.js +1 -0
- package/addon/services/map-adapter/google.js +25 -0
- package/addon/services/map-adapter/leaflet.js +1 -1
- package/addon/services/map-adapter-interface.js +1 -1
- package/addon/services/map-manager.js +4 -1
- package/addon/services/map-settings.js +15 -0
- package/addon/services/sensor-actions.js +3 -0
- package/addon/services/service-rate-actions.js +39 -1
- package/addon/services/vehicle-actions.js +24 -12
- package/addon/services/vendor-actions.js +3 -0
- package/addon/styles/fleetops-engine.css +9 -1
- package/addon/templates/connectivity/devices/index/details/vehicle.hbs +66 -2
- package/addon/templates/connectivity/events/details.hbs +40 -0
- package/addon/templates/management/vendors/index/details.hbs +2 -2
- package/addon/templates/settings/map.hbs +38 -9
- package/addon/templates/settings/notifications.hbs +2 -1
- package/addon/templates/settings/routing.hbs +1 -0
- package/addon/utils/device-table-columns.js +288 -0
- package/addon/utils/identity-cell-resource.js +20 -0
- package/addon/utils/leaflet-plugin-loader.js +5 -5
- package/addon/utils/map-drawer-dropdown-position.js +47 -0
- package/addon/utils/route-colors.js +1 -1
- package/addon/utils/trackable-option.js +93 -0
- package/app/components/cell/attached-vehicle.js +1 -0
- package/app/components/cell/device-identity.js +1 -0
- package/app/components/cell/driver-identity.js +1 -0
- package/app/components/cell/equipment-identity.js +1 -0
- package/app/components/cell/part-identity.js +1 -0
- package/app/components/cell/telematic-device.js +1 -0
- package/app/components/cell/vehicle-identity.js +1 -0
- package/app/components/device/panel-tabs/events.hbs +30 -0
- package/app/components/device/panel-tabs/events.js +128 -0
- package/app/components/device/panel-tabs/sensors.hbs +30 -0
- package/app/components/device/panel-tabs/sensors.js +93 -0
- package/app/components/device/panel-tabs/vehicle.hbs +68 -0
- package/app/components/device/panel-tabs/vehicle.js +90 -0
- package/app/components/device-event/details.hbs +192 -0
- package/app/components/device-event/details.js +1 -0
- package/app/components/table/cell/dropdown/action-item.js +1 -0
- package/app/components/table/cell/dropdown.js +1 -0
- package/app/components/vendor/panel-header.js +1 -0
- package/app/controllers/connectivity/events/{index/details.js → details.js} +1 -1
- package/app/routes/connectivity/events/{index/details.js → details.js} +1 -1
- package/app/templates/connectivity/events/{index/details.js → details.js} +1 -1
- package/app/utils/map-drawer-dropdown-position.js +1 -0
- package/app/utils/trackable-option.js +1 -0
- package/composer.json +1 -1
- package/extension.json +1 -1
- package/package.json +4 -4
- package/server/migrations/2026_06_23_000001_delete_bad_afaqy_telematics_sensors.php +34 -0
- package/server/src/Console/Commands/SyncTelematics.php +4 -4
- package/server/src/Exports/ContactExport.php +12 -5
- package/server/src/Exports/DeviceExport.php +92 -0
- package/server/src/Exports/DriverExport.php +28 -3
- package/server/src/Exports/EquipmentExport.php +94 -0
- package/server/src/Exports/FleetExport.php +22 -7
- package/server/src/Exports/FuelReportExport.php +16 -1
- package/server/src/Exports/IssueExport.php +25 -3
- package/server/src/Exports/MaintenanceExport.php +106 -0
- package/server/src/Exports/MaintenanceScheduleExport.php +99 -0
- package/server/src/Exports/OrderExport.php +24 -5
- package/server/src/Exports/PartExport.php +99 -0
- package/server/src/Exports/PlaceExport.php +33 -7
- package/server/src/Exports/SensorExport.php +94 -0
- package/server/src/Exports/ServiceAreaExport.php +31 -7
- package/server/src/Exports/ServiceRateExport.php +41 -1
- package/server/src/Exports/TelematicExport.php +90 -0
- package/server/src/Exports/VehicleExport.php +274 -8
- package/server/src/Exports/VendorExport.php +15 -2
- package/server/src/Exports/WorkOrderExport.php +92 -0
- package/server/src/Http/Controllers/Api/v1/Concerns/ResolvesFleetOpsApiResources.php +176 -0
- package/server/src/Http/Controllers/Api/v1/DeviceController.php +225 -0
- package/server/src/Http/Controllers/Api/v1/EquipmentController.php +114 -0
- package/server/src/Http/Controllers/Api/v1/FuelTransactionController.php +185 -0
- package/server/src/Http/Controllers/Api/v1/PartController.php +120 -0
- package/server/src/Http/Controllers/Api/v1/SensorController.php +132 -0
- package/server/src/Http/Controllers/Api/v1/WorkOrderController.php +161 -0
- package/server/src/Http/Controllers/Internal/v1/DeviceController.php +36 -1
- package/server/src/Http/Controllers/Internal/v1/DeviceEventController.php +1 -1
- package/server/src/Http/Controllers/Internal/v1/EquipmentController.php +17 -0
- package/server/src/Http/Controllers/Internal/v1/LiveController.php +1 -1
- package/server/src/Http/Controllers/Internal/v1/MaintenanceController.php +17 -0
- package/server/src/Http/Controllers/Internal/v1/MaintenanceScheduleController.php +17 -0
- package/server/src/Http/Controllers/Internal/v1/PartController.php +17 -0
- package/server/src/Http/Controllers/Internal/v1/SensorController.php +18 -0
- package/server/src/Http/Controllers/Internal/v1/ServiceRateController.php +82 -13
- package/server/src/Http/Controllers/Internal/v1/SettingController.php +29 -5
- package/server/src/Http/Controllers/Internal/v1/TelematicController.php +18 -0
- package/server/src/Http/Controllers/Internal/v1/WorkOrderController.php +17 -0
- package/server/src/Http/Filter/DeviceEventFilter.php +21 -0
- package/server/src/Http/Filter/DeviceFilter.php +50 -4
- package/server/src/Http/Filter/EquipmentFilter.php +23 -0
- package/server/src/Http/Filter/FuelProviderTransactionFilter.php +57 -2
- package/server/src/Http/Filter/PartFilter.php +47 -0
- package/server/src/Http/Filter/SensorFilter.php +34 -6
- package/server/src/Http/Filter/WorkOrderFilter.php +23 -0
- package/server/src/Http/Requests/CreateDeviceRequest.php +51 -0
- package/server/src/Http/Requests/CreateEquipmentRequest.php +35 -0
- package/server/src/Http/Requests/CreateFuelTransactionRequest.php +50 -0
- package/server/src/Http/Requests/CreatePartRequest.php +40 -0
- package/server/src/Http/Requests/CreateSensorRequest.php +47 -0
- package/server/src/Http/Requests/CreateWorkOrderRequest.php +42 -0
- package/server/src/Http/Requests/UpdateDeviceRequest.php +7 -0
- package/server/src/Http/Requests/UpdateEquipmentRequest.php +7 -0
- package/server/src/Http/Requests/UpdateFuelTransactionRequest.php +7 -0
- package/server/src/Http/Requests/UpdatePartRequest.php +7 -0
- package/server/src/Http/Requests/UpdateSensorRequest.php +7 -0
- package/server/src/Http/Requests/UpdateWorkOrderRequest.php +7 -0
- package/server/src/Http/Resources/v1/Device.php +72 -0
- package/server/src/Http/Resources/v1/Equipment.php +57 -0
- package/server/src/Http/Resources/v1/FuelTransaction.php +69 -0
- package/server/src/Http/Resources/v1/Index/Vehicle.php +19 -0
- package/server/src/Http/Resources/v1/Part.php +64 -0
- package/server/src/Http/Resources/v1/Sensor.php +68 -0
- package/server/src/Jobs/SyncTelematicDevicesJob.php +194 -38
- package/server/src/Models/Device.php +2 -0
- package/server/src/Models/DeviceEvent.php +81 -0
- package/server/src/Models/Equipment.php +55 -0
- package/server/src/Models/Order.php +2 -1
- package/server/src/Observers/PurchaseRateObserver.php +2 -1
- package/server/src/Support/Analytics/RevenueTrend.php +3 -8
- package/server/src/Support/Metrics/ActiveRevenueQuery.php +121 -0
- package/server/src/Support/Metrics/AvgOrderValueMetric.php +1 -7
- package/server/src/Support/Metrics/EarningsMetric.php +1 -10
- package/server/src/Support/Telematics/Providers/AfaqyProvider.php +105 -5
- package/server/src/Support/Telematics/Providers/FlespiProvider.php +89 -15
- package/server/src/Support/Telematics/Providers/GeotabProvider.php +123 -35
- package/server/src/Support/Telematics/Providers/SafeeProvider.php +567 -47
- package/server/src/Support/Telematics/Providers/SamsaraProvider.php +122 -14
- package/server/src/Support/Telematics/TelematicService.php +28 -9
- package/server/src/routes.php +67 -15
- package/server/tests/DeviceFilterTest.php +9 -0
- package/server/tests/DriverVehicleStatusDefaultTest.php +19 -2
- package/server/tests/EquipmentAssignmentMorphTypeTest.php +35 -0
- package/server/tests/ExportCoverageTest.php +79 -0
- package/server/tests/MetricsRegistryTest.php +45 -5
- package/server/tests/PublicFleetOpsRestEndpointsTest.php +191 -0
- package/server/tests/ServiceRateRouteValidationTest.php +101 -0
- package/server/tests/TelematicsHardeningTest.php +873 -7
- package/addon/controllers/connectivity/events/index/details.js +0 -3
- package/addon/routes/connectivity/events/index/details.js +0 -3
- package/addon/templates/connectivity/events/index/details.hbs +0 -1
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
<div class="flex flex-col gap-3 p-3" ...attributes>
|
|
2
|
+
<section class="overflow-hidden rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
|
3
|
+
<div class="flex flex-col gap-3 p-3 lg:flex-row lg:items-start lg:justify-between">
|
|
4
|
+
<div class="min-w-0">
|
|
5
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
6
|
+
<h2 class="truncate text-base font-bold text-gray-900 dark:text-gray-100">{{smart-humanize this.eventType}}</h2>
|
|
7
|
+
<Badge @status={{this.severity}} @hideStatusDot={{true}}>{{smart-humanize this.severity}}</Badge>
|
|
8
|
+
<Badge @status={{this.processedStatus}} @hideStatusDot={{true}}>{{this.processedLabel}}</Badge>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<p class="mt-2 max-w-4xl text-sm leading-5 text-gray-700 dark:text-gray-200">{{n-a this.message}}</p>
|
|
12
|
+
|
|
13
|
+
<div class="mt-2 flex flex-wrap gap-2 text-xs text-gray-500 dark:text-gray-300">
|
|
14
|
+
<span>Occurred: {{n-a (format-date-fns this.occurredAt "dd MMM yyyy, HH:mm")}}</span>
|
|
15
|
+
<span>Processed: {{n-a (format-date-fns this.processedAt "dd MMM yyyy, HH:mm")}}</span>
|
|
16
|
+
<span>Public ID: {{n-a @resource.public_id}}</span>
|
|
17
|
+
<span>UUID: {{n-a @resource.id}}</span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</section>
|
|
22
|
+
|
|
23
|
+
<section class="grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-4">
|
|
24
|
+
{{#each this.metrics as |metric|}}
|
|
25
|
+
<div class="fleet-ops-widget fleet-ops-kpi-tile fleetops-connectivity-kpi-tile {{metric.accentClass}} relative min-h-[82px] overflow-hidden rounded-md border bg-white shadow-sm dark:bg-gray-800">
|
|
26
|
+
<div class="flex h-full items-start justify-between gap-2 p-3">
|
|
27
|
+
<div class="min-w-0">
|
|
28
|
+
<div class="truncate text-[10px] font-bold uppercase text-gray-500 dark:text-gray-400">{{metric.label}}</div>
|
|
29
|
+
<div class="mt-1 truncate text-lg font-extrabold leading-none text-gray-900 dark:text-gray-50">{{n-a metric.value}}</div>
|
|
30
|
+
{{#if metric.meta}}
|
|
31
|
+
<div class="mt-1 truncate text-xs text-gray-500 dark:text-gray-300">{{metric.meta}}</div>
|
|
32
|
+
{{/if}}
|
|
33
|
+
</div>
|
|
34
|
+
<div class="fleetops-connectivity-kpi-icon flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-md text-[13px]">
|
|
35
|
+
<FaIcon @icon={{metric.icon}} />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
{{/each}}
|
|
40
|
+
</section>
|
|
41
|
+
|
|
42
|
+
<section class="grid grid-cols-1 gap-3 xl:grid-cols-2">
|
|
43
|
+
<div class="overflow-hidden rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
|
44
|
+
<div class="border-b border-gray-200 px-3 py-2 dark:border-gray-700">
|
|
45
|
+
<h3 class="text-sm font-bold text-gray-900 dark:text-gray-100">Event Details</h3>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="grid grid-cols-1 gap-2 p-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
48
|
+
<div class="field-info-container">
|
|
49
|
+
<div class="field-name">Event Type</div>
|
|
50
|
+
<div class="field-value">{{n-a (smart-humanize this.eventType)}}</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="field-info-container">
|
|
53
|
+
<div class="field-name">Severity</div>
|
|
54
|
+
<div class="field-value"><Badge @status={{this.severity}}>{{smart-humanize this.severity}}</Badge></div>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="field-info-container">
|
|
57
|
+
<div class="field-name">State</div>
|
|
58
|
+
<div class="field-value">{{n-a (smart-humanize @resource.state)}}</div>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="field-info-container">
|
|
61
|
+
<div class="field-name">Code</div>
|
|
62
|
+
<div class="field-value">{{n-a @resource.code}}</div>
|
|
63
|
+
</div>
|
|
64
|
+
<div class="field-info-container">
|
|
65
|
+
<div class="field-name">Reason</div>
|
|
66
|
+
<div class="field-value">{{n-a @resource.reason}}</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="field-info-container">
|
|
69
|
+
<div class="field-name">Mileage</div>
|
|
70
|
+
<div class="field-value">{{n-a @resource.mileage}}</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="field-info-container">
|
|
73
|
+
<div class="field-name">Age</div>
|
|
74
|
+
<div class="field-value">{{#if this.ageMinutes}}{{this.ageMinutes}} minutes{{else}}{{n-a null}}{{/if}}</div>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="field-info-container">
|
|
77
|
+
<div class="field-name">Processing Delay</div>
|
|
78
|
+
<div class="field-value">{{#if this.processingDelay}}{{this.processingDelay}} minutes{{else}}{{n-a null}}{{/if}}</div>
|
|
79
|
+
</div>
|
|
80
|
+
<div class="field-info-container sm:col-span-2 lg:col-span-3">
|
|
81
|
+
<div class="field-name">Comment</div>
|
|
82
|
+
<div class="field-value whitespace-pre-line">{{n-a @resource.comment}}</div>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
|
|
87
|
+
<div class="overflow-hidden rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
|
88
|
+
<div class="border-b border-gray-200 px-3 py-2 dark:border-gray-700">
|
|
89
|
+
<h3 class="text-sm font-bold text-gray-900 dark:text-gray-100">Device & Provider</h3>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="grid grid-cols-1 gap-2 p-3 sm:grid-cols-2 lg:grid-cols-3">
|
|
92
|
+
<div class="field-info-container">
|
|
93
|
+
<div class="field-name">Device</div>
|
|
94
|
+
<div class="field-value">
|
|
95
|
+
{{#if this.deviceRouteModel}}
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
class="text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-300 dark:hover:text-blue-200"
|
|
99
|
+
data-test-device-event-device-link
|
|
100
|
+
{{on "click" this.openDevice}}
|
|
101
|
+
>
|
|
102
|
+
{{n-a this.deviceName}}
|
|
103
|
+
</button>
|
|
104
|
+
{{else}}
|
|
105
|
+
{{n-a this.deviceName}}
|
|
106
|
+
{{/if}}
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="field-info-container">
|
|
110
|
+
<div class="field-name">Device UUID</div>
|
|
111
|
+
<div class="field-value">{{n-a @resource.device_uuid}}</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="field-info-container">
|
|
114
|
+
<div class="field-name">Device ID</div>
|
|
115
|
+
<div class="field-value">{{n-a @resource.device_id}}</div>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="field-info-container">
|
|
118
|
+
<div class="field-name">IMEI</div>
|
|
119
|
+
<div class="field-value">{{n-a @resource.device_imei}}</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="field-info-container">
|
|
122
|
+
<div class="field-name">Serial Number</div>
|
|
123
|
+
<div class="field-value">{{n-a @resource.device_serial_number}}</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div class="field-info-container">
|
|
126
|
+
<div class="field-name">IDENT</div>
|
|
127
|
+
<div class="field-value">{{n-a @resource.ident}}</div>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="field-info-container">
|
|
130
|
+
<div class="field-name">Provider</div>
|
|
131
|
+
<div class="field-value">
|
|
132
|
+
{{#if this.telematicRouteModel}}
|
|
133
|
+
<button
|
|
134
|
+
type="button"
|
|
135
|
+
class="text-blue-600 hover:text-blue-700 hover:underline dark:text-blue-300 dark:hover:text-blue-200"
|
|
136
|
+
data-test-device-event-telematic-link
|
|
137
|
+
{{on "click" this.openTelematic}}
|
|
138
|
+
>
|
|
139
|
+
{{n-a this.providerLabel}}
|
|
140
|
+
</button>
|
|
141
|
+
{{else}}
|
|
142
|
+
{{n-a this.providerLabel}}
|
|
143
|
+
{{/if}}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="field-info-container">
|
|
147
|
+
<div class="field-name">Protocol</div>
|
|
148
|
+
<div class="field-value">{{n-a @resource.protocol}}</div>
|
|
149
|
+
</div>
|
|
150
|
+
<div class="field-info-container">
|
|
151
|
+
<div class="field-name">Telematic UUID</div>
|
|
152
|
+
<div class="field-value">{{n-a @resource.telematic_uuid}}</div>
|
|
153
|
+
</div>
|
|
154
|
+
<div class="field-info-container">
|
|
155
|
+
<div class="field-name">Device Status</div>
|
|
156
|
+
<div class="field-value" data-test-device-event-device-status>
|
|
157
|
+
{{#if this.deviceStatus}}
|
|
158
|
+
<Badge @status={{this.deviceStatus}}>{{smart-humanize this.deviceStatus}}</Badge>
|
|
159
|
+
{{else}}
|
|
160
|
+
{{n-a null}}
|
|
161
|
+
{{/if}}
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</section>
|
|
167
|
+
|
|
168
|
+
<section class="grid grid-cols-1 gap-3 xl:grid-cols-3">
|
|
169
|
+
<div class="overflow-hidden rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
|
170
|
+
<div class="border-b border-gray-200 px-3 py-2 dark:border-gray-700">
|
|
171
|
+
<h3 class="text-sm font-bold text-gray-900 dark:text-gray-100">Payload</h3>
|
|
172
|
+
</div>
|
|
173
|
+
<pre class="max-h-80 overflow-auto bg-gray-900 p-3 text-[11px] leading-5 text-gray-100">{{n-a this.payloadJson}}</pre>
|
|
174
|
+
</div>
|
|
175
|
+
|
|
176
|
+
<div class="overflow-hidden rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
|
177
|
+
<div class="border-b border-gray-200 px-3 py-2 dark:border-gray-700">
|
|
178
|
+
<h3 class="text-sm font-bold text-gray-900 dark:text-gray-100">Data</h3>
|
|
179
|
+
</div>
|
|
180
|
+
<pre class="max-h-80 overflow-auto bg-gray-900 p-3 text-[11px] leading-5 text-gray-100">{{n-a this.dataJson}}</pre>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="overflow-hidden rounded-md border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800">
|
|
184
|
+
<div class="border-b border-gray-200 px-3 py-2 dark:border-gray-700">
|
|
185
|
+
<h3 class="text-sm font-bold text-gray-900 dark:text-gray-100">Meta</h3>
|
|
186
|
+
</div>
|
|
187
|
+
<pre class="max-h-80 overflow-auto bg-gray-900 p-3 text-[11px] leading-5 text-gray-100">{{n-a this.metaJson}}</pre>
|
|
188
|
+
</div>
|
|
189
|
+
</section>
|
|
190
|
+
|
|
191
|
+
<CustomField::Yield @subject={{@resource}} @viewMode={{true}} @wrapperClass="bordered-top" />
|
|
192
|
+
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/device-event/details';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/table/cell/dropdown/action-item';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/table/cell/dropdown';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/components/vendor/panel-header';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/controllers/connectivity/events/
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/controllers/connectivity/events/details';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/routes/connectivity/events/
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/routes/connectivity/events/details';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '@fleetbase/fleetops-engine/templates/connectivity/events/
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/templates/connectivity/events/details';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/fleetops-engine/utils/map-drawer-dropdown-position';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@fleetbase/fleetops-engine/utils/trackable-option';
|
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.56",
|
|
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.
|
|
46
|
-
"@fleetbase/ember-ui": "^0.3.
|
|
47
|
-
"@fleetbase/fleetops-data": "^0.1.
|
|
45
|
+
"@fleetbase/ember-core": "^0.3.23",
|
|
46
|
+
"@fleetbase/ember-ui": "^0.3.38",
|
|
47
|
+
"@fleetbase/fleetops-data": "^0.1.40",
|
|
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",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
use Illuminate\Database\Migrations\Migration;
|
|
4
|
+
use Illuminate\Support\Facades\DB;
|
|
5
|
+
|
|
6
|
+
return new class extends Migration {
|
|
7
|
+
/**
|
|
8
|
+
* Delete malformed AFAQY telematics sensor rows created before sensor identities
|
|
9
|
+
* were normalized. AFAQY remains the source of truth and the next sync recreates
|
|
10
|
+
* one clean latest-state row per real provider sensor.
|
|
11
|
+
*/
|
|
12
|
+
public function up(): void
|
|
13
|
+
{
|
|
14
|
+
DB::table('sensors')
|
|
15
|
+
->whereIn('telematic_uuid', function ($query) {
|
|
16
|
+
$query->select('uuid')
|
|
17
|
+
->from('telematics')
|
|
18
|
+
->where('provider', 'afaqy');
|
|
19
|
+
})
|
|
20
|
+
->delete();
|
|
21
|
+
|
|
22
|
+
DB::table('sensors')
|
|
23
|
+
->whereRaw("LOWER(JSON_UNQUOTE(JSON_EXTRACT(meta, '$.provider'))) = ?", ['afaqy'])
|
|
24
|
+
->delete();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* This cleanup cannot restore deleted rows. Run an AFAQY sync to recreate
|
|
29
|
+
* current sensor state from the provider.
|
|
30
|
+
*/
|
|
31
|
+
public function down(): void
|
|
32
|
+
{
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -13,7 +13,7 @@ class SyncTelematics extends Command
|
|
|
13
13
|
protected $signature = 'fleetops:sync-telematics
|
|
14
14
|
{--provider=* : Limit polling to one or more provider keys}
|
|
15
15
|
{--limit=500 : Maximum provider units to fetch per page}
|
|
16
|
-
{--
|
|
16
|
+
{--exclude-webhook-providers : Skip providers that support webhooks}
|
|
17
17
|
{--no-lock : Skip process locking}';
|
|
18
18
|
|
|
19
19
|
protected $description = 'Poll active telematics providers for device snapshots and positional telemetry.';
|
|
@@ -68,10 +68,10 @@ class SyncTelematics extends Command
|
|
|
68
68
|
protected function pollableProviderKeys(TelematicProviderRegistry $registry): array
|
|
69
69
|
{
|
|
70
70
|
$requestedProviders = array_filter((array) $this->option('provider'));
|
|
71
|
-
$
|
|
71
|
+
$excludeWebhookProviders = (bool) $this->option('exclude-webhook-providers');
|
|
72
72
|
|
|
73
73
|
return $registry->all()
|
|
74
|
-
->filter(function ($descriptor) use ($requestedProviders, $
|
|
74
|
+
->filter(function ($descriptor) use ($requestedProviders, $excludeWebhookProviders) {
|
|
75
75
|
if (!empty($requestedProviders) && !in_array($descriptor->key, $requestedProviders, true)) {
|
|
76
76
|
return false;
|
|
77
77
|
}
|
|
@@ -80,7 +80,7 @@ class SyncTelematics extends Command
|
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
return
|
|
83
|
+
return !$excludeWebhookProviders || !$descriptor->supportsWebhooks;
|
|
84
84
|
})
|
|
85
85
|
->keys()
|
|
86
86
|
->values()
|
|
@@ -25,10 +25,13 @@ class ContactExport implements FromCollection, WithHeadings, WithMapping, WithCo
|
|
|
25
25
|
$contact->public_id,
|
|
26
26
|
$contact->internal_id,
|
|
27
27
|
$contact->name,
|
|
28
|
-
$contact->
|
|
28
|
+
$contact->title,
|
|
29
|
+
$contact->type,
|
|
30
|
+
$contact->address,
|
|
29
31
|
$contact->email,
|
|
30
32
|
$contact->phone,
|
|
31
33
|
$contact->created_at,
|
|
34
|
+
$contact->updated_at,
|
|
32
35
|
];
|
|
33
36
|
}
|
|
34
37
|
|
|
@@ -38,18 +41,22 @@ class ContactExport implements FromCollection, WithHeadings, WithMapping, WithCo
|
|
|
38
41
|
'ID',
|
|
39
42
|
'Internal ID',
|
|
40
43
|
'Name',
|
|
44
|
+
'Title',
|
|
45
|
+
'Type',
|
|
41
46
|
'Address',
|
|
42
47
|
'Email',
|
|
43
48
|
'Phone',
|
|
44
49
|
'Date Created',
|
|
50
|
+
'Date Updated',
|
|
45
51
|
];
|
|
46
52
|
}
|
|
47
53
|
|
|
48
54
|
public function columnFormats(): array
|
|
49
55
|
{
|
|
50
56
|
return [
|
|
51
|
-
'
|
|
52
|
-
'
|
|
57
|
+
'H' => '+#',
|
|
58
|
+
'I' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
59
|
+
'J' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
53
60
|
];
|
|
54
61
|
}
|
|
55
62
|
|
|
@@ -59,9 +66,9 @@ class ContactExport implements FromCollection, WithHeadings, WithMapping, WithCo
|
|
|
59
66
|
public function collection()
|
|
60
67
|
{
|
|
61
68
|
if ($this->selections) {
|
|
62
|
-
return Contact::where('company_uuid', session('company'))->whereIn('uuid', $this->selections)->get();
|
|
69
|
+
return Contact::where('company_uuid', session('company'))->whereIn('uuid', $this->selections)->with(['place'])->get();
|
|
63
70
|
}
|
|
64
71
|
|
|
65
|
-
return Contact::where('company_uuid', session('company'))->get();
|
|
72
|
+
return Contact::where('company_uuid', session('company'))->with(['place'])->get();
|
|
66
73
|
}
|
|
67
74
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\FleetOps\Exports;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\FleetOps\Models\Device;
|
|
6
|
+
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
7
|
+
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
|
8
|
+
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
|
9
|
+
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
10
|
+
use Maatwebsite\Excel\Concerns\WithMapping;
|
|
11
|
+
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
|
12
|
+
|
|
13
|
+
class DeviceExport implements FromCollection, WithHeadings, WithMapping, WithColumnFormatting, ShouldAutoSize
|
|
14
|
+
{
|
|
15
|
+
protected array $selections = [];
|
|
16
|
+
|
|
17
|
+
public function __construct(array $selections = [])
|
|
18
|
+
{
|
|
19
|
+
$this->selections = $selections;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public function map($device): array
|
|
23
|
+
{
|
|
24
|
+
return [
|
|
25
|
+
$device->public_id,
|
|
26
|
+
$device->name,
|
|
27
|
+
$device->device_id,
|
|
28
|
+
$device->connection_status,
|
|
29
|
+
$device->attached_to_name,
|
|
30
|
+
$device->telematic_name,
|
|
31
|
+
$device->sensors_count,
|
|
32
|
+
$device->last_online_at,
|
|
33
|
+
$device->provider,
|
|
34
|
+
$device->type,
|
|
35
|
+
$device->serial_number,
|
|
36
|
+
$device->imei,
|
|
37
|
+
$device->status,
|
|
38
|
+
$device->attachable_uuid ? 'Attached' : 'Unattached',
|
|
39
|
+
$this->yesNo($device->online),
|
|
40
|
+
$device->created_at,
|
|
41
|
+
$device->updated_at,
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public function headings(): array
|
|
46
|
+
{
|
|
47
|
+
return [
|
|
48
|
+
'ID',
|
|
49
|
+
'Name',
|
|
50
|
+
'Provider ID / IMEI',
|
|
51
|
+
'Connection Status',
|
|
52
|
+
'Attached To',
|
|
53
|
+
'Telematic Provider',
|
|
54
|
+
'Sensors Count',
|
|
55
|
+
'Last Seen',
|
|
56
|
+
'Provider',
|
|
57
|
+
'Type',
|
|
58
|
+
'Serial Number',
|
|
59
|
+
'IMEI',
|
|
60
|
+
'Status',
|
|
61
|
+
'Attachment State',
|
|
62
|
+
'Online',
|
|
63
|
+
'Date Created',
|
|
64
|
+
'Date Updated',
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public function columnFormats(): array
|
|
69
|
+
{
|
|
70
|
+
return [
|
|
71
|
+
'H' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
72
|
+
'P' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
73
|
+
'Q' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
74
|
+
];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public function collection()
|
|
78
|
+
{
|
|
79
|
+
$query = Device::where('company_uuid', session('company'))->with(['telematic', 'attachable'])->withCount('sensors');
|
|
80
|
+
|
|
81
|
+
if ($this->selections) {
|
|
82
|
+
$query->whereIn('uuid', $this->selections);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return $query->get();
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
protected function yesNo($value): string
|
|
89
|
+
{
|
|
90
|
+
return $value ? 'Yes' : 'No';
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -25,12 +25,21 @@ class DriverExport implements FromCollection, WithHeadings, WithMapping, WithCol
|
|
|
25
25
|
$driver->public_id,
|
|
26
26
|
$driver->internal_id,
|
|
27
27
|
$driver->name,
|
|
28
|
+
$driver->email,
|
|
28
29
|
$driver->vendor_name,
|
|
29
30
|
$driver->vehicle_name,
|
|
30
31
|
$driver->phone,
|
|
31
32
|
$driver->drivers_license_number,
|
|
33
|
+
$driver->license_expiry,
|
|
32
34
|
$driver->country,
|
|
35
|
+
$driver->city,
|
|
36
|
+
$driver->currency,
|
|
37
|
+
$this->yesNo($driver->online),
|
|
38
|
+
$driver->status,
|
|
39
|
+
$driver->orders()->count(),
|
|
40
|
+
data_get($driver, 'currentOrder.tracking') ?? data_get($driver, 'currentOrder.public_id'),
|
|
33
41
|
$driver->created_at,
|
|
42
|
+
$driver->updated_at,
|
|
34
43
|
];
|
|
35
44
|
}
|
|
36
45
|
|
|
@@ -40,32 +49,48 @@ class DriverExport implements FromCollection, WithHeadings, WithMapping, WithCol
|
|
|
40
49
|
'ID',
|
|
41
50
|
'Internal ID',
|
|
42
51
|
'Name',
|
|
52
|
+
'Email',
|
|
43
53
|
'Vendor',
|
|
44
54
|
'Vehicle',
|
|
45
55
|
'Phone',
|
|
46
56
|
'License #',
|
|
57
|
+
'License Expiry',
|
|
47
58
|
'Country',
|
|
59
|
+
'City',
|
|
60
|
+
'Currency',
|
|
61
|
+
'Online',
|
|
62
|
+
'Status',
|
|
63
|
+
'Assigned Orders Count',
|
|
64
|
+
'Current Order',
|
|
48
65
|
'Date Created',
|
|
66
|
+
'Date Updated',
|
|
49
67
|
];
|
|
50
68
|
}
|
|
51
69
|
|
|
52
70
|
public function columnFormats(): array
|
|
53
71
|
{
|
|
54
72
|
return [
|
|
55
|
-
'
|
|
73
|
+
'G' => '+#',
|
|
56
74
|
'I' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
75
|
+
'Q' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
76
|
+
'R' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
57
77
|
];
|
|
58
78
|
}
|
|
59
79
|
|
|
80
|
+
protected function yesNo($value): string
|
|
81
|
+
{
|
|
82
|
+
return $value ? 'Yes' : 'No';
|
|
83
|
+
}
|
|
84
|
+
|
|
60
85
|
/**
|
|
61
86
|
* @return \Illuminate\Support\Collection
|
|
62
87
|
*/
|
|
63
88
|
public function collection()
|
|
64
89
|
{
|
|
65
90
|
if ($this->selections) {
|
|
66
|
-
return Driver::where('company_uuid', session('company'))->whereIn('uuid', $this->selections)->get();
|
|
91
|
+
return Driver::where('company_uuid', session('company'))->whereIn('uuid', $this->selections)->with(['vehicle', 'currentOrder'])->get();
|
|
67
92
|
}
|
|
68
93
|
|
|
69
|
-
return Driver::where('company_uuid', session('company'))->get();
|
|
94
|
+
return Driver::where('company_uuid', session('company'))->with(['vehicle', 'currentOrder'])->get();
|
|
70
95
|
}
|
|
71
96
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
namespace Fleetbase\FleetOps\Exports;
|
|
4
|
+
|
|
5
|
+
use Fleetbase\FleetOps\Models\Equipment;
|
|
6
|
+
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
7
|
+
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
|
8
|
+
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
|
|
9
|
+
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
10
|
+
use Maatwebsite\Excel\Concerns\WithMapping;
|
|
11
|
+
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
|
|
12
|
+
|
|
13
|
+
class EquipmentExport implements FromCollection, WithHeadings, WithMapping, WithColumnFormatting, ShouldAutoSize
|
|
14
|
+
{
|
|
15
|
+
protected array $selections = [];
|
|
16
|
+
|
|
17
|
+
public function __construct(array $selections = [])
|
|
18
|
+
{
|
|
19
|
+
$this->selections = $selections;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public function map($equipment): array
|
|
23
|
+
{
|
|
24
|
+
return [
|
|
25
|
+
$equipment->public_id,
|
|
26
|
+
$equipment->name,
|
|
27
|
+
$equipment->code,
|
|
28
|
+
$equipment->type,
|
|
29
|
+
$equipment->status,
|
|
30
|
+
$equipment->serial_number,
|
|
31
|
+
$equipment->manufacturer,
|
|
32
|
+
$equipment->model,
|
|
33
|
+
$equipment->equipped_to_name,
|
|
34
|
+
$this->yesNo($equipment->is_equipped),
|
|
35
|
+
$equipment->warranty_name,
|
|
36
|
+
$equipment->purchased_at,
|
|
37
|
+
$equipment->purchase_price,
|
|
38
|
+
$equipment->currency,
|
|
39
|
+
$equipment->age_in_days,
|
|
40
|
+
$equipment->depreciated_value,
|
|
41
|
+
$equipment->created_at,
|
|
42
|
+
$equipment->updated_at,
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public function headings(): array
|
|
47
|
+
{
|
|
48
|
+
return [
|
|
49
|
+
'ID',
|
|
50
|
+
'Name',
|
|
51
|
+
'Code',
|
|
52
|
+
'Type',
|
|
53
|
+
'Status',
|
|
54
|
+
'Serial Number',
|
|
55
|
+
'Manufacturer',
|
|
56
|
+
'Model',
|
|
57
|
+
'Equipped To',
|
|
58
|
+
'Is Equipped',
|
|
59
|
+
'Warranty',
|
|
60
|
+
'Purchased At',
|
|
61
|
+
'Purchase Price',
|
|
62
|
+
'Currency',
|
|
63
|
+
'Age In Days',
|
|
64
|
+
'Depreciated Value',
|
|
65
|
+
'Date Created',
|
|
66
|
+
'Date Updated',
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
public function columnFormats(): array
|
|
71
|
+
{
|
|
72
|
+
return [
|
|
73
|
+
'L' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
74
|
+
'Q' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
75
|
+
'R' => NumberFormat::FORMAT_DATE_DDMMYYYY,
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public function collection()
|
|
80
|
+
{
|
|
81
|
+
$query = Equipment::where('company_uuid', session('company'))->with(['warranty', 'equipable']);
|
|
82
|
+
|
|
83
|
+
if ($this->selections) {
|
|
84
|
+
$query->whereIn('uuid', $this->selections);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return $query->get();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected function yesNo($value): string
|
|
91
|
+
{
|
|
92
|
+
return $value ? 'Yes' : 'No';
|
|
93
|
+
}
|
|
94
|
+
}
|