@@ -1,6 +1,5 @@
|
||||
|
||||
<?xml version="1.0" ?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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">
|
||||
@@ -9,23 +8,23 @@
|
||||
</xsl:attribute>
|
||||
<xsl:choose>
|
||||
<xsl:when test="Details/@PrgID">
|
||||
<xsl:copy-of select="Details" />
|
||||
<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:copy-of select="."/>
|
||||
</xsl:for-each>
|
||||
<xsl:for-each select="Details/*">
|
||||
<xsl:copy-of select="." />
|
||||
<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:value-of select="//Envelope/@RONum"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="OwnerFName">
|
||||
<xsl:value-of select="//Admin/@OwnerF"/>
|
||||
@@ -34,43 +33,43 @@
|
||||
<xsl:value-of select="//Admin/@OwnerL"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="VIN">
|
||||
<xsl:value-of select="//Vehicle/@TransVIN" />
|
||||
<xsl:value-of select="//Vehicle/@TransVIN"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="Mileage">
|
||||
<xsl:value-of select="//Vehicle/@TransMileage" />
|
||||
<xsl:value-of select="//Vehicle/@TransMileage"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="Year">
|
||||
<xsl:value-of select="//Vehicle/@TransYear" />
|
||||
<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 test="//Vehicle/@ManufName[. != '']">
|
||||
<xsl:value-of select="//Vehicle/@ManufName"/>
|
||||
</xsl:if>
|
||||
<xsl:if test="//Vehicle/@ManufName[. = '']" >
|
||||
<xsl:value-of select="//Vehicle/@ManufCode" />
|
||||
<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: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: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: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:apply-templates select="PartsList"/>
|
||||
<xsl:element name="Envelope">
|
||||
<xsl:element name="Software">
|
||||
<xsl:attribute name="Manifest">CCC.xml</xsl:attribute>
|
||||
@@ -91,10 +90,13 @@
|
||||
<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: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:value-of select="//Envelope/@EstimatingSystem"/>-
|
||||
<xsl:value-of select="//Envelope/@UniqueFileID"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="EstimateFormatVersion">
|
||||
<xsl:value-of select="//Envelope/@EMSVersion"/>
|
||||
@@ -102,9 +104,9 @@
|
||||
</xsl:element>
|
||||
</xsl:element>
|
||||
<xsl:element name="Totals">
|
||||
<xsl:attribute name="GrandTotalAmount">
|
||||
<xsl:value-of select="//Total/@GrandTotalAmount"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="GrandTotalAmount">
|
||||
<xsl:value-of select="//Total/@GrandTotalAmount"/>
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
<xsl:element name="Administrative">
|
||||
<xsl:element name="Owner">
|
||||
@@ -215,7 +217,8 @@
|
||||
<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:when
|
||||
test="string-length(substring-after(//Admin/@InsuranceZip, '-'))=4">
|
||||
<xsl:value-of select="//Admin/@InsuranceZip"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
@@ -226,7 +229,8 @@
|
||||
</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: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)>4">
|
||||
<xsl:value-of select="substring(//Admin/@InsuranceZip, 1, 5)"/>
|
||||
@@ -239,7 +243,8 @@
|
||||
<xsl:attribute name="Phone">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//Admin/@InsurancePhone1Ext[. != '']">
|
||||
<xsl:value-of select="//Admin/@InsurancePhone1"/> x<xsl:value-of select="//Admin/@InsurancePhone1Ext"/>
|
||||
<xsl:value-of select="//Admin/@InsurancePhone1"/> x
|
||||
<xsl:value-of select="//Admin/@InsurancePhone1Ext"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="//Admin/@InsurancePhone1"/>
|
||||
@@ -249,7 +254,8 @@
|
||||
<xsl:attribute name="Phone2">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//Admin/@InsurancePhone2Ext[. != '']">
|
||||
<xsl:value-of select="//Admin/@InsurancePhone2"/> x<xsl:value-of select="//Admin/@InsurancePhone2Ext"/>
|
||||
<xsl:value-of select="//Admin/@InsurancePhone2"/> x
|
||||
<xsl:value-of select="//Admin/@InsurancePhone2Ext"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="//Admin/@InsurancePhone2"/>
|
||||
@@ -259,7 +265,8 @@
|
||||
<xsl:attribute name="Fax">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//Admin/@InsuranceFaxExt[. != '']">
|
||||
<xsl:value-of select="//Admin/@InsuranceFax"/> x<xsl:value-of select="//Admin/@InsuranceFaxExt"/>
|
||||
<xsl:value-of select="//Admin/@InsuranceFax"/> x
|
||||
<xsl:value-of select="//Admin/@InsuranceFaxExt"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="//Admin/@InsuranceFax"/>
|
||||
@@ -272,7 +279,7 @@
|
||||
</xsl:element>
|
||||
<xsl:element name="Insured">
|
||||
<xsl:attribute name="LastName">
|
||||
<xsl:value-of select="//Admin/@InsuranceLName" />
|
||||
<xsl:value-of select="//Admin/@InsuranceLName"/>
|
||||
</xsl:attribute>
|
||||
</xsl:element>
|
||||
<xsl:element name="Claim">
|
||||
@@ -308,7 +315,8 @@
|
||||
<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:when
|
||||
test="string-length(substring-after(//Admin2/@EstimatorZip, '-'))=4">
|
||||
<xsl:value-of select="//Admin2/@EstimatorZip"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
@@ -319,7 +327,8 @@
|
||||
</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: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)>4">
|
||||
<xsl:value-of select="substring(//Admin2/@EstimatorZip, 1, 5)"/>
|
||||
@@ -332,7 +341,8 @@
|
||||
<xsl:attribute name="Phone">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//Admin2/@EstimatorPhone1Ext[. != '']">
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone1"/> x<xsl:value-of select="//Admin2/@EstimatorPhone1Ext"/>
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone1"/> x
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone1Ext"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone1"/>
|
||||
@@ -342,7 +352,8 @@
|
||||
<xsl:attribute name="Phone2">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//Admin2/@EstimatorPhone2Ext[. != '']">
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone2"/> x<xsl:value-of select="//Admin2/@EstimatorPhone2Ext"/>
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone2"/> x
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone2Ext"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="//Admin2/@EstimatorPhone2"/>
|
||||
@@ -352,7 +363,8 @@
|
||||
<xsl:attribute name="Fax">
|
||||
<xsl:choose>
|
||||
<xsl:when test="//Admin2/@EstimatorFaxExt[. != '']">
|
||||
<xsl:value-of select="//Admin2/@EstimatorFax"/> x<xsl:value-of select="//Admin2/@EstimatorFaxExt"/>
|
||||
<xsl:value-of select="//Admin2/@EstimatorFax"/> x
|
||||
<xsl:value-of select="//Admin2/@EstimatorFaxExt"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="//Admin2/@EstimatorFax"/>
|
||||
@@ -368,7 +380,8 @@
|
||||
<xsl:if test="string-length(//Admin2/@VehicleInDate)>6">
|
||||
<xsl:value-of select="substring-before(//Admin2/@VehicleInDate, ' ')"/>
|
||||
<xsl:if test="string-length(//Admin2/@VehicleInTime)=4">
|
||||
 <xsl:value-of select="substring(//Admin2/@VehicleInTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleInTime, 3, 2)"/>
|
||||
 <xsl:value-of select="substring(//Admin2/@VehicleInTime, 1, 2)"/>:
|
||||
<xsl:value-of select="substring(//Admin2/@VehicleInTime, 3, 2)"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
@@ -376,7 +389,8 @@
|
||||
<xsl:if test="string-length(//Admin2/@TargetVehicleOutDate)>6">
|
||||
<xsl:value-of select="substring-before(//Admin2/@TargetVehicleOutDate,' ')"/>
|
||||
<xsl:if test="string-length(//Admin2/@TargetVehicleOutTime)=4">
|
||||
 <xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 3, 2)"/>
|
||||
 <xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 1, 2)"/>:
|
||||
<xsl:value-of select="substring(//Admin2/@TargetVehicleOutTime, 3, 2)"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
@@ -384,7 +398,8 @@
|
||||
<xsl:if test="string-length(//Admin2/@VehicleOutDate)>6">
|
||||
<xsl:value-of select="substring-before(//Admin2/@VehicleOutDate, ' ')"/>
|
||||
<xsl:if test="string-length(//Admin2/@VehicleOutTime)=4">
|
||||
 <xsl:value-of select="substring(//Admin2/@VehicleOutTime, 1, 2)"/>:<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 3, 2)"/>
|
||||
 <xsl:value-of select="substring(//Admin2/@VehicleOutTime, 1, 2)"/>:
|
||||
<xsl:value-of select="substring(//Admin2/@VehicleOutTime, 3, 2)"/>
|
||||
</xsl:if>
|
||||
</xsl:if>
|
||||
</xsl:attribute>
|
||||
@@ -394,16 +409,16 @@
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
<xsl:template match="PartsList">
|
||||
<xsl:element name="PartsList" >
|
||||
<xsl:element name="PartsList">
|
||||
<xsl:for-each select="Part">
|
||||
<xsl:element name="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: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:value-of select="substring-before(@TDPartNum,' GM PART')"/>
|
||||
</xsl:if>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="AltPartNumber">
|
||||
@@ -476,13 +491,13 @@
|
||||
<xsl:value-of select="$PrimaryPartNumber"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="AltPartNum">
|
||||
<xsl:value-of select="$SecondaryPartNumber" />
|
||||
<xsl:value-of select="$SecondaryPartNumber"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="ExternalPartType">
|
||||
<xsl:value-of select="$PrimaryPartType" />
|
||||
<xsl:value-of select="$PrimaryPartType"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="ExternalAltPartType">
|
||||
<xsl:value-of select="$SecondaryPartType" />
|
||||
<xsl:value-of select="$SecondaryPartType"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="TDPartType">
|
||||
<xsl:choose>
|
||||
@@ -505,56 +520,56 @@
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="TDPartDesc">
|
||||
<xsl:value-of select="@TDPartDesc" />
|
||||
<xsl:value-of select="@TDPartDesc"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="TDLineRef">
|
||||
<xsl:value-of select="@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:value-of select="@TDEstimate"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@PartType='PAM'">
|
||||
<xsl:value-of select="@ActPrice" />
|
||||
<xsl:value-of select="@ActPrice"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@PartType='PAA'">
|
||||
<xsl:value-of select="@ActPrice" />
|
||||
<xsl:value-of select="@ActPrice"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="@PartType='PAL'">
|
||||
<xsl:value-of select="@ActPrice" />
|
||||
<xsl:value-of select="@ActPrice"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="@ActPrice" />
|
||||
<xsl:value-of select="@ActPrice"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="TDPartQty">
|
||||
<xsl:value-of select="@TDPartQty" />
|
||||
<xsl:value-of select="@TDPartQty"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="LineNumber">
|
||||
<xsl:value-of select="@LineNumber" />
|
||||
<xsl:value-of select="@LineNumber"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="SequenceNumber">
|
||||
<xsl:value-of select="@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: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:value-of select="@LaborType"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="LaborHours">
|
||||
<xsl:value-of select="@LaborHours" />
|
||||
<xsl:value-of select="@LaborHours"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="OperationCode">
|
||||
<xsl:value-of select="@LaborOp" />
|
||||
<xsl:value-of select="@LaborOp"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="CLPart">
|
||||
<!-- CLPart is false if TRAN_CODE == 2 or TRAN_CODE == 3 -->
|
||||
@@ -565,10 +580,14 @@
|
||||
<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=''" >
|
||||
<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: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>
|
||||
|
||||
Reference in New Issue
Block a user