Compare commits

...

124 Commits

Author SHA1 Message Date
Patrick Fic
932bbd8fde Resolve Report Center Issue.
(cherry picked from commit 76ea8ca2ed)
2021-12-08 15:14:50 -08:00
Patrick Fic
01977cefde Merged in release/2021-12-10 (pull request #292)
Release/2021 12 10
2021-12-08 18:29:37 +00:00
Patrick Fic
26d22388c0 Add IO Event tracking to graylog. 2021-12-08 09:25:55 -08:00
Patrick Fic
22a5c4a12d Add production repolling once an hr. 2021-12-07 15:15:40 -08:00
Patrick Fic
61edcf63be Update split functionality for Production List Colors. 2021-12-07 13:49:34 -08:00
Patrick Fic
a09daf052b DMS Updates 2021-12-07 13:45:33 -08:00
Patrick Fic
4393bf42ed IO-1550 Updated production boards to simplify subscription. 2021-12-06 16:39:13 -08:00
Patrick Fic
df83acb5ed IO-117 PBS Updates. 2021-12-06 11:33:50 -08:00
Patrick Fic
09cf49080b IO-223 ARMS Updates. 2021-12-03 18:34:09 -08:00
Patrick Fic
3b301efd27 IO-223 ARMS Updates. 2021-12-03 18:33:52 -08:00
Patrick Fic
2e843bbd8a IO-244 IOU Parts 2021-12-03 17:39:58 -08:00
Patrick Fic
b539ecaeb1 Package updates. 2021-12-03 14:40:31 -08:00
Patrick Fic
62cba80f82 Merged in release/2021-12-03 (pull request #289)
release/2021-12-03

Approved-by: Patrick Fic
2021-12-03 22:37:55 +00:00
Patrick Fic
7d7cd8d85e Merged in release/2021-12-03 (pull request #288)
Resolve CI.
2021-12-03 22:06:35 +00:00
Patrick Fic
5518395533 Resolve CI. 2021-12-03 14:05:17 -08:00
Patrick Fic
1cf2851e39 Merged in release/2021-12-03 (pull request #287)
Release/2021 12 03
2021-12-03 21:58:32 +00:00
Patrick Fic
cdbcef323f IO-233 Update Receive Bills 2021-12-03 13:57:48 -08:00
Patrick Fic
5125b20721 IO-233 Update CDK URLs. 2021-12-03 11:17:07 -08:00
Patrick Fic
c644ed67fd Merged in release/2021-12-03 (pull request #286)
Release/2021 12 03
2021-12-03 17:33:37 +00:00
Patrick Fic
48fd2b1461 IO-233 Minor CDK UI Updates. 2021-12-03 09:32:47 -08:00
Patrick Fic
2f1c168b3e IO-233 Add GST override for CDK. 2021-12-03 09:13:24 -08:00
Patrick Fic
a5aee28d42 IO-233 CDK Updates. 2021-12-02 15:51:21 -08:00
Patrick Fic
3c9625b622 Merged in release/2021-12-03 (pull request #285)
IO-233 CDK Updates.
2021-12-02 21:13:28 +00:00
Patrick Fic
8d3c2f7af6 IO-233 CDK Updates. 2021-12-02 13:11:23 -08:00
Patrick Fic
0109c9974f Merged in release/2021-12-03 (pull request #284)
Release/2021 12 03
2021-12-02 18:51:08 +00:00
Patrick Fic
39ec9d92ec IO-233 CDK updates. 2021-12-02 10:50:11 -08:00
Patrick Fic
a77e664ab1 Add OEC Reference Files. 2021-12-01 14:33:27 -08:00
Patrick Fic
b601bf1c1f Merged in release/2021-12-03 (pull request #282)
release/2021-12-03

Approved-by: Patrick Fic
2021-12-01 21:38:21 +00:00
Patrick Fic
724898714d IO-223 ARMS WIP 2021-12-01 13:37:55 -08:00
Patrick Fic
9fe535336c Merge branch 'release/2021-12-03' of bitbucket.org:snaptsoft/bodyshop into release/2021-12-03 2021-12-01 13:37:16 -08:00
Patrick Fic
1483f5f7c8 IO-233 Add CDK Control List. 2021-12-01 13:37:03 -08:00
Patrick Fic
4355a04ba4 IO-223 ARMS Backup. 2021-11-30 15:20:26 -08:00
Patrick Fic
cdc0c8bb37 IO-117 WIP PBS. 2021-11-30 12:46:04 -08:00
Patrick Fic
85deec1c21 Merge branch 'test' into release/2021-12-03 2021-11-30 08:39:18 -08:00
Patrick Fic
d4572a2d36 IO-1383 Include PVRT on export. 2021-11-29 15:37:49 -08:00
Patrick Fic
6f76c16994 Merged in release/2021-11-26 (pull request #280)
release/2021-11-26

Approved-by: Patrick Fic
2021-11-29 23:07:49 +00:00
Patrick Fic
97317c5179 Merge branch 'feature/oec' into release/2021-11-26 2021-11-29 15:07:29 -08:00
Patrick Fic
5db43dd065 IO-70 Add basic functions of OEC. 2021-11-29 15:04:34 -08:00
Patrick Fic
673654a9b7 IO-223 WIP ARMS 2021-11-29 10:46:59 -08:00
Patrick Fic
53be0bbc1a IO-70 OEC WIP. 2021-11-29 08:57:44 -08:00
Patrick Fic
ca6f4070d0 Merged in release/2021-11-26 (pull request #279)
IO-233 CDK Updates.

Approved-by: Patrick Fic
2021-11-26 17:26:11 +00:00
Patrick Fic
8c40d541c4 Merged in release/2021-11-26 (pull request #278)
release/2021-11-26

Approved-by: Patrick Fic
2021-11-26 17:25:22 +00:00
Patrick Fic
c3baee1fa9 IO-233 CDK Updates. 2021-11-26 09:18:19 -08:00
Patrick Fic
dc6e5fe3aa Merged in release/2021-11-26 (pull request #277)
release/2021-11-26

Approved-by: Patrick Fic
2021-11-23 22:25:05 +00:00
Patrick Fic
b311a6df53 Resolve CI issues. 2021-11-23 14:24:48 -08:00
Patrick Fic
785f22c026 Merged in release/2021-11-26 (pull request #276)
Release/2021 11 26
2021-11-23 20:37:44 +00:00
Patrick Fic
bfcc03850b IO-70 Add OEC Through Partner Call. 2021-11-23 00:30:11 -08:00
Patrick Fic
65402c1420 Clean up console log statements. 2021-11-22 23:20:13 -08:00
Patrick Fic
b462b2fa03 IO-1485 Auto CC on parts order. 2021-11-22 15:39:12 -08:00
Patrick Fic
112dfdf074 Merged in release/2021-11-26 (pull request #275)
release/2021-11-26

Approved-by: Patrick Fic
2021-11-22 06:25:53 +00:00
Patrick Fic
ac22e226b5 Merged in release/2021-11-26 (pull request #274)
IO-1533 Resolve board rerender.

Approved-by: Patrick Fic
2021-11-22 06:00:13 +00:00
Patrick Fic
0c26b90591 IO-1533 Resolve board rerender. 2021-11-21 21:59:33 -08:00
Patrick Fic
ff5611e123 Merged in release/2021-11-19 (pull request #273)
IO-233 CDK Updates.

Approved-by: Patrick Fic
2021-11-19 20:09:14 +00:00
Patrick Fic
f8f2384c54 Merged in release/2021-11-19 (pull request #272)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-19 20:08:53 +00:00
Patrick Fic
ef18cf0718 IO-233 CDK Updates. 2021-11-19 10:50:38 -08:00
Patrick Fic
9d35fc85ad Merged in release/2021-11-19 (pull request #271)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-18 18:39:14 +00:00
Patrick Fic
e98f9763fd Resolve QB Payments Refund Issue. 2021-11-18 10:38:04 -08:00
Patrick Fic
95e5385cd1 Merged in release/2021-11-19 (pull request #270)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-18 17:19:57 +00:00
Patrick Fic
46abf01366 IO-1533 Resolve defaults check issue for production board. 2021-11-18 09:19:34 -08:00
Patrick Fic
87f06425e1 Merged in release/2021-11-19 (pull request #269)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-18 06:19:53 +00:00
Patrick Fic
45ab7543d5 Resolve CI Issues. 2021-11-17 22:18:09 -08:00
Patrick Fic
120e4fc94c Merged in release/2021-11-19 (pull request #268)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-18 06:17:09 +00:00
Patrick Fic
fed16efd10 IO-1533 Added check for null settings on kanban. 2021-11-17 22:16:43 -08:00
Patrick Fic
ea6277c586 Merged in release/2021-11-19 (pull request #267)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-18 06:08:21 +00:00
Patrick Fic
49bf461c36 IO-1533 Kanban Customizations 2021-11-17 22:07:50 -08:00
Patrick Fic
696781c857 IO-1533 Kanban Customizations 2021-11-17 21:47:05 -08:00
Patrick Fic
5540872f62 IO-1531 CC Contract add to production. 2021-11-17 20:18:21 -08:00
Patrick Fic
dac53a56c3 Merged in release/2021-11-19 (pull request #266)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-18 01:30:23 +00:00
Patrick Fic
69690f0184 IO-1533 Kanban Customizations 2021-11-17 15:29:04 -08:00
Patrick Fic
f11a4c93ac IO-233 CDK Updates 2021-11-17 14:44:07 -08:00
Patrick Fic
d74870812e Merged in release/2021-11-19 (pull request #265)
release/2021-11-19

Approved-by: Patrick Fic
2021-11-16 01:17:31 +00:00
Patrick Fic
9eed33b5f2 Resolve CI issues with missing imports. 2021-11-15 17:15:51 -08:00
Patrick Fic
55b7715e1c IO-1529 Added gateway templates. 2021-11-15 17:14:12 -08:00
Patrick Fic
c129b5ba8c IO-1533 Kanban Customization 2021-11-15 13:53:54 -08:00
Patrick Fic
efc2844d99 IO-1530 Email individual note. 2021-11-15 11:06:10 -08:00
Patrick Fic
ab38f85d38 Package updates. 2021-11-15 10:36:41 -08:00
Patrick Fic
485959c399 Merged in release/2021-11-12 (pull request #264)
release/2021-11-12

Approved-by: Patrick Fic
2021-11-12 23:29:35 +00:00
Patrick Fic
81eccba393 Merged in release/2021-11-12 (pull request #263)
release/2021-11-12

Approved-by: Patrick Fic
2021-11-12 21:46:33 +00:00
Patrick Fic
b3b49fd4ca Email test fix & Shop Config validation for resp centers. 2021-11-12 13:46:01 -08:00
Patrick Fic
b7a08db4e7 Merged in release/2021-11-12 (pull request #262)
IO-117 PBS WIP

Approved-by: Patrick Fic
2021-11-11 02:13:28 +00:00
Patrick Fic
2d63c3d576 IO-1528 Autohouse Updates. 2021-11-10 18:06:24 -08:00
Patrick Fic
5f4a2392af Costmetic updates & limit of conversations in subscription. 2021-11-10 17:09:09 -08:00
Patrick Fic
f6fe8be7c4 IO-1491 Simplify production query to use ignore employee relationships and match locally. 2021-11-10 16:54:02 -08:00
Patrick Fic
89af6d23e8 IO-1513 Added next contact date. 2021-11-10 16:22:52 -08:00
Patrick Fic
7e1431d65e IO-117 WIP PBS 2021-11-10 15:30:07 -08:00
Patrick Fic
d50e845ba0 IO-117 PBS WIP 2021-11-10 08:18:29 -08:00
Patrick Fic
6796c35e5b Merged in release/2021-11-12 (pull request #260)
release/2021-11-12

Approved-by: Patrick Fic
2021-11-10 01:06:57 +00:00
Patrick Fic
4a68a10005 IO-1486 Add dropdown for file handler. 2021-11-09 17:05:20 -08:00
Patrick Fic
17088b3025 IO-1188 Add AB proof of loss. 2021-11-09 16:33:20 -08:00
Patrick Fic
4e3c659b6d IO-1497 Ability to delete parts orders. 2021-11-09 16:31:57 -08:00
Patrick Fic
6afcf82cc4 IO-1505 Resolve PST exempt exporting to QBO. 2021-11-09 16:04:16 -08:00
Patrick Fic
f4ddb40bde IO-117 PBS WIP 2021-11-09 13:56:52 -08:00
Patrick Fic
6017e2172e IO-117 PBS WIP 2021-11-09 10:38:07 -08:00
Patrick Fic
bef9e64bf8 Resolve associations permissions to allow adjustments of RBAC. 2021-11-08 11:23:37 -08:00
Patrick Fic
e8d95bdb68 IO-1508 Add # of jobs in production. 2021-11-08 11:12:56 -08:00
Patrick Fic
10fb7d9d96 IO-1499 Reconciliation to consider quantity. 2021-11-08 10:50:21 -08:00
Patrick Fic
2ec196e664 IO-1510 Missing report templates 2021-11-08 10:29:16 -08:00
Patrick Fic
1f38b98bfd Package Updates 2021-11-08 10:27:38 -08:00
Patrick Fic
122d21d4eb Merged in release/2021-11-01 (pull request #259)
IO-1438 Resolve issue with texting

Approved-by: Patrick Fic
2021-11-01 16:01:32 +00:00
Patrick Fic
a7c76386bc Merged in release/2021-11-01 (pull request #258)
release/2021-11-01

Approved-by: Patrick Fic
2021-11-01 16:00:52 +00:00
Patrick Fic
042b67c531 IO-1438 Resolve issue with texting 2021-11-01 08:57:30 -07:00
Patrick Fic
2e72ed3698 IO-1438 Resolve Texting Issue 2021-11-01 08:40:53 -07:00
Patrick Fic
e0157f6da4 Merged in release/2021-10-29 (pull request #257)
Release/2021 10 29
2021-10-29 21:18:53 +00:00
Patrick Fic
bc01f46388 Merge branch 'release/2021-10-29' into test 2021-10-29 13:48:27 -07:00
Patrick Fic
74f791541f IO-256 Resolve no invoice on CM QBO export. 2021-10-29 13:48:17 -07:00
Patrick Fic
84c7fdba5a Merge branch 'release/2021-10-29' into test 2021-10-29 11:30:53 -07:00
Patrick Fic
630fa23f6c Resolve uneeded import CI error. 2021-10-29 11:30:43 -07:00
Patrick Fic
8f58f09c8c Merge branch 'release/2021-10-29' into test 2021-10-29 11:19:36 -07:00
Patrick Fic
a0922f2944 IO-1476 Add Hrs to schedule modal. 2021-10-29 11:18:17 -07:00
Patrick Fic
b8f001625b IO-1502 PST on Adjustments for QBO 2021-10-29 10:55:35 -07:00
Patrick Fic
53394efebf IO-1503 QBO Credit Memos 2021-10-28 09:56:59 -07:00
Patrick Fic
d8296e1d01 Merge branch 'release/2021-10-29' into test 2021-10-27 11:37:04 -07:00
Patrick Fic
2c00e5ee79 IO-256 Resolve QBO Aposstroph Issues 2021-10-27 11:36:40 -07:00
Patrick Fic
34e220dcad IO-233 Update Regex for CDK. 2021-10-27 10:46:06 -07:00
Patrick Fic
fa1fffd8b9 Merge branch 'release/2021-10-29' into test 2021-10-27 08:39:20 -07:00
Patrick Fic
67eb430ff9 Add missing query field to CDK. 2021-10-27 08:39:05 -07:00
Patrick Fic
ff53355b4a Merge branch 'release/2021-10-29' into test 2021-10-27 08:30:03 -07:00
Patrick Fic
331b2c517b Update CDK Country Inclusion. 2021-10-27 08:29:43 -07:00
Patrick Fic
05d9f20a66 Mark Other RO field as Read Only 2021-10-26 15:38:05 -07:00
Patrick Fic
9e3a2e920d Merge branch 'release/2021-10-29' into test 2021-10-26 13:10:37 -07:00
Patrick Fic
1511b87959 IO-1487 MPI Totals Adjustments 2021-10-26 13:10:07 -07:00
Patrick Fic
9c3e4b7b83 IO-1489 Resolve payables memo for QBO. 2021-10-25 17:25:29 -07:00
Patrick Fic
b718f49071 IO-256 Resolve QBO Payable Vendor Insert. 2021-10-25 17:05:21 -07:00
Patrick Fic
e7157119ae Merged in release/2021-10-29 (pull request #256)
Release/2021 10 29
2021-10-25 21:58:53 +00:00
173 changed files with 14649 additions and 2984 deletions

1
.gitignore vendored
View File

@@ -112,3 +112,4 @@ firebase/.env
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
logs/oAuthClient-log.log

586
_reference/OEC/Audatex.xsl Normal file
View File

@@ -0,0 +1,586 @@
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:template match="/">
<xsl:for-each select="//TranslatedData">
<xsl:element name="TranslatedData">
<xsl:attribute name="TranslationOutputFile">
<xsl:value-of select="@TranslationOutputFile"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="Details/@PrgID">
<xsl:copy-of select="Details" />
</xsl:when>
<xsl:otherwise>
<xsl:element name="Details">
<xsl:attribute name="PrgID">OECTrans.ImportTrans</xsl:attribute>
<xsl:for-each select="Details/@*">
<xsl:copy-of select="." />
</xsl:for-each>
<xsl:for-each select="Details/*">
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="Header">
<xsl:attribute name="RONum">
<xsl:value-of select="//Envelope/@RONum" />
</xsl:attribute>
<xsl:attribute name="OwnerFName">
<xsl:value-of select="//Admin/@OwnerF"/>
</xsl:attribute>
<xsl:attribute name="OwnerLName">
<xsl:value-of select="//Admin/@OwnerL"/>
</xsl:attribute>
<xsl:attribute name="VIN">
<xsl:value-of select="//Vehicle/@TransVIN" />
</xsl:attribute>
<xsl:attribute name="Mileage">
<xsl:value-of select="//Vehicle/@TransMileage" />
</xsl:attribute>
<xsl:attribute name="Year">
<xsl:value-of select="//Vehicle/@TransYear" />
</xsl:attribute>
<xsl:attribute name="Make">
<xsl:if test="//Vehicle/@ManufName[. != '']" >
<xsl:choose>
<xsl:when test="//Vehicle/@ManufName[. = 'Geo']">CHEV</xsl:when>
<xsl:when test="//Vehicle/@ManufName[. = 'Chev-GMC Truck']">CHEV</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Vehicle/@ManufName" />
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:if test="//Vehicle/@ManufName[. = '']" >
<xsl:value-of select="//Vehicle/@ManufCode" />
</xsl:if>
</xsl:attribute>
<xsl:attribute name="Model">
<xsl:value-of select="//Vehicle/@TransModel" />
</xsl:attribute>
<xsl:attribute name="Description">
<xsl:value-of select="//Vehicle/@TransYear" />
<xsl:text> </xsl:text>
<xsl:value-of select="//Vehicle/@ManufName" />
<xsl:text> </xsl:text>
<xsl:value-of select="//Vehicle/@TransModel" />
</xsl:attribute>
<xsl:attribute name="LastSupplLevel">
<xsl:choose>
<xsl:when test="//Envelope/@TransactionType = 'E'">0</xsl:when>
<xsl:when test="substring(//Envelope/@SupplementNum, 1, 1) = 'S'">
<xsl:value-of select="substring(//Envelope/@SupplementNum, 2)" />
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="PartsList" />
<xsl:element name="Envelope">
<xsl:element name="Software">
<xsl:attribute name="Manifest">Audatex.xml</xsl:attribute>
<xsl:attribute name="Descriptor">Audatex.xsl</xsl:attribute>
<xsl:attribute name="System">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>
</xsl:attribute>
<xsl:attribute name="Version">
<xsl:value-of select="//Envelope/@SoftwareVersion"/>
</xsl:attribute>
<xsl:attribute name="SystemName">
<xsl:value-of select="//Envelope/@SystemName"/>
</xsl:attribute>
<xsl:attribute name="EstimateFileID">
<xsl:value-of select="//Envelope/@EstimateFileID"/>
</xsl:attribute>
<xsl:attribute name="UniqueFileID">
<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateID">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>-<xsl:value-of select="//Envelope/@SoftwareVersion"/>-<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateIDv2">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>-<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateFormatVersion">
<xsl:value-of select="//Envelope/@EMSVersion"/>
</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Totals">
<xsl:attribute name="GrandTotalAmount">
<xsl:value-of select="//Total/@GrandTotalAmount"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Administrative">
<xsl:element name="Owner">
<xsl:attribute name="FName">
<xsl:value-of select="//Admin/@OwnerF"/>
</xsl:attribute>
<xsl:attribute name="LName">
<xsl:value-of select="//Admin/@OwnerL"/>
</xsl:attribute>
<xsl:attribute name="Company">
<!--<xsl:value-of select="//Admin/@OwnerCompanyName"/>-->
</xsl:attribute>
<xsl:attribute name="Address">
<!--<xsl:value-of select="//Admin/@OwnerAddr1"/>-->
</xsl:attribute>
<xsl:attribute name="Address2">
<!--<xsl:value-of select="//Admin/@OwnerAddr2"/>-->
</xsl:attribute>
<xsl:attribute name="City">
<!--<xsl:value-of select="//Admin/@OwnerCity"/>-->
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin/@OwnerState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<!--<xsl:choose>
<xsl:when test="contains(//Admin/@OwnerZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin/@OwnerZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin/@OwnerZip, '-'))=4">
<xsl:value-of select="//Admin/@OwnerZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin/@OwnerZip)=9">
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin/@OwnerZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin/@OwnerZip)&gt;4">
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>
</xsl:when>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Country">
<!--<xsl:value-of select="//Admin/@OwnerCountry"/>-->
</xsl:attribute>
<xsl:attribute name="Phone">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerPhone1Ext[. != '']">
<xsl:value-of select="//Admin/@OwnerPhone1"/>&#32;x<xsl:value-of select="//Admin/@OwnerPhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerPhone1"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Phone2">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerPhone2Ext[. != '']">
<xsl:value-of select="//Admin/@OwnerPhone2"/>&#32;x<xsl:value-of select="//Admin/@OwnerPhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerPhone2"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Fax">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerFaxExt[. != '']">
<xsl:value-of select="//Admin/@OwnerFax"/>&#32;x<xsl:value-of select="//Admin/@OwnerFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerFax"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Email">
<!--<xsl:value-of select="//Admin/@OwnerEmail"/>-->
</xsl:attribute>
</xsl:element>
<xsl:element name="InsuranceCompany">
<xsl:attribute name="Id">
<xsl:value-of select="//Admin/@InsuranceCompanyID"/>
</xsl:attribute>
<xsl:attribute name="Name">
<xsl:value-of select="//Admin/@InsuranceCompanyName"/>
</xsl:attribute>
<xsl:attribute name="Address">
<xsl:value-of select="//Admin/@InsuranceAddr1"/>
</xsl:attribute>
<xsl:attribute name="Address2">
<xsl:value-of select="//Admin/@InsuranceAddr2"/>
</xsl:attribute>
<xsl:attribute name="City">
<xsl:value-of select="//Admin/@InsuranceCity"/>
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin/@InsuranceState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<xsl:choose>
<xsl:when test="contains(//Admin/@InsuranceZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin/@InsuranceZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin/@InsuranceZip, '-'))=4">
<xsl:value-of select="//Admin/@InsuranceZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin/@InsuranceZip)=9">
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin/@InsuranceZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin/@InsuranceZip)&gt;4">
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Country">
<xsl:value-of select="//Admin/@InsuranceCountry"/>
</xsl:attribute>
<xsl:attribute name="Phone">
<xsl:choose>
<xsl:when test="//Admin/@InsurancePhone1Ext[. != '']">
<xsl:value-of select="//Admin/@InsurancePhone1"/>&#32;x<xsl:value-of select="//Admin/@InsurancePhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsurancePhone1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Phone2">
<xsl:choose>
<xsl:when test="//Admin/@InsurancePhone2Ext[. != '']">
<xsl:value-of select="//Admin/@InsurancePhone2"/>&#32;x<xsl:value-of select="//Admin/@InsurancePhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsurancePhone2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Fax">
<xsl:choose>
<xsl:when test="//Admin/@InsuranceFaxExt[. != '']">
<xsl:value-of select="//Admin/@InsuranceFax"/>&#32;x<xsl:value-of select="//Admin/@InsuranceFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsuranceFax"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Email">
<xsl:value-of select="//Admin/@InsuranceEmail"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Insured">
<xsl:attribute name="LastName">
<xsl:value-of select="//Admin/@InsuranceLName" />
</xsl:attribute>
</xsl:element>
<xsl:element name="Claim">
<xsl:attribute name="Number">
<xsl:value-of select="//Admin/@ClaimNumber"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Estimator">
<xsl:attribute name="FName">
<xsl:value-of select="//Admin2/@EstimatorF"/>
</xsl:attribute>
<xsl:attribute name="LName">
<xsl:value-of select="//Admin2/@EstimatorL"/>
</xsl:attribute>
<xsl:attribute name="Company">
<xsl:value-of select="//Admin2/@EstimatorCompanyName"/>
</xsl:attribute>
<xsl:attribute name="BodyShopCity">
<xsl:value-of select="//Admin2/@BodyShopCity"/>
</xsl:attribute>
<xsl:attribute name="BodyShopName">
<xsl:value-of select="//Admin2/@BodyShopName"/>
</xsl:attribute>
<xsl:attribute name="Address">
<xsl:value-of select="//Admin2/@EstimatorAddr1"/>
</xsl:attribute>
<xsl:attribute name="Address2">
<xsl:value-of select="//Admin2/@EstimatorAddr2"/>
</xsl:attribute>
<xsl:attribute name="City">
<xsl:value-of select="//Admin2/@EstimatorCity"/>
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin2/@EstimatorState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<xsl:choose>
<xsl:when test="contains(//Admin2/@EstimatorZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin2/@EstimatorZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin2/@EstimatorZip, '-'))=4">
<xsl:value-of select="//Admin2/@EstimatorZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin2/@EstimatorZip)=9">
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin2/@EstimatorZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin2/@EstimatorZip)&gt;4">
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Country">
<xsl:value-of select="//Admin2/@EstimatorCountry"/>
</xsl:attribute>
<xsl:attribute name="Phone">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorPhone1Ext[. != '']">
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorPhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Phone2">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorPhone2Ext[. != '']">
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorPhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Fax">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorFaxExt[. != '']">
<xsl:value-of select="//Admin2/@EstimatorFax"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorFax"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Email">
<xsl:value-of select="//Admin2/@EstimatorEmail"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="RepairInformation">
<xsl:attribute name="VehicleDateIn">
<xsl:if test="string-length(//Admin2/@VehicleInDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@VehicleInDate, ' ')"/>
<xsl:if test="string-length(//Admin2/@VehicleInTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@VehicleInTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleInTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="EstimatedVehicleDateOut">
<xsl:if test="string-length(//Admin2/@TargetVehicleOutDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@TargetVehicleOutDate,' ')"/>
<xsl:if test="string-length(//Admin2/@TargetVehicleOutTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="VehicleDateOut">
<xsl:if test="string-length(//Admin2/@VehicleOutDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@VehicleOutDate, ' ')"/>
<xsl:if test="string-length(//Admin2/@VehicleOutTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="PartsList">
<xsl:element name="PartsList" >
<xsl:for-each select="Part">
<xsl:element name="Part" >
<!-- Part number translation rules -->
<xsl:variable name="OEMPartNumber">
<xsl:if test="substring(@TDPartNum, string-length(@TDPartNum) - 7) != ' GM PART'">
<xsl:value-of select="@TDPartNum" />
</xsl:if>
<xsl:if test="substring(@TDPartNum, string-length(@TDPartNum) - 7) = ' GM PART'">
<xsl:value-of select="substring-before(@TDPartNum,' GM PART')" />
</xsl:if>
</xsl:variable>
<xsl:variable name="AltPartNumber">
<xsl:value-of select="@AltPartNum"/>
</xsl:variable>
<xsl:variable name="PrimaryPartType">
<xsl:value-of select="@PartType"/>
</xsl:variable>
<xsl:variable name="PrimaryPartNumber">
<xsl:choose>
<xsl:when test="@PartType='PAN' or @PartType='PAG'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:when test="@PartType!='PAN' and @PartType!='PAG'">
<xsl:choose>
<xsl:when test="$AltPartNumber!=''">
<xsl:value-of select="$AltPartNumber"/>
</xsl:when>
<xsl:when test="$OEMPartNumber!=''">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:otherwise>Salvage or Assembly</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="SecondaryPartNumber">
<xsl:choose>
<xsl:when test="@PartType!='PAN'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="SecondaryPartType">
<xsl:choose>
<xsl:when test="@PartType='PAA'">PAN</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="TDPartNum">
<xsl:value-of select="$PrimaryPartNumber"/>
</xsl:attribute>
<xsl:attribute name="AltPartNum">
<xsl:value-of select="$SecondaryPartNumber" />
</xsl:attribute>
<xsl:attribute name="ExternalPartType">
<xsl:value-of select="$PrimaryPartType" />
</xsl:attribute>
<xsl:attribute name="ExternalAltPartType">
<xsl:value-of select="$SecondaryPartType" />
</xsl:attribute>
<xsl:attribute name="TDPartType">
<xsl:choose>
<xsl:when test="$PrimaryPartType='PAN' or $PrimaryPartType='PAP'">1</xsl:when>
<xsl:when test="$PrimaryPartType='PAA' or $PrimaryPartType='PATR'">2</xsl:when>
<xsl:when test="$PrimaryPartType='PAL'">3</xsl:when>
<xsl:when test="$PrimaryPartType='PAM' or $PrimaryPartType='PAC' or $PrimaryPartType='PAR'">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="AltPartType">
<xsl:choose>
<xsl:when test="$SecondaryPartType='PAN'">1</xsl:when>
<xsl:when test="$SecondaryPartType='PAA' or $SecondaryPartType='PATR'">2</xsl:when>
<xsl:when test="$SecondaryPartType='PAL'">3</xsl:when>
<xsl:when test="$SecondaryPartType='PAM' or $SecondaryPartType='PAC' or $SecondaryPartType='PAR'">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="TDPartDesc">
<xsl:value-of select="@TDPartDesc" />
</xsl:attribute>
<xsl:attribute name="TDEstimate">
<xsl:choose>
<xsl:when test="@PartType='PAN'">
<xsl:value-of select="@TDEstimate" />
</xsl:when>
<xsl:when test="@PartType='PAM'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:when test="@PartType='PAA'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:when test="@PartType='PAL'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@ActPrice" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="TDPartQty">
<xsl:value-of select="@TDPartQty" />
</xsl:attribute>
<xsl:attribute name="LineNumber">
<xsl:value-of select="@LineNumber" />
</xsl:attribute>
<xsl:attribute name="SequenceNumber">
<xsl:value-of select="@SequenceNumber" />
</xsl:attribute>
<xsl:attribute name="SupplLevel">
<xsl:choose>
<xsl:when test="@SupplementLevel = 'E'">0</xsl:when>
<xsl:when test="substring(@SupplementLevel, 1, 1) = 'S'">
<xsl:value-of select="substring(@SupplementLevel, 2)" />
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="LaborType">
<xsl:value-of select="@LaborType" />
</xsl:attribute>
<xsl:attribute name="LaborHours">
<xsl:value-of select="@LaborHours" />
</xsl:attribute>
<xsl:attribute name="OperationCode">
<xsl:value-of select="@LaborOp" />
</xsl:attribute>
<xsl:attribute name="PriceIncluded">
<xsl:value-of select="@PriceIncluded" />
</xsl:attribute>
<xsl:attribute name="MarkUp">
<xsl:value-of select="@MarkUp" />
</xsl:attribute>
<xsl:attribute name="CLPart">
<!-- CLPart is false if TRAN_CODE == 2 or TRAN_CODE == 3 -->
<!-- CLPart is false if PartType is not 'PAN','PAP','PAL','PAG', 'PAM', or 'PAA', or 'PAC' or 'PATR' -->
<!-- CLPart is false if LaborCode is only labor -->
<!-- CLPart is false if OpCode is not "Remove/Replace" or "Remove/Replace Partial" -->
<!-- If LaborOp is OP1, then allow the part to import CP 12/28/08 for Shop Client Release 4.1.4 -->
<xsl:choose>
<xsl:when test="@TransactionCode='3'">False</xsl:when>
<xsl:when test="@TransactionCode='1' or @TransactionCode=' ' or @TransactionCode='' or @TransactionCode='2'">
<xsl:choose>
<xsl:when test="@PartType='PAN' or @PartType='PAG' or @PartType='PAM' or @PartType='PAP' or @PartType='PAL' or @PartType='PAA' or @PartType='PAC' or @PartType='PATR'">
<xsl:choose>
<xsl:when test="@LaborType='LAD' or @LaborType='LAE' or @LaborType='LAU' or @LaborType='LAT'">False</xsl:when>
<xsl:otherwise>
<xsl:choose>
<!--xsl:when test="@LaborOp='OP0'">False</xsl:when -->
<xsl:when test="@LaborOp='OP1'">False</xsl:when>
<xsl:when test="@LaborOp='OP2'">False</xsl:when>
<xsl:when test="@LaborOp='OP3'">False</xsl:when>
<xsl:when test="@LaborOp='OP4'">False</xsl:when>
<xsl:when test="@LaborOp='OP5'">False</xsl:when>
<xsl:when test="@LaborOp='OP6'">False</xsl:when>
<xsl:when test="@LaborOp='OP7'">False</xsl:when>
<xsl:when test="@LaborOp='OP8'">False</xsl:when>
<xsl:when test="@LaborOp='OP9'">False</xsl:when>
<xsl:when test="@LaborOp='OP10'">False</xsl:when>
<xsl:when test="@LaborOp='OP13'">False</xsl:when>
<xsl:when test="@LaborOp='OP14'">False</xsl:when>
<xsl:when test="@LaborOp='OP15'">False</xsl:when>
<xsl:when test="@LaborOp='OP16'">False</xsl:when>
<xsl:otherwise>True</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<TranslationDescriptor>
<FileTranslations FormatName="ADP EMS" ElementName="Estimate" Description="Translation Descriptor for a ADP ShopLink Estimate, Version EMS 2.0">
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.env">
<DBFFileTranslation ID="ID1" ElementName="Envelope" Description="Envelope Table">
<DBFFieldSpec FieldName="RO_ID" Form="attribute" Name="RONum" FieldType="" Description="RO Number"/>
<DBFFieldSpec FieldName="UNQFILE_ID" Form="attribute" Name="UniqueFileID" FieldType="" Description="Unique File Identifier"/>
<DBFFieldSpec FieldName="ESTFILE_ID" Form="attribute" Name="EstimateFileID" FieldType="" Description="Estimate File Identifier"/>
<DBFFieldSpec FieldName="INCL_ADMIN" Form="attribute" Name="IncludesAdminInfo" FieldType="Boolean" Description="Includes Admin Info Flag"/>
<DBFFieldSpec FieldName="INCL_VEH" Form="attribute" Name="IncludesVehicleInfo" FieldType="Boolean" Description="Includes Vehicle Info Flag"/>
<DBFFieldSpec FieldName="INCL_EST" Form="attribute" Name="IncludesEstimateInfo" FieldType="Boolean" Description="Includes Estimate Info Flag"/>
<DBFFieldSpec FieldName="INCL_PROFL" Form="attribute" Name="IncludesProfileInfo" FieldType="Boolean" Description="Includes Profile Info Flag"/>
<DBFFieldSpec FieldName="INCL_TOTAL" Form="attribute" Name="IncludesTotalsInfo" FieldType="Boolean" Description="Includes Totals Info Flag"/>
<DBFFieldSpec FieldName="INCL_VENDR" Form="attribute" Name="IncludesVendorInfo" FieldType="Boolean" Description="Includes Vendor Info Flag"/>
<DBFFieldSpec FieldName="EMS_VER" Form="attribute" Name="EMSVersion" FieldType="" Description="EMS Version Number"/>
<DBFFieldSpec FieldName="SUPP_NO" Form="attribute" Name="SupplementNum" FieldType="" Description="Supplement Number"/>
<DBFFieldSpec FieldName="TRANS_TYPE" Form="attribute" Name="TransactionType" FieldType="" Description="Transaction Type"/>
<DBFFieldSpec FieldName="EST_SYSTEM" Form="attribute" Name="EstimatingSystem" FieldType="" Description="Estimating System Software"/>
<DBFFieldSpec FieldName="SW_VERSION" Form="attribute" Name="SoftwareVersion" FieldType="" Description="Software Version Identifier"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.LIN">
<DBFFileTranslation ID="ID2" ElementSetName="PartsList" ElementName="Part" Description="Parts List Table">
<DBFFieldSpec FieldName="OEM_PARTNO" Form="attribute" Name="TDPartNum" FieldType="" Description="Part Number"/>
<DBFFieldSpec FieldName="ALT_PARTNO" Form="attribute" Name="AltPartNum" FieldType="" Description="Alternate Part Number"/>
<DBFFieldSpec FieldName="ACT_PRICE" Form="attribute" Name="ActPrice" FieldType="" Description="Actual Part Price"/>
<DBFFieldSpec FieldName="LINE_DESC" Form="attribute" Name="TDPartDesc" FieldType="" Description="Part Description"/>
<DBFFieldSpec FieldName="DB_PRICE" Form="attribute" Name="TDEstimate" FieldType="" Description="DB_Price"/>
<DBFFieldSpec FieldName="PART_QTY" Form="attribute" Name="TDPartQty" FieldType="" Description="Part Quantity"/>
<DBFFieldSpec FieldName="PART_TYPE" Form="attribute" Name="PartType" FieldType="" Description="Part Type"/>
<DBFFieldSpec FieldName="MOD_LBR_TY" Form="attribute" Name="LaborType" FieldType="" Description="Labor Type"/>
<DBFFieldSpec FieldName="MOD_LB_HRS" Form="attribute" Name="LaborHours" FieldType="" Description="Labor Hours"/>
<DBFFieldSpec FieldName="LBR_OP" Form="attribute" Name="LaborOp" FieldType="" Description="Labor Op"/>
<DBFFieldSpec FieldName="LINE_NO" Form="attribute" Name="LineNumber" FieldType="" Description="Line number"/>
<DBFFieldSpec FieldName="UNQ_SEQ" Form="attribute" Name="SequenceNumber" FieldType="" Description=""/>
<DBFFieldSpec FieldName="LINE_IND" Form="attribute" Name="SupplementLevel" FieldType="" Description="Supplement Level"/>
<DBFFieldSpec FieldName="TRAN_CODE" Form="attribute" Name="TransactionCode" FieldType="" Description="Transaction Code"/>
<DBFFieldSpec FieldName="PRICE_INC" Form="attribute" Name="PriceIncluded" FieldType="" Description="Price Included"/>
<DBFFieldSpec FieldName="PRT_DSMK_P" Form="attribute" Name="MarkUp" FieldType="" Description="Price Mark up for non OEM parts"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.VEH">
<DBFFileTranslation ID="ID3" ElementName="Vehicle" Description="Vehicle Table">
<DBFFieldSpec FieldName="V_VIN" Form="attribute" Name="TransVIN" FieldType="" Description=""/>
<DBFFieldSpec FieldName="V_MODEL_YR" Form="attribute" Name="TransYear" FieldType="" Description="V_MODEL_YR"/>
<DBFFieldSpec FieldName="V_MAKEDESC" Form="attribute" Name="ManufName" FieldType="" Description="V_MAKEDESC"/>
<DBFFieldSpec FieldName="V_MAKECODE" Form="attribute" Name="ManufCode" FieldType="" Description="V_MAKECODE"/>
<DBFFieldSpec FieldName="V_MODEL" Form="attribute" Name="TransModel" FieldType="" Description="V_MODEL"/>
<DBFFieldSpec FieldName="V_MILEAGE" Form="attribute" Name="TransMileage" FieldType="" Description="V_MILEAGE"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.AD1">
<DBFFileTranslation ID="ID4" ElementName="Admin" Description="Administrative information">
<DBFFieldSpec FieldName="OWNR_LN" Form="attribute" Name="OwnerL" FieldType="" Description="Owner Lastname"/>
<DBFFieldSpec FieldName="OWNR_FN" Form="attribute" Name="OwnerF" FieldType="" Description="Owner Firstname"/>
<DBFFieldSpec FieldName="OWNR_CO_NM" Form="attribute" Name="OwnerCompanyName" FieldType="" Description="Owner Company Name"/>
<DBFFieldSpec FieldName="OWNR_TITLE" Form="attribute" Name="OwnerTitle" FieldType="" Description="Owner Title"/>
<DBFFieldSpec FieldName="OWNR_ADDR1" Form="attribute" Name="OwnerAddr1" FieldType="" Description="Owner Address Line 1"/>
<DBFFieldSpec FieldName="OWNR_ADDR2" Form="attribute" Name="OwnerAddr2" FieldType="" Description="Owner Address Line 2"/>
<DBFFieldSpec FieldName="OWNR_CITY" Form="attribute" Name="OwnerCity" FieldType="" Description="Owner City"/>
<DBFFieldSpec FieldName="OWNR_ST" Form="attribute" Name="OwnerState" FieldType="" Description="Owner State"/>
<DBFFieldSpec FieldName="OWNR_ZIP" Form="attribute" Name="OwnerZip" FieldType="" Description="Owner Zip"/>
<DBFFieldSpec FieldName="OWNR_CTRY" Form="attribute" Name="OwnerCountry" FieldType="" Description="Owner Country"/>
<DBFFieldSpec FieldName="OWNR_PH1" Form="attribute" Name="OwnerPhone1" FieldType="" Description="Owner Primary Phone"/>
<DBFFieldSpec FieldName="OWNR_PH1X" Form="attribute" Name="OwnerPhone1Ext" FieldType="" Description="Owner Primary Phone Extension"/>
<DBFFieldSpec FieldName="OWNR_PH2" Form="attribute" Name="OwnerPhone2" FieldType="" Description="Owner Secondary Phone"/>
<DBFFieldSpec FieldName="OWNR_PH2X" Form="attribute" Name="OwnerPhone2Ext" FieldType="" Description="Owner Secondary Phone Extension"/>
<DBFFieldSpec FieldName="OWNR_FAX" Form="attribute" Name="OwnerFax" FieldType="" Description="Owner Fax"/>
<DBFFieldSpec FieldName="OWNR_FAXX" Form="attribute" Name="OwnerFaxExt" FieldType="" Description="Owner Fax Extension"/>
<DBFFieldSpec FieldName="OWNR_EA" Form="attribute" Name="OwnerEmail" FieldType="" Description="Owner Email Address"/>
<DBFFieldSpec FieldName="INS_CO_NM" Form="attribute" Name="InsuranceCompanyName" FieldType="" Description="Insurance Company Name"/>
<DBFFieldSpec FieldName="INS_CO_ID" Form="attribute" Name="InsuranceCompanyID" FieldType="" Description="Insurance Company Identifier"/>
<DBFFieldSpec FieldName="INS_ADDR1" Form="attribute" Name="InsuranceAddr1" FieldType="" Description="Insurance Address Line 1"/>
<DBFFieldSpec FieldName="INS_ADDR2" Form="attribute" Name="InsuranceAddr2" FieldType="" Description="Insurance Address Line 2"/>
<DBFFieldSpec FieldName="INS_CITY" Form="attribute" Name="InsuranceCity" FieldType="" Description="Insurance City"/>
<DBFFieldSpec FieldName="INS_ST" Form="attribute" Name="InsuranceState" FieldType="" Description="Insurance State"/>
<DBFFieldSpec FieldName="INS_ZIP" Form="attribute" Name="InsuranceZip" FieldType="" Description="Insurance Zip"/>
<DBFFieldSpec FieldName="INS_CTRY" Form="attribute" Name="InsuranceCountry" FieldType="" Description="Insurance Country"/>
<DBFFieldSpec FieldName="INS_PH1" Form="attribute" Name="InsurancePhone1" FieldType="" Description="Insurance Primary Phone"/>
<DBFFieldSpec FieldName="INS_PH1X" Form="attribute" Name="InsurancePhone1Ext" FieldType="" Description="Insurance Primary Phone Extension"/>
<DBFFieldSpec FieldName="INS_PH2" Form="attribute" Name="InsurancePhone2" FieldType="" Description="Insurance Secondary Phone"/>
<DBFFieldSpec FieldName="INS_PH2X" Form="attribute" Name="InsurancePhone2Ext" FieldType="" Description="Insurance Secondary Phone Extension"/>
<DBFFieldSpec FieldName="INS_FAX" Form="attribute" Name="InsuranceFax" FieldType="" Description="Insurance Fax"/>
<DBFFieldSpec FieldName="INS_FAXX" Form="attribute" Name="InsuranceFaxExt" FieldType="" Description="Insurance Fax Extension"/>
<DBFFieldSpec FieldName="INS_EA" Form="attribute" Name="InsuranceEmail" FieldType="" Description="Insurance Email Address"/>
<DBFFieldSpec FieldName="INSD_LN" Form="attribute" Name="InsuranceLName" FieldType="" Description="Insurance Last Name"/>
<DBFFieldSpec FieldName="CLM_NO" Form="attribute" Name="ClaimNumber" FieldType="" Description="Claim Number"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.AD2">
<DBFFileTranslation ID="ID5" ElementName="Admin2" Description="Administrative information2">
<DBFFieldSpec FieldName="EST_CT_LN" Form="attribute" Name="EstimatorL" FieldType="" Description="Estimator Lastname"/>
<DBFFieldSpec FieldName="EST_CT_FN" Form="attribute" Name="EstimatorF" FieldType="" Description="Estimator Firstname"/>
<DBFFieldSpec FieldName="EST_CO_NM" Form="attribute" Name="EstimatorCompanyName" FieldType="" Description="Estimator Company Name"/>
<DBFFieldSpec FieldName="EST_CO_ID" Form="attribute" Name="EstimatorCompanyID" FieldType="" Description="Estimator Company Identifier"/>
<DBFFieldSpec FieldName="EST_ADDR1" Form="attribute" Name="EstimatorAddr1" FieldType="" Description="Estimator Address1"/>
<DBFFieldSpec FieldName="EST_ADDR2" Form="attribute" Name="EstimatorAddr2" FieldType="" Description="Estimator Address2"/>
<DBFFieldSpec FieldName="EST_CITY" Form="attribute" Name="EstimatorCity" FieldType="" Description="Estimator City"/>
<DBFFieldSpec FieldName="EST_ST" Form="attribute" Name="EstimatorState" FieldType="" Description="Estimator State"/>
<DBFFieldSpec FieldName="EST_ZIP" Form="attribute" Name="EstimatorZip" FieldType="" Description="Estimator Zip"/>
<DBFFieldSpec FieldName="EST_CTRY" Form="attribute" Name="EstimatorCountry" FieldType="" Description="Estimator Country"/>
<DBFFieldSpec FieldName="EST_PH1" Form="attribute" Name="EstimatorPhone1" FieldType="" Description="Estimator Primary Phone"/>
<DBFFieldSpec FieldName="EST_PH1X" Form="attribute" Name="EstimatorPhone1Ext" FieldType="" Description="Estimator Primary Phone Extension"/>
<DBFFieldSpec FieldName="EST_PH2" Form="attribute" Name="EstimatorPhone2" FieldType="" Description="Estimator Secondary Phone"/>
<DBFFieldSpec FieldName="EST_PH2X" Form="attribute" Name="EstimatorPhone2Ext" FieldType="" Description="Estimator Secondary Phone Extension"/>
<DBFFieldSpec FieldName="EST_FAX" Form="attribute" Name="EstimatorFax" FieldType="" Description="Estimator Fax"/>
<DBFFieldSpec FieldName="EST_FAXX" Form="attribute" Name="EstimatorFaxExt" FieldType="" Description="Estimator Fax Extension"/>
<DBFFieldSpec FieldName="EST_EA" Form="attribute" Name="EstimatorEmail" FieldType="" Description="Estimator Email Address"/>
<DBFFieldSpec FieldName="EST_LIC_NO" Form="attribute" Name="EstimatorLicenseNumber" FieldType="" Description="Estimator License Number"/>
<DBFFieldSpec FieldName="EST_FILENO" Form="attribute" Name="EstimatorFileNumber" FieldType="" Description="Estimator File Number"/>
<DBFFieldSpec FieldName="RO_IN_DATE" Form="attribute" Name="VehicleInDate" FieldType="" Description="Date arrived in shop"/>
<DBFFieldSpec FieldName="RO_IN_TIME" Form="attribute" Name="VehicleInTime" FieldType="" Description="Time arrived in shop"/>
<DBFFieldSpec FieldName="TAR_DATE" Form="attribute" Name="TargetVehicleOutDate" FieldType="" Description="Target date to be completed"/>
<DBFFieldSpec FieldName="TAR_TIME" Form="attribute" Name="TargetVehicleOutTime" FieldType="" Description="Target time to be completed"/>
<DBFFieldSpec FieldName="RO_CMPDATE" Form="attribute" Name="VehicleOutDate" FieldType="" Description="Date completed"/>
<DBFFieldSpec FieldName="RO_CMPTIME" Form="attribute" Name="VehicleOutTime" FieldType="" Description="Time completed"/>
<DBFFieldSpec FieldName="RF_CITY" Form="attribute" Name="BodyShopCity" FieldType="" Description="Body Shop City"/>
<DBFFieldSpec FieldName="RF_CO_NM" Form="attribute" Name="BodyShopName" FieldType="" Description="Body Shop Name"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.TTL">
<DBFFileTranslation ID="ID6" ElementName="Total" Description="Total Table">
<DBFFieldSpec FieldName="G_TTL_AMT" Form="attribute" Name="GrandTotalAmount" FieldType="" Description=""/>
</DBFFileTranslation>
</FileTranslation>
</FileTranslations>
<StyleSheetTranslation>
<StyleSheetURL>Audatex.xsl</StyleSheetURL>
</StyleSheetTranslation>
</TranslationDescriptor>

607
_reference/OEC/CCC.xsl Normal file
View File

@@ -0,0 +1,607 @@
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:template match="/">
<xsl:for-each select="//TranslatedData">
<xsl:element name="TranslatedData">
<xsl:attribute name="TranslationOutputFile">
<xsl:value-of select="@TranslationOutputFile"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="Details/@PrgID">
<xsl:copy-of select="Details" />
</xsl:when>
<xsl:otherwise>
<xsl:element name="Details">
<xsl:attribute name="PrgID">OECTrans.ImportTrans</xsl:attribute>
<xsl:for-each select="Details/@*">
<xsl:copy-of select="." />
</xsl:for-each>
<xsl:for-each select="Details/*">
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="Header">
<xsl:attribute name="RONum">
<xsl:value-of select="//Envelope/@RONum" />
</xsl:attribute>
<xsl:attribute name="OwnerFName">
<xsl:value-of select="//Admin/@OwnerF"/>
</xsl:attribute>
<xsl:attribute name="OwnerLName">
<xsl:value-of select="//Admin/@OwnerL"/>
</xsl:attribute>
<xsl:attribute name="VIN">
<xsl:value-of select="//Vehicle/@TransVIN" />
</xsl:attribute>
<xsl:attribute name="Mileage">
<xsl:value-of select="//Vehicle/@TransMileage" />
</xsl:attribute>
<xsl:attribute name="Year">
<xsl:value-of select="//Vehicle/@TransYear" />
</xsl:attribute>
<xsl:attribute name="Make">
<xsl:if test="//Vehicle/@ManufName[. != '']" >
<xsl:value-of select="//Vehicle/@ManufName" />
</xsl:if>
<xsl:if test="//Vehicle/@ManufName[. = '']" >
<xsl:value-of select="//Vehicle/@ManufCode" />
</xsl:if>
</xsl:attribute>
<xsl:attribute name="Model">
<xsl:value-of select="//Vehicle/@TransModel" />
</xsl:attribute>
<xsl:attribute name="Description">
<xsl:value-of select="//Vehicle/@TransYear" />
<xsl:text> </xsl:text>
<xsl:value-of select="//Vehicle/@ManufName" />
<xsl:text> </xsl:text>
<xsl:value-of select="//Vehicle/@TransModel" />
</xsl:attribute>
<xsl:attribute name="LastSupplLevel">
<xsl:choose>
<xsl:when test="//Envelope/@TransactionType = 'E'">0</xsl:when>
<xsl:when test="//Envelope/@TransactionType = 'S'">
<xsl:value-of select="substring(//Envelope/@SupplementNum, 2)" />
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="PartsList" />
<xsl:element name="Envelope">
<xsl:element name="Software">
<xsl:attribute name="Manifest">CCC.xml</xsl:attribute>
<xsl:attribute name="Descriptor">CCC.xsl</xsl:attribute>
<xsl:attribute name="System">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>
</xsl:attribute>
<xsl:attribute name="Version">
<xsl:value-of select="//Envelope/@SoftwareVersion"/>
</xsl:attribute>
<xsl:attribute name="SystemName">
<xsl:value-of select="//Envelope/@SystemName"/>
</xsl:attribute>
<xsl:attribute name="EstimateFileID">
<xsl:value-of select="//Envelope/@EstimateFileID"/>
</xsl:attribute>
<xsl:attribute name="UniqueFileID">
<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateID">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>-<xsl:value-of select="//Envelope/@SoftwareVersion"/>-<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateIDv2">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>-<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateFormatVersion">
<xsl:value-of select="//Envelope/@EMSVersion"/>
</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Totals">
<xsl:attribute name="GrandTotalAmount">
<xsl:value-of select="//Total/@GrandTotalAmount"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Administrative">
<xsl:element name="Owner">
<xsl:attribute name="FName">
<xsl:value-of select="//Admin/@OwnerF"/>
</xsl:attribute>
<xsl:attribute name="LName">
<xsl:value-of select="//Admin/@OwnerL"/>
</xsl:attribute>
<xsl:attribute name="Company">
<!--<xsl:value-of select="//Admin/@OwnerCompanyName"/>-->
</xsl:attribute>
<xsl:attribute name="Address">
<!--<xsl:value-of select="//Admin/@OwnerAddr1"/>-->
</xsl:attribute>
<xsl:attribute name="Address2">
<!--<xsl:value-of select="//Admin/@OwnerAddr2"/>-->
</xsl:attribute>
<xsl:attribute name="City">
<!--<xsl:value-of select="//Admin/@OwnerCity"/>-->
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin/@OwnerState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<!--<xsl:choose>
<xsl:when test="contains(//Admin/@OwnerZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin/@OwnerZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin/@OwnerZip, '-'))=4">
<xsl:value-of select="//Admin/@OwnerZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin/@OwnerZip)=9">
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin/@OwnerZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin/@OwnerZip)&gt;4">
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>
</xsl:when>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Country">
<!--<xsl:value-of select="//Admin/@OwnerCountry"/>-->
</xsl:attribute>
<xsl:attribute name="Phone">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerPhone1Ext[. != '']">
<xsl:value-of select="//Admin/@OwnerPhone1"/>&#32;x<xsl:value-of select="//Admin/@OwnerPhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerPhone1"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Phone2">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerPhone2Ext[. != '']">
<xsl:value-of select="//Admin/@OwnerPhone2"/>&#32;x<xsl:value-of select="//Admin/@OwnerPhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerPhone2"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Fax">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerFaxExt[. != '']">
<xsl:value-of select="//Admin/@OwnerFax"/>&#32;x<xsl:value-of select="//Admin/@OwnerFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerFax"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Email">
<!--<xsl:value-of select="//Admin/@OwnerEmail"/>-->
</xsl:attribute>
</xsl:element>
<xsl:element name="InsuranceCompany">
<xsl:attribute name="Id">
<xsl:value-of select="//Admin/@InsuranceCompanyID"/>
</xsl:attribute>
<xsl:attribute name="Name">
<xsl:value-of select="//Admin/@InsuranceCompanyName"/>
</xsl:attribute>
<xsl:attribute name="Address">
<xsl:value-of select="//Admin/@InsuranceAddr1"/>
</xsl:attribute>
<xsl:attribute name="Address2">
<xsl:value-of select="//Admin/@InsuranceAddr2"/>
</xsl:attribute>
<xsl:attribute name="City">
<xsl:value-of select="//Admin/@InsuranceCity"/>
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin/@InsuranceState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<xsl:choose>
<xsl:when test="contains(//Admin/@InsuranceZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin/@InsuranceZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin/@InsuranceZip, '-'))=4">
<xsl:value-of select="//Admin/@InsuranceZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin/@InsuranceZip)=9">
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin/@InsuranceZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin/@InsuranceZip)&gt;4">
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Country">
<xsl:value-of select="//Admin/@InsuranceCountry"/>
</xsl:attribute>
<xsl:attribute name="Phone">
<xsl:choose>
<xsl:when test="//Admin/@InsurancePhone1Ext[. != '']">
<xsl:value-of select="//Admin/@InsurancePhone1"/>&#32;x<xsl:value-of select="//Admin/@InsurancePhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsurancePhone1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Phone2">
<xsl:choose>
<xsl:when test="//Admin/@InsurancePhone2Ext[. != '']">
<xsl:value-of select="//Admin/@InsurancePhone2"/>&#32;x<xsl:value-of select="//Admin/@InsurancePhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsurancePhone2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Fax">
<xsl:choose>
<xsl:when test="//Admin/@InsuranceFaxExt[. != '']">
<xsl:value-of select="//Admin/@InsuranceFax"/>&#32;x<xsl:value-of select="//Admin/@InsuranceFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsuranceFax"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Email">
<xsl:value-of select="//Admin/@InsuranceEmail"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Insured">
<xsl:attribute name="LastName">
<xsl:value-of select="//Admin/@InsuranceLName" />
</xsl:attribute>
</xsl:element>
<xsl:element name="Claim">
<xsl:attribute name="Number">
<xsl:value-of select="//Admin/@ClaimNumber"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Estimator">
<xsl:attribute name="FName">
<xsl:value-of select="//Admin2/@EstimatorF"/>
</xsl:attribute>
<xsl:attribute name="LName">
<xsl:value-of select="//Admin2/@EstimatorL"/>
</xsl:attribute>
<xsl:attribute name="Company">
<xsl:value-of select="//Admin2/@EstimatorCompanyName"/>
</xsl:attribute>
<xsl:attribute name="Address">
<xsl:value-of select="//Admin2/@EstimatorAddr1"/>
</xsl:attribute>
<xsl:attribute name="Address2">
<xsl:value-of select="//Admin2/@EstimatorAddr2"/>
</xsl:attribute>
<xsl:attribute name="City">
<xsl:value-of select="//Admin2/@EstimatorCity"/>
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin2/@EstimatorState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<xsl:choose>
<xsl:when test="contains(//Admin2/@EstimatorZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin2/@EstimatorZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin2/@EstimatorZip, '-'))=4">
<xsl:value-of select="//Admin2/@EstimatorZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin2/@EstimatorZip)=9">
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin2/@EstimatorZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin2/@EstimatorZip)&gt;4">
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Country">
<xsl:value-of select="//Admin2/@EstimatorCountry"/>
</xsl:attribute>
<xsl:attribute name="Phone">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorPhone1Ext[. != '']">
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorPhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Phone2">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorPhone2Ext[. != '']">
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorPhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Fax">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorFaxExt[. != '']">
<xsl:value-of select="//Admin2/@EstimatorFax"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorFax"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Email">
<xsl:value-of select="//Admin2/@EstimatorEmail"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="RepairInformation">
<xsl:attribute name="VehicleDateIn">
<xsl:if test="string-length(//Admin2/@VehicleInDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@VehicleInDate, ' ')"/>
<xsl:if test="string-length(//Admin2/@VehicleInTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@VehicleInTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleInTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="EstimatedVehicleDateOut">
<xsl:if test="string-length(//Admin2/@TargetVehicleOutDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@TargetVehicleOutDate,' ')"/>
<xsl:if test="string-length(//Admin2/@TargetVehicleOutTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="VehicleDateOut">
<xsl:if test="string-length(//Admin2/@VehicleOutDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@VehicleOutDate, ' ')"/>
<xsl:if test="string-length(//Admin2/@VehicleOutTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="PartsList">
<xsl:element name="PartsList" >
<xsl:for-each select="Part">
<xsl:element name="Part" >
<!-- Part number translation rules -->
<xsl:variable name="OEMPartNumber">
<xsl:if test="substring(@TDPartNum, string-length(@TDPartNum) - 7) != ' GM PART'">
<xsl:value-of select="@TDPartNum" />
</xsl:if>
<xsl:if test="substring(@TDPartNum, string-length(@TDPartNum) - 7) = ' GM PART'">
<xsl:value-of select="substring-before(@TDPartNum,' GM PART')" />
</xsl:if>
</xsl:variable>
<xsl:variable name="AltPartNumber">
<xsl:value-of select="@AltPartNum"/>
</xsl:variable>
<xsl:variable name="PrimaryPartType">
<!-- RoseP modified to convert PAP to PAN -->
<!--<xsl:value-of select="@PartType"/>-->
<xsl:choose>
<xsl:when test="@PartType='PAP'">PAN</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@PartType"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="PrimaryPartNumber">
<xsl:choose>
<xsl:when test="@PartType='PAN'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:when test="@PartType='PAA'">
<xsl:value-of select="$AltPartNumber"/>
</xsl:when>
<xsl:when test="@PartType='PAL'">
<xsl:choose>
<xsl:when test="$AltPartNumber!=''">
<xsl:value-of select="$AltPartNumber"/>
</xsl:when>
<xsl:when test="$OEMPartNumber!=''">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:otherwise>Salvage or Assembly</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="@PartType='PAG'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<!-- RoseP added Dec 08, 06 -->
<xsl:when test="@PartType='PAP'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:when test="@PartType='PAM'">
<xsl:choose>
<xsl:when test="$AltPartNumber!=''">
<xsl:value-of select="$AltPartNumber"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$OEMPartNumber"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="SecondaryPartNumber">
<xsl:choose>
<xsl:when test="@PartType='PAA'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:when test="@PartType='PAM'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="SecondaryPartType">
<xsl:choose>
<xsl:when test="@PartType='PAA'">PAN</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="TDPartNum">
<xsl:value-of select="$PrimaryPartNumber"/>
</xsl:attribute>
<xsl:attribute name="AltPartNum">
<xsl:value-of select="$SecondaryPartNumber" />
</xsl:attribute>
<xsl:attribute name="ExternalPartType">
<xsl:value-of select="$PrimaryPartType" />
</xsl:attribute>
<xsl:attribute name="ExternalAltPartType">
<xsl:value-of select="$SecondaryPartType" />
</xsl:attribute>
<xsl:attribute name="TDPartType">
<xsl:choose>
<xsl:when test="$PrimaryPartType='PAN'">1</xsl:when>
<xsl:when test="$PrimaryPartType='PAA'">2</xsl:when>
<xsl:when test="$PrimaryPartType='PAL'">3</xsl:when>
<xsl:when test="$PrimaryPartType='PAM'">4</xsl:when>
<xsl:when test="$PrimaryPartType='PAR'">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="AltPartType">
<xsl:choose>
<xsl:when test="$SecondaryPartType='PAN'">1</xsl:when>
<xsl:when test="$SecondaryPartType='PAA'">2</xsl:when>
<xsl:when test="$SecondaryPartType='PAL'">3</xsl:when>
<xsl:when test="$SecondaryPartType='PAM'">4</xsl:when>
<xsl:when test="$SecondaryPartType='PAR'">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="TDPartDesc">
<xsl:value-of select="@TDPartDesc" />
</xsl:attribute>
<xsl:attribute name="TDLineRef">
<xsl:value-of select="@TDLineRef" />
</xsl:attribute>
<xsl:attribute name="TDEstimate">
<xsl:choose>
<xsl:when test="@PartType='PAN'">
<xsl:value-of select="@TDEstimate" />
</xsl:when>
<xsl:when test="@PartType='PAM'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:when test="@PartType='PAA'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:when test="@PartType='PAL'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@ActPrice" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="TDPartQty">
<xsl:value-of select="@TDPartQty" />
</xsl:attribute>
<xsl:attribute name="LineNumber">
<xsl:value-of select="@LineNumber" />
</xsl:attribute>
<xsl:attribute name="SequenceNumber">
<xsl:value-of select="@SequenceNumber" />
</xsl:attribute>
<xsl:attribute name="SupplLevel">
<xsl:choose>
<xsl:when test="@SupplementLevel = 'E01'">0</xsl:when>
<xsl:when test="substring(@SupplementLevel, 1, 1) = 'S'">
<xsl:value-of select="substring(@SupplementLevel, 2)" />
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="LaborType">
<xsl:value-of select="@LaborType" />
</xsl:attribute>
<xsl:attribute name="LaborHours">
<xsl:value-of select="@LaborHours" />
</xsl:attribute>
<xsl:attribute name="OperationCode">
<xsl:value-of select="@LaborOp" />
</xsl:attribute>
<xsl:attribute name="CLPart">
<!-- CLPart is false if TRAN_CODE == 2 or TRAN_CODE == 3 -->
<!-- CLPart is false if PartType is not 'PAN','PAP','PAL','PAG', 'PAM', 'PAA', 'PAO', 'PAR', or '' -->
<!-- CLPart is false if LaborCode is only labor -->
<!-- CLPart is false if OpCode is not "Remove/Replace" or "Remove/Replace Partial" or "Repair, Partial" -->
<xsl:choose>
<xsl:when test="@TransactionCode='3'">False</xsl:when>
<xsl:when test="@TransactionCode='1' or @TransactionCode ='2'">
<xsl:choose>
<xsl:when test="@PartType='PAN' or @PartType='PAG' or @PartType='PAM' or @PartType='PAP' or @PartType='PAL' or @PartType='PAA' or @PartType='PAO' or @PartType='PAR' or @PartType=''" >
<!-- we now handle blank part types-->
<xsl:choose>
<xsl:when test="@LaborType='LAD' or @LaborType='LAE' or @LaborType='LAU' or @LaborType='LAT'">False</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@LaborOp=''">False</xsl:when>
<!--Needed for Blank Part Type-->
<xsl:when test="@LaborOp='OP0'">False</xsl:when>
<xsl:when test="@LaborOp='OP1'">False</xsl:when>
<xsl:when test="@LaborOp='OP2'">False</xsl:when>
<xsl:when test="@LaborOp='OP3'">False</xsl:when>
<xsl:when test="@LaborOp='OP4'">False</xsl:when>
<xsl:when test="@LaborOp='OP5'">False</xsl:when>
<xsl:when test="@LaborOp='OP6'">False</xsl:when>
<xsl:when test="@LaborOp='OP7'">False</xsl:when>
<xsl:when test="@LaborOp='OP8'">False</xsl:when>
<xsl:when test="@LaborOp='OP9'">False</xsl:when>
<!-- RoseP removed OP10 Dec 08, 06 -->
<!-- <xsl:when test="@LaborOp='OP10'">False</xsl:when> -->
<xsl:when test="@LaborOp='OP13'">False</xsl:when>
<xsl:when test="@LaborOp='OP14'">False</xsl:when>
<xsl:when test="@LaborOp='OP15'">False</xsl:when>
<xsl:when test="@LaborOp='OP16'">False</xsl:when>
<xsl:otherwise>True</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<TranslationDescriptor>
<FileTranslations FormatName="CCC" ElementName="Estimate" Description="Translation Descriptor for a CCC Estimate, Version 2.0">
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.env">
<DBFFileTranslation ID="ID1" ElementName="Envelope" Description="Envelope Table">
<DBFFieldSpec FieldName="RO_ID" Form="attribute" Name="RONum" FieldType="" Description="RO Number"/>
<DBFFieldSpec FieldName="UNQFILE_ID" Form="attribute" Name="UniqueFileID" FieldType="" Description="Unique File Identifier"/>
<DBFFieldSpec FieldName="ESTFILE_ID" Form="attribute" Name="EstimateFileID" FieldType="" Description="Estimate File Identifier"/>
<DBFFieldSpec FieldName="INCL_ADMIN" Form="attribute" Name="IncludesAdminInfo" FieldType="Boolean" Description="Includes Admin Info Flag"/>
<DBFFieldSpec FieldName="INCL_VEH" Form="attribute" Name="IncludesVehicleInfo" FieldType="Boolean" Description="Includes Vehicle Info Flag"/>
<DBFFieldSpec FieldName="INCL_EST" Form="attribute" Name="IncludesEstimateInfo" FieldType="Boolean" Description="Includes Estimate Info Flag"/>
<DBFFieldSpec FieldName="INCL_PROFL" Form="attribute" Name="IncludesProfileInfo" FieldType="Boolean" Description="Includes Profile Info Flag"/>
<DBFFieldSpec FieldName="INCL_TOTAL" Form="attribute" Name="IncludesTotalsInfo" FieldType="Boolean" Description="Includes Totals Info Flag"/>
<DBFFieldSpec FieldName="INCL_VENDR" Form="attribute" Name="IncludesVendorInfo" FieldType="Boolean" Description="Includes Vendor Info Flag"/>
<DBFFieldSpec FieldName="EMS_VER" Form="attribute" Name="EMSVersion" FieldType="" Description="EMS Version Number"/>
<DBFFieldSpec FieldName="SUPP_NO" Form="attribute" Name="SupplementNum" FieldType="" Description="Supplement Number"/>
<DBFFieldSpec FieldName="TRANS_TYPE" Form="attribute" Name="TransactionType" FieldType="" Description="Transaction Type"/>
<DBFFieldSpec FieldName="EST_SYSTEM" Form="attribute" Name="EstimatingSystem" FieldType="" Description="Estimating System Software"/>
<DBFFieldSpec FieldName="SW_VERSION" Form="attribute" Name="SoftwareVersion" FieldType="" Description="Software Version Identifier"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.LIN">
<DBFFileTranslation ID="ID2" ElementSetName="PartsList" ElementName="Part" Description="Parts List Table">
<DBFFieldSpec FieldName="OEM_PARTNO" Form="attribute" Name="TDPartNum" FieldType="" Description="Part Number"/>
<DBFFieldSpec FieldName="ALT_PARTNO" Form="attribute" Name="AltPartNum" FieldType="" Description="Alternate Part Number"/>
<DBFFieldSpec FieldName="ACT_PRICE" Form="attribute" Name="ActPrice" FieldType="" Description="Actual Part Price"/>
<DBFFieldSpec FieldName="LINE_DESC" Form="attribute" Name="TDPartDesc" FieldType="" Description="Part Description"/>
<DBFFieldSpec FieldName="DB_PRICE" Form="attribute" Name="TDEstimate" FieldType="" Description="DB_Price"/>
<DBFFieldSpec FieldName="PART_QTY" Form="attribute" Name="TDPartQty" FieldType="" Description="PART_QTY"/>
<DBFFieldSpec FieldName="LINE_NO" Form="attribute" Name="LineNumber" FieldType="" Description=""/>
<DBFFieldSpec FieldName="UNQ_SEQ" Form="attribute" Name="SequenceNumber" FieldType="" Description=""/>
<DBFFieldSpec FieldName="PART_TYPE" Form="attribute" Name="PartType" FieldType="" Description="Part Type"/>
<DBFFieldSpec FieldName="MOD_LBR_TY" Form="attribute" Name="LaborType" FieldType="" Description="Labor Type"/>
<DBFFieldSpec FieldName="MOD_LB_HRS" Form="attribute" Name="LaborHours" FieldType="" Description="Labor Hours"/>
<DBFFieldSpec FieldName="LBR_OP" Form="attribute" Name="LaborOp" FieldType="" Description="Labor Op"/>
<DBFFieldSpec FieldName="LINE_IND" Form="attribute" Name="SupplementLevel" FieldType="" Description="Supplement Level"/>
<DBFFieldSpec FieldName="TRAN_CODE" Form="attribute" Name="TransactionCode" FieldType="" Description="Transaction Code"/>
<DBFFieldSpec FieldName="LINE_REF" Form="attribute" Name="TDLineRef" FieldType="" Description="Line Reference Number"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.VEH">
<DBFFileTranslation ID="ID3" ElementName="Vehicle" Description="Vehicle Table">
<DBFFieldSpec FieldName="V_VIN" Form="attribute" Name="TransVIN" FieldType="" Description="V_VIN"/>
<DBFFieldSpec FieldName="V_MODEL_YR" Form="attribute" Name="TransYear" FieldType="" Description="V_MODEL_YR"/>
<DBFFieldSpec FieldName="V_MAKEDESC" Form="attribute" Name="ManufName" FieldType="" Description="V_MAKEDESC"/>
<DBFFieldSpec FieldName="V_MAKECODE" Form="attribute" Name="ManufCode" FieldType="" Description="V_MAKECODE"/>
<DBFFieldSpec FieldName="V_MODEL" Form="attribute" Name="TransModel" FieldType="" Description="V_MODEL"/>
<DBFFieldSpec FieldName="V_MILEAGE" Form="attribute" Name="TransMileage" FieldType="" Description="V_MILEAGE"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.AD1">
<DBFFileTranslation ID="ID4" ElementName="Admin" Description="Administrative information">
<DBFFieldSpec FieldName="OWNR_LN" Form="attribute" Name="OwnerL" FieldType="" Description="Owner Lastname"/>
<DBFFieldSpec FieldName="OWNR_FN" Form="attribute" Name="OwnerF" FieldType="" Description="Owner Firstname"/>
<DBFFieldSpec FieldName="OWNR_CO_NM" Form="attribute" Name="OwnerCompanyName" FieldType="" Description="Owner Company Name"/>
<DBFFieldSpec FieldName="OWNR_TITLE" Form="attribute" Name="OwnerTitle" FieldType="" Description="Owner Title"/>
<DBFFieldSpec FieldName="OWNR_ADDR1" Form="attribute" Name="OwnerAddr1" FieldType="" Description="Owner Address Line 1"/>
<DBFFieldSpec FieldName="OWNR_ADDR2" Form="attribute" Name="OwnerAddr2" FieldType="" Description="Owner Address Line 2"/>
<DBFFieldSpec FieldName="OWNR_CITY" Form="attribute" Name="OwnerCity" FieldType="" Description="Owner City"/>
<DBFFieldSpec FieldName="OWNR_ST" Form="attribute" Name="OwnerState" FieldType="" Description="Owner State"/>
<DBFFieldSpec FieldName="OWNR_ZIP" Form="attribute" Name="OwnerZip" FieldType="" Description="Owner Zip"/>
<DBFFieldSpec FieldName="OWNR_CTRY" Form="attribute" Name="OwnerCountry" FieldType="" Description="Owner Country"/>
<DBFFieldSpec FieldName="OWNR_PH1" Form="attribute" Name="OwnerPhone1" FieldType="" Description="Owner Primary Phone"/>
<DBFFieldSpec FieldName="OWNR_PH1X" Form="attribute" Name="OwnerPhone1Ext" FieldType="" Description="Owner Primary Phone Extension"/>
<DBFFieldSpec FieldName="OWNR_PH2" Form="attribute" Name="OwnerPhone2" FieldType="" Description="Owner Secondary Phone"/>
<DBFFieldSpec FieldName="OWNR_PH2X" Form="attribute" Name="OwnerPhone2Ext" FieldType="" Description="Owner Secondary Phone Extension"/>
<DBFFieldSpec FieldName="OWNR_FAX" Form="attribute" Name="OwnerFax" FieldType="" Description="Owner Fax"/>
<DBFFieldSpec FieldName="OWNR_FAXX" Form="attribute" Name="OwnerFaxExt" FieldType="" Description="Owner Fax Extension"/>
<DBFFieldSpec FieldName="OWNR_EA" Form="attribute" Name="OwnerEmail" FieldType="" Description="Owner Email Address"/>
<DBFFieldSpec FieldName="INS_CO_NM" Form="attribute" Name="InsuranceCompanyName" FieldType="" Description="Insurance Company Name"/>
<DBFFieldSpec FieldName="INS_CO_ID" Form="attribute" Name="InsuranceCompanyID" FieldType="" Description="Insurance Company Identifier"/>
<DBFFieldSpec FieldName="INS_ADDR1" Form="attribute" Name="InsuranceAddr1" FieldType="" Description="Insurance Address Line 1"/>
<DBFFieldSpec FieldName="INS_ADDR2" Form="attribute" Name="InsuranceAddr2" FieldType="" Description="Insurance Address Line 2"/>
<DBFFieldSpec FieldName="INS_CITY" Form="attribute" Name="InsuranceCity" FieldType="" Description="Insurance City"/>
<DBFFieldSpec FieldName="INS_ST" Form="attribute" Name="InsuranceState" FieldType="" Description="Insurance State"/>
<DBFFieldSpec FieldName="INS_ZIP" Form="attribute" Name="InsuranceZip" FieldType="" Description="Insurance Zip"/>
<DBFFieldSpec FieldName="INS_CTRY" Form="attribute" Name="InsuranceCountry" FieldType="" Description="Insurance Country"/>
<DBFFieldSpec FieldName="INS_PH1" Form="attribute" Name="InsurancePhone1" FieldType="" Description="Insurance Primary Phone"/>
<DBFFieldSpec FieldName="INS_PH1X" Form="attribute" Name="InsurancePhone1Ext" FieldType="" Description="Insurance Primary Phone Extension"/>
<DBFFieldSpec FieldName="INS_PH2" Form="attribute" Name="InsurancePhone2" FieldType="" Description="Insurance Secondary Phone"/>
<DBFFieldSpec FieldName="INS_PH2X" Form="attribute" Name="InsurancePhone2Ext" FieldType="" Description="Insurance Secondary Phone Extension"/>
<DBFFieldSpec FieldName="INS_FAX" Form="attribute" Name="InsuranceFax" FieldType="" Description="Insurance Fax"/>
<DBFFieldSpec FieldName="INS_FAXX" Form="attribute" Name="InsuranceFaxExt" FieldType="" Description="Insurance Fax Extension"/>
<DBFFieldSpec FieldName="INS_EA" Form="attribute" Name="InsuranceEmail" FieldType="" Description="Insurance Email Address"/>
<DBFFieldSpec FieldName="INSD_LN" Form="attribute" Name="InsuranceLName" FieldType="" Description="Insurance Last Name"/>
<DBFFieldSpec FieldName="CLM_NO" Form="attribute" Name="ClaimNumber" FieldType="" Description="Claim Number"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.AD2">
<DBFFileTranslation ID="ID5" ElementName="Admin2" Description="Administrative information2">
<DBFFieldSpec FieldName="EST_CT_LN" Form="attribute" Name="EstimatorL" FieldType="" Description="Estimator Lastname"/>
<DBFFieldSpec FieldName="EST_CT_FN" Form="attribute" Name="EstimatorF" FieldType="" Description="Estimator Firstname"/>
<DBFFieldSpec FieldName="EST_CO_NM" Form="attribute" Name="EstimatorCompanyName" FieldType="" Description="Estimator Company Name"/>
<DBFFieldSpec FieldName="EST_CO_ID" Form="attribute" Name="EstimatorCompanyID" FieldType="" Description="Estimator Company Identifier"/>
<DBFFieldSpec FieldName="EST_ADDR1" Form="attribute" Name="EstimatorAddr1" FieldType="" Description="Estimator Address1"/>
<DBFFieldSpec FieldName="EST_ADDR2" Form="attribute" Name="EstimatorAddr2" FieldType="" Description="Estimator Address2"/>
<DBFFieldSpec FieldName="EST_CITY" Form="attribute" Name="EstimatorCity" FieldType="" Description="Estimator City"/>
<DBFFieldSpec FieldName="EST_ST" Form="attribute" Name="EstimatorState" FieldType="" Description="Estimator State"/>
<DBFFieldSpec FieldName="EST_ZIP" Form="attribute" Name="EstimatorZip" FieldType="" Description="Estimator Zip"/>
<DBFFieldSpec FieldName="EST_CTRY" Form="attribute" Name="EstimatorCountry" FieldType="" Description="Estimator Country"/>
<DBFFieldSpec FieldName="EST_PH1" Form="attribute" Name="EstimatorPhone1" FieldType="" Description="Estimator Primary Phone"/>
<DBFFieldSpec FieldName="EST_PH1X" Form="attribute" Name="EstimatorPhone1Ext" FieldType="" Description="Estimator Primary Phone Extension"/>
<DBFFieldSpec FieldName="EST_PH2" Form="attribute" Name="EstimatorPhone2" FieldType="" Description="Estimator Secondary Phone"/>
<DBFFieldSpec FieldName="EST_PH2X" Form="attribute" Name="EstimatorPhone2Ext" FieldType="" Description="Estimator Secondary Phone Extension"/>
<DBFFieldSpec FieldName="EST_FAX" Form="attribute" Name="EstimatorFax" FieldType="" Description="Estimator Fax"/>
<DBFFieldSpec FieldName="EST_FAXX" Form="attribute" Name="EstimatorFaxExt" FieldType="" Description="Estimator Fax Extension"/>
<DBFFieldSpec FieldName="EST_EA" Form="attribute" Name="EstimatorEmail" FieldType="" Description="Estimator Email Address"/>
<DBFFieldSpec FieldName="EST_LIC_NO" Form="attribute" Name="EstimatorLicenseNumber" FieldType="" Description="Estimator License Number"/>
<DBFFieldSpec FieldName="EST_FILENO" Form="attribute" Name="EstimatorFileNumber" FieldType="" Description="Estimator File Number"/>
<DBFFieldSpec FieldName="RO_IN_DATE" Form="attribute" Name="VehicleInDate" FieldType="" Description="Date arrived in shop"/>
<DBFFieldSpec FieldName="RO_IN_TIME" Form="attribute" Name="VehicleInTime" FieldType="" Description="Time arrived in shop"/>
<DBFFieldSpec FieldName="TAR_DATE" Form="attribute" Name="TargetVehicleOutDate" FieldType="" Description="Target date to be completed"/>
<DBFFieldSpec FieldName="TAR_TIME" Form="attribute" Name="TargetVehicleOutTime" FieldType="" Description="Target time to be completed"/>
<DBFFieldSpec FieldName="RO_CMPDATE" Form="attribute" Name="VehicleOutDate" FieldType="" Description="Date completed"/>
<DBFFieldSpec FieldName="RO_CMPTIME" Form="attribute" Name="VehicleOutTime" FieldType="" Description="Time completed"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.TTL">
<DBFFileTranslation ID="ID6" ElementName="Total" Description="Total Table">
<DBFFieldSpec FieldName="G_TTL_AMT" Form="attribute" Name="GrandTotalAmount" FieldType="" Description=""/>
</DBFFileTranslation>
</FileTranslation>
</FileTranslations>
<StyleSheetTranslation>
<StyleSheetURL>ccc.xsl</StyleSheetURL>
</StyleSheetTranslation>
</TranslationDescriptor>

580
_reference/OEC/Mitchell.xsl Normal file
View File

@@ -0,0 +1,580 @@
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:template match="/">
<xsl:for-each select="//TranslatedData">
<xsl:element name="TranslatedData">
<xsl:attribute name="TranslationOutputFile">
<xsl:value-of select="@TranslationOutputFile"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="Details/@PrgID">
<xsl:copy-of select="Details" />
</xsl:when>
<xsl:otherwise>
<xsl:element name="Details">
<xsl:attribute name="PrgID">OECTrans.ImportTrans</xsl:attribute>
<xsl:for-each select="Details/@*">
<xsl:copy-of select="." />
</xsl:for-each>
<xsl:for-each select="Details/*">
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="Header">
<xsl:attribute name="RONum">
<xsl:value-of select="//Envelope/@RONum" />
</xsl:attribute>
<xsl:attribute name="OwnerFName">
<xsl:value-of select="//Admin/@OwnerF"/>
</xsl:attribute>
<xsl:attribute name="OwnerLName">
<xsl:value-of select="//Admin/@OwnerL"/>
</xsl:attribute>
<xsl:attribute name="VIN">
<xsl:value-of select="//Vehicle/@TransVIN" />
</xsl:attribute>
<xsl:attribute name="Mileage">
<xsl:value-of select="//Vehicle/@TransMileage" />
</xsl:attribute>
<xsl:attribute name="Year">
<xsl:value-of select="//Vehicle/@TransYear" />
</xsl:attribute>
<xsl:attribute name="Make">
<xsl:if test="//Vehicle/@ManufName[. != '']" >
<xsl:value-of select="//Vehicle/@ManufName" />
</xsl:if>
<xsl:if test="//Vehicle/@ManufName[. = '']" >
<xsl:value-of select="//Vehicle/@ManufCode" />
</xsl:if>
</xsl:attribute>
<xsl:attribute name="Model">
<xsl:value-of select="//Vehicle/@TransModel" />
</xsl:attribute>
<xsl:attribute name="Description">
<xsl:value-of select="//Vehicle/@TransYear" />
<xsl:text> </xsl:text>
<xsl:value-of select="//Vehicle/@ManufName" />
<xsl:text> </xsl:text>
<xsl:value-of select="//Vehicle/@TransModel" />
</xsl:attribute>
<xsl:attribute name="LastSupplLevel">
<xsl:choose>
<xsl:when test="string-length(//Envelope/@SupplementNum) > 0">
<xsl:value-of select="//Envelope/@SupplementNum" />
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:apply-templates select="PartsList" />
<xsl:element name="Envelope">
<xsl:element name="Software">
<xsl:attribute name="Manifest">Mitchell.xml</xsl:attribute>
<xsl:attribute name="Descriptor">Mitchell.xsl</xsl:attribute>
<xsl:attribute name="System">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>
</xsl:attribute>
<xsl:attribute name="Version">
<xsl:value-of select="//Envelope/@SoftwareVersion"/>
</xsl:attribute>
<xsl:attribute name="SystemName">
<xsl:value-of select="//Envelope/@SystemName"/>
</xsl:attribute>
<xsl:attribute name="EstimateFileID">
<xsl:value-of select="//Envelope/@EstimateFileID"/>
</xsl:attribute>
<xsl:attribute name="UniqueFileID">
<xsl:value-of select="//Envelope/@UniqueFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateID">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>-<xsl:value-of select="//Envelope/@SoftwareVersion"/>-<xsl:value-of select="//Envelope/@EstimateFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateIDv2">
<xsl:value-of select="//Envelope/@EstimatingSystem"/>-<xsl:value-of select="//Envelope/@EstimateFileID"/>
</xsl:attribute>
<xsl:attribute name="EstimateFormatVersion">
<xsl:value-of select="//Envelope/@EMSVersion"/>
</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="Totals">
<xsl:attribute name="GrandTotalAmount">
<xsl:value-of select="//Total/@GrandTotalAmount"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Administrative">
<xsl:element name="Owner">
<xsl:attribute name="FName">
<xsl:value-of select="//Admin/@OwnerF"/>
</xsl:attribute>
<xsl:attribute name="LName">
<xsl:value-of select="//Admin/@OwnerL"/>
</xsl:attribute>
<xsl:attribute name="Company">
<!--<xsl:value-of select="//Admin/@OwnerCompanyName"/>-->
</xsl:attribute>
<xsl:attribute name="Address">
<!--<xsl:value-of select="//Admin/@OwnerAddr1"/>-->
</xsl:attribute>
<xsl:attribute name="Address2">
<!--<xsl:value-of select="//Admin/@OwnerAddr2"/>-->
</xsl:attribute>
<xsl:attribute name="City">
<!--<xsl:value-of select="//Admin/@OwnerCity"/>-->
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin/@OwnerState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<!--<xsl:choose>
<xsl:when test="contains(//Admin/@OwnerZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin/@OwnerZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin/@OwnerZip, '-'))=4">
<xsl:value-of select="//Admin/@OwnerZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin/@OwnerZip)=9">
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin/@OwnerZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin/@OwnerZip)&gt;4">
<xsl:value-of select="substring(//Admin/@OwnerZip, 1, 5)"/>
</xsl:when>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Country">
<!--<xsl:value-of select="//Admin/@OwnerCountry"/>-->
</xsl:attribute>
<xsl:attribute name="Phone">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerPhone1Ext[. != '']">
<xsl:value-of select="//Admin/@OwnerPhone1"/>&#32;x<xsl:value-of select="//Admin/@OwnerPhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerPhone1"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Phone2">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerPhone2Ext[. != '']">
<xsl:value-of select="//Admin/@OwnerPhone2"/>&#32;x<xsl:value-of select="//Admin/@OwnerPhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerPhone2"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Fax">
<!--<xsl:choose>
<xsl:when test="//Admin/@OwnerFaxExt[. != '']">
<xsl:value-of select="//Admin/@OwnerFax"/>&#32;x<xsl:value-of select="//Admin/@OwnerFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@OwnerFax"/>
</xsl:otherwise>
</xsl:choose>-->
</xsl:attribute>
<xsl:attribute name="Email">
<!--<xsl:value-of select="//Admin/@OwnerEmail"/>-->
</xsl:attribute>
</xsl:element>
<xsl:element name="InsuranceCompany">
<xsl:attribute name="Id">
<xsl:value-of select="//Admin/@InsuranceCompanyID"/>
</xsl:attribute>
<xsl:attribute name="Name">
<xsl:value-of select="//Admin/@InsuranceCompanyName"/>
</xsl:attribute>
<xsl:attribute name="Address">
<xsl:value-of select="//Admin/@InsuranceAddr1"/>
</xsl:attribute>
<xsl:attribute name="Address2">
<xsl:value-of select="//Admin/@InsuranceAddr2"/>
</xsl:attribute>
<xsl:attribute name="City">
<xsl:value-of select="//Admin/@InsuranceCity"/>
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin/@InsuranceState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<xsl:choose>
<xsl:when test="contains(//Admin/@InsuranceZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin/@InsuranceZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin/@InsuranceZip, '-'))=4">
<xsl:value-of select="//Admin/@InsuranceZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin/@InsuranceZip)=9">
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin/@InsuranceZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin/@InsuranceZip)&gt;4">
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Country">
<xsl:value-of select="//Admin/@InsuranceCountry"/>
</xsl:attribute>
<xsl:attribute name="Phone">
<xsl:choose>
<xsl:when test="//Admin/@InsurancePhone1Ext[. != '']">
<xsl:value-of select="//Admin/@InsurancePhone1"/>&#32;x<xsl:value-of select="//Admin/@InsurancePhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsurancePhone1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Phone2">
<xsl:choose>
<xsl:when test="//Admin/@InsurancePhone2Ext[. != '']">
<xsl:value-of select="//Admin/@InsurancePhone2"/>&#32;x<xsl:value-of select="//Admin/@InsurancePhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsurancePhone2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Fax">
<xsl:choose>
<xsl:when test="//Admin/@InsuranceFaxExt[. != '']">
<xsl:value-of select="//Admin/@InsuranceFax"/>&#32;x<xsl:value-of select="//Admin/@InsuranceFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin/@InsuranceFax"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Email">
<xsl:value-of select="//Admin/@InsuranceEmail"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Insured">
<xsl:attribute name="LastName">
<xsl:value-of select="//Admin/@InsuranceLName"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Claim">
<xsl:attribute name="Number">
<xsl:value-of select="//Admin/@ClaimNumber"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="Estimator">
<xsl:attribute name="FName">
<xsl:value-of select="//Admin2/@EstimatorF"/>
</xsl:attribute>
<xsl:attribute name="LName">
<xsl:value-of select="//Admin2/@EstimatorL"/>
</xsl:attribute>
<xsl:attribute name="Company">
<xsl:value-of select="//Admin2/@EstimatorCompanyName"/>
</xsl:attribute>
<xsl:attribute name="BodyShopName">
<xsl:value-of select="//Admin2/@BodyShopName"/>
</xsl:attribute>
<xsl:attribute name="Address">
<xsl:value-of select="//Admin2/@EstimatorAddr1"/>
</xsl:attribute>
<xsl:attribute name="Address2">
<xsl:value-of select="//Admin2/@EstimatorAddr2"/>
</xsl:attribute>
<xsl:attribute name="City">
<xsl:value-of select="//Admin2/@EstimatorCity"/>
</xsl:attribute>
<xsl:attribute name="State">
<xsl:value-of select="//Admin2/@EstimatorState"/>
</xsl:attribute>
<xsl:attribute name="Zip">
<xsl:choose>
<xsl:when test="contains(//Admin2/@EstimatorZip, '-')">
<xsl:choose>
<xsl:when test="string-length(substring-before(//Admin2/@EstimatorZip, '-'))=5">
<xsl:choose>
<xsl:when test="string-length(substring-after(//Admin2/@EstimatorZip, '-'))=4">
<xsl:value-of select="//Admin2/@EstimatorZip"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:when test="string-length(//Admin2/@EstimatorZip)=9">
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>-<xsl:value-of select="substring(//Admin2/@EstimatorZip, 6, 4)"/>
</xsl:when>
<xsl:when test="string-length(//Admin2/@EstimatorZip)&gt;4">
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Country">
<xsl:value-of select="//Admin2/@EstimatorCountry"/>
</xsl:attribute>
<xsl:attribute name="Phone">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorPhone1Ext[. != '']">
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorPhone1Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Phone2">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorPhone2Ext[. != '']">
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorPhone2Ext"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Fax">
<xsl:choose>
<xsl:when test="//Admin2/@EstimatorFaxExt[. != '']">
<xsl:value-of select="//Admin2/@EstimatorFax"/>&#32;x<xsl:value-of select="//Admin2/@EstimatorFaxExt"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="//Admin2/@EstimatorFax"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="Email">
<xsl:value-of select="//Admin2/@EstimatorEmail"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="RepairInformation">
<xsl:attribute name="VehicleDateIn">
<xsl:if test="string-length(//Admin2/@VehicleInDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@VehicleInDate, ' ')"/>
<xsl:if test="string-length(//Admin2/@VehicleInTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@VehicleInTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleInTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="EstimatedVehicleDateOut">
<xsl:if test="string-length(//Admin2/@TargetVehicleOutDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@TargetVehicleOutDate,' ')"/>
<xsl:if test="string-length(//Admin2/@TargetVehicleOutTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
<xsl:attribute name="VehicleDateOut">
<xsl:if test="string-length(//Admin2/@VehicleOutDate)&gt;6">
<xsl:value-of select="substring-before(//Admin2/@VehicleOutDate, ' ')"/>
<xsl:if test="string-length(//Admin2/@VehicleOutTime)=4">
&#32;<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 3, 2)"/>
</xsl:if>
</xsl:if>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:template>
<xsl:template match="PartsList">
<xsl:element name="PartsList" >
<xsl:for-each select="Part">
<xsl:element name="Part" >
<!-- Part number translation rules -->
<xsl:variable name="OEMPartNumber">
<xsl:if test="substring(@TDPartNum, string-length(@TDPartNum) - 7) != ' GM PART'">
<xsl:value-of select="@TDPartNum" />
</xsl:if>
<xsl:if test="substring(@TDPartNum, string-length(@TDPartNum) - 7) = ' GM PART'">
<xsl:value-of select="substring-before(@TDPartNum,' GM PART')" />
</xsl:if>
</xsl:variable>
<xsl:variable name="AltPartNumber">
<xsl:value-of select="@AltPartNum"/>
</xsl:variable>
<xsl:variable name="PrimaryPartType">
<xsl:value-of select="@PartType"/>
</xsl:variable>
<xsl:variable name="PrimaryPartNumber">
<xsl:choose>
<xsl:when test="@PartType='PAN'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:when test="@PartType!='PAN'">
<xsl:choose>
<xsl:when test="$AltPartNumber!=''">
<xsl:value-of select="$AltPartNumber"/>
</xsl:when>
<xsl:when test="$OEMPartNumber!=''">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
<xsl:otherwise>Salvage or Assembly</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="SecondaryPartNumber">
<xsl:choose>
<xsl:when test="@PartType!='PAN'">
<xsl:value-of select="$OEMPartNumber"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="SecondaryPartType">
<xsl:choose>
<xsl:when test="@PartType='PAA'">PAN</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:attribute name="TDPartNum">
<xsl:value-of select="$PrimaryPartNumber"/>
</xsl:attribute>
<xsl:attribute name="AltPartNum">
<xsl:value-of select="$SecondaryPartNumber" />
</xsl:attribute>
<xsl:attribute name="ExternalPartType">
<xsl:value-of select="$PrimaryPartType" />
</xsl:attribute>
<xsl:attribute name="ExternalAltPartType">
<xsl:value-of select="$SecondaryPartType" />
</xsl:attribute>
<xsl:attribute name="TDPartType">
<xsl:choose>
<xsl:when test="$PrimaryPartType='PAN'">1</xsl:when>
<xsl:when test="$PrimaryPartType='PAA'">2</xsl:when>
<xsl:when test="$PrimaryPartType='PAL'">3</xsl:when>
<xsl:when test="$PrimaryPartType='PAM'">4</xsl:when>
<xsl:when test="$PrimaryPartType='PAR'">4</xsl:when>
<xsl:when test="$PrimaryPartType='PAC'">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="AltPartType">
<xsl:choose>
<xsl:when test="$SecondaryPartType='PAN'">1</xsl:when>
<xsl:when test="$SecondaryPartType='PAA'">2</xsl:when>
<xsl:when test="$SecondaryPartType='PAL'">3</xsl:when>
<xsl:when test="$SecondaryPartType='PAM'">4</xsl:when>
<xsl:when test="$SecondaryPartType='PAC'">4</xsl:when>
<xsl:when test="$SecondaryPartType='PAR'">4</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="TDPartDesc">
<xsl:value-of select="@TDPartDesc" />
</xsl:attribute>
<xsl:attribute name="TDEstimate">
<xsl:choose>
<xsl:when test="@PartType='PAN'">
<xsl:value-of select="@TDEstimate" />
</xsl:when>
<xsl:when test="@PartType='PAM'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:when test="@PartType='PAA'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:when test="@PartType='PAL'">
<xsl:value-of select="@ActPrice" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@ActPrice" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="TDPartQty">
<xsl:value-of select="@TDPartQty" />
</xsl:attribute>
<xsl:attribute name="LineNumber">
<xsl:value-of select="@LineNumber" />
</xsl:attribute>
<xsl:attribute name="SequenceNumber">
<xsl:value-of select="@SequenceNumber" />
</xsl:attribute>
<xsl:attribute name="SupplLevel">
<xsl:choose>
<xsl:when test="@SupplementLevel = 'E'">0</xsl:when>
<xsl:when test="substring(@SupplementLevel, 1, 1) = 'S'">
<xsl:value-of select="substring(@SupplementLevel, 2)" />
</xsl:when>
<xsl:otherwise>0</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="LaborType">
<xsl:value-of select="@LaborType" />
</xsl:attribute>
<xsl:attribute name="LaborHours">
<xsl:value-of select="@LaborHours" />
</xsl:attribute>
<xsl:attribute name="OperationCode">
<xsl:value-of select="@LaborOp" />
</xsl:attribute>
<xsl:attribute name="GlassFlag">
<xsl:value-of select="@GlassFlag" />
</xsl:attribute>
<xsl:attribute name="MarkUp">
<xsl:value-of select="@MarkUp" />
</xsl:attribute>
<xsl:attribute name="CLPart">
<!-- CLPart is false if TRAN_CODE == 2 or TRAN_CODE == 3 -->
<!-- CLPart is false if PartType is not 'PAN','PAP','PAL','PAG', 'PAM', or 'PAA' or 'PAC' or 'PAR' -->
<!-- CLPart is false if LaborCode is only labor -->
<!-- CLPart is false if OpCode is not "Remove/Replace" or "Remove/Replace Partial" -->
<xsl:choose>
<xsl:when test="@TransactionCode='3'">False</xsl:when>
<xsl:when test="@TransactionCode='1' or @TransactionCode='2'">
<xsl:choose>
<xsl:when test="@PartType='PAN' or @PartType='PAG' or @PartType='PAM' or @PartType='PAP' or @PartType='PAL' or @PartType='PAA' or @PartType='PAR' or @PartType='PAC'">
<xsl:choose>
<xsl:when test="@LaborType='LAD' or @LaborType='LAE' or @LaborType='LAU' or @LaborType='LAT'">False</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="@LaborOp='OP0'">False</xsl:when>
<xsl:when test="@LaborOp='OP1'">False</xsl:when>
<xsl:when test="@LaborOp='OP2'">False</xsl:when>
<xsl:when test="@LaborOp='OP3'">False</xsl:when>
<xsl:when test="@LaborOp='OP4'">False</xsl:when>
<xsl:when test="@LaborOp='OP5'">False</xsl:when>
<xsl:when test="@LaborOp='OP6'">False</xsl:when>
<xsl:when test="@LaborOp='OP7'">False</xsl:when>
<xsl:when test="@LaborOp='OP8'">False</xsl:when>
<xsl:when test="@LaborOp='OP9'">False</xsl:when>
<xsl:when test="@LaborOp='OP10'">False</xsl:when>
<xsl:when test="@LaborOp='OP13'">False</xsl:when>
<xsl:when test="@LaborOp='OP14'">False</xsl:when>
<xsl:when test="@LaborOp='OP15'">False</xsl:when>
<xsl:when test="@LaborOp='OP16'">False</xsl:when>
<xsl:otherwise>True</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>False</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<TranslationDescriptor>
<FileTranslations FormatName="Mitchell" ElementName="Estimate" Description="Translation Descriptor for a Mitchell Estimate, Version EMS 2.0">
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.env">
<DBFFileTranslation ID="ID1" ElementName="Envelope" Description="Envelope Table">
<DBFFieldSpec FieldName="RO_ID" Form="attribute" Name="RONum" FieldType="" Description="RO Number"/>
<DBFFieldSpec FieldName="UNQFILE_ID" Form="attribute" Name="UniqueFileID" FieldType="" Description="Unique File Identifier"/>
<DBFFieldSpec FieldName="ESTFILE_ID" Form="attribute" Name="EstimateFileID" FieldType="" Description="Estimate File Identifier"/>
<DBFFieldSpec FieldName="INCL_ADMIN" Form="attribute" Name="IncludesAdminInfo" FieldType="Boolean" Description="Includes Admin Info Flag"/>
<DBFFieldSpec FieldName="INCL_VEH" Form="attribute" Name="IncludesVehicleInfo" FieldType="Boolean" Description="Includes Vehicle Info Flag"/>
<DBFFieldSpec FieldName="INCL_EST" Form="attribute" Name="IncludesEstimateInfo" FieldType="Boolean" Description="Includes Estimate Info Flag"/>
<DBFFieldSpec FieldName="INCL_PROFL" Form="attribute" Name="IncludesProfileInfo" FieldType="Boolean" Description="Includes Profile Info Flag"/>
<DBFFieldSpec FieldName="INCL_TOTAL" Form="attribute" Name="IncludesTotalsInfo" FieldType="Boolean" Description="Includes Totals Info Flag"/>
<DBFFieldSpec FieldName="INCL_VENDR" Form="attribute" Name="IncludesVendorInfo" FieldType="Boolean" Description="Includes Vendor Info Flag"/>
<DBFFieldSpec FieldName="EMS_VER" Form="attribute" Name="EMSVersion" FieldType="" Description="EMS Version Number"/>
<DBFFieldSpec FieldName="SUPP_NO" Form="attribute" Name="SupplementNum" FieldType="" Description="Supplement Number"/>
<DBFFieldSpec FieldName="TRANS_TYPE" Form="attribute" Name="TransactionType" FieldType="" Description="Transaction Type"/>
<DBFFieldSpec FieldName="EST_SYSTEM" Form="attribute" Name="EstimatingSystem" FieldType="" Description="Estimating System Software"/>
<DBFFieldSpec FieldName="SW_VERSION" Form="attribute" Name="SoftwareVersion" FieldType="" Description="Software Version Identifier"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.LIN">
<DBFFileTranslation ID="ID2" ElementSetName="PartsList" ElementName="Part" Description="Parts List Table">
<DBFFieldSpec FieldName="OEM_PARTNO" Form="attribute" Name="TDPartNum" FieldType="" Description="Part Number"/>
<DBFFieldSpec FieldName="ALT_PARTNO" Form="attribute" Name="AltPartNum" FieldType="" Description="Alternate Part Number"/>
<DBFFieldSpec FieldName="ACT_PRICE" Form="attribute" Name="ActPrice" FieldType="" Description="Actual Part Price"/>
<DBFFieldSpec FieldName="LINE_DESC" Form="attribute" Name="TDPartDesc" FieldType="" Description="Part Description"/>
<DBFFieldSpec FieldName="DB_PRICE" Form="attribute" Name="TDEstimate" FieldType="" Description="DB_Price"/>
<DBFFieldSpec FieldName="PART_QTY" Form="attribute" Name="TDPartQty" FieldType="" Description="Part Quantity"/>
<DBFFieldSpec FieldName="LINE_NO" Form="attribute" Name="LineNumber" FieldType="" Description=""/>
<DBFFieldSpec FieldName="UNQ_SEQ" Form="attribute" Name="SequenceNumber" FieldType="" Description=""/>
<DBFFieldSpec FieldName="PART_TYPE" Form="attribute" Name="PartType" FieldType="" Description="Part Type"/>
<DBFFieldSpec FieldName="MOD_LBR_TY" Form="attribute" Name="LaborType" FieldType="" Description="Labor Type"/>
<DBFFieldSpec FieldName="MOD_LB_HRS" Form="attribute" Name="LaborHours" FieldType="" Description="Labor Hours"/>
<DBFFieldSpec FieldName="LBR_OP" Form="attribute" Name="LaborOp" FieldType="" Description="Labor Op"/>
<DBFFieldSpec FieldName="LINE_IND" Form="attribute" Name="SupplementLevel" FieldType="" Description="Supplement Level"/>
<DBFFieldSpec FieldName="TRAN_CODE" Form="attribute" Name="TransactionCode" FieldType="" Description="Transaction Code"/>
<DBFFieldSpec FieldName="GLASS_FLAG" Form="attribute" Name="GlassFlag" FieldType="" Description="Glass Flag"/>
<DBFFieldSpec FieldName="PRT_DSMK_M" Form="attribute" Name="MarkUp" FieldType="" Description="Price Mark up for non OEM parts"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.VEH">
<DBFFileTranslation ID="ID3" ElementName="Vehicle" Description="Vehicle Table">
<DBFFieldSpec FieldName="V_VIN" Form="attribute" Name="TransVIN" FieldType="" Description=""/>
<DBFFieldSpec FieldName="V_MODEL_YR" Form="attribute" Name="TransYear" FieldType="" Description="V_MODEL_YR"/>
<DBFFieldSpec FieldName="V_MAKEDESC" Form="attribute" Name="ManufName" FieldType="" Description="V_MAKEDESC"/>
<DBFFieldSpec FieldName="V_MAKECODE" Form="attribute" Name="ManufCode" FieldType="" Description="V_MAKECODE"/>
<DBFFieldSpec FieldName="V_MODEL" Form="attribute" Name="TransModel" FieldType="" Description="V_MODEL"/>
<DBFFieldSpec FieldName="V_MILEAGE" Form="attribute" Name="TransMileage" FieldType="" Description="V_MILEAGE"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.AD1">
<DBFFileTranslation ID="ID4" ElementName="Admin" Description="Administrative information">
<DBFFieldSpec FieldName="OWNR_LN" Form="attribute" Name="OwnerL" FieldType="" Description="Owner Lastname"/>
<DBFFieldSpec FieldName="OWNR_FN" Form="attribute" Name="OwnerF" FieldType="" Description="Owner Firstname"/>
<DBFFieldSpec FieldName="OWNR_CO_NM" Form="attribute" Name="OwnerCompanyName" FieldType="" Description="Owner Company Name"/>
<DBFFieldSpec FieldName="OWNR_TITLE" Form="attribute" Name="OwnerTitle" FieldType="" Description="Owner Title"/>
<DBFFieldSpec FieldName="OWNR_ADDR1" Form="attribute" Name="OwnerAddr1" FieldType="" Description="Owner Address Line 1"/>
<DBFFieldSpec FieldName="OWNR_ADDR2" Form="attribute" Name="OwnerAddr2" FieldType="" Description="Owner Address Line 2"/>
<DBFFieldSpec FieldName="OWNR_CITY" Form="attribute" Name="OwnerCity" FieldType="" Description="Owner City"/>
<DBFFieldSpec FieldName="OWNR_ST" Form="attribute" Name="OwnerState" FieldType="" Description="Owner State"/>
<DBFFieldSpec FieldName="OWNR_ZIP" Form="attribute" Name="OwnerZip" FieldType="" Description="Owner Zip"/>
<DBFFieldSpec FieldName="OWNR_CTRY" Form="attribute" Name="OwnerCountry" FieldType="" Description="Owner Country"/>
<DBFFieldSpec FieldName="OWNR_PH1" Form="attribute" Name="OwnerPhone1" FieldType="" Description="Owner Primary Phone"/>
<DBFFieldSpec FieldName="OWNR_PH1X" Form="attribute" Name="OwnerPhone1Ext" FieldType="" Description="Owner Primary Phone Extension"/>
<DBFFieldSpec FieldName="OWNR_PH2" Form="attribute" Name="OwnerPhone2" FieldType="" Description="Owner Secondary Phone"/>
<DBFFieldSpec FieldName="OWNR_PH2X" Form="attribute" Name="OwnerPhone2Ext" FieldType="" Description="Owner Secondary Phone Extension"/>
<DBFFieldSpec FieldName="OWNR_FAX" Form="attribute" Name="OwnerFax" FieldType="" Description="Owner Fax"/>
<DBFFieldSpec FieldName="OWNR_FAXX" Form="attribute" Name="OwnerFaxExt" FieldType="" Description="Owner Fax Extension"/>
<DBFFieldSpec FieldName="OWNR_EA" Form="attribute" Name="OwnerEmail" FieldType="" Description="Owner Email Address"/>
<DBFFieldSpec FieldName="INS_CO_NM" Form="attribute" Name="InsuranceCompanyName" FieldType="" Description="Insurance Company Name"/>
<DBFFieldSpec FieldName="INS_CO_ID" Form="attribute" Name="InsuranceCompanyID" FieldType="" Description="Insurance Company Identifier"/>
<DBFFieldSpec FieldName="INS_ADDR1" Form="attribute" Name="InsuranceAddr1" FieldType="" Description="Insurance Address Line 1"/>
<DBFFieldSpec FieldName="INS_ADDR2" Form="attribute" Name="InsuranceAddr2" FieldType="" Description="Insurance Address Line 2"/>
<DBFFieldSpec FieldName="INS_CITY" Form="attribute" Name="InsuranceCity" FieldType="" Description="Insurance City"/>
<DBFFieldSpec FieldName="INS_ST" Form="attribute" Name="InsuranceState" FieldType="" Description="Insurance State"/>
<DBFFieldSpec FieldName="INS_ZIP" Form="attribute" Name="InsuranceZip" FieldType="" Description="Insurance Zip"/>
<DBFFieldSpec FieldName="INS_CTRY" Form="attribute" Name="InsuranceCountry" FieldType="" Description="Insurance Country"/>
<DBFFieldSpec FieldName="INS_PH1" Form="attribute" Name="InsurancePhone1" FieldType="" Description="Insurance Primary Phone"/>
<DBFFieldSpec FieldName="INS_PH1X" Form="attribute" Name="InsurancePhone1Ext" FieldType="" Description="Insurance Primary Phone Extension"/>
<DBFFieldSpec FieldName="INS_PH2" Form="attribute" Name="InsurancePhone2" FieldType="" Description="Insurance Secondary Phone"/>
<DBFFieldSpec FieldName="INS_PH2X" Form="attribute" Name="InsurancePhone2Ext" FieldType="" Description="Insurance Secondary Phone Extension"/>
<DBFFieldSpec FieldName="INS_FAX" Form="attribute" Name="InsuranceFax" FieldType="" Description="Insurance Fax"/>
<DBFFieldSpec FieldName="INS_FAXX" Form="attribute" Name="InsuranceFaxExt" FieldType="" Description="Insurance Fax Extension"/>
<DBFFieldSpec FieldName="INS_EA" Form="attribute" Name="InsuranceEmail" FieldType="" Description="Insurance Email Address"/>
<DBFFieldSpec FieldName="INSD_LN" Form="attribute" Name="InsuranceLName" FieldType="" Description="Insurance Last Name"/>
<DBFFieldSpec FieldName="CLM_NO" Form="attribute" Name="ClaimNumber" FieldType="" Description="Claim Number"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.AD2">
<DBFFileTranslation ID="ID5" ElementName="Admin2" Description="Administrative information2">
<DBFFieldSpec FieldName="EST_CT_LN" Form="attribute" Name="EstimatorL" FieldType="" Description="Estimator Lastname"/>
<DBFFieldSpec FieldName="EST_CT_FN" Form="attribute" Name="EstimatorF" FieldType="" Description="Estimator Firstname"/>
<DBFFieldSpec FieldName="EST_CO_NM" Form="attribute" Name="EstimatorCompanyName" FieldType="" Description="Estimator Company Name"/>
<DBFFieldSpec FieldName="EST_CO_ID" Form="attribute" Name="EstimatorCompanyID" FieldType="" Description="Estimator Company Identifier"/>
<DBFFieldSpec FieldName="EST_ADDR1" Form="attribute" Name="EstimatorAddr1" FieldType="" Description="Estimator Address1"/>
<DBFFieldSpec FieldName="EST_ADDR2" Form="attribute" Name="EstimatorAddr2" FieldType="" Description="Estimator Address2"/>
<DBFFieldSpec FieldName="EST_CITY" Form="attribute" Name="EstimatorCity" FieldType="" Description="Estimator City"/>
<DBFFieldSpec FieldName="EST_ST" Form="attribute" Name="EstimatorState" FieldType="" Description="Estimator State"/>
<DBFFieldSpec FieldName="EST_ZIP" Form="attribute" Name="EstimatorZip" FieldType="" Description="Estimator Zip"/>
<DBFFieldSpec FieldName="EST_CTRY" Form="attribute" Name="EstimatorCountry" FieldType="" Description="Estimator Country"/>
<DBFFieldSpec FieldName="EST_PH1" Form="attribute" Name="EstimatorPhone1" FieldType="" Description="Estimator Primary Phone"/>
<DBFFieldSpec FieldName="EST_PH1X" Form="attribute" Name="EstimatorPhone1Ext" FieldType="" Description="Estimator Primary Phone Extension"/>
<DBFFieldSpec FieldName="EST_PH2" Form="attribute" Name="EstimatorPhone2" FieldType="" Description="Estimator Secondary Phone"/>
<DBFFieldSpec FieldName="EST_PH2X" Form="attribute" Name="EstimatorPhone2Ext" FieldType="" Description="Estimator Secondary Phone Extension"/>
<DBFFieldSpec FieldName="EST_FAX" Form="attribute" Name="EstimatorFax" FieldType="" Description="Estimator Fax"/>
<DBFFieldSpec FieldName="EST_FAXX" Form="attribute" Name="EstimatorFaxExt" FieldType="" Description="Estimator Fax Extension"/>
<DBFFieldSpec FieldName="EST_EA" Form="attribute" Name="EstimatorEmail" FieldType="" Description="Estimator Email Address"/>
<DBFFieldSpec FieldName="EST_LIC_NO" Form="attribute" Name="EstimatorLicenseNumber" FieldType="" Description="Estimator License Number"/>
<DBFFieldSpec FieldName="EST_FILENO" Form="attribute" Name="EstimatorFileNumber" FieldType="" Description="Estimator File Number"/>
<DBFFieldSpec FieldName="RO_IN_DATE" Form="attribute" Name="VehicleInDate" FieldType="" Description="Date arrived in shop"/>
<DBFFieldSpec FieldName="RO_IN_TIME" Form="attribute" Name="VehicleInTime" FieldType="" Description="Time arrived in shop"/>
<DBFFieldSpec FieldName="TAR_DATE" Form="attribute" Name="TargetVehicleOutDate" FieldType="" Description="Target date to be completed"/>
<DBFFieldSpec FieldName="TAR_TIME" Form="attribute" Name="TargetVehicleOutTime" FieldType="" Description="Target time to be completed"/>
<DBFFieldSpec FieldName="RO_CMPDATE" Form="attribute" Name="VehicleOutDate" FieldType="" Description="Date completed"/>
<DBFFieldSpec FieldName="RO_CMPTIME" Form="attribute" Name="VehicleOutTime" FieldType="" Description="Time completed"/>
<DBFFieldSpec FieldName="RF_CO_NM" Form="attribute" Name="BodyShopName" FieldType="" Description="Body Shop Name"/>
</DBFFileTranslation>
</FileTranslation>
<FileTranslation TranslatorID="OECImportEngine.DBFTranslator" FileNameMask="*.TTL">
<DBFFileTranslation ID="ID6" ElementName="Total" Description="Total Table">
<DBFFieldSpec FieldName="G_TTL_AMT" Form="attribute" Name="GrandTotalAmount" FieldType="" Description=""/>
</DBFFileTranslation>
</FileTranslation>
</FileTranslations>
<StyleSheetTranslation>
<StyleSheetURL>Mitchell.xsl</StyleSheetURL>
</StyleSheetTranslation>
</TranslationDescriptor>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -2,87 +2,87 @@
"name": "bodyshop",
"version": "0.1.1",
"private": true,
"proxy": "http://localhost:5000",
"proxy": "http://localhost:4000",
"dependencies": {
"@apollo/client": "^3.4.16",
"@craco/craco": "^6.4.0",
"@apollo/client": "^3.5.5",
"@asseinfo/react-kanban": "^2.2.0",
"@craco/craco": "^6.4.2",
"@fingerprintjs/fingerprintjs": "^3.3.0",
"@lourenci/react-kanban": "^2.1.0",
"@openreplay/tracker": "^3.4.4",
"@openreplay/tracker-assist": "^3.4.4",
"@openreplay/tracker": "^3.4.10",
"@openreplay/tracker-assist": "^3.4.9",
"@openreplay/tracker-graphql": "^3.0.0",
"@openreplay/tracker-redux": "^3.0.0",
"@sentry/react": "^6.13.3",
"@sentry/tracing": "^6.13.3",
"@openreplay/tracker-redux": "^3.4.8",
"@sentry/react": "^6.15.0",
"@sentry/tracing": "^6.15.0",
"@splitsoftware/splitio-react": "^1.3.0",
"@stripe/react-stripe-js": "^1.6.0",
"@stripe/stripe-js": "^1.20.2",
"@tanem/react-nprogress": "^3.0.81",
"antd": "^4.16.13",
"@stripe/stripe-js": "^1.21.2",
"@tanem/react-nprogress": "^3.0.82",
"antd": "^4.17.3",
"apollo-link-logger": "^2.0.0",
"axios": "^0.23.0",
"axios": "^0.24.0",
"craco-less": "^1.20.0",
"dinero.js": "^1.9.1",
"dotenv": "^10.0.0",
"enquire-js": "^0.2.1",
"env-cmd": "^10.1.0",
"exifr": "^7.1.3",
"firebase": "^9.1.3",
"graphql": "^15.6.1",
"i18next": "^21.3.3",
"firebase": "^9.6.0",
"graphql": "^16.0.1",
"i18next": "^21.5.4",
"i18next-browser-languagedetector": "^6.1.2",
"jsoneditor": "^9.5.6",
"jsoneditor": "^9.5.7",
"jsreport-browser-client-dist": "^1.3.0",
"libphonenumber-js": "^1.9.38",
"logrocket": "^2.1.1",
"markerjs2": "^2.15.0",
"libphonenumber-js": "^1.9.44",
"logrocket": "^2.1.2",
"markerjs2": "^2.17.2",
"moment-business-days": "^1.2.0",
"phone": "^3.1.8",
"phone": "^3.1.10",
"preval.macro": "^5.0.0",
"prop-types": "^15.7.2",
"query-string": "^7.0.1",
"rc-queue-anim": "^2.0.0",
"rc-scroll-anim": "^2.7.6",
"react": "^17.0.1",
"react-big-calendar": "^0.38.0",
"react-big-calendar": "^0.38.1",
"react-color": "^2.19.3",
"react-cookie": "^4.1.1",
"react-dom": "^17.0.1",
"react-drag-listview": "^0.1.8",
"react-grid-gallery": "^0.5.5",
"react-grid-layout": "^1.3.0",
"react-i18next": "^11.12.0",
"react-i18next": "^11.14.3",
"react-icons": "^4.3.1",
"react-number-format": "^4.7.3",
"react-redux": "^7.2.5",
"react-number-format": "^4.8.0",
"react-redux": "^7.2.6",
"react-resizable": "^3.0.4",
"react-router-dom": "^5.3.0",
"react-scripts": "^4.0.3",
"react-sublime-video": "^0.2.5",
"react-virtualized": "^9.22.3",
"recharts": "^2.1.5",
"redux": "^4.1.1",
"recharts": "^2.1.6",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3",
"redux-state-sync": "^3.1.2",
"reselect": "^4.0.0",
"sass": "^1.43.3",
"socket.io-client": "^4.3.2",
"reselect": "^4.1.5",
"sass": "^1.44.0",
"socket.io-client": "^4.4.0",
"styled-components": "^5.3.3",
"subscriptions-transport-ws": "^0.9.18",
"subscriptions-transport-ws": "^0.11.0",
"web-vitals": "^2.1.2",
"workbox-background-sync": "^6.3.0",
"workbox-broadcast-update": "^6.3.0",
"workbox-cacheable-response": "^6.3.0",
"workbox-core": "^6.3.0",
"workbox-expiration": "^6.3.0",
"workbox-google-analytics": "^6.3.0",
"workbox-navigation-preload": "^6.3.0",
"workbox-precaching": "^6.3.0",
"workbox-range-requests": "^6.3.0",
"workbox-routing": "^6.3.0",
"workbox-strategies": "^6.3.0",
"workbox-streams": "^6.3.0"
"workbox-background-sync": "^6.4.2",
"workbox-broadcast-update": "^6.4.2",
"workbox-cacheable-response": "^6.4.2",
"workbox-core": "^6.4.2",
"workbox-expiration": "^6.4.2",
"workbox-google-analytics": "^6.4.2",
"workbox-navigation-preload": "^6.4.2",
"workbox-precaching": "^6.4.2",
"workbox-range-requests": "^6.4.2",
"workbox-routing": "^6.4.2",
"workbox-strategies": "^6.4.2",
"workbox-streams": "^6.4.2"
},
"scripts": {
"postinstall": "patch-package",

View File

@@ -27,7 +27,6 @@ export const tracker = new Tracker({
onStart: async ({ sessionID }) => {
const user = await getCurrentUser();
if (user) tracker.setUserID(user.email);
console.log("ORS SESSION ", sessionID, user && user.email);
},
});
@@ -35,7 +34,7 @@ export const tracker = new Tracker({
// trackerAssist({ confirmText: "Technical support is about to assist you." })
// ); // check the list of available options below
export const recordGraphQL = tracker.use(trackerGraphQL());
tracker.start();
//tracker.start();
if (process.env.NODE_ENV === "production") LogRocket.init("gvfvfw/bodyshopapp");
export const factory = SplitSdk({

View File

@@ -53,7 +53,6 @@ export function App({ checkUserSession, currentUser, online, setOnline }) {
const { t } = useTranslation();
window.addEventListener("offline", function (e) {
console.log("Internet connection lost.");
setOnline(false);
});

View File

@@ -251,7 +251,10 @@ function BillEnterModalContainer({
keyboard="false"
onOk={() => form.submit()}
onCancel={handleCancel}
afterClose={() => form.resetFields()}
afterClose={() => {
form.resetFields();
setLoading(false);
}}
footer={
<Space>
<Button onClick={handleCancel}>{t("general.actions.cancel")}</Button>

View File

@@ -1,6 +1,8 @@
import { UploadOutlined } from "@ant-design/icons";
import Icon, { UploadOutlined } from "@ant-design/icons";
import { useApolloClient } from "@apollo/client";
import { MdOpenInNew } from "react-icons/md";
import {
Alert,
Divider,
Form,
Input,
@@ -13,6 +15,7 @@ import {
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { Link } from "react-router-dom";
import { createStructuredSelector } from "reselect";
import { CHECK_BILL_INVOICE_NUMBER } from "../../graphql/bills.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
@@ -132,6 +135,30 @@ export function BillFormComponent({
/>
</Form.Item>
</LayoutFormRow>
{job &&
job.ious &&
job.ious.length > 0 &&
job.ious.map((iou) => (
<Alert
key={iou.id}
type="warning"
message={
<Space>
{t("bills.labels.iouexists")}
<Link
target="_blank"
rel="noopener noreferrer"
to={`/manage/jobs/${iou.id}?tab=repairdata`}
>
<Space>
{iou.ro_number}
<Icon component={MdOpenInNew} />
</Space>
</Link>
</Space>
}
/>
))}
<LayoutFormRow>
<Form.Item
label={t("bills.fields.invoice_number")}
@@ -337,6 +364,7 @@ export function BillFormComponent({
responsibilityCenters={responsibilityCenters}
disabled={disabled}
/>
<Form.Item
name="upload"
label="Upload"

View File

@@ -7,13 +7,14 @@ import {
Select,
Space,
Switch,
Table,
Table
} from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import CiecaSelect from "../../utils/Ciecaselect";
import BillLineSearchSelect from "../bill-line-search-select/bill-line-search-select.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
@@ -72,11 +73,13 @@ export function BillEnterModalLinesComponent({
quantity: opt.part_qty || 1,
actual_price: opt.cost,
cost_center: opt.part_type
? responsibilityCenters.defaults &&
(responsibilityCenters.defaults.costs[
opt.part_type
] ||
null)
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
? opt.part_type
: responsibilityCenters.defaults &&
(responsibilityCenters.defaults.costs[
opt.part_type
] ||
null)
: null,
};
}
@@ -157,16 +160,6 @@ export function BillEnterModalLinesComponent({
billlines: getFieldsValue("billlines").billlines.map(
(item, idx) => {
if (idx === index) {
console.log(
"Found and setting.",
!!item.actual_cost
? item.actual_cost
: Math.round(
(parseFloat(e.target.value) * (1 - discount) +
Number.EPSILON) *
100
) / 100
);
return {
...item,
actual_cost: !!item.actual_cost
@@ -234,6 +227,7 @@ export function BillEnterModalLinesComponent({
key: `${field.index}cost_center`,
name: [field.name, "cost_center"],
label: t("billlines.fields.cost_center"),
valuePropName: "value",
rules: [
{
required: true,
@@ -243,10 +237,12 @@ export function BillEnterModalLinesComponent({
};
},
formInput: (record, index) => (
<Select style={{ minWidth: "3rem" }} disabled={disabled}>
{responsibilityCenters.costs.map((item) => (
<Select.Option key={item.name}>{item.name}</Select.Option>
))}
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? CiecaSelect(true, false)
: responsibilityCenters.costs.map((item) => (
<Select.Option key={item.name}>{item.name}</Select.Option>
))}
</Select>
),
},

View File

@@ -14,7 +14,6 @@ const BillLineSearchSelect = ({ options, disabled, ...restProps }, ref) => {
showSearch
// optionFilterProp="line_desc"
filterOption={(inputValue, option) => {
console.log(inputValue);
return (
(option.line_desc &&
option.line_desc

View File

@@ -20,7 +20,6 @@ export function ChatNewConversation({ openChatByPhone }) {
const { t } = useTranslation();
const [form] = Form.useForm();
const handleFinish = (values) => {
console.log("values :>> ", values);
openChatByPhone({ phone_num: values.phoneNumber });
form.resetFields();
};

View File

@@ -1,5 +1,5 @@
import { ShrinkOutlined } from "@ant-design/icons";
import { Col, Row, Typography } from "antd";
import { ShrinkOutlined, InfoCircleOutlined } from "@ant-design/icons";
import { Col, Row, Tooltip, Typography } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -31,6 +31,9 @@ export function ChatPopupComponent({
{t("messaging.labels.messaging")}
</Typography.Title>
<ChatNewConversation />
<Tooltip title={t("messaging.labels.recentonly")}>
<InfoCircleOutlined />
</Tooltip>
</div>
<ShrinkOutlined
onClick={() => toggleChatVisible()}

View File

@@ -42,7 +42,6 @@ export default function ContractFormComponent({
<ContractStatusSelector />
</Form.Item>
)}
<Form.Item
label={t("contracts.fields.start")}
name="start"

View File

@@ -86,10 +86,7 @@ export function DashboardGridComponent({ currentUser, bodyshop }) {
const handleRemoveComponent = (key) => {
logImEXEvent("dashboard_remove_component", { name: key });
const idxToRemove = state.items.findIndex((i) => i.i === key);
console.log(
"🚀 ~ file: dashboard-grid.component.jsx ~ line 81 ~ idxToRemove",
idxToRemove
);
const items = _.cloneDeep(state.items);
items.splice(idxToRemove, 1);

View File

@@ -95,19 +95,22 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
columns={columns}
rowKey="center"
dataSource={allocationsSummary}
locale={{ emptyText: t("dms.labels.refreshallocations") }}
summary={() => {
const totals = allocationsSummary.reduce(
(acc, val) => {
return {
totalSale: acc.totalSale.add(Dinero(val.sale)),
totalCost: acc.totalCost.add(Dinero(val.cost)),
};
},
{
totalSale: Dinero(),
totalCost: Dinero(),
}
);
const totals =
allocationsSummary &&
allocationsSummary.reduce(
(acc, val) => {
return {
totalSale: acc.totalSale.add(Dinero(val.sale)),
totalCost: acc.totalCost.add(Dinero(val.cost)),
};
},
{
totalSale: Dinero(),
totalCost: Dinero(),
}
);
return (
<Table.Summary.Row>
@@ -117,7 +120,7 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
</Typography.Title>
</Table.Summary.Cell>
<Table.Summary.Cell>
{totals.totalSale.toFormat()}
{totals && totals.totalSale.toFormat()}
</Table.Summary.Cell>
<Table.Summary.Cell>
{

View File

@@ -48,7 +48,7 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
];
return (
<div>
<>
<Modal
width={"90%"}
visible={visible}
@@ -100,6 +100,6 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
>
{t("jobs.actions.dms.findmakemodelcode")}
</Button>
</div>
</>
);
}

View File

@@ -1,12 +1,15 @@
import { Button } from "antd";
import axios from "axios";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { useTranslation } from "react-i18next";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
currentUser: selectCurrentUser,
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
@@ -14,16 +17,19 @@ const mapDispatchToProps = (dispatch) => ({
});
export default connect(mapStateToProps, mapDispatchToProps)(DmsCdkMakesRefetch);
export function DmsCdkMakesRefetch({ bodyshop, form, socket }) {
export function DmsCdkMakesRefetch({ currentUser, bodyshop, form, socket }) {
const [loading, setLoading] = useState(false);
const { t } = useTranslation();
if (!currentUser.email.includes("@imex.")) return null;
const handleRefetch = async () => {
setLoading(true);
const response = await axios.post("/cdk/getvehicles", {
await axios.post("/cdk/getvehicles", {
cdk_dealerid: bodyshop.cdk_dealerid,
bodyshopid: bodyshop.id,
});
console.log(response);
setLoading(false);
};
return (

View File

@@ -1,4 +1,4 @@
import { Button, Table, Col , Checkbox} from "antd";
import { Button, Table, Col, Checkbox } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -23,22 +23,29 @@ export function DmsCustomerSelector({ bodyshop }) {
const [customerList, setcustomerList] = useState([]);
const [visible, setVisible] = useState(false);
const [selectedCustomer, setSelectedCustomer] = useState(null);
const [dmsType, setDmsType] = useState("cdk");
socket.on("cdk-select-customer", (customerList, callback) => {
setVisible(true);
setDmsType("cdk");
setcustomerList(customerList);
});
socket.on("pbs-select-customer", (customerList, callback) => {
setVisible(true);
setDmsType("pbs");
setcustomerList(customerList);
});
const onUseSelected = () => {
setVisible(false);
socket.emit("cdk-selected-customer", selectedCustomer);
socket.emit(`${dmsType}-selected-customer`, selectedCustomer);
setSelectedCustomer(null);
};
const onUseGeneric = () => {
setVisible(false);
socket.emit(
"cdk-selected-customer",
`${dmsType}selected-customer`,
bodyshop.cdk_configuration.generic_customer_number
);
setSelectedCustomer(null);
@@ -46,11 +53,11 @@ export function DmsCustomerSelector({ bodyshop }) {
const onCreateNew = () => {
setVisible(false);
socket.emit("cdk-selected-customer", null);
socket.emit(`${dmsType}-selected-customer`, null);
setSelectedCustomer(null);
};
const columns = [
const cdkColumns = [
{
title: t("jobs.fields.dms.id"),
dataIndex: ["id", "value"],
@@ -60,13 +67,14 @@ export function DmsCustomerSelector({ bodyshop }) {
title: t("jobs.fields.dms.vinowner"),
dataIndex: "vinOwner",
key: "vinOwner",
render: (text, record) => <Checkbox disabled checked={record.vinOwner}/>
render: (text, record) => <Checkbox disabled checked={record.vinOwner} />,
},
{
title: t("jobs.fields.dms.name1"),
dataIndex: ["name1", "fullName"],
key: "name1",
sorter: (a, b) => alphaSort(a.name1?.fullName, b.name1?.fullName),
sorter: (a, b) =>
alphaSort(a.name1 && a.name1.fullName, b.name1 && b.name1.fullName),
},
{
@@ -74,11 +82,39 @@ export function DmsCustomerSelector({ bodyshop }) {
//dataIndex: ["name2", "fullName"],
key: "address",
render: (record, value) =>
`${record?.address?.addressLine[0]}, ${record.address?.city} ${record.address?.stateOrProvince} ${record.address?.postalCode}`,
`${
record.address &&
record.address.addressLine &&
record.address.addressLine[0]
}, ${record.address && record.address.city} ${
record.address && record.address.stateOrProvince
} ${record.address && record.address.postalCode}`,
},
];
if (!visible) return <></>;
const pbsColumns = [
{
title: t("jobs.fields.dms.id"),
dataIndex: "ContactId",
key: "ContactId",
},
{
title: t("jobs.fields.dms.name1"),
key: "name1",
sorter: (a, b) => alphaSort(a.LastName, b.LastName),
render: (text, record) =>
`${record.FirstName || ""} ${record.LastName || ""}`,
},
{
title: t("jobs.fields.dms.address"),
key: "address",
render: (record, value) =>
`${record.Address}, ${record.City} ${record.State} ${record.ZipCode}`,
},
];
if (!visible) return null;
return (
<Col span={24}>
<Table
@@ -104,13 +140,17 @@ export function DmsCustomerSelector({ bodyshop }) {
</div>
)}
pagination={{ position: "top" }}
columns={columns}
rowKey={(record) => record.id.value}
columns={dmsType === "cdk" ? cdkColumns : pbsColumns}
rowKey={(record) =>
dmsType === "cdk" ? record.id.value : record.ContactId
}
dataSource={customerList}
//onChange={handleTableChange}
rowSelection={{
onSelect: (props) => {
setSelectedCustomer(props.id.value);
onSelect: (record) => {
setSelectedCustomer(
dmsType === "cdk" ? record.id.value : record.ContactId
);
},
type: "radio",
selectedRowKeys: [selectedCustomer],

View File

@@ -22,12 +22,14 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsLogEvents);
export function DmsLogEvents({ socket, logs, bodyshop }) {
return (
<Timeline pending reverse={true}>
<Timeline pending
reverse={true}
>
{logs.map((log, idx) => (
<Timeline.Item key={idx} color={LogLevelHierarchy(log.level)}>
<Space wrap align="start" style={{}}>
<Tag color={LogLevelHierarchy(log.level)}>{log.level}</Tag>
<span>{moment(log.timestamp).format("MM/DD/YYYY HH:MM:ss")}</span>
<span>{moment(log.timestamp).format("MM/DD/YYYY HH:mm:ss")}</span>
<Divider type="vertical" />
<span>{log.message}</span>
</Space>

View File

@@ -1,11 +1,13 @@
import { DeleteFilled } from "@ant-design/icons";
import { DeleteFilled, DownOutlined } from "@ant-design/icons";
import {
Button,
Card,
Divider,
Dropdown,
Form,
Input,
InputNumber,
Menu,
Select,
Space,
Statistic,
@@ -19,9 +21,9 @@ import { createStructuredSelector } from "reselect";
import { determineDmsType } from "../../pages/dms/dms.container";
import { selectBodyshop } from "../../redux/user/user.selectors";
import DmsCdkMakes from "../dms-cdk-makes/dms-cdk-makes.component";
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import DmsCdkMakesRefetch from "../dms-cdk-makes/dms-cdk-makes.refetch.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -31,7 +33,7 @@ const mapDispatchToProps = (dispatch) => ({
});
export default connect(mapStateToProps, mapDispatchToProps)(DmsPostForm);
export function DmsPostForm({ bodyshop, socket, job }) {
export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
const [form] = Form.useForm();
const { t } = useTranslation();
@@ -59,6 +61,14 @@ export function DmsPostForm({ bodyshop, socket, job }) {
jobid: job.id,
txEnvelope: values,
});
console.log(logsRef);
if (logsRef) {
console.log("executing", logsRef);
logsRef.curent &&
logsRef.current.scrollIntoView({
behavior: "smooth",
});
}
};
return (
@@ -119,33 +129,38 @@ export function DmsPostForm({ bodyshop, socket, job }) {
</Form.Item>
</LayoutFormRow>
<LayoutFormRow style={{ justifyContent: "center" }} grow>
<Form.Item
name="dms_make"
label={t("jobs.fields.dms.dms_make")}
rules={[
{
required: true,
},
]}
>
<Input disabled />
</Form.Item>
<Form.Item
name="dms_model"
label={t("jobs.fields.dms.dms_model")}
rules={[
{
required: true,
},
]}
>
<Input disabled />
</Form.Item>
<DmsCdkMakes form={form} socket={socket} job={job} />
<DmsCdkMakesRefetch />
</LayoutFormRow>
{bodyshop.cdk_dealerid && (
<div>
<LayoutFormRow style={{ justifyContent: "center" }} grow>
<Form.Item
name="dms_make"
label={t("jobs.fields.dms.dms_make")}
rules={[
{
required: true,
},
]}
>
<Input disabled />
</Form.Item>
<Form.Item
name="dms_model"
label={t("jobs.fields.dms.dms_model")}
rules={[
{
required: true,
},
]}
>
<Input disabled />
</Form.Item>
</LayoutFormRow>
<Space>
<DmsCdkMakes form={form} socket={socket} job={job} />
<DmsCdkMakesRefetch />
</Space>
</div>
)}
<Form.Item
name="story"
label={t("jobs.fields.dms.story")}
@@ -157,6 +172,7 @@ export function DmsPostForm({ bodyshop, socket, job }) {
>
<Input.TextArea maxLength={240} />
</Form.Item>
<Divider />
<Form.List name={["payers"]}>
{(fields, { add, remove }) => {
@@ -216,7 +232,47 @@ export function DmsPostForm({ bodyshop, socket, job }) {
</Form.Item>
<Form.Item
label={t("jobs.fields.dms.payer.controlnumber")}
label={
<div>
{t("jobs.fields.dms.payer.controlnumber")}{" "}
<Dropdown
overlay={
<Menu>
{bodyshop.cdk_configuration.controllist &&
bodyshop.cdk_configuration.controllist.map(
(key, idx) => (
<Menu.Item
key={idx}
onClick={() => {
form.setFieldsValue({
payers: form
.getFieldValue("payers")
.map((row, mapIndex) => {
if (index !== mapIndex)
return row;
return {
...row,
controlnumber:
key.controlnumber,
};
}),
});
}}
>
{key.name}
</Menu.Item>
)
)}
</Menu>
}
>
<a href=" #" onClick={(e) => e.preventDefault()}>
<DownOutlined />
</a>
</Dropdown>
</div>
}
key={`${index}controlnumber`}
name={[field.name, "controlnumber"]}
rules={[

View File

@@ -58,11 +58,9 @@ export function DocumentEditorComponent({ currentUser, bodyshop, document }) {
if (imgRef.current !== null) {
// create a marker.js MarkerArea
markerArea.current = new markerjs2.MarkerArea(imgRef.current);
console.log(`markerArea.current`, markerArea.current);
// attach an event handler to assign annotated image back to our image element
markerArea.current.addCloseEventListener((closeEvent) => {
console.log("Close Event", closeEvent);
});
markerArea.current.addCloseEventListener((closeEvent) => {});
markerArea.current.addRenderEventListener((dataUrl) => {
imgRef.current.src = dataUrl;

View File

@@ -14,8 +14,6 @@ var cleanAxios = axios.create();
cleanAxios.interceptors.request.eject(axiosAuthInterceptorId);
export const handleUpload = (ev, context) => {
console.log("Handling Upload", ev);
logImEXEvent("document_upload", { filetype: ev.file.type });
const { onError, onSuccess, onProgress } = ev;
@@ -61,7 +59,7 @@ export const uploadToCloudinary = async (
// let eager = process.env.REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS;
//Get the signed url.
console.log("fileType", fileType);
const upload_preset = fileType.startsWith("video")
? "incoming_upload_video"
: "incoming_upload";
@@ -74,7 +72,6 @@ export const uploadToCloudinary = async (
});
if (signedURLResponse.status !== 200) {
console.log("Error Getting Signed URL", signedURLResponse.statusText);
if (!!onError) onError(signedURLResponse.statusText);
notification["error"]({
message: i18n.t("documents.errors.getpresignurl", {
@@ -113,13 +110,8 @@ export const uploadToCloudinary = async (
...options,
}
);
console.log("Upload Response", cloudinaryUploadResponse.data);
if (cloudinaryUploadResponse.status !== 200) {
console.log(
"Error uploading to cloudinary.",
cloudinaryUploadResponse.statusText
);
if (!!onError) onError(cloudinaryUploadResponse.statusText);
notification["error"]({
message: i18n.t("documents.errors.insert", {

View File

@@ -35,10 +35,6 @@ export function EmailDocumentsComponent({
},
skip: !emailConfig.jobid,
});
console.log(
"🚀 ~ file: email-documents.component.jsx ~ line 38 ~ emailConfig",
emailConfig
);
return (
<div>

View File

@@ -1,15 +1,71 @@
import { UploadOutlined } from "@ant-design/icons";
import { Divider, Form, Input, Select, Tabs, Upload } from "antd";
import { UploadOutlined, UserAddOutlined } from "@ant-design/icons";
import {
Divider,
Form,
Input,
Select,
Tabs,
Upload,
Space,
Menu,
Dropdown,
} from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import EmailDocumentsComponent from "../email-documents/email-documents.component";
import _ from "lodash";
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))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(EmailOverlayComponent);
export default function EmailOverlayComponent({ form, selectedMediaState }) {
export function EmailOverlayComponent({ form, selectedMediaState, bodyshop }) {
const { t } = useTranslation();
const handleClick = ({ item, key, keyPath }) => {
const email = item.props.value;
form.setFieldsValue({ to: _.uniq([...form.getFieldValue("to"), email]) });
};
const menu = (
<div>
<Menu onClick={handleClick}>
{bodyshop.employees
.filter((e) => e.user_email)
.map((e, idx) => (
<Menu.Item value={e.user_email} key={idx}>
{`${e.first_name} ${e.last_name}`}
</Menu.Item>
))}
</Menu>
</div>
);
return (
<div>
<Form.Item
label={t("emails.fields.to")}
label={
<Space>
{t("emails.fields.to")}
<Dropdown overlay={menu}>
<a
className="ant-dropdown-link"
href=" #"
onClick={(e) => e.preventDefault()}
>
<UserAddOutlined />
</a>
</Dropdown>
</Space>
}
name="to"
rules={[
{

View File

@@ -111,7 +111,6 @@ export function EmailOverlayContainer({
notification["success"]({ message: t("emails.successes.sent") });
toggleEmailOverlayVisible();
} catch (error) {
console.log(JSON.stringify(error));
notification["error"]({
message: t("emails.errors.notsent", { message: error.message }),
});
@@ -149,6 +148,18 @@ export function EmailOverlayContainer({
html: response.data,
fileList: [],
});
if (
bodyshop.md_email_cc[emailConfig.template.name] &&
bodyshop.md_email_cc[emailConfig.template.name].length > 0
) {
form.setFieldsValue({
cc: [
...(form.getFieldValue("cc") || []),
...bodyshop.md_email_cc[emailConfig.template.name],
],
});
}
setLoading(false);
};

View File

@@ -7,10 +7,12 @@ import { selectCurrentUser } from "../../redux/user/user.selectors";
import { GenerateDocument } from "../../utils/RenderTemplate";
import DateTimePicker from "../form-date-time-picker/form-date-time-picker.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import moment from "moment";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
});
const mapDispatchToProps = (dispatch) => ({
setEmailOptions: (e) => dispatch(setEmailOptions(e)),
});
@@ -19,14 +21,24 @@ export function EmailTestComponent({ currentUser, setEmailOptions }) {
const [form] = Form.useForm();
const handleFinish = (values) => {
console.log("values", values);
GenerateDocument(
{
name: values.key,
variables: {
...(values.start
? {
start: moment(values.start).startOf("day").format("YYYY-MM-DD"),
}
: {}),
...(values.end
? { end: moment(values.end).endOf("day").format("YYYY-MM-DD") }
: {}),
...(values.start
? { starttz: moment(values.start).startOf("day") }
: {}),
...(values.end ? { endtz: moment(values.end).endOf("day") } : {}),
...(values.id ? { id: values.id } : {}),
...(values.start ? { start: values.start } : {}),
...(values.end ? { end: values.end } : {}),
},
},
{

View File

@@ -46,12 +46,16 @@ import {
} from "../../redux/application/application.selectors";
import { setModalContext } from "../../redux/modals/modals.actions";
import { signOutStart } from "../../redux/user/user.actions";
import { selectCurrentUser } from "../../redux/user/user.selectors";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
recentItems: selectRecentItems,
selectedHeader: selectSelectedHeader,
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
@@ -69,6 +73,7 @@ const mapDispatchToProps = (dispatch) => ({
function Header({
handleMenuClick,
currentUser,
bodyshop,
selectedHeader,
signOutStart,
setBillEnterContext,
@@ -237,16 +242,26 @@ function Header({
{t("menus.header.accounting-receivables")}
</Link>
</Menu.Item>
<Menu.Item key="payables">
<Link to="/manage/accounting/payables">
{t("menus.header.accounting-payables")}
</Link>
</Menu.Item>
<Menu.Item key="payments">
<Link to="/manage/accounting/payments">
{t("menus.header.accounting-payments")}
</Link>
</Menu.Item>
{!(
(bodyshop && bodyshop.cdk_dealerid) ||
(bodyshop && bodyshop.pbs_serialnumber)
) && (
<Menu.Item key="payables">
<Link to="/manage/accounting/payables">
{t("menus.header.accounting-payables")}
</Link>
</Menu.Item>
)}
{!(
(bodyshop && bodyshop.cdk_dealerid) ||
(bodyshop && bodyshop.pbs_serialnumber)
) && (
<Menu.Item key="payments">
<Link to="/manage/accounting/payments">
{t("menus.header.accounting-payments")}
</Link>
</Menu.Item>
)}
<Menu.Item key="export-logs">
<Link to="/manage/accounting/exportlogs">
{t("menus.header.export-logs")}

View File

@@ -10,15 +10,11 @@ export default function HelpRescue() {
var bodyFormData = new FormData();
bodyFormData.append("Code", code);
bodyFormData.append("hostederrorhandling", 1);
const res1 = await fetch(
"https://secure.logmeinrescue.com/Customer/Code.aspx",
{
mode: "no-cors",
method: "POST",
body: bodyFormData,
}
);
console.log("handleClick -> res1", await res1.text());
await fetch("https://secure.logmeinrescue.com/Customer/Code.aspx", {
mode: "no-cors",
method: "POST",
body: bodyFormData,
});
};
return (
@@ -40,7 +36,6 @@ export default function HelpRescue() {
method="post"
id="logmeinsupport"
onSubmit={(...props) => {
console.log(`props`, props);
alert();
}}
>

View File

@@ -44,7 +44,7 @@ export function Jobd3RdPartyModal({ bodyshop, jobId }) {
};
const handleFinish = (values) => {
const { sendtype, ...restVals } = values;
console.log(restVals);
GenerateDocument(
{
name: TemplateList("job_special").thirdpartypayer.key,

View File

@@ -56,7 +56,7 @@ export function ScheduleEventColor({ bodyshop, event }) {
<Menu.Item key={"null"}>{t("general.actions.clear")}</Menu.Item>
</Menu>
);
console.log(`event`, event);
return (
<Dropdown overlay={menu}>
<a href=" #" onClick={(e) => e.preventDefault()}>

View File

@@ -176,7 +176,7 @@ export function ScheduleEventComponent({
t("appointments.labels.reminder", {
shopname: bodyshop.shopname,
date: moment(event.start).format("MM/DD/YYYY"),
time: moment(event.start).format("HH:MM a"),
time: moment(event.start).format("HH:mm a"),
})
);
setVisible(false);

View File

@@ -55,7 +55,6 @@ export default function JobBillsTotalComponent({
);
}
if (il.deductedfromlbr) {
console.log(i, "Deducting from labor.");
lbrAdjustments = lbrAdjustments.add(
Dinero({
amount: Math.round((il.actual_price || 0) * 100),

View File

@@ -34,7 +34,7 @@ export default function JobIntakeTemplateList({ templates }) {
const renderAllTemplates = async () => {
logImEXEvent("checklist_render_all_templates");
setLoading(true);
console.log("templates :>> ", templates);
await GenerateDocuments(
templates.map((key) => {
return { name: key, variables: { id: jobId } };

View File

@@ -35,7 +35,7 @@ export function JobCostingModalContainer({
async function getData() {
if (jobId && visible) {
const { data } = await axios.post("/job/costing", { jobid: jobId });
console.log(data);
setCostingData(data);
}
}

View File

@@ -77,7 +77,6 @@ export default function JobCostingPartsTable({ data, summaryData }) {
.includes(searchText.toLowerCase())
);
console.log("data :>> ", data);
return (
<div>
<Table

View File

@@ -0,0 +1,95 @@
import { useApolloClient } from "@apollo/client";
import { useTreatments } from "@splitsoftware/splitio-react";
import { Button, notification, Popconfirm } from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { useHistory } from "react-router";
import { createStructuredSelector } from "reselect";
import { UPDATE_JOB_LINES_IOU } from "../../graphql/jobs-lines.queries";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
import { CreateIouForJob } from "../jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
currentUser: selectCurrentUser,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(mapStateToProps, mapDispatchToProps)(JobCreateIOU);
export function JobCreateIOU({
bodyshop,
currentUser,
jobid,
selectedJobLines,
}) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const client = useApolloClient();
const history = useHistory();
const { IOU_Tracking } = useTreatments(
["IOU_Tracking"],
{},
bodyshop.imexshopid
);
if (IOU_Tracking.treatment !== "on") return null;
const handleCreateIou = async () => {
setLoading(true);
//Query all of the job details to recreate.
const iouId = await CreateIouForJob(
client,
jobid,
{
status: bodyshop.md_ro_statuses.default_open,
bodyshopid: bodyshop.id,
useremail: currentUser.email,
},
selectedJobLines
);
notification.open({
type: "success",
message: t("jobs.successes.ioucreated"),
onClick: () => history.push(`/manage/jobs/${iouId}`),
});
const selectedJobLinesIds = selectedJobLines.map((l) => l.id);
await client.mutate({
mutation: UPDATE_JOB_LINES_IOU,
variables: { ids: selectedJobLinesIds },
update(cache) {
cache.modify({
id: cache.identify(jobid),
fields: {
joblines(existingJobLines, { readField }) {
return existingJobLines.map((a) => {
if (!selectedJobLinesIds.includes(a.id)) return a;
return { ...a, ioucreated: true };
});
},
},
});
},
});
setLoading(false);
};
return (
<Popconfirm
title={t("jobs.labels.createiouwarning")}
onConfirm={handleCreateIou}
>
<Button
loading={loading}
disabled={!selectedJobLines || selectedJobLines.length === 0}
>
{t("jobs.actions.createiou")}
</Button>
</Popconfirm>
);
}

View File

@@ -37,6 +37,7 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re
// import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container";
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
import _ from "lodash";
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
@@ -427,6 +428,7 @@ export function JobLinesComponent({
>
{t("joblines.actions.new")}
</Button>
<JobCreateIOU jobid={job.id} selectedJobLines={selectedLines} />
<Input.Search
placeholder={t("general.labels.search")}
onChange={(e) => {

View File

@@ -1,5 +1,6 @@
import React, { useState, useEffect } from "react";
import { Input, notification } from "antd";
import { Input, notification, Space } from "antd";
import { FieldTimeOutlined } from "@ant-design/icons";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import { useMutation } from "@apollo/client";
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
@@ -59,6 +60,12 @@ export default function JobLineNotePopup({ jobline, disabled }) {
style={{ width: "100%", minHeight: "2rem", cursor: "pointer" }}
onClick={() => !disabled && setEditing(true)}
>
{jobline.ioucreated && (
<Space>
<FieldTimeOutlined />
{t("joblines.labels.ioucreated")}
</Space>
)}
{jobline.notes}
</div>
);

View File

@@ -73,7 +73,7 @@ export const reconcileByPrice = (
jobLines.forEach((jl) => {
const matchingBillLineIds = billLines
.filter((bl) => bl.actual_price === jl.act_price && !jl.removed)
.filter((bl) => bl.actual_price === jl.act_price && bl.quantity === jl.part_qty && !jl.removed)
.map((bl) => bl.id);
if (matchingBillLineIds.length > 1) {

View File

@@ -42,9 +42,7 @@ export default function ScoreboardAddButton({
}, [visibility, job.id, callQuery]);
useEffect(() => {
console.log("UE", entryData);
if (entryData && entryData.scoreboard && entryData.scoreboard[0]) {
console.log("Setting FOrm");
form.setFieldsValue(entryData.scoreboard[0]);
}
}, [entryData, form]);

View File

@@ -22,7 +22,6 @@ export function JobsAdminClass({ bodyshop, job }) {
const [updateJob] = useMutation(UPDATE_JOB);
const handleFinish = async (values) => {
console.log(values);
setLoading(true);
const result = await updateJob({
variables: { jobId: job.id, job: values },

View File

@@ -13,7 +13,6 @@ export default function JobsAdminDatesChange({ job }) {
const [updateJob] = useMutation(UPDATE_JOB);
const handleFinish = async (values) => {
console.log(values);
setLoading(true);
const result = await updateJob({
variables: { jobId: job.id, job: values },

View File

@@ -10,7 +10,6 @@ export default function JobAdminOwnerReassociate({ job }) {
const [form] = Form.useForm();
const [updateJob] = useMutation(UPDATE_JOB);
const handleFinish = async (values) => {
console.log(values);
setLoading(true);
const result = await updateJob({
variables: { jobId: job.id, job: { ownerid: values.ownerid } },

View File

@@ -10,7 +10,6 @@ export default function JobAdminOwnerReassociate({ job }) {
const [form] = Form.useForm();
const [updateJob] = useMutation(UPDATE_JOB);
const handleFinish = async (values) => {
console.log(values);
setLoading(true);
const result = await updateJob({
variables: { jobId: job.id, job: { vehicleid: values.vehicleid } },

View File

@@ -3,8 +3,6 @@ import { gql } from "@apollo/client";
import _ from "lodash";
export const GetSupplementDelta = async (client, jobId, newLines) => {
console.log("-----Begin Supplement-----");
const {
data: { joblines: existingLinesFromDb },
} = await client.query({

View File

@@ -100,7 +100,7 @@ export function JobsAvailableContainer({
}
//IO-539 Check for Parts Rate on PAL for SGI use case.
await CheckTaxRates(estData.est_data, bodyshop);
console.log(estData);
const newTotals = (
await Axios.post("/job/totals", {
job: {

View File

@@ -54,6 +54,7 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
const handleMenuClick = ({ item, key, keyPath, domEvent }) => {
logImEXEvent("jobs_close_allocate_auto_dms");
form.setFieldsValue({ dms_allocation: key });
handleAllocate(
bodyshop.md_responsibility_centers.dms_defaults.find(
(x) => x.name === key
@@ -61,15 +62,17 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
);
};
const overlay = bodyshop.cdk_dealerid && (
const overlay = (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
<Menu onClick={handleMenuClick}>
{bodyshop.md_responsibility_centers.dms_defaults.map((mapping) => (
<Menu.Item key={mapping.name}>{mapping.name}</Menu.Item>
<Menu.Item disabled={disabled} key={mapping.name}>
{mapping.name}
</Menu.Item>
))}
</Menu>
);
return bodyshop.cdk_dealerid ? (
return bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? (
<Dropdown overlay={overlay}>
<Button disabled={disabled}>{t("jobs.actions.dmsautoallocate")}</Button>
</Dropdown>

View File

@@ -1,7 +1,6 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown, Menu } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
@@ -11,8 +10,6 @@ const mapStateToProps = createStructuredSelector({
});
export function JobsDetailChangeEstimator({ disabled, form, bodyshop }) {
const { t } = useTranslation();
const handleClick = ({ item, key, keyPath }) => {
const est = item.props.value;
form.setFieldsValue(est);
@@ -37,7 +34,7 @@ export function JobsDetailChangeEstimator({ disabled, form, bodyshop }) {
href=" #"
onClick={(e) => e.preventDefault()}
>
{t("jobs.actions.changestimator")} <DownOutlined />
<DownOutlined />
</a>
</Dropdown>
);

View File

@@ -0,0 +1,43 @@
import { DownOutlined } from "@ant-design/icons";
import { Dropdown, Menu } from "antd";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
export function JobsDetailChangeFilehandler({ disabled, form, bodyshop }) {
const handleClick = ({ item, key, keyPath }) => {
const est = item.props.value;
form.setFieldsValue(est);
};
const menu = (
<div>
<Menu onClick={handleClick}>
{bodyshop.md_filehandlers.map((est, idx) => (
<Menu.Item value={est} key={idx}>
{`${est.ins_ct_fn} ${est.ins_ct_ln}`}
</Menu.Item>
))}
</Menu>
</div>
);
return (
<Dropdown overlay={menu} disabled={disabled}>
<a
className="ant-dropdown-link"
href=" #"
onClick={(e) => e.preventDefault()}
>
<DownOutlined />
</a>
</Dropdown>
);
}
export default connect(mapStateToProps, null)(JobsDetailChangeFilehandler);

View File

@@ -75,6 +75,12 @@ export function JobsDetailDatesComponent({ jobRO, job, bodyshop }) {
>
<DateTimePicker />
</Form.Item>
<Form.Item
label={t("jobs.fields.date_next_contact")}
name="date_next_contact"
>
<DateTimePicker />
</Form.Item>
<Form.Item
label={t("jobs.fields.scheduled_completion")}
name="scheduled_completion"

View File

@@ -6,6 +6,7 @@ import {
InputNumber,
Row,
Select,
Space,
Switch,
} from "antd";
import React from "react";
@@ -23,7 +24,7 @@ import FormItemPhone, {
import Car from "../job-damage-visual/job-damage-visual.component";
import JobsDetailChangeEstimator from "../jobs-detail-change-estimator/jobs-detail-change-estimator.component";
import FormRow from "../layout-form-row/layout-form-row.component";
import JobsDetailChangeFileHandler from "../jobs-detail-change-filehandler/jobs-detail-change-filehandler.component";
const mapStateToProps = createStructuredSelector({
jobRO: selectJobReadOnly,
bodyshop: selectBodyshop,
@@ -85,7 +86,15 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
<Form.Item label={t("jobs.fields.ins_city")} name="ins_city">
<Input disabled={jobRO} />
</Form.Item>
<Form.Item label={t("jobs.fields.ins_ct_ln")} name="ins_ct_ln">
<Form.Item
label={
<Space>
{t("jobs.fields.ins_ct_ln")}
<JobsDetailChangeFileHandler form={form} disabled={jobRO} />
</Space>
}
name="ins_ct_ln"
>
<Input disabled={jobRO} />
</Form.Item>
<Form.Item label={t("jobs.fields.ins_ct_fn")} name="ins_ct_fn">
@@ -135,7 +144,7 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
label={t("jobs.fields.referral_source_extra")}
name="referral_source_extra"
>
<Input />
<Input disabled={jobRO} />
</Form.Item>
<Form.Item label={t("jobs.fields.alt_transport")} name="alt_transport">
<Select disabled={jobRO} allowClear>
@@ -219,12 +228,19 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) {
{t("jobs.forms.appraiserinfo")}
</Divider>
<JobsDetailChangeEstimator form={form} disabled={jobRO} />
<FormRow noDivider>
<Form.Item label={t("jobs.fields.est_co_nm")} name="est_co_nm">
<Input disabled={jobRO} />
</Form.Item>
<Form.Item label={t("jobs.fields.est_ct_fn")} name="est_ct_fn">
<Form.Item
label={
<Space>
{t("jobs.fields.est_ct_fn")}
<JobsDetailChangeEstimator form={form} disabled={jobRO} />
</Space>
}
name="est_ct_fn"
>
<Input disabled={jobRO} />
</Form.Item>
<Form.Item label={t("jobs.fields.est_ct_ln")} name="est_ct_ln">

View File

@@ -2,6 +2,8 @@ import Axios from "axios";
import _ from "lodash";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { INSERT_NEW_JOB, QUERY_JOB_FOR_DUPE } from "../../graphql/jobs.queries";
import moment from "moment";
import i18n from "i18next";
export default async function DuplicateJob(
apolloClient,
@@ -19,7 +21,6 @@ export default async function DuplicateJob(
variables: { id: jobId },
});
console.log("res", res);
const { jobs_by_pk } = res.data;
const existingJob = _.cloneDeep(jobs_by_pk);
delete existingJob.__typename;
@@ -58,3 +59,71 @@ export default async function DuplicateJob(
return;
}
export async function CreateIouForJob(
apolloClient,
jobId,
config,
jobLinesToKeep
) {
logImEXEvent("job_create_iou");
const { status } = config;
//get a list of all fields on the job
const res = await apolloClient.query({
query: QUERY_JOB_FOR_DUPE,
variables: { id: jobId },
});
const { jobs_by_pk } = res.data;
const existingJob = _.cloneDeep(jobs_by_pk);
delete existingJob.__typename;
delete existingJob.id;
delete existingJob.createdat;
delete existingJob.updatedat;
const newJob = {
...existingJob,
converted: true,
status: status,
iouparent: jobId,
date_open: moment(),
audit_trails: {
data: [
{
useremail: config.useremail,
bodyshopid: config.bodyshopid,
operation: i18n.t("audit_trail.messages.jobioucreated"),
},
],
},
};
const selectedJoblinesIds = jobLinesToKeep.map((l) => l.id);
const _tempLines = _.cloneDeep(existingJob.joblines).filter((l) =>
selectedJoblinesIds.includes(l.id)
);
_tempLines.forEach((line) => {
delete line.id;
delete line.__typename;
line.manual_line = true;
});
delete newJob.joblines;
newJob.joblines = { data: _tempLines };
const res2 = await apolloClient.mutate({
mutation: INSERT_NEW_JOB,
variables: { job: [newJob] },
});
Axios.post("/job/totalsssu", {
id: res2.data.insert_jobs.returning[0].id,
});
//insert the new job. call the callback with the returned ID when done.
return res2.data.insert_jobs.returning[0].id;
}

View File

@@ -40,7 +40,6 @@ export function JobsDocumentsGalleryReassign({ bodyshop, galleryImages }) {
const updateImage = async (i, jobid) => {
//Move the cloudinary image
console.log(i);
//Update it in the database.
const result = await updateDocument({

View File

@@ -3,17 +3,17 @@ import { notification } from "antd";
import React, { useState } from "react";
//import SpinComponent from "../../components/loading-spinner/loading-spinner.component";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import AlertComponent from "../../components/alert/alert.component";
import { logImEXEvent } from "../../firebase/firebase.utils";
import {
DELETE_NOTE,
QUERY_NOTES_BY_JOB_PK,
} from "../../graphql/notes.queries";
import JobNotesComponent from "./jobs.notes.component";
import { insertAuditTrail } from "../../redux/application/application.actions";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import JobNotesComponent from "./jobs.notes.component";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
@@ -63,6 +63,7 @@ export function JobNotesContainer({ jobId, insertAuditTrail }) {
refetch={refetch}
deleteLoading={deleteLoading}
handleNoteDelete={handleNoteDelete}
ro_number={data ? data.jobs_by_pk.ro_number : null}
/>
);
}

View File

@@ -13,7 +13,9 @@ import { createStructuredSelector } from "reselect";
import { selectJobReadOnly } from "../../redux/application/application.selectors";
import { setModalContext } from "../../redux/modals/modals.actions";
import { DateTimeFormatter } from "../../utils/DateFormatter";
import { TemplateList } from "../../utils/TemplateConstants";
import NoteUpsertModal from "../note-upsert-modal/note-upsert-modal.container";
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
const mapStateToProps = createStructuredSelector({
jobRO: selectJobReadOnly,
@@ -33,8 +35,12 @@ export function JobNotesComponent({
jobId,
setNoteUpsertContext,
deleteLoading,
ro_number,
}) {
const { t } = useTranslation();
const Templates = TemplateList("job_special", {
ro_number,
});
const columns = [
{
@@ -107,6 +113,18 @@ export function JobNotesComponent({
>
<EditFilled />
</Button>
<PrintWrapperComponent
emailOnly
templateObject={{
name: Templates.individual_job_note.key,
variables: { id: record.id },
}}
messageObject={{
subject: Templates.individual_job_note.subject,
}}
id={record.id}
/>
</Space>
),
},

View File

@@ -38,12 +38,7 @@ export function LaborAllocationsTable({
useEffect(() => {
if (!!joblines && !!timetickets && !!bodyshop);
setTotals(
CalculateAllocationsTotals(
bodyshop.md_responsibility_centers,
joblines,
timetickets,
adjustments
)
CalculateAllocationsTotals(bodyshop, joblines, timetickets, adjustments)
);
if (!jobId) setTotals([]);
}, [joblines, timetickets, bodyshop, adjustments, jobId]);

View File

@@ -1,9 +1,12 @@
import i18next from "i18next";
export const CalculateAllocationsTotals = (
responsibilitycenters,
bodyshop,
joblines,
timetickets,
adjustments = []
) => {
const responsibilitycenters = bodyshop.md_responsibility_centers;
const jobCodes = joblines.map((item) => item.mod_lbr_ty);
//.filter((value, index, self) => self.indexOf(value) === index && !!value);
const ticketCodes = timetickets.map((item) => item.ciecacode);
@@ -15,7 +18,12 @@ export const CalculateAllocationsTotals = (
const r = allCodes.reduce((acc, value) => {
const r = {
opcode: value,
cost_center: responsibilitycenters.defaults.costs[value],
cost_center:
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? i18next.t(
`joblines.fields.lbr_types.${value && value.toUpperCase()}`
)
: responsibilitycenters.defaults.costs[value],
mod_lbr_ty: value,
total: joblines.reduce((acc2, val2) => {
return val2.mod_lbr_ty === value ? acc2 + val2.mod_lb_hrs : acc2;

View File

@@ -29,7 +29,7 @@ export function PartnerPingComponent({ setPartnerVersion }) {
//if (process.env.NODE_ENV === "development") return;
const PartnerResponse = await axios.post("http://localhost:1337/ping/");
const { appver, qbpath } = PartnerResponse.data;
console.log("SETTING PARTNER VERSION.");
setPartnerVersion(appver);
console.log({ appver, qbpath });
if (!qbpath) {

View File

@@ -10,7 +10,7 @@ import {
PageHeader,
Popconfirm,
Space,
Table,
Table
} from "antd";
import queryString from "query-string";
import React, { useState } from "react";
@@ -119,7 +119,7 @@ export function PartsOrderListTableComponent({
</Button>
<Popconfirm
title={t("parts_orders.labels.confirmdelete")}
disabled={jobRO || !record.return}
disabled={jobRO}
onConfirm={async () => {
//Delete the parts return.!
@@ -139,7 +139,7 @@ export function PartsOrderListTableComponent({
});
}}
>
<Button disabled={jobRO || !record.return}>
<Button disabled={jobRO}>
<DeleteFilled />
</Button>
</Popconfirm>
@@ -165,10 +165,15 @@ export function PartsOrderListTableComponent({
quantity: pol.quantity,
actual_price: pol.act_price,
cost_center: pol.jobline?.part_type
? responsibilityCenters.defaults.costs[
pol.jobline.part_type
] || null
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
? pol.jobline.part_type
: responsibilityCenters.defaults &&
(responsibilityCenters.defaults.costs[
pol.jobline.part_type
] ||
null)
: null,
};
}),

View File

@@ -1,14 +1,30 @@
import { DeleteFilled, WarningFilled } from "@ant-design/icons";
import { useTreatments } from "@splitsoftware/splitio-react";
import { Divider, Form, Input, InputNumber, Radio, Space, Tag } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import FormDatePicker from "../form-date-picker/form-date-picker.component";
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component";
export default function PartsOrderModalComponent({
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
const mapDispatchToProps = (dispatch) => ({
//setUserLanguage: language => dispatch(setUserLanguage(language))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(PartsOrderModalComponent);
export function PartsOrderModalComponent({
bodyshop,
vendorList,
sendTypeState,
isReturn,
@@ -16,7 +32,11 @@ export default function PartsOrderModalComponent({
job,
}) {
const [sendType, setSendType] = sendTypeState;
const { OEConnection } = useTreatments(
["OEConnection"],
{},
bodyshop.imexshopid
);
const { t } = useTranslation();
return (
@@ -164,6 +184,9 @@ export default function PartsOrderModalComponent({
<Radio value={"none"}>{t("general.labels.none")}</Radio>
<Radio value={"e"}>{t("parts_orders.labels.email")}</Radio>
<Radio value={"p"}>{t("parts_orders.labels.print")}</Radio>
{OEConnection.treatment === "on" && (
<Radio value={"oec"}>{t("parts_orders.labels.oec")}</Radio>
)}
</Radio.Group>
</div>
);

View File

@@ -1,13 +1,16 @@
import { useMutation, useQuery } from "@apollo/client";
import { useMutation, useQuery, useApolloClient } from "@apollo/client";
import { Form, Modal, notification } from "antd";
import moment from "moment";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { logImEXEvent } from "../../firebase/firebase.utils";
import { logImEXEvent, auth } from "../../firebase/firebase.utils";
import { UPDATE_JOB_LINE_STATUS } from "../../graphql/jobs-lines.queries";
import { INSERT_NEW_PARTS_ORDERS } from "../../graphql/parts-orders.queries";
import {
INSERT_NEW_PARTS_ORDERS,
QUERY_PARTS_ORDER_OEC,
} from "../../graphql/parts-orders.queries";
import { QUERY_ALL_VENDORS_FOR_ORDER } from "../../graphql/vendors.queries";
import { insertAuditTrail } from "../../redux/application/application.actions";
import { setEmailOptions } from "../../redux/email/email.actions";
@@ -26,6 +29,7 @@ import { TemplateList } from "../../utils/TemplateConstants";
import AlertComponent from "../alert/alert.component";
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
import PartsOrderModalComponent from "./parts-order-modal.component";
import axios from "axios";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
@@ -52,7 +56,7 @@ export function PartsOrderModalContainer({
insertAuditTrail,
}) {
const { t } = useTranslation();
const client = useApolloClient();
const { visible, context, actions } = partsOrderModal;
const {
jobId,
@@ -175,7 +179,7 @@ export function PartsOrderModalContainer({
}
if (refetch) refetch();
toggleModalVisible();
const Templates = TemplateList("partsorder", context);
if (sendType === "e") {
@@ -215,7 +219,50 @@ export function PartsOrderModalContainer({
{},
"p"
);
} else if (sendType === "oec") {
//Send to Partner OEC.
try {
const partsOrder = await client.query({
query: QUERY_PARTS_ORDER_OEC,
variables: {
id: insertResult.data.insert_parts_orders.returning[0].id,
},
});
const oecResponse = await axios.post(
"http://localhost:1337/oec/",
partsOrder.data.parts_orders_by_pk,
{
headers: {
Authorization: `Bearer ${await auth.currentUser.getIdToken()}`,
},
}
);
if (oecResponse.data && oecResponse.data.success === false) {
notification.open({
type: "error",
message: t("parts_orders.errors.oec", {
error: oecResponse.data.error,
}),
});
}
} catch (error) {
console.log("Error OEC.", error);
notification["error"]({
message: t("parts_orders.errors.oec", {
error: JSON.stringify(error.message),
}),
});
return;
}
}
toggleModalVisible();
};
const initialValues = {

View File

@@ -60,12 +60,10 @@ export function PartsStatusPie({ bodyshop, joblines_status }) {
[pieColor, t]
);
const memoizedData = useMemo(() => Calculatedata(joblines_status), [
joblines_status,
Calculatedata,
]);
console.log("PartsStatusPie -> memoizedData", memoizedData);
const memoizedData = useMemo(
() => Calculatedata(joblines_status),
[joblines_status, Calculatedata]
);
return (
<div>

View File

@@ -8,6 +8,7 @@ export default function PrintWrapperComponent({
messageObject = {},
children,
id,
emailOnly = false,
}) {
const [loading, setLoading] = useState(false);
const handlePrint = async (type) => {
@@ -19,7 +20,7 @@ export default function PrintWrapperComponent({
return (
<Space>
{children || null}
<PrinterFilled onClick={() => handlePrint("p")} />
{!emailOnly && <PrinterFilled onClick={() => handlePrint("p")} />}
<MailFilled onClick={() => handlePrint("e")} />
{loading && <Spin />}
</Space>

View File

@@ -1,4 +1,4 @@
import { Input, PageHeader, Space, Spin } from "antd";
import { Input, Space, Spin } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -26,8 +26,7 @@ export function ProductionBoardFilters({
const { t } = useTranslation();
return (
<PageHeader
extra={
<Space wrap>
{loading && <Spin />}
<Input.Search
@@ -46,7 +45,6 @@ export function ProductionBoardFilters({
allowClear
/>
</Space>
}
></PageHeader>
);
}

View File

@@ -1,106 +1,171 @@
import { CalendarOutlined, EyeFilled } from "@ant-design/icons";
import { Card, Col, Row, Space } from "antd";
import React from "react";
import { Card, Row, Col, Dropdown } from "antd";
import { useTranslation } from "react-i18next";
import { Link } from "react-router-dom";
import { DateTimeFormatter } from "../../utils/DateFormatter";
import ProductionAlert from "../production-list-columns/production-list-columns.alert.component";
import { EyeFilled } from "@ant-design/icons";
import { Link } from "react-router-dom";
import "./production-board-card.styles.scss";
import ProductionRemoveButton from "../production-remove-button/production-remove-button.component";
import { useTranslation } from "react-i18next";
import ProductionSubletsManageComponent from "../production-sublets-manage/production-sublets-manage.component";
import ProductionListColumnProductionNote from "../production-list-columns/production-list-columns.productionnote.component";
import ProductionSubletsManageComponent from "../production-sublets-manage/production-sublets-manage.component";
import "./production-board-card.styles.scss";
export default function ProductionBoardCard(technician, card) {
export default function ProductionBoardCard(
technician,
card,
bodyshop,
cardSettings
) {
const { t } = useTranslation();
const menu = (
<div>
<Card title={t("general.labels.actions")}>
<ProductionRemoveButton jobId={card.id} />
</Card>
</div>
);
let employee_body, employee_prep, employee_refinish; //employee_csr;
if (card.employee_body) {
employee_body = bodyshop.employees.find((e) => e.id === card.employee_body);
}
if (card.employee_prep) {
employee_prep = bodyshop.employees.find((e) => e.id === card.employee_prep);
}
if (card.employee_refinish) {
employee_refinish = bodyshop.employees.find(
(e) => e.id === card.employee_refinish
);
}
// if (card.employee_csr) {
// employee_csr = bodyshop.employees.find((e) => e.id === card.employee_csr);
// }
return (
<Dropdown overlay={menu} trigger={["contextMenu"]}>
<Card
className="react-kanban-card imex-kanban-card tight-antd-rows"
//style={{ margin: ".2rem 0rem" }}
title={`${card.ro_number || t("general.labels.na")} - ${
card.v_model_yr
} ${card.v_make_desc || ""} ${card.v_model_desc || ""}`}
>
<Row>
<Card
className="react-kanban-card imex-kanban-card"
size="small"
title={
<Space>
<ProductionAlert record={card} key="alert" />
<span style={{ fontWeight: "bolder" }}>
{card.ro_number || t("general.labels.na")}
</span>
</Space>
}
extra={
technician ? (
<Link to={`/tech/joblookup?selected=${card.id}`}>
<EyeFilled />
</Link>
) : (
<Link to={`/manage/jobs/${card.id}`}>
<EyeFilled />
</Link>
)
}
>
<Row>
{cardSettings && cardSettings.ownr_nm && (
<Col span={24}>
<div className="ellipses">{`${card.ownr_fn || ""} ${
card.ownr_ln || ""
} ${card.ownr_co_nm || ""}`}</div>
{cardSettings && cardSettings.compact ? (
<div className="ellipses">{`${card.ownr_ln || ""} ${
card.ownr_co_nm || ""
}`}</div>
) : (
<div className="ellipses">{`${card.ownr_ln || ""}, ${
card.ownr_fn || ""
} ${card.ownr_co_nm || ""}`}</div>
)}
</Col>
</Row>
<Row>
<Col span={12}>
<div className="ellipses">{card.clm_no || ""}</div>
</Col>
<Col span={12}>
)}
<Col span={24}>
<div className="ellipses">{`${card.v_model_yr || ""} ${
card.v_make_desc || ""
} ${card.v_model_desc || ""}`}</div>
</Col>
{cardSettings && cardSettings.ins_co_nm && card.ins_co_nm && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<div className="ellipses">{card.ins_co_nm || ""}</div>
</Col>
</Row>
<Row>
)}
{cardSettings && cardSettings.clm_no && card.clm_no && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<div className="ellipses">{card.clm_no || ""}</div>
</Col>
)}
{cardSettings && cardSettings.employeeassignments && (
<Col span={24}>
<div className="imex-flex-row imex-flex-row__flex-space-around">
<div className="mex-flex-row__margin">
<div>{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
<div>{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
</div>
<div className="mex-flex-row__margin">
<div>{`B: ${
card.employee_body_rel
? `${card.employee_body_rel.first_name} ${card.employee_body_rel.last_name}`
: ""
}`}</div>
<div>{`P: ${
card.employee_prep_rel
? `${card.employee_prep_rel.first_name} ${card.employee_prep_rel.last_name}`
: ""
}`}</div>
<div>{`R: ${
card.employee_refinish_rel
? `${card.employee_refinish_rel.first_name} ${card.employee_refinish_rel.last_name}`
: ""
}`}</div>
<div>{`CSR: ${
card.employee_csr_rel
? `${card.employee_csr_rel.first_name} ${card.employee_csr_rel.last_name}`
: ""
}`}</div>
</div>
</div>
<Row>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`B: ${
employee_body
? `${employee_body.first_name.substr(
0,
3
)} ${employee_body.last_name.charAt(0)}`
: ""
} ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`P: ${
employee_prep
? `${employee_prep.first_name.substr(
0,
3
)} ${employee_prep.last_name.charAt(0)}`
: ""
}`}</Col>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`R: ${
employee_refinish
? `${employee_refinish.first_name.substr(
0,
3
)} ${employee_refinish.last_name.charAt(0)}`
: ""
} ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}h`}</Col>
{/* <Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`C: ${
employee_csr
? `${employee_csr.first_name} ${employee_csr.last_name}`
: ""
}`}</Col> */}
</Row>
</Col>
</Row>
<Row>
<Col span={18}>
<DateTimeFormatter>{card.scheduled_completion}</DateTimeFormatter>
)}
{/* {cardSettings && cardSettings.laborhrs && (
<Col span={24}>
<Row>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`B: ${
card.labhrs.aggregate.sum.mod_lb_hrs || "?"
} hrs`}</Col>
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>{`R: ${
card.larhrs.aggregate.sum.mod_lb_hrs || "?"
} hrs`}</Col>
</Row>
</Col>
<Col span={6}>
)} */}
{cardSettings &&
cardSettings.scheduled_completion &&
card.scheduled_completion && (
<Col span={cardSettings && cardSettings.compact ? 24 : 12}>
<Space>
<CalendarOutlined />
<DateTimeFormatter format="MM/DD">
{card.scheduled_completion}
</DateTimeFormatter>
</Space>
</Col>
)}
{cardSettings && cardSettings.ats && card.alt_transport && (
<Col span={12}>
<div>{card.alt_transport || ""}</div>
</Col>
</Row>
<div>
<ProductionListColumnProductionNote record={card} />
</div>
<div className="imex-flex-row imex-flex-row__flex-space-around">
<ProductionAlert record={card} key="alert" />
<ProductionSubletsManageComponent subletJobLines={card.subletLines} />
{technician ? (
<Link to={`/tech/joblookup?selected=${card.id}`}>
<EyeFilled />
</Link>
) : (
<Link to={`/manage/jobs/${card.id}`}>
<EyeFilled />
</Link>
)}
</div>
</Card>
</Dropdown>
)}
{cardSettings && cardSettings.sublets && (
<Col span={12}>
<ProductionSubletsManageComponent
subletJobLines={card.subletLines}
/>
</Col>
)}
{cardSettings && cardSettings.production_note && (
<Col span={24}>
{cardSettings && cardSettings.production_note && (
<ProductionListColumnProductionNote record={card} />
)}
</Col>
)}
</Row>
</Card>
);
}

View File

@@ -0,0 +1,154 @@
import { useMutation } from "@apollo/client";
import {
Button,
Card,
Col,
Form,
notification,
Popover,
Row,
Switch,
} from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { UPDATE_KANBAN_SETTINGS } from "../../graphql/user.queries";
export default function ProductionBoardKanbanCardSettings({
associationSettings,
}) {
const [form] = Form.useForm();
const [visible, setVisible] = useState(false);
const [loading, setLoading] = useState(false);
const [updateKbSettings] = useMutation(UPDATE_KANBAN_SETTINGS);
useEffect(() => {
form.setFieldsValue(
associationSettings && associationSettings.kanban_settings
);
}, [form, associationSettings, visible]);
const { t } = useTranslation();
const handleFinish = async (values) => {
setLoading(true);
const result = await updateKbSettings({
variables: {
id: associationSettings && associationSettings.id,
ks: values,
},
});
if (result.errors) {
notification.open({
type: "error",
message: t("production.errors.settings", {
error: JSON.stringify(result.errors),
}),
});
}
setVisible(false);
setLoading(false);
};
const overlay = (
<div>
<Card>
<Form form={form} onFinish={handleFinish} layout="vertical">
<Row gutter={[16, 16]}>
<Col span={12}>
<Form.Item
label={t("production.labels.compact")}
name="compact"
valuePropName="checked"
>
<Switch />
</Form.Item>
<Form.Item
valuePropName="checked"
label={t("production.labels.ownr_nm")}
name="ownr_nm"
>
<Switch />
</Form.Item>
<Form.Item
valuePropName="checked"
label={t("production.labels.clm_no")}
name="clm_no"
>
<Switch />
</Form.Item>
<Form.Item
valuePropName="checked"
label={t("production.labels.ins_co_nm")}
name="ins_co_nm"
>
<Switch />
</Form.Item>
{/* <Form.Item
valuePropName="checked"
label={t("production.labels.laborhrs")}
name="laborhrs"
>
<Switch />
</Form.Item> */}
<Form.Item
valuePropName="checked"
label={t("production.labels.employeeassignments")}
name="employeeassignments"
>
<Switch />
</Form.Item>
</Col>
<Col span={12}>
<Form.Item
valuePropName="checked"
label={t("production.labels.scheduled_completion")}
name="scheduled_completion"
>
<Switch />
</Form.Item>
<Form.Item
valuePropName="checked"
label={t("production.labels.ats")}
name="ats"
>
<Switch />
</Form.Item>
<Form.Item
valuePropName="checked"
label={t("production.labels.production_note")}
name="production_note"
>
<Switch />
</Form.Item>
{/* <Form.Item
valuePropName='checked' label={t("production.labels.alert")} name="alert">
<Switch/>
</Form.Item> */}
<Form.Item
valuePropName="checked"
label={t("production.labels.sublets")}
name="sublets"
>
<Switch />
</Form.Item>
</Col>
</Row>
</Form>
<Button
onClick={() => {
form.submit();
}}
>
{t("general.actions.save")}
</Button>
</Card>
</div>
);
return (
<Popover content={overlay} visible={visible}>
<Button loading={loading} onClick={() => setVisible(true)}>
{t("production.labels.cardsettings")}
</Button>
</Popover>
);
}

View File

@@ -1,7 +1,9 @@
import { useApolloClient } from "@apollo/client";
import Board, { moveCard } from "@lourenci/react-kanban";
import "@lourenci/react-kanban/dist/styles.css";
import { notification } from "antd";
import Board, { moveCard } from "@asseinfo/react-kanban";
//import "@asseinfo/react-kanban/dist/styles.css";
import "./production-board-kanban.styles.scss";
import { SyncOutlined } from '@ant-design/icons'
import { Grid, notification, Button, PageHeader, Space, Statistic } from "antd";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -16,6 +18,8 @@ import ProductionBoardFilters from "../production-board-filters/production-board
import { selectTechnician } from "../../redux/tech/tech.selectors";
import { insertAuditTrail } from "../../redux/application/application.actions";
import AuditTrailMapping from "../../utils/AuditTrailMappings";
import ProductionBoardKanbanCardSettings from "./production-board-kanban.card-settings.component";
import styled from "styled-components";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -30,8 +34,10 @@ const mapDispatchToProps = (dispatch) => ({
export function ProductionBoardKanbanComponent({
data,
bodyshop,
refetch,
technician,
insertAuditTrail,
associationSettings,
}) {
const [boardLanes, setBoardLanes] = useState({
columns: [{ id: "Loading...", title: "Loading...", cards: [] }],
@@ -116,6 +122,7 @@ export function ProductionBoardKanbanComponent({
newChildCard ? newChildCard.id : null,
newChildCardNewParent
),
// TODO: optimisticResponse
});
insertAuditTrail({
jobid: card.id,
@@ -131,24 +138,118 @@ export function ProductionBoardKanbanComponent({
}
};
const totalHrs = data
.reduce(
(acc, val) =>
acc +
(val.labhrs?.aggregate?.sum?.mod_lb_hrs || 0) +
(val.larhrs?.aggregate?.sum?.mod_lb_hrs || 0),
0
)
.toFixed(1);
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
.filter((screen) => !!screen[1])
.slice(-1)[0];
const standardSizes = {
xs: "250",
sm: "250",
md: "250",
lg: "250",
xl: "250",
xxl: "250",
};
const compactSizes = {
xs: "150",
sm: "150",
md: "150",
lg: "150",
xl: "155",
xxl: "155",
};
const width = selectedBreakpoint
? associationSettings &&
associationSettings.kanban_settings &&
associationSettings.kanban_settings.compact
? compactSizes[selectedBreakpoint[0]]
: standardSizes[selectedBreakpoint[0]]
: "250";
return (
<div>
<Container width={width}>
<IndefiniteLoading loading={isMoving} />
<ProductionBoardFilters
filter={filter}
setFilter={setFilter}
loading={isMoving}
<PageHeader
title={
<Space>
<Statistic
title={t("dashboard.titles.productionhours")}
value={totalHrs}
/>
<Statistic
title={t("appointments.labels.inproduction")}
value={data && data.length}
/>
</Space>
}
extra={
<Space wrap>
<Button onClick={() => refetch && refetch()}>
<SyncOutlined />
</Button>
<ProductionBoardFilters
filter={filter}
setFilter={setFilter}
loading={isMoving}
/>
<ProductionBoardKanbanCardSettings
associationSettings={associationSettings}
/>
</Space>
}
/>
<Board
children={boardLanes}
disableCardDrag={isMoving}
renderCard={(card) => ProductionBoardCard(technician, card)}
renderCard={(card) =>
ProductionBoardCard(
technician,
card,
bodyshop,
associationSettings &&
associationSettings.kanban_settings &&
Object.keys(associationSettings.kanban_settings).length > 0
? associationSettings.kanban_settings
: {
ats: true,
clm_no: true,
compact: false,
ownr_nm: true,
sublets: true,
ins_co_nm: true,
production_note: true,
employeeassignments: true,
scheduled_completion: true,
}
)
}
onCardDragEnd={handleDragEnd}
/>
</div>
</Container>
);
}
export default connect(
mapStateToProps,
mapDispatchToProps
)(ProductionBoardKanbanComponent);
const Container = styled.div`
.react-kanban-card-skeleton,
.react-kanban-card,
.react-kanban-card-adder-form {
box-sizing: border-box;
max-width: ${(props) => props.width}px;
min-width: ${(props) => props.width}px;
}
`;

View File

@@ -1,25 +1,82 @@
import { useSubscription } from "@apollo/client";
import React from "react";
import { useApolloClient, useQuery, useSubscription } from "@apollo/client";
import _ from "lodash";
import React, { useEffect, useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { SUBSCRIPTION_JOBS_IN_PRODUCTION } from "../../graphql/jobs.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
import {
QUERY_EXACT_JOB_IN_PRODUCTION,
QUERY_JOBS_IN_PRODUCTION,
SUBSCRIPTION_JOBS_IN_PRODUCTION,
} from "../../graphql/jobs.queries";
import { QUERY_KANBAN_SETTINGS } from "../../graphql/user.queries";
import {
selectBodyshop,
selectCurrentUser,
} from "../../redux/user/user.selectors";
import ProductionBoardKanbanComponent from "./production-board-kanban.component";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
currentUser: selectCurrentUser,
});
export function ProductionBoardKanbanContainer({ bodyshop }) {
const { loading, data } = useSubscription(
SUBSCRIPTION_JOBS_IN_PRODUCTION,
{}
export function ProductionBoardKanbanContainer({ bodyshop, currentUser }) {
const { refetch, loading, data } = useQuery(QUERY_JOBS_IN_PRODUCTION, {
pollInterval: 3600000,
});
const client = useApolloClient();
const [joblist, setJoblist] = useState([]);
const { data: updatedJobs } = useSubscription(
SUBSCRIPTION_JOBS_IN_PRODUCTION
);
useEffect(() => {
if (!(data && data.jobs)) return;
setJoblist(
data.jobs.map((j) => {
return { id: j.id, updated_at: j.updated_at };
})
);
}, [data]);
useEffect(() => {
if (!updatedJobs || joblist.length === 0) return;
const jobDiff = _.differenceWith(
updatedJobs.jobs,
joblist,
(a, b) => a.id === b.id && a.updated_at === b.updated_at
);
jobDiff.forEach((job) => {
getUpdatedJobData(job.id);
});
setJoblist(updatedJobs);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [updatedJobs]);
const getUpdatedJobData = async (jobId) => {
client.query({
query: QUERY_EXACT_JOB_IN_PRODUCTION,
variables: { id: jobId },
});
};
const { loading: associationSettingsLoading, data: associationSettings } =
useQuery(QUERY_KANBAN_SETTINGS, {
variables: { email: currentUser.email },
});
return (
<ProductionBoardKanbanComponent
loading={loading}
loading={loading || associationSettingsLoading}
data={data ? data.jobs : []}
refetch={refetch}
associationSettings={
associationSettings && associationSettings.associations[0]
? associationSettings.associations[0]
: null
}
/>
);
}

View File

@@ -0,0 +1,123 @@
.react-kanban-board {
padding: 5px;
}
.react-kanban-card {
border-radius: 3px;
background-color: #fff;
padding: 4px;
margin-bottom: 7px;
}
// .react-kanban-card-skeleton,
// .react-kanban-card,
// .react-kanban-card-adder-form {
// box-sizing: border-box;
// max-width: 145px;
// min-width: 145px;
// }
.react-kanban-card--dragging {
box-shadow: 2px 2px grey;
}
.react-kanban-card__description {
padding-top: 10px;
}
.react-kanban-card__title {
border-bottom: 1px solid #eee;
padding-bottom: 5px;
font-weight: bold;
display: flex;
justify-content: space-between;
}
.react-kanban-column {
padding: 10px;
border-radius: 2px;
background-color: #eee;
margin: 5px;
}
.react-kanban-column input:focus {
outline: none;
}
.react-kanban-card-adder-form {
border-radius: 3px;
background-color: #fff;
padding: 10px;
margin-bottom: 7px;
}
.react-kanban-card-adder-form input {
border: 0px;
font-family: inherit;
font-size: inherit;
}
.react-kanban-card-adder-button {
width: 100%;
margin-top: 5px;
background-color: transparent;
cursor: pointer;
border: 1px solid #ccc;
transition: 0.3s;
border-radius: 3px;
font-size: 20px;
margin-bottom: 10px;
font-weight: bold;
}
.react-kanban-card-adder-button:hover {
background-color: #ccc;
}
.react-kanban-card-adder-form__title {
font-weight: bold;
border-bottom: 1px solid #eee;
padding-bottom: 5px;
font-weight: bold;
display: flex;
justify-content: space-between;
width: 100%;
padding: 0px;
}
.react-kanban-card-adder-form__title:focus {
outline: none;
}
.react-kanban-card-adder-form__description {
width: 100%;
margin-top: 10px;
}
.react-kanban-card-adder-form__description:focus {
outline: none;
}
.react-kanban-card-adder-form__button {
background-color: #eee;
border: none;
padding: 5px;
width: 45%;
margin-top: 5px;
border-radius: 3px;
}
.react-kanban-card-adder-form__button:hover {
transition: 0.3s;
cursor: pointer;
background-color: #ccc;
}
.react-kanban-column-header {
padding-bottom: 10px;
font-weight: bold;
}
.react-kanban-column-header input:focus {
outline: none;
}
.react-kanban-column-header__button {
color: #333333;
background-color: #ffffff;
border-color: #cccccc;
}
.react-kanban-column-header__button:hover,
.react-kanban-column-header__button:focus,
.react-kanban-column-header__button:active {
background-color: #e6e6e6;
}
.react-kanban-column-adder-button {
border: 2px dashed #eee;
height: 132px;
margin: 5px;
}
.react-kanban-column-adder-button:hover {
cursor: pointer;
}

View File

@@ -1,4 +1,5 @@
import i18n from "i18next";
import moment from "moment";
import React from "react";
import { Link } from "react-router-dom";
import CurrencyFormatter from "../../utils/CurrencyFormatter";
@@ -11,11 +12,11 @@ import ProductionListColumnBodyPriority from "./production-list-columns.bodyprio
import ProductionListDate from "./production-list-columns.date.component";
import ProductionListColumnDetailPriority from "./production-list-columns.detailpriority.component";
import ProductionListEmployeeAssignment from "./production-list-columns.empassignment.component";
import ProductionListLastContacted from "./production-list-columns.lastcontacted.component";
import ProductionListColumnPaintPriority from "./production-list-columns.paintpriority.component";
import ProductionListColumnNote from "./production-list-columns.productionnote.component";
import ProductionListColumnStatus from "./production-list-columns.status.component";
import ProductionlistColumnTouchTime from "./prodution-list-columns.touchtime.component";
import ProductionListLastContacted from "./production-list-columns.lastcontacted.component";
const r = ({ technician, state, activeStatuses }) => {
return [
@@ -109,6 +110,29 @@ const r = ({ technician, state, activeStatuses }) => {
state.sortedInfo.order,
render: (text, record) => <ProductionListLastContacted record={record} />,
},
{
title: i18n.t("jobs.fields.date_next_contact"),
dataIndex: "date_next_contact",
key: "date_next_contact",
ellipsis: true,
sorter: (a, b) => dateSort(a.date_next_contact, b.date_next_contact),
sortOrder:
state.sortedInfo.columnKey === "date_next_contact" &&
state.sortedInfo.order,
render: (text, record) => (
<span
style={{
color:
record.date_next_contact &&
moment(record.date_next_contact).isBefore(moment())
? "red"
: "",
}}
>
<ProductionListDate record={record} field="date_next_contact" time />
</span>
),
},
{
title: i18n.t("jobs.fields.scheduled_delivery"),
dataIndex: "scheduled_delivery",
@@ -332,7 +356,7 @@ const r = ({ technician, state, activeStatuses }) => {
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}
type="employee_body_rel"
type="employee_body"
/>
),
},
@@ -343,7 +367,7 @@ const r = ({ technician, state, activeStatuses }) => {
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}
type="employee_prep_rel"
type="employee_prep"
/>
),
},
@@ -352,10 +376,7 @@ const r = ({ technician, state, activeStatuses }) => {
dataIndex: "employee_csr",
key: "employee_csr",
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}
type="employee_csr_rel"
/>
<ProductionListEmployeeAssignment record={record} type="employee_csr" />
),
},
{
@@ -365,7 +386,7 @@ const r = ({ technician, state, activeStatuses }) => {
render: (text, record) => (
<ProductionListEmployeeAssignment
record={record}
type="employee_refinish_rel"
type="employee_refinish"
/>
),
},

View File

@@ -49,7 +49,7 @@ export function ProductionListEmpAssignment({
const result = await updateJob({
variables: { jobId: record.id, job: { [empAssignment]: employeeid } },
awaitRefetchQueries: true,
// awaitRefetchQueries: true,
});
insertAuditTrail({
@@ -145,13 +145,18 @@ export function ProductionListEmpAssignment({
</Row>
);
let theEmployee;
if (record[type])
theEmployee = bodyshop.employees.find((e) => e.id === record[type]);
return (
<Popover destroyTooltipOnHide content={popContent} visible={visibility}>
<Spin spinning={loading}>
{record[type] ? (
<div>
<span>{`${record[type].first_name || ""} ${
record[type].last_name || ""
<span>{`${theEmployee.first_name || ""} ${
theEmployee.last_name || ""
}`}</span>
<DeleteFilled
style={iconStyle}
@@ -174,13 +179,13 @@ export function ProductionListEmpAssignment({
const determineFieldName = (operation) => {
switch (operation) {
case "employee_body_rel":
case "employee_body":
return "employee_body";
case "employee_prep_rel":
case "employee_prep":
return "employee_prep";
case "employee_refinish_rel":
case "employee_refinish":
return "employee_refinish";
case "employee_csr_rel":
case "employee_csr":
return "employee_csr";
default:
return null;

View File

@@ -29,7 +29,11 @@ export function ProductionLastContacted({ currentUser, record }) {
const [visible, setVisible] = useState(false);
const { t } = useTranslation();
const [form] = Form.useForm();
const handleFinish = async ({ date_last_contacted, note }) => {
const handleFinish = async ({
date_last_contacted,
date_next_contact,
note,
}) => {
logImEXEvent("production_last_contacted");
//e.stopPropagation();
@@ -38,6 +42,7 @@ export function ProductionLastContacted({ currentUser, record }) {
jobId: record.id,
job: {
date_last_contacted,
...(date_next_contact ? { date_next_contact } : {}),
},
},
});
@@ -98,7 +103,16 @@ export function ProductionLastContacted({ currentUser, record }) {
onClick={(e) => e.stopPropagation()}
>
<Form form={form} onFinish={handleFinish} layout="vertical">
<Form.Item name="date_last_contacted">
<Form.Item
name="date_last_contacted"
label={t("jobs.fields.date_last_contacted")}
>
<FormDateTimePickerComponent />
</Form.Item>
<Form.Item
name="date_next_contact"
label={t("jobs.fields.date_next_contact")}
>
<FormDateTimePickerComponent />
</Form.Item>
<Form.Item label={t("notes.labels.notetoadd")} name="note">

View File

@@ -1,4 +1,7 @@
import { SyncOutlined } from "@ant-design/icons";
import { useTreatments } from "@splitsoftware/splitio-react";
import {
Button,
Dropdown,
Input,
Menu,
@@ -24,7 +27,6 @@ import ProductionListSaveConfigButton from "../production-list-save-config-butto
import ProductionListPrint from "./production-list-print.component";
import ProductionListTableViewSelect from "./production-list-table-view-select.component";
import ResizeableTitle from "./production-list-table.resizeable.component";
import { useTreatments } from "@splitsoftware/splitio-react";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -35,6 +37,7 @@ const mapStateToProps = createStructuredSelector({
export function ProductionListTable({
loading,
data,
refetch,
bodyshop,
technician,
currentUser,
@@ -42,6 +45,7 @@ export function ProductionListTable({
const [searchText, setSearchText] = useState("");
const { Production_List_Status_Colors } = useTreatments([
"Production_List_Status_Colors",
bodyshop.imexshopid,
]);
const assoc = bodyshop.associations.find(
(a) => a.useremail === currentUser.email
@@ -182,13 +186,22 @@ export function ProductionListTable({
<div>
<PageHeader
title={
<Statistic
title={t("dashboard.titles.productionhours")}
value={totalHrs}
/>
<Space>
<Statistic
title={t("dashboard.titles.productionhours")}
value={totalHrs}
/>
<Statistic
title={t("appointments.labels.inproduction")}
value={dataSource && dataSource.length}
/>
</Space>
}
extra={
<Space wrap>
<Button onClick={() => refetch && refetch()}>
<SyncOutlined />
</Button>
<ProductionListColumnsAdd
columnState={[columns, setColumns]}
tableState={state}

View File

@@ -1,13 +1,61 @@
import { useSubscription } from "@apollo/client";
import React from "react";
import { SUBSCRIPTION_JOBS_IN_PRODUCTION } from "../../graphql/jobs.queries";
import { useApolloClient, useQuery, useSubscription } from "@apollo/client";
import React, { useEffect, useState } from "react";
import {
QUERY_EXACT_JOB_IN_PRODUCTION,
QUERY_JOBS_IN_PRODUCTION,
SUBSCRIPTION_JOBS_IN_PRODUCTION,
} from "../../graphql/jobs.queries";
import ProductionListTable from "./production-list-table.component";
import _ from "lodash";
export default function ProductionListTableContainer() {
const { loading, data } = useSubscription(
SUBSCRIPTION_JOBS_IN_PRODUCTION,
{}
const { refetch, loading, data } = useQuery(QUERY_JOBS_IN_PRODUCTION, {
pollInterval: 3600000,
});
const client = useApolloClient();
const [joblist, setJoblist] = useState([]);
const { data: updatedJobs } = useSubscription(
SUBSCRIPTION_JOBS_IN_PRODUCTION
);
return <ProductionListTable loading={loading} data={data ? data.jobs : []} />;
useEffect(() => {
if (!(data && data.jobs)) return;
setJoblist(
data.jobs.map((j) => {
return { id: j.id, updated_at: j.updated_at };
})
);
}, [data]);
useEffect(() => {
if (!updatedJobs || joblist.length === 0) return;
const jobDiff = _.differenceWith(
updatedJobs.jobs,
joblist,
(a, b) => a.id === b.id && a.updated_at === b.updated_at
);
jobDiff.forEach((job) => {
getUpdatedJobData(job.id);
});
setJoblist(updatedJobs);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [updatedJobs]);
const getUpdatedJobData = async (jobId) => {
client.query({
query: QUERY_EXACT_JOB_IN_PRODUCTION,
variables: { id: jobId },
});
};
return (
<ProductionListTable
loading={loading}
data={data ? data.jobs : []}
refetch={refetch}
/>
);
}

View File

@@ -3,10 +3,10 @@ import { Button, List, notification, Popover } from "antd";
import React, { useMemo, useState } from "react";
import { useMutation } from "@apollo/client";
import { useTranslation } from "react-i18next";
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
import { UPDATE_JOB_LINE_SUBLET } from "../../graphql/jobs-lines.queries";
export default function ProductionSubletsManageComponent({ subletJobLines }) {
const { t } = useTranslation();
const [updateJobLine] = useMutation(UPDATE_JOB_LINE);
const [updateJobLine] = useMutation(UPDATE_JOB_LINE_SUBLET);
const [loading, setLoading] = useState(false);
const subletCount = useMemo(() => {
return {
@@ -22,6 +22,8 @@ export default function ProductionSubletsManageComponent({ subletJobLines }) {
const result = await updateJobLine({
variables: {
jobId: sublet.jobid,
now: new Date(),
lineId: sublet.id,
line: {
sublet_completed:
@@ -56,7 +58,10 @@ export default function ProductionSubletsManageComponent({ subletJobLines }) {
<Button
key="complete"
loading={loading}
onClick={() => handleSubletMark(s, "complete")}
onClick={(e) => {
e.stopPropagation();
handleSubletMark(s, "complete");
}}
type={s.sublet_completed ? "primary" : "ghost"}
>
<CheckCircleFilled
@@ -66,7 +71,10 @@ export default function ProductionSubletsManageComponent({ subletJobLines }) {
<Button
key="sublet"
loading={loading}
onClick={() => handleSubletMark(s, "ignore")}
onClick={(e) => {
e.stopPropagation();
handleSubletMark(s, "ignore");
}}
type={s.sublet_ignored ? "primary" : "ghost"}
>
<EyeInvisibleFilled

View File

@@ -71,7 +71,7 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
const start = values.dates[0];
const end = values.dates[1];
const { id } = values;
console.log("values", values);
await GenerateDocument(
{
name: values.key,
@@ -185,24 +185,14 @@ export function ReportCenterModalComponent({ reportCenterModal }) {
);
}}
</Form.Item>
<Form.Item
shouldUpdate={(prev, cur) =>
Templates[prev.key]?.idtype !== Templates[cur.key]?.idtype
}
style={{ display: "none", margin: 0, padding: 0 }}
>
{() => {
form.setFieldsValue({ id: null });
return null;
}}
</Form.Item>
<Form.Item style={{ margin: 0, padding: 0 }} dependencies={["key"]}>
{() => {
const key = form.getFieldValue("key");
const currentId = form.getFieldValue("id");
if (!key) return null;
//Kind of Id
const idtype = Templates[key] && Templates[key].idtype;
if (!idtype) {
if (!idtype && currentId) {
form.setFieldsValue({ id: null });
return null;
}

View File

@@ -5,9 +5,8 @@ import {
Input,
Row,
Select,
Space,
Switch,
Typography,
Space, Switch,
Typography
} from "antd";
import axios from "axios";
import moment from "moment";
@@ -75,6 +74,12 @@ export function ScheduleJobModalComponent({
return (
<Row gutter={[16, 16]}>
<Col span={12}>
<Space>
<Typography.Title level={3}>{lbrHrsData?.jobs_by_pk?.ro_number}</Typography.Title>
<Typography.Title
level={4}
>{`B/R Hrs:${lbrHrsData?.jobs_by_pk.labhrs?.aggregate.sum.mod_lb_hrs}/${lbrHrsData?.jobs_by_pk.larhrs?.aggregate.sum.mod_lb_hrs}`}</Typography.Title>
</Space>
<LayoutFormRow grow>
<Form.Item
name="start"

View File

@@ -101,7 +101,6 @@ export function ScheduleJobModalContainer({
}
if (existingAppointments.data.appointments.length > 0) {
console.log("Cancelling all previous appts.");
await Promise.all(
existingAppointments.data.appointments.map((app) => {
return cancelAppointment({

View File

@@ -3,12 +3,9 @@ import { Form } from "antd";
import ConfigFormComponents from "../config-form-components/config-form-components.component";
export default function ShopCsiConfigForm({ selectedCsi }) {
console.log("ShopCsiConfigForm -> selectedCsi", selectedCsi);
const readOnly = !!selectedCsi;
const [form] = Form.useForm();
const handleFinish = (values) => {
console.log("values :>> ", values);
};
const handleFinish = (values) => {};
return (
<div>

View File

@@ -14,6 +14,7 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
import FormDatePicker from "../form-date-picker/form-date-picker.component";
import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component";
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
import CiecaSelect from "../../utils/Ciecaselect";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
@@ -218,6 +219,7 @@ export function ShopEmployeesFormComponent({
label={t("employees.fields.cost_center")}
key={`${index}`}
name={[field.name, "cost_center"]}
valuePropName="value"
rules={[
{
required: true,
@@ -232,11 +234,16 @@ export function ShopEmployeesFormComponent({
>
{t("timetickets.labels.shift")}
</Select.Option>
{bodyshop.md_responsibility_centers.costs.map((c) => (
<Select.Option key={c.name} value={c.name}>
{c.name}
</Select.Option>
))}
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? CiecaSelect(false, true)
: bodyshop.md_responsibility_centers.costs.map(
(c) => (
<Select.Option key={c.name} value={c.name}>
{c.name}
</Select.Option>
)
)}
</Select>
</Form.Item>
<Form.Item

View File

@@ -467,6 +467,19 @@ export default function ShopInfoGeneral({ form }) {
>
<Switch />
</Form.Item>
<Form.Item
name={["md_email_cc", "parts_order"]}
label={t("bodyshop.fields.md_email_cc", { template: "parts_order" })}
rules={[
{
//message: t("general.validation.required"),
type: "array",
},
]}
>
<Select mode="tags" />
</Form.Item>
<Form.Item
name={["tt_allow_post_to_invoiced"]}
label={t("bodyshop.fields.tt_allow_post_to_invoiced")}
@@ -479,7 +492,7 @@ export default function ShopInfoGeneral({ form }) {
label={t("bodyshop.fields.md_ded_notes")}
rules={[
{
required: true,
//message: t("general.validation.required"),
type: "array",
},
@@ -848,6 +861,88 @@ export default function ShopInfoGeneral({ form }) {
}}
</Form.List>
</LayoutFormRow>
<LayoutFormRow grow header={t("bodyshop.labels.filehandlers")}>
<Form.List name={["md_filehandlers"]}>
{(fields, { add, remove, move }) => {
return (
<div>
{fields.map((field, index) => (
<Form.Item key={field.key}>
<LayoutFormRow noDivider>
<Form.Item
label={t("jobs.fields.ins_ct_fn")}
key={`${index}ins_ct_fn`}
name={[field.name, "ins_ct_fn"]}
>
<Input />
</Form.Item>
<Form.Item
label={t("jobs.fields.ins_ct_ln")}
key={`${index}ins_ct_ln`}
name={[field.name, "ins_ct_ln"]}
>
<Input />
</Form.Item>
<Form.Item
label={t("jobs.fields.ins_ph1")}
key={`${index}ins_ph1`}
name={[field.name, "ins_ph1"]}
rules={[
({ getFieldValue }) =>
PhoneItemFormatterValidation(getFieldValue, [
field.name,
"ins_ph",
]),
]}
>
<Input />
</Form.Item>
<Form.Item
label={t("jobs.fields.ins_ea")}
key={`${index}ins_ea`}
name={[field.name, "ins_ea"]}
rules={[
{
type: "email",
message: "This is not a valid email address.",
},
]}
>
<FormItemEmail
email={form.getFieldValue([field.name, "ins_ea"])}
/>
</Form.Item>
<Space>
<DeleteFilled
onClick={() => {
remove(field.name);
}}
/>
<FormListMoveArrows
move={move}
index={index}
total={fields.length}
/>
</Space>
</LayoutFormRow>
</Form.Item>
))}
<Form.Item>
<Button
type="dashed"
onClick={() => {
add();
}}
style={{ width: "100%" }}
>
{t("general.actions.add")}
</Button>
</Form.Item>
</div>
);
}}
</Form.List>
</LayoutFormRow>
<LayoutFormRow grow header={t("bodyshop.fields.md_ccc_rates")}>
<Form.List name={["md_ccc_rates"]}>
{(fields, { add, remove, move }) => {

View File

@@ -7,16 +7,31 @@ import { useTranslation } from "react-i18next";
import styled from "styled-components";
import LayoutFormRow from "../layout-form-row/layout-form-row.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))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(ShopInfoROStatusComponent);
const SelectorDiv = styled.div`
.ant-form-item .ant-select {
width: 200px;
}
`;
export default function ShopInfoROStatusComponent({ form }) {
export function ShopInfoROStatusComponent({ bodyshop, form }) {
const { t } = useTranslation();
const { Production_List_Status_Colors } = useTreatments([
"Production_List_Status_Colors",
bodyshop.imexshopid,
]);
const [options, setOptions] = useState(
@@ -344,10 +359,6 @@ export default function ShopInfoROStatusComponent({ form }) {
const ColorPicker = ({ value, onChange, style, ...restProps }) => {
const handleChange = (color) => {
console.log(
"🚀 ~ file: shop-info.rostatus.component.jsx ~ line 345 ~ color",
color
);
if (onChange) onChange(color.rgb);
};
return (

View File

@@ -47,9 +47,13 @@ export function TimeTicketModalComponent({
>
{emps &&
emps.rates.map((item) => (
<Select.Option key={item.cost_center}>
<Select.Option key={item.cost_center} value={item.cost_center}>
{item.cost_center === "timetickets.labels.shift"
? t(item.cost_center)
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? t(
`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`
)
: item.cost_center}
</Select.Option>
))}
@@ -116,11 +120,10 @@ export function TimeTicketModalComponent({
<EmployeeSearchSelect
options={employeeAutoCompleteOptions}
onSelect={(value) => {
console.log(value);
const emps =
employeeAutoCompleteOptions &&
employeeAutoCompleteOptions.filter((e) => e.id === value)[0];
console.log(emps);
form.setFieldsValue({ flat_rate: emps && emps.flat_rate });
}}
/>
@@ -138,6 +141,7 @@ export function TimeTicketModalComponent({
<Form.Item
name="cost_center"
label={t("timetickets.fields.cost_center")}
valuePropName="value"
rules={[
{
required: true,

View File

@@ -143,13 +143,16 @@ export function TimeTicketModalContainer({
}
if (!!changedFields.cost_center && !!EmployeeAutoCompleteData) {
form.setFieldsValue({
ciecacode: Object.keys(
bodyshop.md_responsibility_centers.defaults.costs
).find(
(key) =>
bodyshop.md_responsibility_centers.defaults.costs[key] ===
changedFields.cost_center
),
ciecacode:
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
? changedFields.cost_center
: Object.keys(
bodyshop.md_responsibility_centers.defaults.costs
).find(
(key) =>
bodyshop.md_responsibility_centers.defaults.costs[key] ===
changedFields.cost_center
),
});
}
};

View File

@@ -37,10 +37,9 @@ export function UserValidatePwReset({
async function checkCodeValid() {
try {
const codeValid = await checkActionCode(auth, oobCode);
console.log("codeValid :>> ", codeValid);
setCodeValid({ loading: false, ...codeValid });
} catch (error) {
console.log("error :>> ", error);
setCodeValid({ loading: false, ...error });
}
}

View File

@@ -37,7 +37,7 @@ export function VendorsPhonebookAdd({ form, bodyshop, disabled }) {
"zip",
"country",
]);
console.log(`VendorValues`, VendorValues);
const result = await insertPhonebook({
variables: {
phonebook_entry: [

View File

@@ -98,7 +98,10 @@ export const QUERY_BODYSHOP = gql`
md_ded_notes
pbs_configuration
pbs_serialnumber
md_filehandlers
md_email_cc
employees {
user_email
id
active
first_name
@@ -192,6 +195,8 @@ export const UPDATE_SHOP = gql`
md_ded_notes
pbs_configuration
pbs_serialnumber
md_filehandlers
md_email_cc
employees {
id
first_name
@@ -199,6 +204,7 @@ export const UPDATE_SHOP = gql`
last_name
employee_number
rates
user_email
}
}
}

View File

@@ -2,7 +2,7 @@ import { gql } from "@apollo/client";
export const QUERY_EMPLOYEES = gql`
query QUERY_EMPLOYEES {
employees {
employees(order_by: { employee_number: asc }) {
last_name
id
first_name

View File

@@ -136,6 +136,27 @@ export const RECEIVE_PARTS_LINE = gql`
}
`;
export const UPDATE_JOB_LINE_SUBLET = gql`
mutation UPDATE_JOB_LINE_SUBLET(
$lineId: uuid!
$line: joblines_set_input!
$now: timestamptz!
$jobId: uuid!
) {
update_jobs_by_pk(pk_columns: { id: $jobId }, _set: { updated_at: $now }) {
id
updated_at
}
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
returning {
id
sublet_completed
sublet_ignored
}
}
}
`;
export const UPDATE_JOB_LINE = gql`
mutation UPDATE_JOB_LINE($lineId: uuid!, $line: joblines_set_input!) {
update_joblines(where: { id: { _eq: $lineId } }, _set: $line) {
@@ -179,6 +200,10 @@ export const GET_JOB_LINES_TO_ENTER_BILL = gql`
jobs_by_pk(id: $id) {
id
status
ious {
id
ro_number
}
}
}
`;
@@ -226,3 +251,14 @@ export const DELETE_JOB_LINE_BY_PK = gql`
}
}
`;
export const UPDATE_JOB_LINES_IOU = gql`
mutation UPDATE_JOB_LINES_IOU($ids: [uuid!]!) {
update_joblines(where: { id: { _in: $ids } }, _set: { ioucreated: true }) {
returning {
ioucreated
id
}
}
}
`;

View File

@@ -105,10 +105,18 @@ export const QUERY_PARTS_QUEUE = gql`
}
}
`;
export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
subscription SUBSCRIPTION_JOBS_IN_PRODUCTION {
jobs(where: { inproduction: { _eq: true } }) {
id
updated_at
}
}
`;
export const QUERY_EXACT_JOB_IN_PRODUCTION = gql`
query QUERY_EXACT_JOB_IN_PRODUCTION($id: uuid!) {
jobs(where: { id: { _eq: $id } }) {
id
status
ro_number
@@ -125,6 +133,7 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
scheduled_completion
scheduled_delivery
date_last_contacted
date_next_contact
ins_co_nm
clm_total
ownr_ph1
@@ -134,39 +143,10 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
production_vars
kanbanparent
alt_transport
joblines_status {
part_type
count
status
}
employee_body
employee_body_rel {
id
first_name
last_name
}
employee_refinish
employee_refinish_rel {
id
first_name
last_name
}
employee_prep
employee_prep_rel {
id
first_name
last_name
}
employee_csr_rel {
id
first_name
last_name
}
partcount: joblines_aggregate(where: { removed: { _eq: false } }) {
nodes {
status
}
}
employee_csr
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
@@ -199,6 +179,79 @@ export const SUBSCRIPTION_JOBS_IN_PRODUCTION = gql`
line_desc
sublet_ignored
sublet_completed
jobid
}
}
}
`;
export const QUERY_JOBS_IN_PRODUCTION = gql`
query QUERY_JOBS_IN_PRODUCTION {
jobs(where: { inproduction: { _eq: true } }) {
id
updated_at
status
ro_number
ownr_fn
ownr_ln
ownr_co_nm
v_model_yr
v_model_desc
clm_no
v_make_desc
v_color
plate_no
actual_in
scheduled_completion
scheduled_delivery
date_last_contacted
date_next_contact
ins_co_nm
clm_total
ownr_ph1
ownr_ph2
special_coverage_policy
owner_owing
production_vars
kanbanparent
alt_transport
employee_body
employee_refinish
employee_prep
employee_csr
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
subletLines: joblines(
where: {
_and: { part_type: { _in: ["PAS", "PASL"] }, removed: { _eq: false } }
}
order_by: { line_no: asc }
) {
id
line_desc
sublet_ignored
sublet_completed
jobid
}
}
}
@@ -208,6 +261,7 @@ export const QUERY_LBR_HRS_BY_PK = gql`
query QUERY_LBR_HRS_BY_PK($id: uuid!) {
jobs_by_pk(id: $id) {
id
ro_number
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
@@ -518,6 +572,7 @@ export const GET_JOB_BY_PK = gql`
date_scheduled
date_invoiced
date_last_contacted
date_next_contact
date_exported
status
owner_owing
@@ -535,6 +590,7 @@ export const GET_JOB_BY_PK = gql`
unq_seq
line_ind
line_desc
line_ref
part_type
oem_partno
db_price
@@ -554,6 +610,7 @@ export const GET_JOB_BY_PK = gql`
manual_line
prt_dsmk_p
prt_dsmk_m
ioucreated
billlines(limit: 1, order_by: { bill: { date: desc } }) {
id
quantity
@@ -760,6 +817,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
scheduled_delivery
date_invoiced
date_last_contacted
date_next_contact
date_open
date_exported
@@ -846,6 +904,7 @@ export const QUERY_TECH_JOB_DETAILS = gql`
scheduled_delivery
date_invoiced
date_last_contacted
date_next_contact
date_open
date_exported
voided
@@ -897,6 +956,7 @@ export const UPDATE_JOB = gql`
update_jobs(where: { id: { _eq: $jobId } }, _set: $job) {
returning {
id
date_exported
status
alt_transport
@@ -1276,9 +1336,7 @@ export const QUERY_JOB_FOR_DUPE = gql`
servicing_dealer
servicing_dealer_contact
shopid
state_tax_rate
tax_lbr_rt
tax_levies_rt
tax_paint_mat_rt
@@ -1343,9 +1401,19 @@ export const QUERY_JOB_FOR_DUPE = gql`
tax_part
unq_seq
manual_line
notes
line_no
tran_code
}
driveable
towin
adj_g_disc
adj_strdis
adj_towdis
ca_gst_registrant
special_coverage_policy
tax_registration_number
tax_shop_mat_rt
}
}
`;
@@ -1603,46 +1671,6 @@ export const QUERY_ALL_JOB_FIELDS = gql`
}
}
`;
export const QUERY_JOBS_IN_PRODUCTION = gql`
query QUERY_JOBS_IN_PRODUCTION {
jobs(
where: { inproduction: { _eq: true } }
order_by: { scheduled_completion: asc }
) {
id
ro_number
ownr_co_nm
ownr_fn
ownr_ln
v_model_yr
v_make_desc
v_model_desc
scheduled_completion
labhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _neq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
larhrs: joblines_aggregate(
where: {
_and: [{ mod_lbr_ty: { _eq: "LAR" } }, { removed: { _eq: false } }]
}
) {
aggregate {
sum {
mod_lb_hrs
}
}
}
}
}
`;
export const QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED = gql`
query QUERY_ALL_JOBS_PAGINATED_STATUS_FILTERED(
@@ -1718,6 +1746,7 @@ export const QUERY_JOB_CLOSE_DETAILS = gql`
ro_number
invoice_allocation
ins_co_id
dms_allocation
id
ded_amt
ded_status
@@ -1941,6 +1970,7 @@ export const QUERY_JOB_EXPORT_DMS = gql`
v_model_yr
v_model_desc
area_of_damage
date_exported
}
}
`;

View File

@@ -14,6 +14,7 @@ export const QUERY_NOTES_BY_JOB_PK = gql`
query QUERY_NOTES_BY_JOB_PK($id: uuid!) {
jobs_by_pk(id: $id) {
id
ro_number
notes {
created_at
created_by

View File

@@ -11,6 +11,278 @@ export const INSERT_NEW_PARTS_ORDERS = gql`
}
`;
export const QUERY_PARTS_ORDER_OEC = gql`
query QUERY_PARTS_ORDER_OEC($id: uuid!) {
parts_orders_by_pk(id: $id) {
parts_order_lines {
jobline {
tran_code
act_price
db_ref
db_price
db_hrs
glass_flag
id
lbr_amt
lbr_hrs_j
lbr_inc
lbr_op
lbr_op_j
lbr_tax
lbr_typ_j
line_desc
line_ind
line_no
line_ref
location
misc_amt
misc_sublt
misc_tax
mod_lb_hrs
mod_lbr_ty
oem_partno
op_code_desc
paint_stg
paint_tone
part_qty
part_type
price_inc
price_j
prt_dsmk_m
prt_dsmk_p
tax_part
unq_seq
alt_co_id
alt_overrd
alt_part_i
alt_partm
alt_partno
bett_amt
bett_pctg
bett_tax
bett_type
cert_part
est_seq
}
act_price
id
db_price
line_desc
quantity
}
job {
bodyshop{
shopname
bill_tax_rates
}
ro_number
clm_no
asgn_no
asgn_date
state_tax_rate
area_of_damage
asgn_no
asgn_type
ciecaid
clm_addr1
clm_city
clm_addr2
clm_ct_fn
clm_ct_ln
clm_ct_ph
clm_ct_phx
clm_ctry
clm_ea
clm_fax
clm_faxx
clm_ofc_id
clm_ofc_nm
clm_ph1
clm_ph1x
clm_ph2
clm_ph2x
clm_st
clm_title
clm_total
clm_zip
ded_amt
est_addr1
est_addr2
est_city
est_co_nm
est_ct_fn
est_ctry
est_ct_ln
est_ea
est_ph1
est_st
est_zip
g_bett_amt
id
ins_addr1
ins_city
ins_addr2
ins_co_id
ins_co_nm
ins_ct_fn
ins_ct_ln
ins_ct_ph
ins_ct_phx
ins_ctry
ins_ea
ins_fax
ins_faxx
ins_memo
ins_ph1
ins_ph1x
ins_ph2
ins_ph2x
ins_st
ins_title
ins_zip
insd_addr1
insd_addr2
insd_city
insd_co_nm
insd_ctry
insd_ea
insd_fax
insd_faxx
insd_fn
insd_ln
insd_ph1
insd_ph1x
insd_ph2
insd_ph2x
insd_st
insd_title
insd_zip
job_totals
loss_cat
loss_date
loss_desc
loss_of_use
loss_type
ownr_addr1
ownr_addr2
ownr_city
ownr_co_nm
ownr_ctry
ownr_ea
ownr_fax
ownr_faxx
ownr_ph1
ownr_fn
ownr_ln
ownr_ph1x
ownr_ph2
ownr_ph2x
ownr_st
ownr_title
ownr_zip
parts_tax_rates
pay_amt
pay_date
pay_type
pay_chknm
payee_nms
plate_no
plate_st
po_number
policy_no
tax_lbr_rt
tax_levies_rt
tax_paint_mat_rt
tax_predis
tax_prethr
tax_pstthr
tax_registration_number
tax_str_rt
tax_shop_mat_rt
tax_sub_rt
tax_thramt
tax_tow_rt
theft_ind
tlos_ind
towin
v_color
v_make_desc
v_model_desc
v_model_yr
v_vin
vehicle {
v_bstyle
v_type
v_trimcode
v_tone
v_stage
v_prod_dt
v_options
v_paint_codes
v_model_yr
v_model_desc
v_mldgcode
v_makecode
v_make_desc
v_engine
v_cond
v_color
trim_color
shopid
plate_no
plate_st
db_v_code
v_vin
}
agt_zip
agt_st
agt_ph2x
agt_ph2
agt_ph1x
agt_ph1
agt_lic_no
agt_faxx
agt_fax
agt_ea
agt_ctry
agt_ct_phx
agt_ct_ph
agt_ct_ln
agt_ct_fn
agt_co_nm
agt_co_id
agt_city
agt_addr1
agt_addr2
adj_g_disc
rate_matd
rate_mash
rate_mapa
rate_mahw
rate_macs
rate_mabl
rate_ma3s
rate_ma2t
rate_ma2s
rate_lau
rate_las
rate_lar
rate_lam
rate_lag
rate_laf
rate_lae
rate_lad
rate_lab
rate_laa
rate_la4
rate_la3
rate_la2
rate_la1
}
}
}
`;
export const DELETE_PARTS_ORDER = gql`
mutation DELETE_PARTS_ORDER($partsOrderId: uuid!) {
delete_parts_orders_by_pk(id: $partsOrderId) {

View File

@@ -69,3 +69,25 @@ export const UPDATE_FCM_TOKEN = gql`
}
}
`;
export const QUERY_KANBAN_SETTINGS = gql`
query QUERY_KANBAN_SETTINGS($email: String!) {
associations(
where: { _and: { useremail: { _eq: $email }, active: { _eq: true } } }
) {
id
kanban_settings
}
}
`;
export const UPDATE_KANBAN_SETTINGS = gql`
mutation UPDATE_KANBAN_SETTINGS($id: uuid!, $ks: jsonb) {
update_associations_by_pk(
pk_columns: { id: $id }
_set: { kanban_settings: $ks }
) {
id
kanban_settings
}
}
`;

Some files were not shown because too many files have changed in this diff Show More