Compare commits

...

99 Commits

Author SHA1 Message Date
Allan Carr
e8cda88a33 IO-3075 Crisp in Rome Online
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-28 16:17:11 -08:00
Allan Carr
71a74c5437 Merged in hotfix/2025-01-23 (pull request #2082)
Hotfix/2025 01 23
2025-01-23 23:21:28 +00:00
Allan Carr
6fe4d982f5 Merged in feature/IO-3108-Job-Totals-USA-PASL (pull request #2081)
Feature/IO-3108 Job Totals USA PASL
2025-01-23 23:20:44 +00:00
Allan Carr
5ec032d8d6 IO-3108 Remove Console Log
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-23 15:21:10 -08:00
Allan Carr
2718a66fb0 IO-3108 Adjust Initial Values/FieldValues
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-23 15:19:33 -08:00
Allan Carr
4c737371e3 IO-3108 Adjust Initial Values
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-23 14:49:51 -08:00
Dave Richer
ee7a3d0bdf Merged in hotfix/2025-01-23 (pull request #2079)
Hotfix/2025 01 23
2025-01-23 21:01:43 +00:00
Allan Carr
181af581e5 Merged in feature/IO-3108-Job-Totals-USA-PASL (pull request #2078)
IO-3108 Job Totals USA PASL

Approved-by: Dave Richer
2025-01-23 21:00:43 +00:00
Dave Richer
11e2f5d83d feature/IO-3108-Job-Totals-USA-PASL - Fix submit button for Product Fruits reasons, to go into hotfix 2025-01-23 12:57:10 -08:00
Allan Carr
cbc723fa38 IO-3108 Job Totals USA PASL
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-23 12:05:35 -08:00
Allan Carr
95c310119f Merged in hotfix/2025-01-22 (pull request #2073)
IO-3099 check for intellipay initialization before calling. rename files to remove erroneous period.
2025-01-22 16:52:28 +00:00
Allan Carr
ebe1facbd1 Merged in feature/IO-3099-wait-for-intellipay (pull request #2072)
IO-3099 check for intellipay initialization before calling. rename files to remove erroneous period.
2025-01-22 16:50:08 +00:00
Patrick Fic
b021992552 IO-3099 check for intellipay initialization before calling. rename files to remove erroneous period. 2025-01-20 12:16:24 -08:00
Dave Richer
0e218abbf4 Merged in release/2025-01-17 (pull request #2067)
Release/2025 01 17 into master-AIO - IO-999 IO-1927 IO-2951 IO-3022 IO-3060 IO-3063 IO-3065 IO-3076 IO-3078 IO-3080 IO-3082 IO-3083 IO-3094 IO-3096
2025-01-18 04:04:26 +00:00
Dave Richer
0cf7961d7d Merged in hotfix/AdditionalProductFruitIds (pull request #2066)
hotfix/AdditionalProductFruitsIds - Add additional IDs for product fruits
2025-01-17 18:15:56 +00:00
Dave Richer
ca02937461 Merged in hotfix/AdditionalProductFruitIds (pull request #2064)
hotfix/AdditionalProductFruitsIds - Add additional IDs for product fruits
2025-01-17 18:14:26 +00:00
Dave Richer
fa7e0a107b hotfix/AdditionalProductFruitsIds - Add additional IDs for product fruits 2025-01-17 10:13:41 -08:00
Allan Carr
9ccffd73ba Merged in feature/IO-999-Part-Tax-rate-Label (pull request #2062)
IO-999 Part Tax Rate Label

Approved-by: Dave Richer
2025-01-17 17:53:05 +00:00
Dave Richer
f68ad181e4 feature/IO-999-Part-Tax-rate-Label 2025-01-17 09:52:35 -08:00
Dave Richer
23bd6085a8 feature/IO-3096-Global-Notifications-Preferences
-  Package Updates
2025-01-17 09:51:55 -08:00
Allan Carr
e4325e39bf Merged in feature/IO-2951-Ro-Guard-Labor-Warning (pull request #2061)
IO-2951 RO Guard Labor Warning

Approved-by: Dave Richer
2025-01-17 15:32:51 +00:00
Allan Carr
584c2e5de2 IO-999 Part Tax Rate Label
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-16 18:39:41 -08:00
Allan Carr
eccc992cfa IO-2951 RO Guard Labor Warning
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-16 18:28:54 -08:00
Allan Carr
f293e80d0d Merged in feature/IO-3063-LOU-on-Schedule-PopOver (pull request #2059)
IO-3063 LOU on Schedule PopOver

Approved-by: Dave Richer
2025-01-16 15:23:59 +00:00
Allan Carr
eea2a758b0 IO-3063 LOU on Schedule PopOver
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-15 17:14:08 -08:00
Allan Carr
8d7d4ab4ac Merged in feature/IO-3083-i18-Translation-Shop-Info-Warning (pull request #2044)
IO-3083 i18 Translation Warning in Shop Info

Approved-by: Dave Richer
2025-01-15 15:49:37 +00:00
Dave Richer
f9105806ba feature/IO-3083-i18-Translation-Shop-Info-Warning
resolve conflicts
2025-01-15 07:49:19 -08:00
Dave Richer
acd278f5b4 Merged in release/2025-01-17 (pull request #2057)
Release/2025 01 17 IO-3065, IO-3076, IO-3094
2025-01-15 15:40:44 +00:00
Allan Carr
a4a6fac224 Merged in feature/IO-3094-Purchases-by-Date-Excel (pull request #2056)
IO-3094 Purchases by Date - Excel Report

Approved-by: Dave Richer
2025-01-15 15:39:12 +00:00
Patrick Fic
b2b7064007 Merged in feature/IO-3065-0-dollar-parts-status (pull request #2055)
feature/IO-3065-0-dollar-parts-status

Approved-by: Dave Richer
2025-01-15 15:38:42 +00:00
Allan Carr
4a56fbb135 IO-3094 Purchases by Date - Excel Report
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-14 18:00:46 -08:00
Allan Carr
e1fcb0ecba IO-3083 Merge Conflit Resolution
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-14 17:54:12 -08:00
Allan Carr
ee5e091118 Merge branch 'release/2025-01-17' into feature/IO-3083-i18-Translation-Shop-Info-Warning
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>

# Conflicts:
#	client/src/translations/en_us/common.json
2025-01-14 17:48:10 -08:00
Patrick Fic
9f46f8ec31 IO-3065 All manual toggle to include $0 line in part status count. 2025-01-14 13:49:38 -08:00
Patrick Fic
8c737ff0ae Merged in feature/IO-3076-daily-usage-reports (pull request #2054)
feature/IO-3076-daily-usage-reports

Approved-by: Patrick Fic
2025-01-14 21:14:13 +00:00
Patrick Fic
a8ef681cf1 IO-3076 Adjust daily usage report window. 2025-01-14 13:13:09 -08:00
Dave Richer
494c8b6867 Merged in release/2025-01-17 (pull request #2053)
Release/2025 01 17 into test-AIO - IO-1927, IO-3022, IO-3060, IO-3078, IO-3080, IO-3082
2025-01-14 17:02:26 +00:00
Dave Richer
262b5600d8 Merged in feature/IO-3060-Realtime-Notification-System (pull request #2052)
feature/IO-3060-Realtime-Notifications- Checkpoint
2025-01-14 17:01:20 +00:00
Dave Richer
a06d3c9365 feature/IO-3060-Realtime-Notifications- Checkpoint 2025-01-14 09:00:04 -08:00
Allan Carr
1861bd68d1 Merged in feature/IO-3080-Restrict-Claimable-Hours-Label (pull request #2042)
IO-3080 Restrict Claimable Hours Label

Approved-by: Dave Richer
2025-01-14 14:43:12 +00:00
Allan Carr
348561c812 Merged in feature/IO-3078-Job-Presets-Company-Setup-Markup-Rule (pull request #2043)
IO-3078 Jobs Presets Company Setup Markup Discount

Approved-by: Dave Richer
2025-01-14 14:42:59 +00:00
Allan Carr
bf4a52b3c1 Merged in feature/IO-3022-Export-Payments-Payment-Methods (pull request #2045)
IO-3022 Export Payments - Payment Method

Approved-by: Dave Richer
2025-01-14 14:42:34 +00:00
Allan Carr
1950023f37 Merged in feature/IO-3082-Additional-IO-Basic-Lock-Out-Reports (pull request #2041)
IO-3082 Additional IO Basic Lock Out Reports

Approved-by: Dave Richer
2025-01-14 14:42:17 +00:00
Allan Carr
a2798a02b3 Merged in feature/IO-1927-Mark-Exported-Primary (pull request #2046)
IO-1927 Export Button as Primary

Approved-by: Dave Richer
2025-01-14 14:41:54 +00:00
Dave Richer
5fcb5a3a3e Merged in release/2025-01-17 (pull request #2051)
Release/2025 01 17
2025-01-14 01:44:03 +00:00
Dave Richer
ba41b29538 Merged in feature/IO-3060-Realtime-Notification-System (pull request #2050)
Feature/IO-3060 Realtime Notification System
2025-01-14 01:42:46 +00:00
Dave Richer
8a0916a47f feature/IO-3060-Realtime-Notifications- Checkpoint 2025-01-13 07:27:10 -08:00
Patrick Fic
d187ed6f73 Merged in release/2025-01-10 (pull request #2049)
Release/2025 01 10
2025-01-10 22:03:04 +00:00
Patrick Fic
13a57406d9 Merged in release/2025-01-10 (pull request #2048)
Release/2025 01 10
2025-01-10 20:06:28 +00:00
Patrick Fic
68c1ac3e70 Merged in feature/IO-3076-daily-usage-reports (pull request #2047)
Feature/IO-3076 daily usage reports

Approved-by: Dave Richer
2025-01-10 19:47:37 +00:00
Patrick Fic
2f267a9f2c IO-3076 updates to usage report. 2025-01-10 11:39:18 -08:00
Dave Richer
3bc6504ae6 feature/IO-3060-Realtime-Notifications-Progress Update 2025-01-10 09:33:47 -08:00
Allan Carr
c7f293ceca IO-1927 Export Button as Primary
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-09 19:28:28 -08:00
Allan Carr
66e60e96ad IO-3022 Export Payments - Payment Method
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-09 19:16:45 -08:00
Allan Carr
54a9beb37f IO-3083 i18 Translation Warning in Shop Info
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-09 19:00:23 -08:00
Allan Carr
779cc7d9e8 IO-3078 Jobs Presets Company Setup Markup Discount
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-09 18:57:21 -08:00
Allan Carr
c1b3df9c3b IO-3080 Restrict Claimable Hours Label
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-09 17:43:43 -08:00
Allan Carr
80379cdd79 IO-3082 Additional IO Basic Lock Out Reports
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2025-01-09 17:37:30 -08:00
Dave Richer
e2e5f3f885 feature/IO-3060-Realtime-Notifications-System
- Add handlers for Job and Bill Change / Register Routers
- Add Tables / Modify Tables / Add permissions.
2025-01-09 13:28:56 -08:00
Patrick Fic
d6fbf02092 IO-3076 Initial usage reports design. 2025-01-09 11:22:08 -08:00
Patrick Fic
7a88dd1aae Release/2025 01 10 IO-3069 IO-3067 IO-3070 2025-01-08 14:16:41 -08:00
Patrick Fic
91c3ac56fa Merged in release/2025-01-10 (pull request #2039)
Release/2025 01 10
2025-01-08 18:39:00 +00:00
Patrick Fic
521aa81591 Merged in feature/IO-3067-implement-learn-more-link-for-rome-upsells (pull request #2038)
Feature/IO-3067 implement learn more link for rome upsells
2025-01-08 17:52:41 +00:00
Patrick Fic
d70fee6125 IO-3067 clean up unused imports. 2025-01-08 09:51:52 -08:00
Patrick Fic
7d21cb7d70 Merged in feature/IO-3067-implement-learn-more-link-for-rome-upsells (pull request #2037)
Revert "IO-3067 Add learn more link for Rome."
2025-01-07 18:24:52 +00:00
Patrick Fic
1a8fad26e5 IO-3067 Correct Rome Learn More Link. 2025-01-06 16:09:00 -08:00
Patrick Fic
d69050f006 Revert "IO-3067 Add learn more link for Rome."
This reverts commit c4f7c57c24.
2025-01-06 15:58:56 -08:00
Allan Carr
abe1e80844 Merged in feature/IO-3070-Enter-Bills-Header-Missing-Translation (pull request #2033)
IO-3070 Enter Bills Header Missing Translation

Approved-by: Dave Richer
2025-01-02 16:10:16 +00:00
Allan Carr
58e897db31 Merged in feature/IO-3069-Job-Drawer-Documents-Upsell (pull request #2032)
IO-3069 Job Drawer Documents Upsell correction

Approved-by: Dave Richer
2025-01-02 16:09:59 +00:00
Patrick Fic
b7ed6734a0 Merged in revert/revert-pr-2034 (pull request #2036)
Revert "Feature/IO-3067 implement learn more link for rome upsells (pull request #2034)"
2025-01-02 16:08:29 +00:00
Patrick Fic
7d5a866a5c include intellipay. 2025-01-02 08:07:01 -08:00
Patrick Fic
23becf6494 Revert "Feature/IO-3067 implement learn more link for rome upsells (pull request #2034)" 2025-01-02 16:02:14 +00:00
Patrick Fic
64ee2c1526 Merged in feature/IO-3067-implement-learn-more-link-for-rome-upsells (pull request #2035)
IO-3067 Add learn more link for Rome.
2025-01-01 23:17:26 +00:00
Patrick Fic
c033c0fbc5 Merged in feature/IO-3067-implement-learn-more-link-for-rome-upsells (pull request #2034)
Feature/IO-3067 implement learn more link for rome upsells
2025-01-01 23:09:58 +00:00
Allan Carr
f8ddfeb7d0 IO-3070 Enter Bills Header Missing Translation
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-12-27 10:03:51 -08:00
Allan Carr
bc42d19dff IO-3069 Job Drawer Documents Upsell correction
Would constantly display the upsell component

Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-12-27 10:01:11 -08:00
Patrick Fic
c4f7c57c24 IO-3067 Add learn more link for Rome. 2024-12-20 09:01:51 -08:00
Patrick Fic
c0bf829dc0 Merged in hotfix/IO-3056-intellipay-logging (pull request #2031)
IO-3056 resolve logging issue for intellipay.
2024-12-16 21:17:03 +00:00
Patrick Fic
51cd61c932 IO-3056 resolve logging issue for intellipay. 2024-12-16 13:16:13 -08:00
Allan Carr
4ab77de591 Merged in hotfix/IO-3020-smart-scheduling-upsell (pull request #2030)
IO-3020 Fix PrintCenter Upsell restrictions
2024-12-16 20:56:40 +00:00
Allan Carr
acc6633271 Merged in hotfix/IO-3020-smart-scheduling-upsell (pull request #2029)
IO-3020 Fix PrintCenter Upsell restrictions

Approved-by: Patrick Fic
2024-12-16 20:50:51 +00:00
Allan Carr
2336617077 IO-3020 Fix PrintCenter Upsell restrictions
Signed-off-by: Allan Carr <allan.carr@thinkimex.com>
2024-12-16 12:42:21 -08:00
Patrick Fic
836e9b846a Merged in hotfix/IO-3020-smart-scheduling-upsell (pull request #2028)
IO-3020 Resolve smart scheduling upsell displays when they shouldn't.
2024-12-16 18:29:51 +00:00
Patrick Fic
897efde14d Merged in hotfix/IO-3020-smart-scheduling-upsell (pull request #2027)
IO-3020 Resolve smart scheduling upsell displays when they shouldn't.
2024-12-16 18:26:55 +00:00
Patrick Fic
98f7147378 IO-3020 Resolve smart scheduling upsell displays when they shouldn't. 2024-12-16 10:26:03 -08:00
Patrick Fic
fd01746f7d Merged in hotfix/IO-3001-null-cieca-scrubbing (pull request #2026)
Hotfix/IO-3001 null cieca scrubbing
2024-12-16 16:33:42 +00:00
Patrick Fic
54b8f564e4 Merged in hotfix/IO-3001-null-cieca-scrubbing (pull request #2025)
IO-3001 Add CIECA data check for scrubbing.
2024-12-16 16:07:15 +00:00
Patrick Fic
591284c972 IO-3001 Add CIECA data check for scrubbing. 2024-12-16 08:06:39 -08:00
Dave Richer
9e0dae2adf Merged in release/2024-12-13 (pull request #2023)
[DO NOT MERGE] Release/2024-12-13 into master-AIO - IO-2968, IO-3020, IO-3036, IO-3056, IO-3096
2024-12-14 04:35:30 +00:00
Patrick Fic
4ec171d93b Merged in release/2024-12-13 (pull request #2022)
IO-3020 IO-3036 Remove Audit and Lifecycle feature wraps.
2024-12-13 16:28:53 +00:00
Dave Richer
608988c67c Merged in release/2024-12-13 (pull request #2020)
feature/IO-3056-Enhanced-Lightbox-Logging
2024-12-12 21:16:07 +00:00
Patrick Fic
8da4d0b0f1 Merged in release/2024-12-13 (pull request #2018)
IO-3020 IO-3036 Resolve lock wrapper on payroll allocations.
2024-12-12 20:43:04 +00:00
Patrick Fic
a54668e030 Merged in release/2024-12-13 (pull request #2016)
Release/2024 12 13
2024-12-12 17:48:33 +00:00
Dave Richer
2386457cf5 Merged in release/2024-12-13 (pull request #2013)
release/2024-12-13 into test-AIO - IO-2968
2024-12-11 18:26:57 +00:00
Patrick Fic
45944ae8c9 Merged in feature/IO-3020-IO-3036-imex-lite-rome-lite (pull request #2012)
feature/IO-3020-IO-3036-imex-lite-rome-lite

Approved-by: Patrick Fic
2024-12-11 17:45:25 +00:00
Patrick Fic
2c32a4891b Merged in feature/IO-3020-IO-3036-imex-lite-rome-lite (pull request #2011)
feature/IO-3020-IO-3036-imex-lite-rome-lite

Approved-by: Patrick Fic
2024-12-10 21:23:37 +00:00
Patrick Fic
2b9fe61d79 Merged in feature/IO-3020-IO-3036-imex-lite-rome-lite (pull request #2009)
IO-3020 IO-3036 Correct masking issue.
2024-12-10 19:03:07 +00:00
Patrick Fic
95751103a2 Merged in feature/IO-3020-IO-3036-imex-lite-rome-lite (pull request #2004)
Feature/IO-3020 IO 3036 ImEX Lite Rome Starter

Approved-by: Dave Richer
2024-12-10 17:49:56 +00:00
Allan Carr
8ca4c5d7fa Merged in hotfix/2024-12-09 (pull request #2007)
IO-3050 Adjust Customer setup
2024-12-09 19:57:21 +00:00
95 changed files with 12889 additions and 11756 deletions

View File

@@ -6369,6 +6369,27 @@
<folder_node>
<name>md_parts_scan</name>
<children>
<concept_node>
<name>caseInsensitive</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>expression</name>
<definition_loaded>false</definition_loaded>
@@ -6390,6 +6411,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>field</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>flags</name>
<definition_loaded>false</definition_loaded>
@@ -6411,6 +6453,48 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>operation</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>value</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
<concept_node>
@@ -11987,6 +12071,158 @@
</concept_node>
</children>
</folder_node>
<folder_node>
<name>operations</name>
<children>
<concept_node>
<name>contains</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>ends_with</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>equals</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>greater_than</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>less_than</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>not_equals</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>starts_with</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
</children>
</folder_node>
<folder_node>
<name>successes</name>
<children>
@@ -23131,6 +23367,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>alt_partno</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node>
<name>amount</name>
<definition_loaded>false</definition_loaded>
@@ -23236,6 +23493,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>include_in_part_cnt</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<folder_node>
<name>lbr_types</name>
<children>

View File

@@ -62,7 +62,17 @@
t = d.getElementsByTagName("script")[0];
t.parentNode.insertBefore(s, t);
</script>
<script type="text/javascript">
window.$crisp = [];
window.CRISP_WEBSITE_ID = "36724f62-2eb0-4b29-9cdd-9905fb99913e";
(function () {
d = document;
s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();
</script>
<% } %>
<script>
!(function () {

View File

@@ -85,6 +85,17 @@ export function AccountingPayablesTableComponent({ bodyshop, loading, payments,
sortOrder: state.sortedInfo.columnKey === "amount" && state.sortedInfo.order,
render: (text, record) => <CurrencyFormatter>{record.amount}</CurrencyFormatter>
},
{
title: t("payments.fields.type"),
dataIndex: "type",
key: "type",
sorter: (a, b) => a.type.localeCompare(b.type),
sortOrder: state.sortedInfo.columnKey === "type" && state.sortedInfo.order,
filters: bodyshop.md_payment_types.map((s) => {
return { text: s, value: [s] };
}),
onFilter: (value, record) => value.includes(record.type)
},
{
title: t("payments.fields.memo"),
dataIndex: "memo",

View File

@@ -1,6 +1,6 @@
import { EditFilled, SyncOutlined } from "@ant-design/icons";
import { Button, Card, Checkbox, Input, Space, Table } from "antd";
import React, { useRef, useState } from "react";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { FaTasks } from "react-icons/fa";
import { connect } from "react-redux";
@@ -17,8 +17,7 @@ import BillDetailEditReturnComponent from "../bill-detail-edit/bill-detail-edit-
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import LockerWrapperComponent from "../lock-wrapper/lock-wrapper.component";
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
import UpsellComponent from "../upsell/upsell.component";
import { upsellEnum } from "../upsell/upsell.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
const mapStateToProps = createStructuredSelector({
jobRO: selectJobReadOnly,
@@ -61,7 +60,6 @@ export function BillsListTableComponent({
// const search = queryString.parse(useLocation().search);
// const selectedBill = search.billid;
const [searchText, setSearchText] = useState("");
const containerRef = useRef(null);
const Templates = TemplateList("bill");
const bills = billsQuery.data ? billsQuery.data.bills : [];

View File

@@ -133,15 +133,19 @@ const CardPaymentModalComponent = ({
if (window.intellipay) {
// eslint-disable-next-line no-eval
eval(response.data);
SetIntellipayCallbackFunctions();
window.intellipay.autoOpen();
pollForIntelliPay(() => {
SetIntellipayCallbackFunctions();
window.intellipay.autoOpen();
});
} else {
const rg = document.createRange();
const node = rg.createContextualFragment(response.data);
document.documentElement.appendChild(node);
SetIntellipayCallbackFunctions();
window.intellipay.isAutoOpen = true;
window.intellipay.initialize();
pollForIntelliPay(() => {
SetIntellipayCallbackFunctions();
window.intellipay.isAutoOpen = true;
window.intellipay.initialize();
});
}
} catch (error) {
notification.open({
@@ -345,3 +349,27 @@ const CardPaymentModalComponent = ({
};
export default connect(mapStateToProps, mapDispatchToProps)(CardPaymentModalComponent);
//Poll for window.IntelliPay.fixAmount for 5 seconds. If it doesn't come up, just try anyways to force the possible error.
function pollForIntelliPay(callbackFunction) {
const timeout = 5000;
const interval = 150; // Poll every 100 milliseconds
const startTime = Date.now();
function checkFixAmount() {
if (window.intellipay && window.intellipay.fixAmount !== undefined) {
callbackFunction();
return;
}
if (Date.now() - startTime >= timeout) {
console.log("Stopped polling IntelliPay after 10 seconds. Attemping to set functions anyways.");
callbackFunction();
return;
}
setTimeout(checkFixAmount, interval);
}
checkFixAmount();
}

View File

@@ -6,7 +6,7 @@ import { createStructuredSelector } from "reselect";
import { toggleModalVisible } from "../../redux/modals/modals.actions";
import { selectCardPayment } from "../../redux/modals/modals.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import CardPaymentModalComponent from "./card-payment-modal.component.";
import CardPaymentModalComponent from "./card-payment-modal.component";
const mapStateToProps = createStructuredSelector({
cardPaymentModal: selectCardPayment,

View File

@@ -1,10 +1,10 @@
import * as Sentry from "@sentry/react";
import { Button, Col, Collapse, Result, Row, Space } from "antd";
import React from "react";
import { withTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
import * as Sentry from "@sentry/react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
@@ -38,28 +38,23 @@ class ErrorBoundary extends React.Component {
}
handleErrorSubmit = () => {
InstanceRenderManager({
executeFunction: true,
args: [],
imex: () => {
window.$crisp.push([
"do",
"message:send",
[
"text",
`I hit the following error: \n\n
window.$crisp.push([
"do",
"message:send",
[
"text",
`I hit the following error: \n\n
${this.state.error.message}\n\n
${this.state.error.stack}\n\n
URL:${window.location} as ${this.props.currentUser.email} for ${
this.props.bodyshop && this.props.bodyshop.name
}
`
]
]);
]
]);
window.$crisp.push(["do", "chat:open"]);
window.$crisp.push(["do", "chat:open"]);
}
});
// const errorDescription = `**Please add relevant details about what you were doing before you encountered this issue**
// ----

View File

@@ -148,7 +148,7 @@ function Header({
label: (
<Space>
<LockWrapper featureName="bills" bodyshop={bodyshop}>
{t(t("menus.header.enterbills"))}
{t("menus.header.enterbills")}
</LockWrapper>
</Space>
),
@@ -650,14 +650,7 @@ function Header({
icon: <Icon component={QuestionCircleFilled} />,
label: t("menus.header.help"),
onClick: () => {
window.open(
InstanceRenderManager({
imex: "https://help.imex.online/",
rome: "https://rometech.com//"
}),
"_blank"
);
window.open("https://help.imex.online/", "_blank");
}
},
...(InstanceRenderManager({

View File

@@ -1,30 +1,30 @@
import { AlertFilled } from "@ant-design/icons";
import { useMutation } from "@apollo/client";
import { Button, Divider, Dropdown, Form, Input, notification, Popover, Select, Space } from "antd";
import parsePhoneNumber from "libphonenumber-js";
import dayjs from "../../utils/day";
import queryString from "query-string";
import React, { useContext, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Link, useLocation, useNavigate } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
import { openChatByPhone, setMessage } from "../../redux/messaging/messaging.actions";
import { setModalContext } from "../../redux/modals/modals.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import dayjs from "../../utils/day";
import { GenerateDocument } from "../../utils/RenderTemplate";
import { TemplateList } from "../../utils/TemplateConstants";
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
import DataLabel from "../data-label/data-label.component";
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
import ScheduleManualEvent from "../schedule-manual-event/schedule-manual-event.component";
import ScheduleAtChange from "./job-at-change.component";
import ScheduleEventColor from "./schedule-event.color.component";
import ScheduleEventNote from "./schedule-event.note.component";
import { useMutation } from "@apollo/client";
import { UPDATE_APPOINTMENT } from "../../graphql/appointments.queries";
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
import SocketContext from "../../contexts/SocketIO/socketContext.jsx";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
@@ -127,6 +127,7 @@ export function ScheduleEventComponent({
<DataLabel label={t("jobs.fields.ownr_ph2")}>
<ChatOpenButton phone={event.job && event.job.ownr_ph2} jobid={event.job.id} />
</DataLabel>
<DataLabel hideIfNull label={t("jobs.fields.loss_of_use")}>{(event.job && event.job.loss_of_use) || ""}</DataLabel>
<DataLabel label={t("jobs.fields.alt_transport")}>
{(event.job && event.job.alt_transport) || ""}
<ScheduleAtChange job={event && event.job} />

View File

@@ -122,7 +122,7 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
</Col>
{!bodyshop.uselocalmediaserver && (
<Col {...span}>
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} />
<JobDetailCardsDocumentsComponent loading={loading} data={data ? data.jobs_by_pk : null} bodyshop={bodyshop} />
</Col>
)}
<Col {...span}>

View File

@@ -1,12 +1,14 @@
import { Carousel } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import { GenerateThumbUrl } from "../jobs-documents-gallery/job-documents.utility";
import CardTemplate from "./job-detail-cards.template.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
import CardTemplate from "./job-detail-cards.template.component";
export default function JobDetailCardsDocumentsComponent({ loading, data }) {
export default function JobDetailCardsDocumentsComponent({ loading, data, bodyshop }) {
const { t } = useTranslation();
const hasMediaAccess = HasFeatureAccess({ bodyshop, featureName: "media" });
if (!data)
return (
@@ -21,17 +23,19 @@ export default function JobDetailCardsDocumentsComponent({ loading, data }) {
title={t("jobs.labels.cards.documents")}
extraLink={`/manage/jobs/${data.id}?tab=documents`}
>
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
{data.documents.length > 0 ? (
<Carousel autoplay>
{data.documents.map((item) => (
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
))}
</Carousel>
) : (
<div>{t("documents.errors.nodocuments")}</div>
)}
</UpsellComponent>
{!hasMediaAccess && (
<UpsellComponent disableMask upsell={upsellEnum().media.general}>
{data.documents.length > 0 ? (
<Carousel autoplay>
{data.documents.map((item) => (
<img key={item.id} src={GenerateThumbUrl(item)} alt={item.name} />
))}
</Carousel>
) : (
<div>{t("documents.errors.nodocuments")}</div>
)}
</UpsellComponent>
)}
</CardTemplate>
);
}

View File

@@ -519,6 +519,7 @@ export function JobLinesComponent({
{selectedLines.length > 0 && ` (${selectedLines.length})`}
</Button>
<Button
id="job-lines-order-parts-button"
disabled={(job && !job.converted) || (selectedLines.length > 0 ? false : true) || jobRO || technician}
onClick={() => {
setPartsOrderContext({
@@ -541,6 +542,7 @@ export function JobLinesComponent({
{selectedLines.length > 0 && ` (${selectedLines.length})`}
</Button>
<Button
id="job-lines-filter-parts-only-button"
onClick={() => {
setState((state) => ({
...state,
@@ -554,7 +556,7 @@ export function JobLinesComponent({
<FilterFilled /> {t("jobs.actions.filterpartsonly")}
</Button>
<Dropdown menu={markMenu} trigger={["click"]}>
<Button>{t("jobs.actions.mark")}</Button>
<Button id="repair-data-mark-button">{t("jobs.actions.mark")}</Button>
</Dropdown>
<Button
disabled={jobRO || technician}

View File

@@ -9,14 +9,25 @@ import { useTranslation } from "react-i18next";
import "./job-lifecycle.styles.scss";
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
// show text on bar if text can fit
export function JobLifecycleComponent({ job, statuses, ...rest }) {
export function JobLifecycleComponent({ bodyshop, job, statuses, ...rest }) {
const [loading, setLoading] = useState(true);
const [lifecycleData, setLifecycleData] = useState(null);
const { t } = useTranslation(); // Used for tracking external state changes.
const hasLifeCycleAccess = HasFeatureAccess({ bodyshop, featureName: "lifecycle" });
const { data } = useQuery(
gql`
query get_job_test($id: uuid!) {
@@ -143,9 +154,11 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
}
style={{ width: "100%" }}
>
<Card type="inner" style={{ marginTop: "10px" }}>
<UpsellComponent upsell={upsellEnum().lifecycle.general} />
</Card>
{!hasLifeCycleAccess && (
<Card type="inner" style={{ marginTop: "10px" }}>
<UpsellComponent upsell={upsellEnum().lifecycle.general} />
</Card>
)}
<BlurWrapperComponent featureName="lifecycle" bypass>
<div
id="bar-container"
@@ -302,5 +315,4 @@ export function JobLifecycleComponent({ job, statuses, ...rest }) {
</Card>
);
}
export default JobLifecycleComponent;
export default connect(mapStateToProps, mapDispatchToProps)(JobLifecycleComponent);

View File

@@ -192,6 +192,23 @@ export function JobLinesUpsertModalComponent({ bodyshop, open, jobLine, handleCa
<Form.Item label={t("joblines.fields.tax_part")} name="tax_part" valuePropName="checked" initialValue={true}>
<Switch />
</Form.Item>
<Form.Item dependencies={[["act_price"]]} noStyle>
{() => {
if (form.getFieldValue("act_price") === 0) {
return (
<Form.Item
label={t("joblines.fields.include_in_part_cnt")}
name="include_in_part_cnt"
valuePropName="checked"
>
<Switch />
</Form.Item>
);
} else {
return null;
}
}}
</Form.Item>
</LayoutFormRow>
</Form>
</Modal>

View File

@@ -173,7 +173,7 @@ export function JobsCloseExportButton({
}
});
if (!!!jobUpdateResponse.errors) {
if (!jobUpdateResponse.errors) {
notification.open({
type: "success",
key: "jobsuccessexport",
@@ -222,7 +222,7 @@ export function JobsCloseExportButton({
};
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
<Button onClick={handleQbxml} loading={loading} disabled={disabled} type="primary">
{t("jobs.actions.export")}
</Button>
);

View File

@@ -1,7 +1,8 @@
import { useMutation } from "@apollo/client";
import { Button, Form, Input, notification, Popover, Select, Space, Switch } from "antd";
import axios from "axios";
import React, { useState } from "react";
import { some } from "lodash";
import React, { useCallback, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
@@ -18,7 +19,14 @@ const mapStateToProps = createStructuredSelector({
jobRO: selectJobReadOnly
});
const mapDispatchToProps = (dispatch) => ({
insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type }))
insertAuditTrail: ({ jobid, operation, type }) =>
dispatch(
insertAuditTrail({
jobid,
operation,
type
})
)
});
export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTrail, parentFormIsFieldsTouched }) {
@@ -27,6 +35,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO);
const { t } = useTranslation();
const [form] = Form.useForm();
const allFormValues = Form.useWatch([], form);
const handleConvert = async ({ employee_csr, category, ...values }) => {
if (parentFormIsFieldsTouched()) {
@@ -69,6 +78,8 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
setLoading(false);
};
const submitDisabled = useCallback(() => some(allFormValues, (v) => v === undefined), [allFormValues]);
const popMenu = (
<div>
<Form
@@ -77,9 +88,12 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
onFinish={handleConvert}
initialValues={{
driveable: true,
towin: false,
towin: job.towin,
ca_gst_registrant: job.ca_gst_registrant,
employee_csr: job.employee_csr,
category: job.category
category: job.category,
referral_source: job.referral_source,
referral_source_extra: job.referral_source_extra ?? ""
}}
>
<Form.Item
@@ -209,7 +223,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
<Switch />
</Form.Item>
<Space wrap>
<Button type="primary" danger onClick={() => form.submit()} loading={loading}>
<Button disabled={submitDisabled()} type="primary" danger onClick={() => form.submit()} loading={loading}>
{t("jobs.actions.convert")}
</Button>
<Button onClick={() => setOpen(false)}>{t("general.actions.close")}</Button>
@@ -231,11 +245,6 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
loading={loading}
onClick={() => {
setOpen(true);
form.setFieldsValue({
driveable: true,
towin: false,
employee_csr: job.employee_csr
});
}}
>
{t("jobs.actions.convert")}

View File

@@ -982,7 +982,7 @@ export function JobsDetailRatesParts({ jobRO, expanded, required = true, form })
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
</Form.Item>
</LayoutFormRow>
<LayoutFormRow>
<LayoutFormRow header={t("jobs.labels.cieca_pfo")}>
<Form.Item label={t("jobs.fields.tax_tow_rt")} name="tax_tow_rt">
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
</Form.Item>

View File

@@ -10,8 +10,8 @@ import { auth, logImEXEvent } from "../../firebase/firebase.utils";
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
import { UPDATE_JOBS } from "../../graphql/jobs.queries";
import { insertAuditTrail } from "../../redux/application/application.actions";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import client from "../../utils/GraphQLClient";
const mapStateToProps = createStructuredSelector({
@@ -165,7 +165,7 @@ export function JobsExportAllButton({
}
});
if (!!!jobUpdateResponse.errors) {
if (!jobUpdateResponse.errors) {
notification.open({
type: "success",
key: "jobsuccessexport",
@@ -213,13 +213,13 @@ export function JobsExportAllButton({
})
);
if (!!completedCallback) completedCallback([]);
if (!!loadingCallback) loadingCallback(false);
if (completedCallback) completedCallback([]);
if (loadingCallback) loadingCallback(false);
setLoading(false);
};
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled || jobIds?.length > 10}>
<Button onClick={handleQbxml} loading={loading} disabled={disabled || jobIds?.length > 10} type="primary">
{t("jobs.actions.exportselected")}
</Button>
);

View File

@@ -1,6 +1,5 @@
import { EditFilled } from "@ant-design/icons";
import { Alert, Card, Col, Row, Space, Table, Typography } from "antd";
import _ from "lodash";
import React, { useEffect, useMemo, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -9,11 +8,11 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { alphaSort } from "../../utils/sorters";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import LaborAllocationsAdjustmentEdit from "../labor-allocations-adjustment-edit/labor-allocations-adjustment-edit.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
import "./labor-allocations-table.styles.scss";
import { CalculateAllocationsTotals } from "./labor-allocations-table.utility";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
technician: selectTechnician
@@ -65,6 +64,7 @@ export function LaborAllocationsTable({
key: "total",
sorter: (a, b) => a.total - b.total,
sortOrder: state.sortedInfo.columnKey === "total" && state.sortedInfo.order,
align: "right",
render: (text, record) => record.total.toFixed(1)
},
{
@@ -73,6 +73,7 @@ export function LaborAllocationsTable({
key: "hrs_claimed",
sorter: (a, b) => a.claimed - b.claimed,
sortOrder: state.sortedInfo.columnKey === "claimed" && state.sortedInfo.order,
align: "right",
render: (text, record) => record.claimed && record.claimed.toFixed(1)
},
{
@@ -81,6 +82,7 @@ export function LaborAllocationsTable({
key: "adjustments",
sorter: (a, b) => a.adjustments - b.adjustments,
sortOrder: state.sortedInfo.columnKey === "adjustments" && state.sortedInfo.order,
align: "right",
render: (text, record) => (
<Space wrap>
{record.adjustments.toFixed(1)}
@@ -100,17 +102,17 @@ export function LaborAllocationsTable({
{
title: t("jobs.labels.difference"),
dataIndex: "difference",
key: "difference",
sorter: (a, b) => a.difference - b.difference,
sortOrder: state.sortedInfo.columnKey === "difference" && state.sortedInfo.order,
align: "right",
render: (text, record) => (
<strong
style={{
color: record.difference >= 0 ? "green" : "red"
color: record.difference.toFixed(1) >= 0 ? "green" : "red"
}}
>
{_.round(record.difference, 1)}
{(Math.abs(record.difference) < 0.05 ? 0 : record.difference).toFixed(1)}
</strong>
)
}
@@ -129,7 +131,6 @@ export function LaborAllocationsTable({
ellipsis: true,
render: (text, record) => `${record.op_code_desc || ""}${record.alt_partm ? ` ${record.alt_partm}` : ""}`
},
{
title: t("joblines.fields.act_price"),
dataIndex: "act_price",
@@ -187,7 +188,7 @@ export function LaborAllocationsTable({
{ hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0 }
);
if (summary.difference !== 0 && typeof warningCallback === "function") {
if (Math.abs(summary.difference.toFixed(1)) !== 0 && typeof warningCallback === "function") {
warningCallback({ key: "labor", warning: t("jobs.labels.outstandinghours") });
}
@@ -217,19 +218,21 @@ export function LaborAllocationsTable({
summary={() => (
<Table.Summary.Row>
<Table.Summary.Cell>
<Typography.Title level={4}>{t("general.labels.totals")}</Typography.Title>
<Typography.Title level={4} style={{ margin: 0, lineHeight: 1 }}>
{t("general.labels.totals")}
</Typography.Title>
</Table.Summary.Cell>
<Table.Summary.Cell>{summary.hrs_total.toFixed(1)}</Table.Summary.Cell>
<Table.Summary.Cell>{summary.hrs_claimed.toFixed(1)}</Table.Summary.Cell>
<Table.Summary.Cell>{summary.adjustments.toFixed(1)}</Table.Summary.Cell>
<Table.Summary.Cell>
<Table.Summary.Cell align="right">{summary.hrs_total.toFixed(1)}</Table.Summary.Cell>
<Table.Summary.Cell align="right">{summary.hrs_claimed.toFixed(1)}</Table.Summary.Cell>
<Table.Summary.Cell align="right">{summary.adjustments.toFixed(1)}</Table.Summary.Cell>
<Table.Summary.Cell align="right">
<Typography.Text
style={{
fontWeight: "bold",
color: summary.difference >= 0 ? "green" : "red"
color: summary.difference.toFixed(1) >= 0 ? "green" : "red"
}}
>
{summary.difference.toFixed(1)}
{(Math.abs(summary.difference) < 0.05 ? 0 : summary.difference).toFixed(1)}
</Typography.Text>
</Table.Summary.Cell>
</Table.Summary.Row>
@@ -261,11 +264,10 @@ export function LaborAllocationsTable({
</Card>
</Col>
)}
{showWarning && summary.difference !== 0 && (
{showWarning && Math.abs(summary.difference.toFixed(1)) !== 0 && (
<Alert style={{ margin: "8px 0px" }} type="warning" message={t("jobs.labels.outstandinghours")} />
)}
</Row>
);
}
export default connect(mapStateToProps, null)(LaborAllocationsTable);

View File

@@ -38,7 +38,11 @@ export default function OwnerFindModalContainer({
}, [callSearchowners, modalProps.open, owner]);
return (
<Modal title={t("owners.labels.existing_owners")} width={"80%"} {...modalProps}>
<Modal
title={<span id="owner-find-modal-title">{t("owners.labels.existing_owners")}</span>}
width={"80%"}
{...modalProps}
>
{loading ? <LoadingSpinner /> : null}
{error ? <AlertComponent message={error.message} type="error" /> : null}
{owner ? (

View File

@@ -48,7 +48,7 @@ export function PayableExportAll({
let PartnerResponse;
setLoading(true);
if (!!loadingCallback) loadingCallback(true);
if (loadingCallback) loadingCallback(true);
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/payables`, {
bills: billids,
@@ -85,7 +85,7 @@ export function PayableExportAll({
notification["error"]({
message: t("bills.errors.exporting-partner")
});
if (!!loadingCallback) loadingCallback(false);
if (loadingCallback) loadingCallback(false);
setLoading(false);
return;
}
@@ -152,7 +152,7 @@ export function PayableExportAll({
}
}
});
if (!!!billUpdateResponse.errors) {
if (!billUpdateResponse.errors) {
notification.open({
type: "success",
key: "billsuccessexport",
@@ -187,8 +187,8 @@ export function PayableExportAll({
});
await Promise.all(proms);
if (!!completedCallback) completedCallback([]);
if (!!loadingCallback) loadingCallback(false);
if (completedCallback) completedCallback([]);
if (loadingCallback) loadingCallback(false);
setLoading(false);
};
@@ -200,7 +200,7 @@ export function PayableExportAll({
);
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled || billids?.length > 10}>
<Button onClick={handleQbxml} loading={loading} disabled={disabled || billids?.length > 10} type="primary">
{t("jobs.actions.exportselected")}
</Button>
);

View File

@@ -46,7 +46,7 @@ export function PayableExportButton({
logImEXEvent("accounting_export_payable");
setLoading(true);
if (!!loadingCallback) loadingCallback(true);
if (loadingCallback) loadingCallback(true);
//Check if it's a QBO Setup.
let PartnerResponse;
@@ -88,7 +88,7 @@ export function PayableExportButton({
notification["error"]({
message: t("bills.errors.exporting-partner")
});
if (!!loadingCallback) loadingCallback(false);
if (loadingCallback) loadingCallback(false);
setLoading(false);
return;
}
@@ -149,7 +149,7 @@ export function PayableExportButton({
}
}
});
if (!!!billUpdateResponse.errors) {
if (!billUpdateResponse.errors) {
notification.open({
type: "success",
key: "billsuccessexport",
@@ -186,7 +186,7 @@ export function PayableExportButton({
}
}
if (!!loadingCallback) loadingCallback(false);
if (loadingCallback) loadingCallback(false);
setLoading(false);
};
@@ -198,7 +198,7 @@ export function PayableExportButton({
);
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
<Button onClick={handleQbxml} loading={loading} disabled={disabled} type="primary">
{t("jobs.actions.export")}
</Button>
);

View File

@@ -55,7 +55,7 @@ export function PaymentExportButton({
} else {
//Default is QBD
if (!!loadingCallback) loadingCallback(true);
if (loadingCallback) loadingCallback(true);
let QbXmlResponse;
try {
@@ -88,7 +88,7 @@ export function PaymentExportButton({
notification["error"]({
message: t("payments.errors.exporting-partner")
});
if (!!loadingCallback) loadingCallback(false);
if (loadingCallback) loadingCallback(false);
setLoading(false);
return;
}
@@ -148,7 +148,7 @@ export function PaymentExportButton({
}
}
});
if (!!!paymentUpdateResponse.errors) {
if (!paymentUpdateResponse.errors) {
notification.open({
type: "success",
key: "paymentsuccessexport",
@@ -184,12 +184,12 @@ export function PaymentExportButton({
)
]);
}
if (!!loadingCallback) loadingCallback(false);
if (loadingCallback) loadingCallback(false);
setLoading(false);
};
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled}>
<Button onClick={handleQbxml} loading={loading} disabled={disabled} type="primary">
{t("jobs.actions.export")}
</Button>
);

View File

@@ -44,7 +44,7 @@ export function PaymentsExportAllButton({
const handleQbxml = async () => {
setLoading(true);
if (!!loadingCallback) loadingCallback(true);
if (loadingCallback) loadingCallback(true);
let PartnerResponse;
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo) {
PartnerResponse = await axios.post(`/qbo/payments`, {
@@ -76,7 +76,7 @@ export function PaymentsExportAllButton({
notification["error"]({
message: t("payments.errors.exporting-partner")
});
if (!!loadingCallback) loadingCallback(false);
if (loadingCallback) loadingCallback(false);
setLoading(false);
return;
}
@@ -140,7 +140,7 @@ export function PaymentsExportAllButton({
}
}
});
if (!!!paymentUpdateResponse.errors) {
if (!paymentUpdateResponse.errors) {
notification.open({
type: "success",
key: "paymentsuccessexport",
@@ -174,13 +174,13 @@ export function PaymentsExportAllButton({
);
});
await Promise.all(proms);
if (!!completedCallback) completedCallback([]);
if (!!loadingCallback) loadingCallback(false);
if (completedCallback) completedCallback([]);
if (loadingCallback) loadingCallback(false);
setLoading(false);
};
return (
<Button onClick={handleQbxml} loading={loading} disabled={disabled || paymentIds?.length > 10}>
<Button onClick={handleQbxml} loading={loading} disabled={disabled || paymentIds?.length > 10} type="primary">
{t("jobs.actions.exportselected")}
</Button>
);

View File

@@ -9,6 +9,7 @@ import { selectTechnician } from "../../redux/tech/tech.selectors";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { GenerateDocument } from "../../utils/RenderTemplate";
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
import { HasFeatureAccess } from './../feature-wrapper/feature-wrapper.component';
const mapStateToProps = createStructuredSelector({
printCenterModal: selectPrintCenter,
@@ -43,10 +44,12 @@ export function PrintCenterItemComponent({
setLoading(false);
};
if (disabled || item.featureNameRestricted)
if (disabled || (item.featureNameRestricted && !HasFeatureAccess({"featureName": item.featureNameRestricted, bodyshop})))
return (
<li className="print-center-item">
<LockWrapperComponent featureName={item.featureNameRestricted}>{item.title}</LockWrapperComponent>
<LockWrapperComponent featureName={item.featureNameRestricted} bodyshop={bodyshop}>
{item.title}
</LockWrapperComponent>
</li>
);
return (

View File

@@ -8,6 +8,7 @@ import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import BlurWrapperComponent from "../feature-wrapper/blur-wrapper.component";
import { UpsellMaskWrapper, upsellEnum } from "../upsell/upsell.component";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop
@@ -35,6 +36,28 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
[]
);
}, [loadData, ssbuckets]);
const hasSmartSchedulingAccess = HasFeatureAccess({ featureName: "smartscheduling", bodyshop });
const chartContents = (
<>
<RadarChart
// cx={300}
// cy={250}
// outerRadius={150}
width={800}
height={600}
data={data}
>
<PolarGrid />
<PolarAngleAxis dataKey="bucket" />
<PolarRadiusAxis angle={90} />
<Radar name="Ideal Load" dataKey="target" stroke="darkgreen" fill="white" fillOpacity={0} />
<Radar name="EOD Load" dataKey="current" stroke="dodgerblue" fill="dodgerblue" fillOpacity={0.6} />
<Tooltip />
<Legend />
</RadarChart>
</>
);
const popContent = (
<div>
@@ -48,26 +71,13 @@ export function ScheduleCalendarHeaderGraph({ bodyshop, loadData }) {
<strong>{loadData?.expectedJobCount}</strong>
</BlurWrapperComponent>
</Space>
<UpsellMaskWrapper upsell={upsellEnum().smartscheduling.general}>
<BlurWrapperComponent featureName="smartscheduling">
<RadarChart
// cx={300}
// cy={250}
// outerRadius={150}
width={800}
height={600}
data={data}
>
<PolarGrid />
<PolarAngleAxis dataKey="bucket" />
<PolarRadiusAxis angle={90} />
<Radar name="Ideal Load" dataKey="target" stroke="darkgreen" fill="white" fillOpacity={0} />
<Radar name="EOD Load" dataKey="current" stroke="dodgerblue" fill="dodgerblue" fillOpacity={0.6} />
<Tooltip />
<Legend />
</RadarChart>
</BlurWrapperComponent>
</UpsellMaskWrapper>
<BlurWrapperComponent featureName="smartscheduling">
{hasSmartSchedulingAccess ? (
chartContents
) : (
<UpsellMaskWrapper upsell={upsellEnum().smartscheduling.general}>{chartContents}</UpsellMaskWrapper>
)}
</BlurWrapperComponent>
</div>
);

View File

@@ -13,11 +13,12 @@ import { selectScheduleLoad, selectScheduleLoadCalculating } from "../../redux/a
import { selectBodyshop } from "../../redux/user/user.selectors";
import { DateTimeFormatter } from "../../utils/DateFormatter";
import { default as BlurWrapper, default as BlurWrapperComponent } from "../feature-wrapper/blur-wrapper.component";
import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component";
import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component";
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
import ScheduleBlockDay from "../schedule-block-day/schedule-block-day.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
import ScheduleCalendarHeaderGraph from "./schedule-calendar-header-graph.component";
import UpsellComponent, { upsellEnum, UpsellMaskWrapper } from "../upsell/upsell.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -52,6 +53,7 @@ export function ScheduleCalendarHeaderComponent({
const { t } = useTranslation();
const loadData = load[date.toISOString().substr(0, 10)];
const hasSmartSchedulingAccess = HasFeatureAccess({ featureName: "smartscheduling", bodyshop });
const jobsOutPopup = () => (
<div onClick={(e) => e.stopPropagation()}>
@@ -89,9 +91,11 @@ export function ScheduleCalendarHeaderComponent({
)}
</tbody>
</table>
<Card style={{ maxWidth: "30rem" }}>
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
</Card>
{!hasSmartSchedulingAccess && (
<Card style={{ maxWidth: "30rem" }}>
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
</Card>
)}
</div>
);
@@ -129,9 +133,11 @@ export function ScheduleCalendarHeaderComponent({
</BlurWrapperComponent>
</tr>
)}
<Card style={{ maxWidth: "30rem" }}>
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
</Card>
{!hasSmartSchedulingAccess && (
<Card style={{ maxWidth: "30rem" }}>
<UpsellComponent size="small" upsell={upsellEnum().smartscheduling.hrsdelta} />
</Card>
)}
</tbody>
</table>
</div>

View File

@@ -16,7 +16,7 @@ import ScheduleDayViewContainer from "../schedule-day-view/schedule-day-view.con
import ScheduleExistingAppointmentsList from "../schedule-existing-appointments-list/schedule-existing-appointments-list.component";
import "./schedule-job-modal.scss";
import LockWrapperComponent from "../lock-wrapper/lock-wrapper.component";
import { BlurWrapper } from "../feature-wrapper/blur-wrapper.component";
import BlurWrapper from "../feature-wrapper/blur-wrapper.component";
import UpsellComponent, { upsellEnum } from "../upsell/upsell.component";
const mapStateToProps = createStructuredSelector({
@@ -138,7 +138,7 @@ export function ScheduleJobModalComponent({
</BlurWrapper>
</Button>
))}
{smartOptions.length > 1 && hasSmartSchedulingAccess && (
{!smartOptions.length > 1 && hasSmartSchedulingAccess && (
<UpsellComponent upsell={upsellEnum().smartscheduling.general} />
)}
</Space>

View File

@@ -555,7 +555,7 @@ export function ShopInfoGeneral({ form, bodyshop }) {
</Form.Item>
<Form.Item
name={["md_email_cc", "parts_order"]}
label={t("bodyshop.fields.md_email_cc", { template: "parts_order" })}
label={t("bodyshop.fields.md_email_cc", { template: "parts_orders" })}
rules={[
{
//message: t("general.validation.required"),
@@ -567,9 +567,7 @@ export function ShopInfoGeneral({ form, bodyshop }) {
</Form.Item>
<Form.Item
name={["md_email_cc", "parts_return_slip"]}
label={t("bodyshop.fields.md_email_cc", {
template: "parts_return_slip"
})}
label={t("bodyshop.fields.md_email_cc", { template: "parts_returns" })}
rules={[
{
//message: t("general.validation.required"),
@@ -1261,7 +1259,7 @@ export function ShopInfoGeneral({ form, bodyshop }) {
key={`${index}prt_dsmk_p`}
name={[field.name, "prt_dsmk_p"]}
>
<InputNumber precision={0} min={0} max={100} />
<InputNumber precision={0} min={-100} max={100} />
</Form.Item>
<Form.Item
label={t("joblines.fields.ah_detail_line")}

View File

@@ -13,13 +13,15 @@ import { Button, Card, Result } from "antd";
import i18n from "i18next";
import React, { useEffect, useRef } from "react";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { store } from "../../redux/store.js";
import InstanceRenderManager from "../../utils/instanceRenderMgr.js";
import "./upsell.styles.scss";
export default function UpsellComponent({ featureName, subFeatureName, upsell, disableMask }) {
const { t } = useTranslation();
const resultProps = upsell || upsellEnum[featureName][subFeatureName];
console.trace("***LOG ~ file: upsell.component.jsx:22 ~ UpsellComponent ~ resultProps:", resultProps);
const componentRef = useRef(null);
useEffect(() => {
@@ -65,174 +67,275 @@ export function UpsellMaskWrapper({ children, upsell, featureName, subFeatureNam
</div>
);
}
//This is kept in this function as pulling it out into it's own util/enum prevents passing JSX as an `extra` prop
export const upsellEnum = () => ({
bills: {
autoreconcile: {
//icon: null,
title: i18n.t("upsell.messages.bills.autoreconcile.title"),
subTitle: i18n.t("upsell.messages.bills.autoreconcile.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null
export const upsellEnum = () => {
const { currentUser, bodyshop } = store.getState().user;
const [first_name, ...last_name] = currentUser?.displayName ? currentUser.displayName.split(" ") : [];
const LearnMoreLink = encodeURI(
InstanceRenderManager({
imex: `https://imexsystems.ca/schedule-a-demo/`,
rome: `https://forms.zohopublic.com/rometech/form/ROLearnMore/formperma/0G29z8LgLlvKK8nno-b7s-GHgNXwIFlrMeE0mC394L4?first_name=${first_name || ""}&last_name=${last_name.join(" ") || ""}&shop_name=${bodyshop?.shopname || ""}&email=${currentUser?.email || ""}&shop_phone=${bodyshop?.phone || ""}`
})
);
return {
bills: {
autoreconcile: {
//icon: null,
title: i18n.t("upsell.messages.bills.autoreconcile.title"),
subTitle: i18n.t("upsell.messages.bills.autoreconcile.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null
},
general: {
//icon: null,
title: i18n.t("upsell.messages.bills.general.title"),
subTitle: i18n.t("upsell.messages.bills.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null
}
},
general: {
//icon: null,
title: i18n.t("upsell.messages.bills.general.title"),
subTitle: i18n.t("upsell.messages.bills.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null
}
},
checklist: {
general: {
//icon: null,
title: i18n.t("upsell.messages.checklist.general.title"),
subTitle: i18n.t("upsell.messages.checklist.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null
}
},
payments: {
general: {
//icon: null,
title: i18n.t("upsell.messages.payments.general.title"),
subTitle: i18n.t("upsell.messages.payments.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null
}
},
audit: {
general: {
//icon: null,
title: i18n.t("upsell.messages.audit.general.title"),
subTitle: i18n.t("upsell.messages.audit.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null
}
},
lifecycle: {
general: {
//icon: null,
title: i18n.t("upsell.messages.lifecycle.general.title"),
subTitle: i18n.t("upsell.messages.lifecycle.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null }
}
},
media: {
general: {
//icon: null,
title: i18n.t("upsell.messages.media.general.title"),
subTitle: i18n.t("upsell.messages.media.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null }
},
mobile: {
icon: <MobileOutlined />,
title: i18n.t("upsell.messages.media.mobile.title"),
subTitle: i18n.t("upsell.messages.media.mobile.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
//status: null }
}
},
timetickets: {
allocations: {
title: i18n.t("upsell.messages.timetickets.allocations.title"),
subTitle: i18n.t("upsell.messages.timetickets.allocations.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
},
general: {
title: i18n.t("upsell.messages.timetickets.general.title"),
subTitle: i18n.t("upsell.messages.timetickets.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
smartscheduling: {
general: {
icon: <CalendarOutlined />,
title: i18n.t("upsell.messages.smartscheduling.general.title"),
subTitle: i18n.t("upsell.messages.smartscheduling.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
},
hrsdelta: {
icon: <CarOutlined />,
title: i18n.t("upsell.messages.smartscheduling.hrsdelta.title"),
subTitle: i18n.t("upsell.messages.smartscheduling.hrsdelta.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
},
datepicker: {
icon: <CarOutlined />,
title: i18n.t("upsell.messages.smartscheduling.datepicker.title"),
subTitle: i18n.t("upsell.messages.smartscheduling.datepicker.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
accounting: {
payables: {
icon: <DollarOutlined />,
title: i18n.t("upsell.messages.accounting.payables.title"),
subTitle: i18n.t("upsell.messages.accounting.payables.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
},
receivables: {
icon: <DollarOutlined />,
title: i18n.t("upsell.messages.accounting.receivables.title"),
subTitle: i18n.t("upsell.messages.accounting.receivables.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
checklist: {
general: {
//icon: null,
title: i18n.t("upsell.messages.checklist.general.title"),
subTitle: i18n.t("upsell.messages.checklist.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null
}
},
payments: {
icon: <DollarOutlined />,
title: i18n.t("upsell.messages.accounting.payments.title"),
subTitle: i18n.t("upsell.messages.accounting.payments.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
general: {
//icon: null,
title: i18n.t("upsell.messages.payments.general.title"),
subTitle: i18n.t("upsell.messages.payments.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null
}
},
audit: {
general: {
//icon: null,
title: i18n.t("upsell.messages.audit.general.title"),
subTitle: i18n.t("upsell.messages.audit.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null
}
},
lifecycle: {
general: {
//icon: null,
title: i18n.t("upsell.messages.lifecycle.general.title"),
subTitle: i18n.t("upsell.messages.lifecycle.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null }
}
},
media: {
general: {
//icon: null,
title: i18n.t("upsell.messages.media.general.title"),
subTitle: i18n.t("upsell.messages.media.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null }
},
mobile: {
icon: <MobileOutlined />,
title: i18n.t("upsell.messages.media.mobile.title"),
subTitle: i18n.t("upsell.messages.media.mobile.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
//status: null }
}
},
timetickets: {
allocations: {
title: i18n.t("upsell.messages.timetickets.allocations.title"),
subTitle: i18n.t("upsell.messages.timetickets.allocations.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
},
general: {
title: i18n.t("upsell.messages.timetickets.general.title"),
subTitle: i18n.t("upsell.messages.timetickets.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
smartscheduling: {
general: {
icon: <CalendarOutlined />,
title: i18n.t("upsell.messages.smartscheduling.general.title"),
subTitle: i18n.t("upsell.messages.smartscheduling.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
},
hrsdelta: {
icon: <CarOutlined />,
title: i18n.t("upsell.messages.smartscheduling.hrsdelta.title"),
subTitle: i18n.t("upsell.messages.smartscheduling.hrsdelta.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
},
datepicker: {
icon: <CarOutlined />,
title: i18n.t("upsell.messages.smartscheduling.datepicker.title"),
subTitle: i18n.t("upsell.messages.smartscheduling.datepicker.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
accounting: {
payables: {
icon: <DollarOutlined />,
title: i18n.t("upsell.messages.accounting.payables.title"),
subTitle: i18n.t("upsell.messages.accounting.payables.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
},
receivables: {
icon: <DollarOutlined />,
title: i18n.t("upsell.messages.accounting.receivables.title"),
subTitle: i18n.t("upsell.messages.accounting.receivables.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
},
payments: {
icon: <DollarOutlined />,
title: i18n.t("upsell.messages.accounting.payments.title"),
subTitle: i18n.t("upsell.messages.accounting.payments.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
courtesycars: {
general: {
icon: <CarOutlined />,
title: i18n.t("upsell.messages.courtesycars.general.title"),
subTitle: i18n.t("upsell.messages.courtesycars.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
dashboard: {
general: {
icon: <DashboardOutlined />,
title: i18n.t("upsell.messages.dashboard.general.title"),
subTitle: i18n.t("upsell.messages.dashboard.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
visualboard: {
general: {
icon: <BuildOutlined />,
title: i18n.t("upsell.messages.visualboard.general.title"),
subTitle: i18n.t("upsell.messages.visualboard.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
scoreboard: {
general: {
icon: <LineChartOutlined />,
title: i18n.t("upsell.messages.scoreboard.general.title"),
subTitle: i18n.t("upsell.messages.scoreboard.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
techconsole: {
general: {
icon: <LineChartOutlined />,
title: i18n.t("upsell.messages.techconsole.general.title"),
subTitle: i18n.t("upsell.messages.techconsole.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
},
csi: {
general: {
icon: <StarOutlined />,
title: i18n.t("upsell.messages.csi.general.title"),
subTitle: i18n.t("upsell.messages.csi.general.subtitle"),
extra: (
<Link to={LearnMoreLink} target="_blank">
<Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
</Link>
)
}
}
},
courtesycars: {
general: {
icon: <CarOutlined />,
title: i18n.t("upsell.messages.courtesycars.general.title"),
subTitle: i18n.t("upsell.messages.courtesycars.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
dashboard: {
general: {
icon: <DashboardOutlined />,
title: i18n.t("upsell.messages.dashboard.general.title"),
subTitle: i18n.t("upsell.messages.dashboard.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
visualboard: {
general: {
icon: <BuildOutlined />,
title: i18n.t("upsell.messages.visualboard.general.title"),
subTitle: i18n.t("upsell.messages.visualboard.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
scoreboard: {
general: {
icon: <LineChartOutlined />,
title: i18n.t("upsell.messages.scoreboard.general.title"),
subTitle: i18n.t("upsell.messages.scoreboard.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
techconsole: {
general: {
icon: <LineChartOutlined />,
title: i18n.t("upsell.messages.techconsole.general.title"),
subTitle: i18n.t("upsell.messages.techconsole.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
},
csi: {
general: {
icon: <StarOutlined />,
title: i18n.t("upsell.messages.csi.general.title"),
subTitle: i18n.t("upsell.messages.csi.general.subtitle"),
extra: <Button type="primary">{i18n.t("upsell.cta.learnmore")}</Button>
}
}
});
};
};

View File

@@ -73,6 +73,7 @@ export const QUERY_PAYMENTS_FOR_EXPORT = gql`
transactionid
paymentnum
date
type
exportlogs {
id
successful

View File

@@ -49,6 +49,7 @@ export const QUERY_ALL_ACTIVE_APPOINTMENTS = gql`
est_ct_fn
est_ct_ln
comment
loss_of_use
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }) {
aggregate {
sum {

View File

@@ -238,6 +238,7 @@ export const UPDATE_JOB_LINE = gql`
convertedtolbr
convertedtolbr_data
assigned_team
include_in_part_cnt
}
}
}

View File

@@ -581,6 +581,7 @@ export const GET_JOB_BY_PK = gql`
status
tax_part
unq_seq
include_in_part_cnt
}
kmin
kmout

View File

@@ -20,7 +20,6 @@ import { FaHardHat, FaRegStickyNote, FaShieldAlt, FaTasks } from "react-icons/fa
import { connect } from "react-redux";
import { useLocation, useNavigate } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import { HasFeatureAccess } from "../../components/feature-wrapper/feature-wrapper.component";
import FormFieldsChanged from "../../components/form-fields-changed-alert/form-fields-changed-alert.component";
import JobAuditTrail from "../../components/job-audit-trail/job-audit-trail.component";
import JobsLinesContainer from "../../components/job-detail-lines/job-lines.container";
@@ -42,6 +41,7 @@ import JobsDetailTotals from "../../components/jobs-detail-totals/jobs-detail-to
import JobsDocumentsGalleryContainer from "../../components/jobs-documents-gallery/jobs-documents-gallery.container";
import JobsDocumentsLocalGallery from "../../components/jobs-documents-local-gallery/jobs-documents-local-gallery.container";
import JobNotesContainer from "../../components/jobs-notes/jobs-notes.container";
import LockWrapperComponent from "../../components/lock-wrapper/lock-wrapper.component.jsx";
import NoteUpsertModalComponent from "../../components/note-upsert-modal/note-upsert-modal.container";
import ScheduleJobModalContainer from "../../components/schedule-job-modal/schedule-job-modal.container";
import TaskListContainer from "../../components/task-list/task-list.container.jsx";
@@ -54,9 +54,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import { DateTimeFormat } from "../../utils/DateFormatter";
import dayjs from "../../utils/day";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
import UndefinedToNull from "../../utils/undefinedtonull";
import LockWrapperComponent from "../../components/lock-wrapper/lock-wrapper.component.jsx";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -403,7 +401,9 @@ export function JobsDetailPage({
icon: <BarsOutlined />,
id: "job-details-lifecycle",
label: (
<LockWrapperComponent featureName="lifecycle" bypass>{t("menus.jobsdetail.lifecycle")}</LockWrapperComponent>
<LockWrapperComponent featureName="lifecycle" bypass>
{t("menus.jobsdetail.lifecycle")}
</LockWrapperComponent>
),
children: <JobLifecycleComponent job={job} statuses={bodyshop.md_ro_statuses} />
},
@@ -438,7 +438,11 @@ export function JobsDetailPage({
key: "audit",
icon: <HistoryOutlined />,
id: "job-details-audit",
label: <LockWrapperComponent featureName="audit" bypass>{t("jobs.labels.audit")}</LockWrapperComponent>,
label: (
<LockWrapperComponent featureName="audit" bypass>
{t("jobs.labels.audit")}
</LockWrapperComponent>
),
children: <JobAuditTrail jobId={job.id} />
},
{

View File

@@ -31,7 +31,7 @@ import { addAlerts } from "../../redux/application/application.actions.js";
const JobsPage = lazy(() => import("../jobs/jobs.page"));
const CardPaymentModalContainer = lazy(
() => import("../../components/card-payment-modal/card-payment-modal.container.")
() => import("../../components/card-payment-modal/card-payment-modal.container.jsx")
);
const JobsDetailPage = lazy(() => import("../jobs-detail/jobs-detail.page.container"));

View File

@@ -26,6 +26,7 @@ import {
updateCurrentUser
} from "../../firebase/firebase.utils";
import { QUERY_EULA } from "../../graphql/bodyshop.queries";
import cleanAxios from "../../utils/CleanAxios";
import client from "../../utils/GraphQLClient";
import dayjs from "../../utils/day";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
@@ -47,7 +48,6 @@ import {
validatePasswordResetSuccess
} from "./user.actions";
import UserActionTypes from "./user.types";
import cleanAxios from "../../utils/CleanAxios";
const fpPromise = FingerprintJS.load();
@@ -234,16 +234,18 @@ export function* signInSuccessSaga({ payload }) {
LogRocket.identify(payload.email);
try {
window.$crisp.push(["set", "user:nickname", [payload.displayName || payload.email]]);
window.$crisp.push(["set", "session:segments", [["user"]]]);
InstanceRenderManager({
executeFunction: true,
args: [],
imex: () => {
window.$crisp.push(["set", "user:nickname", [payload.displayName || payload.email]]);
window.$crisp.push(["set", "session:segments", [["user"]]]);
window.$crisp.push(["set", "session:segments", [["imex"]]]);
},
rome: () => {
window.$zoho.salesiq.visitor.name(payload.displayName || payload.email);
window.$zoho.salesiq.visitor.email(payload.email);
window.$crisp.push(["set", "session:segments", [["rome"]]]);
}
});
} catch (error) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1444,7 +1444,8 @@ export const TemplateList = (type, context) => {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_exported")
},
group: "sales"
group: "sales",
featureNameRestricted: "export"
},
gsr_by_estimator: {
title: i18n.t("reportcenter.templates.gsr_by_estimator"),
@@ -1865,7 +1866,8 @@ export const TemplateList = (type, context) => {
object: i18n.t("reportcenter.labels.objects.jobs"),
field: i18n.t("jobs.fields.date_open")
},
group: "jobs"
group: "jobs",
featureNameRestricted: "bills"
},
psr_by_make: {
title: i18n.t("reportcenter.templates.psr_by_make"),
@@ -1901,7 +1903,8 @@ export const TemplateList = (type, context) => {
object: i18n.t("reportcenter.labels.objects.parts_orders"),
field: i18n.t("parts_orders.fields.order_date")
},
group: "jobs"
group: "jobs",
featureNameRestricted: "bills"
},
returns_grouped_by_vendor_detailed: {
title: i18n.t("reportcenter.templates.returns_grouped_by_vendor_detailed"),
@@ -1913,7 +1916,8 @@ export const TemplateList = (type, context) => {
object: i18n.t("reportcenter.labels.objects.parts_orders"),
field: i18n.t("parts_orders.fields.order_date")
},
group: "jobs"
group: "jobs",
featureNameRestricted: "bills"
},
scheduled_parts_list: {
title: i18n.t("reportcenter.templates.scheduled_parts_list"),
@@ -2225,7 +2229,19 @@ export const TemplateList = (type, context) => {
field: i18n.t("jobs.fields.date_open")
},
group: "jobs"
}
},
purchases_by_date_excel: {
title: i18n.t("reportcenter.templates.purchases_by_date_excel"),
subject: i18n.t("reportcenter.templates.purchases_by_date_excel"),
key: "purchases_by_date_excel",
reporttype: "excel",
disabled: false,
rangeFilter: {
object: i18n.t("reportcenter.labels.objects.bills"),
field: i18n.t("bills.fields.date")
},
group: "purchases"
},
}
: {}),
...(!type || type === "courtesycarcontract"

View File

@@ -207,6 +207,7 @@
- default_prod_list_view
- id
- kanban_settings
- notification_settings
- qbo_realmId
- shopid
- useremail
@@ -222,6 +223,7 @@
- authlevel
- default_prod_list_view
- kanban_settings
- notification_settings
- qbo_realmId
filter:
user:
@@ -681,6 +683,31 @@
- exported:
_eq: false
event_triggers:
- name: notifications_bills
definition:
enable_manual: false
insert:
columns: '*'
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_API_URL
headers:
- name: event-secret
value_from_env: EVENT_SECRET
request_transform:
body:
action: transform
template: |-
{
"success": true
}
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/notifications/events/handleBillsChange'
version: 2
- name: os_bills
definition:
delete:
@@ -2805,6 +2832,80 @@
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
name: job_watchers
schema: public
object_relationships:
- name: job
using:
foreign_key_constraint_on: jobid
- name: user
using:
foreign_key_constraint_on: user_email
insert_permissions:
- role: user
permission:
check:
user:
_and:
- associations:
active:
_eq: true
- authid:
_eq: X-Hasura-User-Id
columns:
- user_email
- created_at
- id
- jobid
comment: ""
select_permissions:
- role: user
permission:
columns:
- user_email
- created_at
- id
- jobid
filter:
user:
_and:
- associations:
active:
_eq: true
- authid:
_eq: X-Hasura-User-Id
comment: ""
update_permissions:
- role: user
permission:
columns:
- user_email
- created_at
- id
- jobid
filter:
user:
_and:
- associations:
active:
_eq: true
- authid:
_eq: X-Hasura-User-Id
check: null
comment: ""
delete_permissions:
- role: user
permission:
filter:
user:
_and:
- associations:
active:
_eq: true
- authid:
_eq: X-Hasura-User-Id
comment: ""
- table:
name: joblines
schema: public
@@ -2896,6 +2997,7 @@
- est_seq
- glass_flag
- id
- include_in_part_cnt
- ioucreated
- jobid
- lbr_amt
@@ -2965,6 +3067,7 @@
- est_seq
- glass_flag
- id
- include_in_part_cnt
- ioucreated
- jobid
- lbr_amt
@@ -3045,6 +3148,7 @@
- est_seq
- glass_flag
- id
- include_in_part_cnt
- ioucreated
- jobid
- lbr_amt
@@ -4326,6 +4430,58 @@
template_engine: Kriti
url: '{{$base_url}}/record-handler/arms'
version: 2
- name: notifications_jobs
definition:
enable_manual: false
insert:
columns: '*'
update:
columns:
- queued_for_parts
- employee_prep
- clm_total
- towin
- employee_body
- converted
- scheduled_in
- scheduled_completion
- scheduled_delivery
- actual_delivery
- actual_completion
- alt_transport
- date_exported
- status
- employee_csr
- actual_in
- deliverchecklist
- comment
- job_totals
- employee_refinish
- inproduction
- production_vars
- intakechecklist
- cieca_ttl
- date_invoiced
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_API_URL
headers:
- name: event-secret
value_from_env: EVENT_SECRET
request_transform:
body:
action: transform
template: |-
{
"success": true
}
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/notifications/events/handleJobsChange'
version: 2
- name: os_jobs
definition:
delete:
@@ -4669,6 +4825,57 @@
_eq: X-Hasura-User-Id
- active:
_eq: true
- table:
name: notifications
schema: public
object_relationships:
- name: association
using:
foreign_key_constraint_on: associationid
- name: job
using:
foreign_key_constraint_on: jobid
select_permissions:
- role: user
permission:
columns:
- associationid
- created_at
- fcm_data
- fcm_message
- fcm_title
- id
- jobid
- meta
- read
- ui_translation_meta
- ui_translation_string
- updated_at
filter:
association:
_and:
- active:
_eq: true
- user:
authid:
_eq: X-Hasura-User-Id
comment: ""
update_permissions:
- role: user
permission:
columns:
- meta
- read
filter:
association:
_and:
- active:
_eq: true
- user:
authid:
_eq: X-Hasura-User-Id
check: null
comment: ""
- table:
name: owners
schema: public
@@ -4909,6 +5116,32 @@
- active:
_eq: true
check: null
event_triggers:
- name: notifications_parts_dispatch
definition:
enable_manual: false
insert:
columns: '*'
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_API_URL
headers:
- name: event-secret
value_from_env: EVENT_SECRET
request_transform:
body:
action: transform
template: |-
{
"success": true
}
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/notifications/events/handlePartsDispatchChange'
version: 2
- table:
name: parts_dispatch_lines
schema: public
@@ -5879,6 +6112,36 @@
_eq: true
check: null
event_triggers:
- name: notifications_tasks
definition:
enable_manual: false
insert:
columns: '*'
update:
columns:
- assigned_to
- completed
- description
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_API_URL
headers:
- name: event-secret
value_from_env: EVENT_SECRET
request_transform:
body:
action: transform
template: |-
{
"success": true
}
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/notifications/events/handleTasksChange'
version: 2
- name: tasks_assigned_changed
definition:
enable_manual: false
@@ -6035,6 +6298,32 @@
_eq: X-Hasura-User-Id
- active:
_eq: true
event_triggers:
- name: notifications_time_tickets
definition:
enable_manual: false
insert:
columns: '*'
retry_conf:
interval_sec: 10
num_retries: 0
timeout_sec: 60
webhook_from_env: HASURA_API_URL
headers:
- name: event-secret
value_from_env: EVENT_SECRET
request_transform:
body:
action: transform
template: |-
{
"success": true
}
method: POST
query_params: {}
template_engine: Kriti
url: '{{$base_url}}/notifications/events/handleTimeTicketsChange'
version: 2
- table:
name: transitions
schema: public

View File

@@ -39,50 +39,50 @@ END;
$$;
CREATE FUNCTION public.assign_ro_number() RETURNS trigger
LANGUAGE plpgsql
AS $$
begin
IF NEW.converted = true and (new.ro_number is null or new.ro_number = '') THEN
UPDATE counters
SET count = count + 1 where shopid=new.shopid AND countertype = 'ronum'
RETURNING concat(prefix,count) into new.ro_number;
END IF;
RETURN NEW;
END;
AS $$
begin
IF NEW.converted = true and (new.ro_number is null or new.ro_number = '') THEN
UPDATE counters
SET count = count + 1 where shopid=new.shopid AND countertype = 'ronum'
RETURNING concat(prefix,count) into new.ro_number;
END IF;
RETURN NEW;
END;
$$;
CREATE FUNCTION public.audit_trigger() RETURNS trigger
LANGUAGE plpgsql SECURITY DEFINER
AS $$
DECLARE
shopid uuid ;
email text;
BEGIN
select b.id, u.email INTO shopid, email from users u join associations a on u.email = a.useremail join bodyshops b on b.id = a.shopid where u.authid = current_setting('hasura.user', 't')::jsonb->>'x-hasura-user-id' and a.active = true;
IF TG_OP = 'INSERT'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(NEW), NEW.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'UPDATE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP,
json_diff(to_jsonb(OLD), to_jsonb(NEW)) , json_diff(to_jsonb(NEW), to_jsonb(OLD)), OLD.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'DELETE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(OLD), OLD.ID, shopid, email);
RETURN OLD;
END IF;
END;
AS $$
DECLARE
shopid uuid ;
email text;
BEGIN
select b.id, u.email INTO shopid, email from users u join associations a on u.email = a.useremail join bodyshops b on b.id = a.shopid where u.authid = current_setting('hasura.user', 't')::jsonb->>'x-hasura-user-id' and a.active = true;
IF TG_OP = 'INSERT'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(NEW), NEW.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'UPDATE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP,
json_diff(to_jsonb(OLD), to_jsonb(NEW)) , json_diff(to_jsonb(NEW), to_jsonb(OLD)), OLD.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'DELETE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(OLD), OLD.ID, shopid, email);
RETURN OLD;
END IF;
END;
$$;
CREATE FUNCTION public.json_diff(l jsonb, r jsonb) RETURNS jsonb
LANGUAGE sql
AS $$
SELECT jsonb_object_agg(a.key, a.value) FROM
( SELECT key, value FROM jsonb_each(l) ) a LEFT OUTER JOIN
( SELECT key, value FROM jsonb_each(r) ) b ON a.key = b.key
WHERE a.value != b.value OR b.key IS NULL;
AS $$
SELECT jsonb_object_agg(a.key, a.value) FROM
( SELECT key, value FROM jsonb_each(l) ) a LEFT OUTER JOIN
( SELECT key, value FROM jsonb_each(r) ) b ON a.key = b.key
WHERE a.value != b.value OR b.key IS NULL;
$$;
CREATE TABLE public.bills (
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
@@ -211,33 +211,33 @@ CREATE TABLE public.exportlog (
);
CREATE FUNCTION public.search_exportlog(search text) RETURNS SETOF public.exportlog
LANGUAGE plpgsql STABLE
AS $$ BEGIN IF search = '' THEN RETURN query
SELECT
*
FROM
exportlog e;
ELSE RETURN query
SELECT
e.*
FROM
exportlog e
LEFT JOIN jobs j on j.id = e.jobid
LEFT JOIN payments p
ON p.id = e.paymentid
LEFT JOIN bills b
ON e.billid = b.id
WHERE
(
j.ro_number ILIKE '%' || search || '%'
OR b.invoice_number ILIKE '%' || search || '%'
OR p.paymentnum ILIKE '%' || search || '%'
OR e.useremail ILIKE '%' || search || '%'
)
AND (e.jobid = j.id
or e.paymentid = p.id
or e.billid = b.id)
;
END IF;
AS $$ BEGIN IF search = '' THEN RETURN query
SELECT
*
FROM
exportlog e;
ELSE RETURN query
SELECT
e.*
FROM
exportlog e
LEFT JOIN jobs j on j.id = e.jobid
LEFT JOIN payments p
ON p.id = e.paymentid
LEFT JOIN bills b
ON e.billid = b.id
WHERE
(
j.ro_number ILIKE '%' || search || '%'
OR b.invoice_number ILIKE '%' || search || '%'
OR p.paymentnum ILIKE '%' || search || '%'
OR e.useremail ILIKE '%' || search || '%'
)
AND (e.jobid = j.id
or e.paymentid = p.id
or e.billid = b.id)
;
END IF;
END $$;
CREATE TABLE public.jobs (
id uuid DEFAULT public.gen_random_uuid() NOT NULL,

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."associations" add column "notification_settings" jsonb
-- null;

View File

@@ -0,0 +1,2 @@
alter table "public"."associations" add column "notification_settings" jsonb
null;

View File

@@ -0,0 +1 @@
DROP TABLE "public"."notifications";

View File

@@ -0,0 +1,2 @@
CREATE TABLE "public"."notifications" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "job_id" uuid NOT NULL, "association_id" uuid NOT NULL, "ui_translation_string" text NOT NULL, "ui_translation_meta" jsonb, "fcm_title" text NOT NULL, "fcm_message" text NOT NULL, "fcm_data" jsonb, "read" timestamptz, "meta" jsonb, "scenario" Integer NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("job_id") REFERENCES "public"."jobs"("id") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("association_id") REFERENCES "public"."associations"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"));COMMENT ON TABLE "public"."notifications" IS E'Real Time Notifications System';
CREATE EXTENSION IF NOT EXISTS pgcrypto;

View File

@@ -0,0 +1,3 @@
comment on column "public"."notifications"."scenario" is E'Real Time Notifications System';
alter table "public"."notifications" alter column "scenario" drop not null;
alter table "public"."notifications" add column "scenario" int4;

View File

@@ -0,0 +1 @@
alter table "public"."notifications" drop column "scenario" cascade;

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."notifications" add column "scenario" text
-- not null;

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" add column "scenario" text
not null;

View File

@@ -0,0 +1 @@
DROP TABLE "public"."job_watchers";

View File

@@ -0,0 +1,2 @@
CREATE TABLE "public"."job_watchers" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "job_id" uuid NOT NULL, "user_email" text NOT NULL, "created_at" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY ("id") , FOREIGN KEY ("user_email") REFERENCES "public"."users"("email") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("job_id") REFERENCES "public"."jobs"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"));COMMENT ON TABLE "public"."job_watchers" IS E'Job Watchers';
CREATE EXTENSION IF NOT EXISTS pgcrypto;

View File

@@ -0,0 +1,3 @@
comment on column "public"."notifications"."scenario" is E'Real Time Notifications System';
alter table "public"."notifications" alter column "scenario" drop not null;
alter table "public"."notifications" add column "scenario" text;

View File

@@ -0,0 +1 @@
alter table "public"."notifications" drop column "scenario" cascade;

View File

@@ -0,0 +1,3 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- update associations set notification_settings = '{}';

View File

@@ -0,0 +1 @@
update associations set notification_settings = '{}';

View File

@@ -0,0 +1 @@
alter table "public"."associations" alter column "notification_settings" drop not null;

View File

@@ -0,0 +1 @@
alter table "public"."associations" alter column "notification_settings" set not null;

View File

@@ -0,0 +1,5 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- update notifications set meta = '{}';
-- update notifications set fcm_data = '{}';
-- update notifications set ui_translation_meta = '{}';

View File

@@ -0,0 +1,3 @@
update notifications set meta = '{}';
update notifications set fcm_data = '{}';
update notifications set ui_translation_meta = '{}';

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" alter column "meta" drop not null;
ALTER TABLE "public"."notifications" ALTER COLUMN "meta" drop default;

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" alter column "meta" set default jsonb_build_object();
alter table "public"."notifications" alter column "meta" set not null;

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" alter column "fcm_data" drop not null;
ALTER TABLE "public"."notifications" ALTER COLUMN "fcm_data" drop default;

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" alter column "fcm_data" set default jsonb_build_object();
alter table "public"."notifications" alter column "fcm_data" set not null;

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" alter column "ui_translation_meta" drop not null;
ALTER TABLE "public"."notifications" ALTER COLUMN "ui_translation_meta" drop default;

View File

@@ -0,0 +1,2 @@
alter table "public"."notifications" alter column "ui_translation_meta" set default jsonb_build_object();
alter table "public"."notifications" alter column "ui_translation_meta" set not null;

View File

@@ -0,0 +1 @@
alter table "public"."notifications" rename column "jobid" to "job_id";

View File

@@ -0,0 +1 @@
alter table "public"."notifications" rename column "job_id" to "jobid";

View File

@@ -0,0 +1 @@
alter table "public"."notifications" rename column "associationid" to "association_id";

View File

@@ -0,0 +1 @@
alter table "public"."notifications" rename column "association_id" to "associationid";

View File

@@ -0,0 +1 @@
alter table "public"."job_watchers" rename column "jobid" to "job_id";

View File

@@ -0,0 +1 @@
alter table "public"."job_watchers" rename column "job_id" to "jobid";

View File

@@ -0,0 +1,4 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."joblines" add column "include_in_part_cnt" boolean
-- not null default 'false';

View File

@@ -0,0 +1,2 @@
alter table "public"."joblines" add column "include_in_part_cnt" boolean
not null default 'false';

View File

@@ -0,0 +1,10 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE OR REPLACE VIEW "public"."joblines_status" AS
-- SELECT j.jobid,
-- j.status,
-- count(1) AS count,
-- j.part_type
-- FROM joblines j
-- WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND ((j.part_qty)::numeric <> (0)::numeric) AND ((j.act_price <> (0)::numeric) OR (j.include_in_part_cnt is TRUE))AND (j.removed IS FALSE))
-- GROUP BY j.jobid, j.status, j.part_type;

View File

@@ -0,0 +1,8 @@
CREATE OR REPLACE VIEW "public"."joblines_status" AS
SELECT j.jobid,
j.status,
count(1) AS count,
j.part_type
FROM joblines j
WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND ((j.part_qty)::numeric <> (0)::numeric) AND ((j.act_price <> (0)::numeric) OR (j.include_in_part_cnt is TRUE))AND (j.removed IS FALSE))
GROUP BY j.jobid, j.status, j.part_type;

View File

@@ -0,0 +1,10 @@
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- CREATE OR REPLACE VIEW "public"."joblines_status" AS
-- SELECT j.jobid,
-- j.status,
-- count(1) AS count,
-- j.part_type
-- FROM joblines j
-- WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND ((j.part_qty)::numeric <> (0)::numeric) AND ((j.act_price <> (0)::numeric) OR (j.include_in_part_cnt is TRUE))AND (j.removed IS FALSE))
-- GROUP BY j.jobid, j.status, j.part_type;

View File

@@ -0,0 +1,8 @@
CREATE OR REPLACE VIEW "public"."joblines_status" AS
SELECT j.jobid,
j.status,
count(1) AS count,
j.part_type
FROM joblines j
WHERE ((j.part_type IS NOT NULL) AND (j.part_type <> 'PAE'::text) AND (j.part_type <> 'PAS'::text) AND (j.part_type <> 'PASL'::text) AND ((j.part_qty)::numeric <> (0)::numeric) AND ((j.act_price <> (0)::numeric) OR (j.include_in_part_cnt is TRUE))AND (j.removed IS FALSE))
GROUP BY j.jobid, j.status, j.part_type;

View File

@@ -39,50 +39,50 @@ END;
$$;
CREATE FUNCTION public.assign_ro_number() RETURNS trigger
LANGUAGE plpgsql
AS $$
begin
IF NEW.converted = true and (new.ro_number is null or new.ro_number = '') THEN
UPDATE counters
SET count = count + 1 where shopid=new.shopid AND countertype = 'ronum'
RETURNING concat(prefix,count) into new.ro_number;
END IF;
RETURN NEW;
END;
AS $$
begin
IF NEW.converted = true and (new.ro_number is null or new.ro_number = '') THEN
UPDATE counters
SET count = count + 1 where shopid=new.shopid AND countertype = 'ronum'
RETURNING concat(prefix,count) into new.ro_number;
END IF;
RETURN NEW;
END;
$$;
CREATE FUNCTION public.audit_trigger() RETURNS trigger
LANGUAGE plpgsql SECURITY DEFINER
AS $$
DECLARE
shopid uuid ;
email text;
BEGIN
select b.id, u.email INTO shopid, email from users u join associations a on u.email = a.useremail join bodyshops b on b.id = a.shopid where u.authid = current_setting('hasura.user', 't')::jsonb->>'x-hasura-user-id' and a.active = true;
IF TG_OP = 'INSERT'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(NEW), NEW.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'UPDATE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP,
json_diff(to_jsonb(OLD), to_jsonb(NEW)) , json_diff(to_jsonb(NEW), to_jsonb(OLD)), OLD.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'DELETE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(OLD), OLD.ID, shopid, email);
RETURN OLD;
END IF;
END;
AS $$
DECLARE
shopid uuid ;
email text;
BEGIN
select b.id, u.email INTO shopid, email from users u join associations a on u.email = a.useremail join bodyshops b on b.id = a.shopid where u.authid = current_setting('hasura.user', 't')::jsonb->>'x-hasura-user-id' and a.active = true;
IF TG_OP = 'INSERT'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(NEW), NEW.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'UPDATE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, new_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP,
json_diff(to_jsonb(OLD), to_jsonb(NEW)) , json_diff(to_jsonb(NEW), to_jsonb(OLD)), OLD.id, shopid, email);
RETURN NEW;
ELSIF TG_OP = 'DELETE'
THEN
INSERT INTO public.audit_trail (tabname, schemaname, operation, old_val, recordid, bodyshopid, useremail)
VALUES (TG_RELNAME, TG_TABLE_SCHEMA, TG_OP, row_to_json(OLD), OLD.ID, shopid, email);
RETURN OLD;
END IF;
END;
$$;
CREATE FUNCTION public.json_diff(l jsonb, r jsonb) RETURNS jsonb
LANGUAGE sql
AS $$
SELECT jsonb_object_agg(a.key, a.value) FROM
( SELECT key, value FROM jsonb_each(l) ) a LEFT OUTER JOIN
( SELECT key, value FROM jsonb_each(r) ) b ON a.key = b.key
WHERE a.value != b.value OR b.key IS NULL;
AS $$
SELECT jsonb_object_agg(a.key, a.value) FROM
( SELECT key, value FROM jsonb_each(l) ) a LEFT OUTER JOIN
( SELECT key, value FROM jsonb_each(r) ) b ON a.key = b.key
WHERE a.value != b.value OR b.key IS NULL;
$$;
CREATE TABLE public.bills (
id uuid DEFAULT public.gen_random_uuid() NOT NULL,
@@ -211,33 +211,33 @@ CREATE TABLE public.exportlog (
);
CREATE FUNCTION public.search_exportlog(search text) RETURNS SETOF public.exportlog
LANGUAGE plpgsql STABLE
AS $$ BEGIN IF search = '' THEN RETURN query
SELECT
*
FROM
exportlog e;
ELSE RETURN query
SELECT
e.*
FROM
exportlog e
LEFT JOIN jobs j on j.id = e.jobid
LEFT JOIN payments p
ON p.id = e.paymentid
LEFT JOIN bills b
ON e.billid = b.id
WHERE
(
j.ro_number ILIKE '%' || search || '%'
OR b.invoice_number ILIKE '%' || search || '%'
OR p.paymentnum ILIKE '%' || search || '%'
OR e.useremail ILIKE '%' || search || '%'
)
AND (e.jobid = j.id
or e.paymentid = p.id
or e.billid = b.id)
;
END IF;
AS $$ BEGIN IF search = '' THEN RETURN query
SELECT
*
FROM
exportlog e;
ELSE RETURN query
SELECT
e.*
FROM
exportlog e
LEFT JOIN jobs j on j.id = e.jobid
LEFT JOIN payments p
ON p.id = e.paymentid
LEFT JOIN bills b
ON e.billid = b.id
WHERE
(
j.ro_number ILIKE '%' || search || '%'
OR b.invoice_number ILIKE '%' || search || '%'
OR p.paymentnum ILIKE '%' || search || '%'
OR e.useremail ILIKE '%' || search || '%'
)
AND (e.jobid = j.id
or e.paymentid = p.id
or e.billid = b.id)
;
END IF;
END $$;
CREATE TABLE public.jobs (
id uuid DEFAULT public.gen_random_uuid() NOT NULL,

View File

@@ -329,7 +329,8 @@ const main = async () => {
main().catch((error) => {
logger.log(`Main-API-Error: Something was not caught in the application.`, "error", "api", null, {
error: error.message,
errorjson: JSON.stringify(error)
errorjson: JSON.stringify(error),
stack: error.stack
});
// Note: If we want the app to crash on all uncaught async operations, we would
// need to put a `process.exit(1);` here

View File

@@ -3,3 +3,4 @@ exports.autohouse = require("./autohouse").default;
exports.chatter = require("./chatter").default;
exports.claimscorp = require("./claimscorp").default;
exports.kaizen = require("./kaizen").default;
exports.usageReport = require("./usageReport").default;

View File

@@ -0,0 +1,90 @@
const path = require("path");
require("dotenv").config({
path: path.resolve(process.cwd(), `.env.${process.env.NODE_ENV || "development"}`)
});
const client = require("../graphql-client/graphql-client").client;
const emailer = require("../email/sendemail");
const moment = require("moment-timezone");
const converter = require("json-2-csv");
const logger = require("../utils/logger");
const queries = require("../graphql-client/queries");
const InstanceMgr = require("../utils/instanceMgr").default;
exports.default = async (req, res) => {
try {
logger.log("usage-report-email-start", "debug", req?.user?.email, null, {});
if (InstanceMgr({ rome: false, imex: true })) {
//Disable for ImEX at the moment.
res.sendStatus(403);
logger.log("usage-report-email-forbidden", "warn", req?.user?.email, null, {});
return;
}
if (process.env.NODE_ENV !== "production") {
res.sendStatus(403);
return;
}
// Validate using autohouse token header.
if (req.headers["x-imex-auth"] !== process.env.AUTOHOUSE_AUTH_TOKEN) {
res.sendStatus(401);
logger.log("usage-report-email-forbidden", "warn", req?.user?.email, null, {});
return;
}
//Query the usage data.
const queryResults = await client.request(queries.STATUS_UPDATE, {
today: moment().startOf("day").subtract(7, "days"),
period: moment().subtract(90, "days").startOf("day")
});
//Massage the data.
const shopList = queryResults.bodyshops.map((shop) => ({
"Shop Name": shop.shopname,
"Days Since Creation": moment().diff(moment(shop.created_at), "days"),
"Jobs Created": shop.jobs_created.aggregate.count,
"Jobs Updated": shop.jobs_updated.aggregate.count,
"Owners Created": shop.owners_created.aggregate.count,
"Owners Updated": shop.owners_updated.aggregate.count,
"Vehicles Created": shop.vehicles_created.aggregate.count,
"Vehicles Updated": shop.vehicles_updated.aggregate.count,
"Tasks Created": shop.tasks_created.aggregate.count,
"Tasks Updated": shop.tasks_updated.aggregate.count
}));
const csv = converter.json2csv(shopList, { emptyFieldValue: "" });
emailer
.sendTaskEmail({
to: ["patrick.fic@convenient-brands.com", "bradley.rhoades@convenient-brands.com"],
subject: `RO Usage Report - ${moment().format("MM/DD/YYYY")}`,
text: `
Usage Report for ${moment().format("MM/DD/YYYY")} for Rome Online Customers.
Notes:
- Days Since Creation: The number of days since the shop was created. Only shops created in the last 90 days are included.
- Updated values should be higher than created values.
- Counts are inclusive of the last 7 days of data.
`,
attachments: [{ filename: `RO Usage Report ${moment().format("MM/DD/YYYY")}.csv`, content: csv }]
})
.then(() => {
logger.log("usage-report-email-success", "debug", req?.user?.email, null, {
csv
});
})
.catch((error) => {
logger.log("usage-report-email-send-error", "ERROR", req?.user?.email, null, {
error: error.message,
stack: error.stack
});
});
res.sendStatus(200);
return;
} catch (error) {
logger.log("usage-report-email-error", "ERROR", req?.user?.email, null, {
error: error.message,
stack: error.stack
});
res.status(500).json({ error: error.message, stack: error.stack });
}
};

View File

@@ -2617,3 +2617,76 @@ exports.CREATE_CONVERSATION = `mutation CREATE_CONVERSATION($conversation: [conv
}
}
`;
exports.STATUS_UPDATE = `query STATUS_UPDATE($period: timestamptz!, $today: timestamptz!) {
bodyshops(where: { created_at: { _gte: $period } }) {
shopname
id
created_at
jobs_created: jobs_aggregate(where: { created_at: { _gte: $today } }) {
aggregate {
count
}
}
jobs_updated: jobs_aggregate(where: { updated_at: { _gte: $today } }) {
aggregate {
count
}
}
owners_created: owners_aggregate(where: { created_at: { _gte: $today } }) {
aggregate {
count
}
}
owners_updated: owners_aggregate(where: { updated_at: { _gte: $today } }) {
aggregate {
count
}
}
vehicles_created: vehicles_aggregate(
where: { created_at: { _gte: $today } }
) {
aggregate {
count
}
}
vehicles_updated: vehicles_aggregate(
where: { updated_at: { _gte: $today } }
) {
aggregate {
count
}
}
tasks_created: tasks_aggregate(where: { created_at: { _gte: $today } }) {
aggregate {
count
}
}
tasks_updated: tasks_aggregate(where: { updated_at: { _gte: $today } }) {
aggregate {
count
}
}
jobs {
parts_orders_created: parts_orders_aggregate(
where: { created_at: { _gte: $today } }
) {
aggregate {
count
}
}
parts_orders_updated: parts_orders_aggregate(
where: { updated_at: { _gte: $today } }
) {
aggregate {
count
}
}
}
}
}
`

View File

@@ -389,7 +389,7 @@ exports.postback = async (req, res) => {
if (decodedComment) {
//Shifted the order to have this first to retain backwards compatibility for the old style of short link.
//This has been triggered by IO and may have multiple jobs.
const parsedComment = JSON.parse(decodedComment);
const parsedComment = decodedComment;
logger.log("intellipay-postback-parsed-comment", "DEBUG", req.user?.email, null, {
parsedComment,

View File

@@ -49,7 +49,8 @@ exports.totalsSsu = async function (req, res) {
} catch (error) {
logger.log("job-totals-ssu-USA-error", "ERROR", req?.user?.email, id, {
jobid: id,
error: error.message
error: error.message,
stack: error.stack
});
res.status(503).send();
}
@@ -68,59 +69,63 @@ async function TotalsServerSide(req, res) {
ret.additional = CalculateAdditional(job);
ret.totals = CalculateTaxesTotals(job, ret);
// Sub total scrubbbing.
const emsTotal =
job.cieca_ttl.data.n_ttl_amt === job.cieca_ttl.data.g_ttl_amt //It looks like sometimes, gross and net are the same, but they shouldn't be.
? job.cieca_ttl.data.n_ttl_amt - job.cieca_ttl.data.g_tax
: job.cieca_ttl.data.g_ttl_amt - job.cieca_ttl.data.g_tax; //If they are, adjust the gross total down by the tax amount.
const ttlDifference =
emsTotal -
ret.totals.subtotal
.add(
Dinero({
amount: Math.round((job.adjustment_bottom_line || 0) * 100)
}).multiply(-1) //Add back in the adjustment to the subtotal. We don't want to scrub it twice.
)
.getAmount() /
//If we don't have the CIECA_TTL, we can't scrub. E.g. a private estimate.
if (job.cieca_ttl) {
// Sub total scrubbbing.
const emsTotal =
job.cieca_ttl.data.n_ttl_amt === job.cieca_ttl.data.g_ttl_amt //It looks like sometimes, gross and net are the same, but they shouldn't be.
? job.cieca_ttl.data.n_ttl_amt - job.cieca_ttl.data.g_tax
: job.cieca_ttl.data.g_ttl_amt - job.cieca_ttl.data.g_tax; //If they are, adjust the gross total down by the tax amount.
const ttlDifference =
emsTotal -
ret.totals.subtotal
.add(
Dinero({
amount: Math.round((job.adjustment_bottom_line || 0) * 100)
}).multiply(-1) //Add back in the adjustment to the subtotal. We don't want to scrub it twice.
)
.getAmount() /
100;
if (Math.abs(ttlDifference) > 0.0) {
//If difference is greater than a pennny, we need to adjust it.
ret.totals.ttl_adjustment = Dinero({ amount: Math.round(ttlDifference * 100) });
ret.totals.subtotal = ret.totals.subtotal.add(ret.totals.ttl_adjustment);
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_adjustment);
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_adjustment);
logger.log("job-totals-USA-ttl-adj", "DEBUG", null, job.id, {
adjAmount: ttlDifference
});
}
//Taxes Scrubbing
const emsTaxTotal = job.cieca_ttl.data.g_tax;
const totalUsTaxes =
(ret.totals.us_sales_tax_breakdown.ty1Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty2Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty3Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty4Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty5Tax.getAmount()) /
100;
const ttlTaxDifference = emsTaxTotal - totalUsTaxes;
if (Math.abs(ttlDifference) > 0.0) {
//If difference is greater than a pennny, we need to adjust it.
ret.totals.ttl_adjustment = Dinero({ amount: Math.round(ttlDifference * 100) });
ret.totals.subtotal = ret.totals.subtotal.add(ret.totals.ttl_adjustment);
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_adjustment);
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_adjustment);
logger.log("job-totals-USA-ttl-adj", "DEBUG", null, job.id, {
adjAmount: ttlDifference
});
}
//Taxes Scrubbing
const emsTaxTotal = job.cieca_ttl.data.g_tax;
const totalUsTaxes =
(ret.totals.us_sales_tax_breakdown.ty1Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty2Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty3Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty4Tax.getAmount() +
ret.totals.us_sales_tax_breakdown.ty5Tax.getAmount()) /
100;
const ttlTaxDifference = emsTaxTotal - totalUsTaxes;
if (Math.abs(ttlTaxDifference) > 0.0) {
//If difference is greater than a pennny, we need to adjust it.
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_tax_adjustment);
logger.log("job-totals-USA-ttl-tax-adj", "DEBUG", null, job.id, {
adjAmount: ttlTaxDifference
});
if (Math.abs(ttlTaxDifference) > 0.0) {
//If difference is greater than a pennny, we need to adjust it.
ret.totals.ttl_tax_adjustment = Dinero({ amount: Math.round(ttlTaxDifference * 100) });
ret.totals.total_repairs = ret.totals.total_repairs.add(ret.totals.ttl_tax_adjustment);
ret.totals.net_repairs = ret.totals.net_repairs.add(ret.totals.ttl_tax_adjustment);
logger.log("job-totals-USA-ttl-tax-adj", "DEBUG", null, job.id, {
adjAmount: ttlTaxDifference
});
}
}
return ret;
} catch (error) {
logger.log("job-totals-ssu-USA-error", "ERROR", req.user?.email, job.id, {
jobid: job.id,
error
error: error.message,
stack: error.stack
});
res.status(400).send(JSON.stringify(error));
}
@@ -150,7 +155,8 @@ async function Totals(req, res) {
} catch (error) {
logger.log("job-totals-USA-error", "ERROR", req.user.email, job.id, {
jobid: job.id,
error
error: error.message,
stack: error.stack
});
res.status(400).send(JSON.stringify(error));
}
@@ -812,6 +818,7 @@ function CalculateTaxesTotals(job, otherTotals) {
PAG: Dinero(),
PAO: Dinero(),
PAS: Dinero(),
PASL: Dinero(),
PAP: Dinero(),
PAM: Dinero(),
@@ -1075,7 +1082,8 @@ function CalculateTaxesTotals(job, otherTotals) {
}
} catch (error) {
logger.log("job-totals-USA - PFP Calculation Error", "error", null, job.id, {
error: error.message
error: error.message,
stack: error.stack
});
}
});

View File

@@ -0,0 +1,5 @@
const handleJobsChange = (req, res) => {
return res.status(200).json({ message: "Jobs change handled." });
};
module.exports = handleJobsChange;

View File

@@ -0,0 +1,5 @@
const handleBillsChange = (req, res) => {
return res.status(200).json({ message: "Bills change handled." });
};
module.exports = handleBillsChange;

View File

@@ -0,0 +1,5 @@
const handlePartsDispatchChange = (req, res) => {
return res.status(200).json({ message: "Parts Dispatch change handled." });
};
module.exports = handlePartsDispatchChange;

View File

@@ -0,0 +1,5 @@
const handlePartsOrderChange = (req, res) => {
return res.status(200).json({ message: "Parts Order change handled." });
};
module.exports = handlePartsOrderChange;

View File

@@ -0,0 +1,5 @@
const handleTasksChange = (req, res) => {
return res.status(200).json({ message: "Tasks change handled." });
};
module.exports = handleTasksChange;

View File

@@ -0,0 +1,5 @@
const handleTimeTicketsChange = (req, res) => {
return res.status(200).json({ message: "Time Tickets change handled." });
};
module.exports = handleTimeTicketsChange;

View File

@@ -1,10 +1,11 @@
const express = require("express");
const router = express.Router();
const { autohouse, claimscorp, chatter, kaizen } = require("../data/data");
const { autohouse, claimscorp, chatter, kaizen, usageReport } = require("../data/data");
router.post("/ah", autohouse);
router.post("/cc", claimscorp);
router.post("/chatter", chatter);
router.post("/kaizen", kaizen);
router.post("/usagereport", usageReport);
module.exports = router;

View File

@@ -1,12 +1,28 @@
const express = require("express");
const validateFirebaseIdTokenMiddleware = require("../middleware/validateFirebaseIdTokenMiddleware");
const { subscribe, unsubscribe, sendNotification } = require("../firebase/firebase-handler");
const eventAuthorizationMiddleware = require("../middleware/eventAuthorizationMIddleware");
const handlePartsOrderChange = require("../notifications/eventHandlers/handlePartsOrderChange");
const handlePartsDispatchChange = require("../notifications/eventHandlers/handlePartsDispatchChange");
const handleTasksChange = require("../notifications/eventHandlers/handleTasksChange");
const handleTimeTicketsChange = require("../notifications/eventHandlers/handleTimeTicketsChange");
const handleJobsChange = require("../notifications/eventHandlers/handeJobsChange");
const handleBillsChange = require("../notifications/eventHandlers/handleBillsChange");
const router = express.Router();
router.use(validateFirebaseIdTokenMiddleware);
// These are FCM handlers
router.post("/subscribe", validateFirebaseIdTokenMiddleware, subscribe);
router.post("/unsubscribe", validateFirebaseIdTokenMiddleware, unsubscribe);
router.post("/sendtestnotification", validateFirebaseIdTokenMiddleware, sendNotification);
router.post("/subscribe", subscribe);
router.post("/unsubscribe", unsubscribe);
router.post("/sendtestnotification", sendNotification);
// Hasura Entry points for creating notifications
router.post("/events/handleJobsChange", eventAuthorizationMiddleware, handleJobsChange);
router.post("/events/handleBillsChange", eventAuthorizationMiddleware, handleBillsChange);
router.post("/events/handlePartsOrderChange", eventAuthorizationMiddleware, handlePartsOrderChange);
router.post("/events/handlePartsDispatchChange", eventAuthorizationMiddleware, handlePartsDispatchChange);
router.post("/events/handleTasksChange", eventAuthorizationMiddleware, handleTasksChange);
router.post("/events/handleTimeTicketsChange", eventAuthorizationMiddleware, handleTimeTicketsChange);
module.exports = router;

View File

@@ -41,7 +41,7 @@ exports.taskHandler = async (req, res) => {
return res.status(200).send(csv);
} catch (error) {
res.status(500).json({ error: error.message, stack: error.stackTrace });
res.status(500).json({ error: error.message, stack: error.stack });
}
};