Mani Pazhana
asked on
XSLT - XML to CSV
I am doing XML to CSV file conversion.
i want
WOCreateDate and CodingDate1 - will always appear in the output as mandatory field with null value only. (no other values will be accepted.)
-------------------------- ---------- ---------- ---
XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:csv="csv:csv"
xmlns:msxsl="urn:schemas-m icrosoft-c om:xslt" exclude-result-prefixes="m sxsl">
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:key name="kInvoiceDetailId" match="/Invoice/InvoiceLin eItemDetai l" use="concat(../VendorInvoi ceNumber,' -',Origina tingInvoic eLineId)"/ >
<!-- DL being used (Comma in this case) -->
<xsl:param name="DL" select="','"/>
<!-- Checking for carriage return -->
<xsl:param name="CR" select="'
'"/>
<xsl:strip-space elements="*"/>
<!-- Column Headers -->
<!--Create header row of element names
(All fields are sent to JDE that are in the CIM, single line per invoice details)-->
<xsl:variable name="headers" >
<headers>ClientId</headers > <!-- 1 -->
<headers>OriginatingInvoic eId</heade rs> <!-- 2 -->
<headers>VendorId</headers > <!-- 3 -->
<headers>AlternativeVendor Id</header s> <!-- 4 -->
<headers>VendorInvoiceNumb er</header s> <!-- 5 -->
<headers>InvoiceDate</head ers> <!-- 6 -->
<headers>InvoiceReceiveDat e</headers > <!-- 7 -->
<headers>GLDate</headers> <!-- 8 -->
<headers>Remark</headers> <!-- 9 -->
<headers>TotalInvoiceAmoun t</headers > <!-- 10 -->
<headers>CurrencyCode</hea ders> <!-- 11 -->
<headers>TaxRateAreaCode</ headers> <!-- 12 -->
<headers>StatusCodeCode</h eaders> <!-- 13 -->
<headers>StatusCodeDescrip tion</head ers> <!-- 14 -->
<headers>ClientApprovalNum ber</heade rs> <!-- 15 -->
<headers>AuthorizedBy</hea ders> <!-- 16 -->
<headers>BatchReferenceNum ber</heade rs> <!-- 17 -->
<headers>InvoiceSource</he aders> <!-- 18 -->
<headers>NumberOfLines</he aders> <!-- 19 -->
<headers>OriginatingInvoic eLineId</h eaders> <!-- 20 -->
<headers>POLineNumber</hea ders> <!-- 21 -->
<headers>LineItemDescripti on</header s> <!-- 22 -->
<headers>LocationId</heade rs> <!-- 23 -->
<headers>BuildingName</hea ders> <!-- 24 -->
<headers>LineItemAmount</h eaders> <!-- 25 -->
<headers>TaxableLineItemAm ount</head ers> <!-- 26 -->
<headers>TaxAmountLineItem </headers> <!-- 27 -->
<headers>CompanyId</header s> <!-- 28 -->
<headers>GLAccountCode</he aders> <!-- 29 -->
<headers>Subsidiary</heade rs> <!-- 30 -->
<headers>SubLedger</header s> <!-- 31 -->
<headers>SubLedgerType</he aders> <!-- 32 -->
<headers>LedgerType</heade rs> <!-- 33 -->
<headers>CostCenter</heade rs> <!-- 34 -->
<headers>AccountBlock</hea ders> <!-- 35 -->
<headers>GLAccountDescript ion</heade rs> <!-- 36 -->
<headers>ClientAccountCode </headers> <!-- 37 -->
<headers>WBSCode</headers> <!-- 38 -->
<headers>OriginatingProjec tNumber</h eaders> <!-- 39 -->
<headers>OriginatingProjec tSystem</h eaders> <!-- 40 -->
<headers>ClientPONumber</h eaders> <!-- 41 -->
<headers>WorkOrderNumber</ headers> <!-- 42 -->
<headers>WorkOrderComplete dDate</hea ders> <!-- 43 -->
<headers>WorkOrderCreatedD ate</heade rs> <!-- 44 -->
<headers>CodingBlock1</hea ders> <!-- 45 -->
<headers>CodingBlock2</hea ders> <!-- 46 -->
<headers>CodingBlock3</hea ders> <!-- 47 -->
<headers>CodingBlock4</hea ders> <!-- 48 -->
<headers>CodingBlock5</hea ders> <!-- 49 -->
<headers>CodingBlock6</hea ders> <!-- 50 -->
<headers>CodingDate1</head ers> <!-- 51 -->
<headers>CodingDate2</head ers> <!-- 52 -->
</xsl:variable>
<xsl:variable name="columns" >
<columns>ClientId</columns > <!-- 1 -->
<columns>OriginatingInvoic eId</colum ns> <!-- 2 -->
<columns>VendorId</columns > <!-- 3 -->
<columns>AlternativeVendor Id</column s> <!-- 4 -->
<columns>VendorInvoiceNumb er</column s> <!-- 5 -->
<columns>InvoiceDate</colu mns> <!-- 6 -->
<columns>InvoiceReceiveDat e</columns > <!-- 7 -->
<columns>GLDate</columns> <!-- 8 -->
<columns>Remark</columns> <!-- 9 -->
<columns>TotalInvoiceAmoun t</columns > <!-- 10 -->
<columns>CurrencyCode</col umns> <!-- 11 -->
<columns>TaxRateAreaCode</ columns> <!-- 12-->
<columns>common:Code</colu mns> <!-- 13 -->
<columns>common:Descriptio n</columns > <!-- 14 -->
<columns>ClientApprovalNum ber</colum ns> <!-- 15 -->
<columns>AuthorizedBy</col umns> <!-- 16 -->
<columns>BatchReferenceNum ber</colum ns> <!-- 17 -->
<columns>InvoiceSource</co lumns> <!-- 18 -->
<columns>NumberOfLines</co lumns> <!-- 19 -->
<columns>OriginatingInvoic eLineId</c olumns> <!-- 20 -->
<columns>POLineNumber</col umns> <!-- 21 -->
<columns>LineItemDescripti on</column s> <!-- 22 -->
<columns>LocationId</colum ns> <!-- 23 -->
<columns>BuildingName</col umns> <!-- 24 -->
<columns>LineItemAmount</c olumns> <!-- 25 -->
<columns>TaxableLineItemAm ount</colu mns> <!-- 26 -->
<columns>TaxAmountLineItem </columns> <!-- 27 -->
<columns>CompanyId</column s> <!-- 28 -->
<columns>GLAccountCode</co lumns> <!-- 29 -->
<columns>Subsidiary</colum ns> <!-- 30 -->
<columns>SubLedger</column s> <!-- 31 -->
<columns>SubLedgerType</co lumns> <!-- 32 -->
<columns>LedgerType</colum ns> <!-- 33 -->
<columns>CostCenter</colum ns> <!-- 34 -->
<columns>AccountBlock</col umns> <!-- 35 -->
<columns>GLAccountDescript ion</colum ns> <!-- 36 -->
<columns>ClientAccountCode </columns> <!-- 37 -->
<columns>WBSCode</columns> <!-- 38 -->
<columns>OriginatingProjec tNumber</c olumns> <!-- 39 -->
<columns>OriginatingProjec tSystem</c olumns> <!-- 40 -->
<columns>ClientPONumber</c olumns> <!-- 41 -->
<columns>WorkOrderNumber</ columns> <!-- 42 -->
<columns>WorkOrderComplete dDate</col umns> <!-- 43 -->
<columns>WorkOrderCreatedD ate</colum ns> <!-- 44 -->
<columns>CodingBlock1</col umns> <!-- 45 -->
<columns>CodingBlock2</col umns> <!-- 46 -->
<columns>CodingBlock3</col umns> <!-- 47 -->
<columns>CodingBlock4</col umns> <!-- 48 -->
<columns>CodingBlock5</col umns> <!-- 49 -->
<columns>CodingBlock6</col umns> <!-- 50 -->
<columns>CodingDate1</colu mns> <!-- 51 -->
<columns>CodingDate2</colu mns> <!-- 52 -->
</xsl:variable>
<!--Invoice hierarchy structure of Invoice/InvoiceLineItemDet ail is flattened into a single line per InvoiceLineItemDetail-->
<xsl:template match="/">
<!--Create header row of attribute names-->
<xsl:for-each select="msxsl:node-set($he aders)/hea ders">
<xsl:text>"</xsl:text>
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
<xsl:if test="position() != last()">
<xsl:value-of select="$DL"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$CR"/>
<xsl:for-each select="/*/*/*/*">
<xsl:variable name="NodeName" select="name(current())"/>
<!-- If node is InvoiceLineItemDetail, get the values based on their element name (from the columns above -->
<xsl:if test="$NodeName = 'InvoiceLineItem'">
<xsl:variable name="property" select="ancestor-or-self:: node()|des cendant::n ode()"/>
<xsl:for-each select="msxsl:node-set($co lumns)/col umns">
<!-- Extract the column name and value -->
<xsl:variable name="column" select="."/>
<xsl:variable name="value" select="$property/*[name() = $column]"/>
<xsl:text>"</xsl:text>
<xsl:choose>
<xsl:when test="contains($column,'Da te')">
<xsl:variable name="year" select="msxsl:format-date( $value, 'yyyy')"/>
<xsl:variable name="month" select="msxsl:format-date( $value, 'M')"/>
<xsl:variable name="day" select="msxsl:format-date( $value, 'd')"/>
<xsl:variable name="isLeap" select="(($year mod 4)=0 and ($year mod 100)!=0) or ($year mod 400)=0"/>
<xsl:choose>
<xsl:when test="$isLeap = true()">
<xsl:choose>
<xsl:when test="$month = 1"><xsl:value-of select="($year*1000) + (0 + $day) - 1900000"/></xsl:when>
<xsl:when test="$month = 2"><xsl:value-of select="($year*1000) + (31 + $day) - 1900000"/></xsl:when> <!-- Jan = 31 -->
<xsl:when test="$month = 3"><xsl:value-of select="($year*1000) + (60 + $day) - 1900000"/></xsl:when> <!-- Feb = 29 -->
<xsl:when test="$month = 4"><xsl:value-of select="($year*1000) + (91 + $day) - 1900000"/></xsl:when> <!-- Mar = 31 -->
<xsl:when test="$month = 5"><xsl:value-of select="($year*1000) + (121 + $day) - 1900000"/></xsl:when> <!-- Apr = 30 -->
<xsl:when test="$month = 6"><xsl:value-of select="($year*1000) + (152 + $day) - 1900000"/></xsl:when> <!-- May = 31 -->
<xsl:when test="$month = 7"><xsl:value-of select="($year*1000) + (182 + $day) - 1900000"/></xsl:when> <!-- Jun = 30 -->
<xsl:when test="$month = 8"><xsl:value-of select="($year*1000) + (213 + $day) - 1900000"/></xsl:when> <!-- Jul = 31 -->
<xsl:when test="$month = 9"><xsl:value-of select="($year*1000) + (244 + $day) - 1900000"/></xsl:when> <!-- Aug = 31 -->
<xsl:when test="$month = 10"><xsl:value-of select="($year*1000) + (274 + $day) - 1900000"/></xsl:when> <!-- Sep = 30 -->
<xsl:when test="$month = 11"><xsl:value-of select="($year*1000) + (305 + $day) - 1900000"/></xsl:when> <!-- Oct = 31 -->
<xsl:when test="$month = 12"><xsl:value-of select="($year*1000) + (335 + $day) - 1900000"/></xsl:when> <!-- Nov = 30 -->
</xsl:choose>
</xsl:when>
<xsl:when test="$isLeap = false()">
<xsl:choose>
<xsl:when test="$month = 1"><xsl:value-of select="($year*1000) + (0 + $day) - 1900000"/></xsl:when>
<xsl:when test="$month = 2"><xsl:value-of select="($year*1000) + (31 + $day) - 1900000"/></xsl:when> <!-- Jan = 31 -->
<xsl:when test="$month = 3"><xsl:value-of select="($year*1000) + (59 + $day) - 1900000"/></xsl:when> <!-- Feb = 28 -->
<xsl:when test="$month = 4"><xsl:value-of select="($year*1000) + (90 + $day) - 1900000"/></xsl:when> <!-- Mar = 31 -->
<xsl:when test="$month = 5"><xsl:value-of select="($year*1000) + (120 + $day) - 1900000"/></xsl:when> <!-- Apr = 30 -->
<xsl:when test="$month = 6"><xsl:value-of select="($year*1000) + (151 + $day) - 1900000"/></xsl:when> <!-- May = 31 -->
<xsl:when test="$month = 7"><xsl:value-of select="($year*1000) + (181 + $day) - 1900000"/></xsl:when> <!-- Jun = 30 -->
<xsl:when test="$month = 8"><xsl:value-of select="($year*1000) + (212 + $day) - 1900000"/></xsl:when> <!-- Jul = 31 -->
<xsl:when test="$month = 9"><xsl:value-of select="($year*1000) + (243 + $day) - 1900000"/></xsl:when> <!-- Aug = 31 -->
<xsl:when test="$month = 10"><xsl:value-of select="($year*1000) + (273 + $day) - 1900000"/></xsl:when> <!-- Sep = 30 -->
<xsl:when test="$month = 11"><xsl:value-of select="($year*1000) + (304 + $day) - 1900000"/></xsl:when> <!-- Oct = 31 -->
<xsl:when test="$month = 12"><xsl:value-of select="($year*1000) + (334 + $day) - 1900000"/></xsl:when> <!-- Nov = 30 -->
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value" disable-output-escaping="y es"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>"</xsl:text>
<xsl:if test="position() != last()">
<xsl:value-of select="$DL"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$CR"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-------------------------- ---------- ---------
XML:
<?xml version="1.0" encoding="utf-8"?>
<root xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v1">
<Invoice xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v2" xmlns:common="http://integration.cbre.com/schemas/gcs/common/v1">
<ClientId>ATT</ClientId>
<OriginatingInvoiceId>1728 </Originat ingInvoice Id>
<VendorId>237006</VendorId >
<AlternativeVendorId>PRV-0 8-220</Alt ernativeVe ndorId>
<VendorInvoiceNumber>INV03 91656</Ven dorInvoice Number>
<InvoiceDate>2013-08-12T00 :00:00</In voiceDate>
<InvoiceReceiveDate>2013-0 8-17T00:00 :00</Invoi ceReceiveD ate>
<GLDate>2013-08-21T20:53:0 3.701-05:0 0</GLDate>
<Remark>Please reposition two locks on two of the panels on the sales floor. Caller says that they are not positioned correctly.</Remark>
<TotalInvoiceAmount>215.18 </TotalInv oiceAmount >
<CurrencyCode>USD</Currenc yCode>
<StatusCode>
<common:Code>Authorized</c ommon:Code >
<common:Description>Author ized</comm on:Descrip tion>
</StatusCode>
<ClientApprovalNumber>3000 317289</Cl ientApprov alNumber>
<InvoiceSource>COR</Invoic eSource>
<NumberOfLines>4</NumberOf Lines>
<InvoiceLineItems>
<InvoiceLineItem>
<OriginatingInvoiceLineID> 5444</Orig inatingInv oiceLineID >
<POLineNumber>1</POLineNum ber>
<LineItemDescription>SWAP 2 LOCKS TO DIFFERENT LOCKS. 2013-08-06T00:00:00</LineI temDescrip tion>
<LocationId>ATR000704</Loc ationId>
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>75.000000< /LineItemA mount>
<GLAccount>
<CompanyId>51785</CompanyI d>
<GLAccountCode>51785</GLAc countCode>
<AccountBlock>51785</Accou ntBlock>
<GLAccountDescription>5178 5</GLAccou ntDescript ion>
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000 1</WorkOrd erNumber>
<WorkOrderCompletedDate>20 13-08-06T1 5:42:36</W orkOrderCo mpletedDat e>
<WorkOrderCreatedDate>2013 -08-01T05: 46:00</Wor kOrderCrea tedDate>
<CodingBlock1>Labor</Codin gBlock1>
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>SWAP 2 LOCKS TO DIFFERENT LOCKS.</CodingBlock4>
<CodingBlock5>Locks/Keys</ CodingBloc k5>
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID> 5445</Orig inatingInv oiceLineID >
<POLineNumber>2</POLineNum ber>
<LineItemDescription>TRIP< /LineItemD escription >
<LocationId>ATR000704</Loc ationId>
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>75.000000< /LineItemA mount>
<GLAccount>
<CompanyId>51785</CompanyI d>
<GLAccountCode>51785</GLAc countCode>
<AccountBlock>51785</Accou ntBlock>
<GLAccountDescription>5178 5</GLAccou ntDescript ion>
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000 1</WorkOrd erNumber>
<WorkOrderCompletedDate>20 13-08-06T1 5:42:36</W orkOrderCo mpletedDat e>
<WorkOrderCreatedDate>2013 -08-01T05: 46:00</Wor kOrderCrea tedDate>
<CodingBlock1>Miscellaneou s</CodingB lock1>
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>TRIP</Coding Block4>
<CodingBlock5>Locks/Keys</ CodingBloc k5>
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID> 5446</Orig inatingInv oiceLineID >
<POLineNumber>3</POLineNum ber>
<LineItemDescription>NSBS SERVICE FEE</LineItemDescription>
<LocationId>ATR000704</Loc ationId>
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>60.000000< /LineItemA mount>
<GLAccount>
<CompanyId>51785</CompanyI d>
<GLAccountCode>51785</GLAc countCode>
<AccountBlock>51785</Accou ntBlock>
<GLAccountDescription>5178 5</GLAccou ntDescript ion>
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000 1</WorkOrd erNumber>
<WorkOrderCompletedDate>20 13-08-06T1 5:42:36</W orkOrderCo mpletedDat e>
<WorkOrderCreatedDate>2013 -08-01T05: 46:00</Wor kOrderCrea tedDate>
<CodingBlock1>Miscellaneou s</CodingB lock1>
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>NSBS SERVICE FEE</CodingBlock4>
<CodingBlock5>Locks/Keys</ CodingBloc k5>
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID> 5443</Orig inatingInv oiceLineID >
<POLineNumber>4</POLineNum ber>
<LineItemDescription>Tax</ LineItemDe scription>
<LocationId>ATR000704</Loc ationId>
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>5.180000</ LineItemAm ount>
<GLAccount>
<CompanyId>51785</CompanyI d>
<GLAccountCode>51785</GLAc countCode>
<AccountBlock>51785</Accou ntBlock>
<GLAccountDescription>5178 5</GLAccou ntDescript ion>
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000 1</WorkOrd erNumber>
<WorkOrderCompletedDate>20 13-08-06T1 5:42:36</W orkOrderCo mpletedDat e>
<WorkOrderCreatedDate>2013 -08-01T05: 46:00</Wor kOrderCrea tedDate>
<CodingBlock1>Tax</CodingB lock1>
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>Tax</CodingB lock4>
<CodingBlock5>Locks/Keys</ CodingBloc k5>
</AdditionalCoding>
</InvoiceLineItem>
</InvoiceLineItems>
</Invoice>
<Invoice xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v2" xmlns:common="http://integration.cbre.com/schemas/gcs/common/v1">
<ClientId>ATT</ClientId>
<OriginatingInvoiceId>1752 </Originat ingInvoice Id>
<VendorId>236998</VendorId >
<AlternativeVendorId>PRV-0 9-1301</Al ternativeV endorId>
<VendorInvoiceNumber>28</V endorInvoi ceNumber>
<InvoiceDate>2013-08-12T00 :00:00</In voiceDate>
<InvoiceReceiveDate>2013-0 8-20T00:00 :00</Invoi ceReceiveD ate>
<GLDate>2013-08-21T20:53:0 3.779-05:0 0</GLDate>
<Remark />
<TotalInvoiceAmount>378.59 </TotalInv oiceAmount >
<CurrencyCode>USD</Currenc yCode>
<StatusCode>
<common:Code>Authorized</c ommon:Code >
<common:Description>Author ized</comm on:Descrip tion>
</StatusCode>
<ClientApprovalNumber>3000 517524</Cl ientApprov alNumber>
<InvoiceSource>COR</Invoic eSource>
<NumberOfLines>2</NumberOf Lines>
<InvoiceLineItems>
<InvoiceLineItem>
<OriginatingInvoiceLineID> 6790</Orig inatingInv oiceLineID >
<POLineNumber>5</POLineNum ber>
<LineItemDescription>1 man Electrician 2013-08-12T00:00:00</LineI temDescrip tion>
<LocationId>ATR000596</Loc ationId>
<BuildingName>Canyon Rd Store</BuildingName>
<LineItemAmount>316.000000 </LineItem Amount>
<GLAccount>
<CompanyId>51310</CompanyI d>
<GLAccountCode>51310</GLAc countCode>
<AccountBlock>51310</Accou ntBlock>
<GLAccountDescription>5131 0</GLAccou ntDescript ion>
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>059600000 2</WorkOrd erNumber>
<WorkOrderCompletedDate>20 13-08-12T1 6:46:21</W orkOrderCo mpletedDat e>
<WorkOrderCreatedDate>2013 -08-01T06: 06:00</Wor kOrderCrea tedDate>
<CodingBlock1>Labor</Codin gBlock1>
<CodingBlock2>Electrical Wiring</CodingBlock2>
<CodingBlock4>1 man Electrician</CodingBlock4>
<CodingBlock5>Electrical</ CodingBloc k5>
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID> 6791</Orig inatingInv oiceLineID >
<POLineNumber>6</POLineNum ber>
<LineItemDescription>wirin g, euipment, trip charge</LineItemDescriptio n>
<LocationId>ATR000596</Loc ationId>
<BuildingName>Canyon Rd Store</BuildingName>
<LineItemAmount>62.590000< /LineItemA mount>
<GLAccount>
<CompanyId>51310</CompanyI d>
<GLAccountCode>51310</GLAc countCode>
<AccountBlock>51310</Accou ntBlock>
<GLAccountDescription>5131 0</GLAccou ntDescript ion>
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>059600000 2</WorkOrd erNumber>
<WorkOrderCompletedDate>20 13-08-12T1 6:46:21</W orkOrderCo mpletedDat e>
<WorkOrderCreatedDate>2013 -08-01T06: 06:00</Wor kOrderCrea tedDate>
<CodingBlock1>Miscellaneou s</CodingB lock1>
<CodingBlock2>Electrical Wiring</CodingBlock2>
<CodingBlock4>wiring, euipment, trip charge</CodingBlock4>
<CodingBlock5>Electrical</ CodingBloc k5>
</AdditionalCoding>
</InvoiceLineItem>
</InvoiceLineItems>
</Invoice>
</root>
Thanks
i want
WOCreateDate and CodingDate1 - will always appear in the output as mandatory field with null value only. (no other values will be accepted.)
--------------------------
XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:csv="csv:csv"
xmlns:msxsl="urn:schemas-m
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:key name="kInvoiceDetailId" match="/Invoice/InvoiceLin
<!-- DL being used (Comma in this case) -->
<xsl:param name="DL" select="','"/>
<!-- Checking for carriage return -->
<xsl:param name="CR" select="'
'"/>
<xsl:strip-space elements="*"/>
<!-- Column Headers -->
<!--Create header row of element names
(All fields are sent to JDE that are in the CIM, single line per invoice details)-->
<xsl:variable name="headers" >
<headers>ClientId</headers
<headers>OriginatingInvoic
<headers>VendorId</headers
<headers>AlternativeVendor
<headers>VendorInvoiceNumb
<headers>InvoiceDate</head
<headers>InvoiceReceiveDat
<headers>GLDate</headers> <!-- 8 -->
<headers>Remark</headers> <!-- 9 -->
<headers>TotalInvoiceAmoun
<headers>CurrencyCode</hea
<headers>TaxRateAreaCode</
<headers>StatusCodeCode</h
<headers>StatusCodeDescrip
<headers>ClientApprovalNum
<headers>AuthorizedBy</hea
<headers>BatchReferenceNum
<headers>InvoiceSource</he
<headers>NumberOfLines</he
<headers>OriginatingInvoic
<headers>POLineNumber</hea
<headers>LineItemDescripti
<headers>LocationId</heade
<headers>BuildingName</hea
<headers>LineItemAmount</h
<headers>TaxableLineItemAm
<headers>TaxAmountLineItem
<headers>CompanyId</header
<headers>GLAccountCode</he
<headers>Subsidiary</heade
<headers>SubLedger</header
<headers>SubLedgerType</he
<headers>LedgerType</heade
<headers>CostCenter</heade
<headers>AccountBlock</hea
<headers>GLAccountDescript
<headers>ClientAccountCode
<headers>WBSCode</headers>
<headers>OriginatingProjec
<headers>OriginatingProjec
<headers>ClientPONumber</h
<headers>WorkOrderNumber</
<headers>WorkOrderComplete
<headers>WorkOrderCreatedD
<headers>CodingBlock1</hea
<headers>CodingBlock2</hea
<headers>CodingBlock3</hea
<headers>CodingBlock4</hea
<headers>CodingBlock5</hea
<headers>CodingBlock6</hea
<headers>CodingDate1</head
<headers>CodingDate2</head
</xsl:variable>
<xsl:variable name="columns" >
<columns>ClientId</columns
<columns>OriginatingInvoic
<columns>VendorId</columns
<columns>AlternativeVendor
<columns>VendorInvoiceNumb
<columns>InvoiceDate</colu
<columns>InvoiceReceiveDat
<columns>GLDate</columns> <!-- 8 -->
<columns>Remark</columns> <!-- 9 -->
<columns>TotalInvoiceAmoun
<columns>CurrencyCode</col
<columns>TaxRateAreaCode</
<columns>common:Code</colu
<columns>common:Descriptio
<columns>ClientApprovalNum
<columns>AuthorizedBy</col
<columns>BatchReferenceNum
<columns>InvoiceSource</co
<columns>NumberOfLines</co
<columns>OriginatingInvoic
<columns>POLineNumber</col
<columns>LineItemDescripti
<columns>LocationId</colum
<columns>BuildingName</col
<columns>LineItemAmount</c
<columns>TaxableLineItemAm
<columns>TaxAmountLineItem
<columns>CompanyId</column
<columns>GLAccountCode</co
<columns>Subsidiary</colum
<columns>SubLedger</column
<columns>SubLedgerType</co
<columns>LedgerType</colum
<columns>CostCenter</colum
<columns>AccountBlock</col
<columns>GLAccountDescript
<columns>ClientAccountCode
<columns>WBSCode</columns>
<columns>OriginatingProjec
<columns>OriginatingProjec
<columns>ClientPONumber</c
<columns>WorkOrderNumber</
<columns>WorkOrderComplete
<columns>WorkOrderCreatedD
<columns>CodingBlock1</col
<columns>CodingBlock2</col
<columns>CodingBlock3</col
<columns>CodingBlock4</col
<columns>CodingBlock5</col
<columns>CodingBlock6</col
<columns>CodingDate1</colu
<columns>CodingDate2</colu
</xsl:variable>
<!--Invoice hierarchy structure of Invoice/InvoiceLineItemDet
<xsl:template match="/">
<!--Create header row of attribute names-->
<xsl:for-each select="msxsl:node-set($he
<xsl:text>"</xsl:text>
<xsl:value-of select="."/>
<xsl:text>"</xsl:text>
<xsl:if test="position() != last()">
<xsl:value-of select="$DL"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$CR"/>
<xsl:for-each select="/*/*/*/*">
<xsl:variable name="NodeName" select="name(current())"/>
<!-- If node is InvoiceLineItemDetail, get the values based on their element name (from the columns above -->
<xsl:if test="$NodeName = 'InvoiceLineItem'">
<xsl:variable name="property" select="ancestor-or-self::
<xsl:for-each select="msxsl:node-set($co
<!-- Extract the column name and value -->
<xsl:variable name="column" select="."/>
<xsl:variable name="value" select="$property/*[name()
<xsl:text>"</xsl:text>
<xsl:choose>
<xsl:when test="contains($column,'Da
<xsl:variable name="year" select="msxsl:format-date(
<xsl:variable name="month" select="msxsl:format-date(
<xsl:variable name="day" select="msxsl:format-date(
<xsl:variable name="isLeap" select="(($year mod 4)=0 and ($year mod 100)!=0) or ($year mod 400)=0"/>
<xsl:choose>
<xsl:when test="$isLeap = true()">
<xsl:choose>
<xsl:when test="$month = 1"><xsl:value-of select="($year*1000) + (0 + $day) - 1900000"/></xsl:when>
<xsl:when test="$month = 2"><xsl:value-of select="($year*1000) + (31 + $day) - 1900000"/></xsl:when> <!-- Jan = 31 -->
<xsl:when test="$month = 3"><xsl:value-of select="($year*1000) + (60 + $day) - 1900000"/></xsl:when> <!-- Feb = 29 -->
<xsl:when test="$month = 4"><xsl:value-of select="($year*1000) + (91 + $day) - 1900000"/></xsl:when> <!-- Mar = 31 -->
<xsl:when test="$month = 5"><xsl:value-of select="($year*1000) + (121 + $day) - 1900000"/></xsl:when> <!-- Apr = 30 -->
<xsl:when test="$month = 6"><xsl:value-of select="($year*1000) + (152 + $day) - 1900000"/></xsl:when> <!-- May = 31 -->
<xsl:when test="$month = 7"><xsl:value-of select="($year*1000) + (182 + $day) - 1900000"/></xsl:when> <!-- Jun = 30 -->
<xsl:when test="$month = 8"><xsl:value-of select="($year*1000) + (213 + $day) - 1900000"/></xsl:when> <!-- Jul = 31 -->
<xsl:when test="$month = 9"><xsl:value-of select="($year*1000) + (244 + $day) - 1900000"/></xsl:when> <!-- Aug = 31 -->
<xsl:when test="$month = 10"><xsl:value-of select="($year*1000) + (274 + $day) - 1900000"/></xsl:when> <!-- Sep = 30 -->
<xsl:when test="$month = 11"><xsl:value-of select="($year*1000) + (305 + $day) - 1900000"/></xsl:when> <!-- Oct = 31 -->
<xsl:when test="$month = 12"><xsl:value-of select="($year*1000) + (335 + $day) - 1900000"/></xsl:when> <!-- Nov = 30 -->
</xsl:choose>
</xsl:when>
<xsl:when test="$isLeap = false()">
<xsl:choose>
<xsl:when test="$month = 1"><xsl:value-of select="($year*1000) + (0 + $day) - 1900000"/></xsl:when>
<xsl:when test="$month = 2"><xsl:value-of select="($year*1000) + (31 + $day) - 1900000"/></xsl:when> <!-- Jan = 31 -->
<xsl:when test="$month = 3"><xsl:value-of select="($year*1000) + (59 + $day) - 1900000"/></xsl:when> <!-- Feb = 28 -->
<xsl:when test="$month = 4"><xsl:value-of select="($year*1000) + (90 + $day) - 1900000"/></xsl:when> <!-- Mar = 31 -->
<xsl:when test="$month = 5"><xsl:value-of select="($year*1000) + (120 + $day) - 1900000"/></xsl:when> <!-- Apr = 30 -->
<xsl:when test="$month = 6"><xsl:value-of select="($year*1000) + (151 + $day) - 1900000"/></xsl:when> <!-- May = 31 -->
<xsl:when test="$month = 7"><xsl:value-of select="($year*1000) + (181 + $day) - 1900000"/></xsl:when> <!-- Jun = 30 -->
<xsl:when test="$month = 8"><xsl:value-of select="($year*1000) + (212 + $day) - 1900000"/></xsl:when> <!-- Jul = 31 -->
<xsl:when test="$month = 9"><xsl:value-of select="($year*1000) + (243 + $day) - 1900000"/></xsl:when> <!-- Aug = 31 -->
<xsl:when test="$month = 10"><xsl:value-of select="($year*1000) + (273 + $day) - 1900000"/></xsl:when> <!-- Sep = 30 -->
<xsl:when test="$month = 11"><xsl:value-of select="($year*1000) + (304 + $day) - 1900000"/></xsl:when> <!-- Oct = 31 -->
<xsl:when test="$month = 12"><xsl:value-of select="($year*1000) + (334 + $day) - 1900000"/></xsl:when> <!-- Nov = 30 -->
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$value" disable-output-escaping="y
</xsl:otherwise>
</xsl:choose>
<xsl:text>"</xsl:text>
<xsl:if test="position() != last()">
<xsl:value-of select="$DL"/>
</xsl:if>
</xsl:for-each>
<xsl:value-of select="$CR"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
--------------------------
XML:
<?xml version="1.0" encoding="utf-8"?>
<root xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v1">
<Invoice xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v2" xmlns:common="http://integration.cbre.com/schemas/gcs/common/v1">
<ClientId>ATT</ClientId>
<OriginatingInvoiceId>1728
<VendorId>237006</VendorId
<AlternativeVendorId>PRV-0
<VendorInvoiceNumber>INV03
<InvoiceDate>2013-08-12T00
<InvoiceReceiveDate>2013-0
<GLDate>2013-08-21T20:53:0
<Remark>Please reposition two locks on two of the panels on the sales floor. Caller says that they are not positioned correctly.</Remark>
<TotalInvoiceAmount>215.18
<CurrencyCode>USD</Currenc
<StatusCode>
<common:Code>Authorized</c
<common:Description>Author
</StatusCode>
<ClientApprovalNumber>3000
<InvoiceSource>COR</Invoic
<NumberOfLines>4</NumberOf
<InvoiceLineItems>
<InvoiceLineItem>
<OriginatingInvoiceLineID>
<POLineNumber>1</POLineNum
<LineItemDescription>SWAP 2 LOCKS TO DIFFERENT LOCKS. 2013-08-06T00:00:00</LineI
<LocationId>ATR000704</Loc
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>75.000000<
<GLAccount>
<CompanyId>51785</CompanyI
<GLAccountCode>51785</GLAc
<AccountBlock>51785</Accou
<GLAccountDescription>5178
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000
<WorkOrderCompletedDate>20
<WorkOrderCreatedDate>2013
<CodingBlock1>Labor</Codin
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>SWAP 2 LOCKS TO DIFFERENT LOCKS.</CodingBlock4>
<CodingBlock5>Locks/Keys</
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID>
<POLineNumber>2</POLineNum
<LineItemDescription>TRIP<
<LocationId>ATR000704</Loc
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>75.000000<
<GLAccount>
<CompanyId>51785</CompanyI
<GLAccountCode>51785</GLAc
<AccountBlock>51785</Accou
<GLAccountDescription>5178
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000
<WorkOrderCompletedDate>20
<WorkOrderCreatedDate>2013
<CodingBlock1>Miscellaneou
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>TRIP</Coding
<CodingBlock5>Locks/Keys</
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID>
<POLineNumber>3</POLineNum
<LineItemDescription>NSBS SERVICE FEE</LineItemDescription>
<LocationId>ATR000704</Loc
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>60.000000<
<GLAccount>
<CompanyId>51785</CompanyI
<GLAccountCode>51785</GLAc
<AccountBlock>51785</Accou
<GLAccountDescription>5178
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000
<WorkOrderCompletedDate>20
<WorkOrderCreatedDate>2013
<CodingBlock1>Miscellaneou
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>NSBS SERVICE FEE</CodingBlock4>
<CodingBlock5>Locks/Keys</
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID>
<POLineNumber>4</POLineNum
<LineItemDescription>Tax</
<LocationId>ATR000704</Loc
<BuildingName>1350 Travis Blvd, Suite Z13</BuildingName>
<LineItemAmount>5.180000</
<GLAccount>
<CompanyId>51785</CompanyI
<GLAccountCode>51785</GLAc
<AccountBlock>51785</Accou
<GLAccountDescription>5178
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>070400000
<WorkOrderCompletedDate>20
<WorkOrderCreatedDate>2013
<CodingBlock1>Tax</CodingB
<CodingBlock2>Install New Locks/Keys</CodingBlock2>
<CodingBlock4>Tax</CodingB
<CodingBlock5>Locks/Keys</
</AdditionalCoding>
</InvoiceLineItem>
</InvoiceLineItems>
</Invoice>
<Invoice xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v2" xmlns:common="http://integration.cbre.com/schemas/gcs/common/v1">
<ClientId>ATT</ClientId>
<OriginatingInvoiceId>1752
<VendorId>236998</VendorId
<AlternativeVendorId>PRV-0
<VendorInvoiceNumber>28</V
<InvoiceDate>2013-08-12T00
<InvoiceReceiveDate>2013-0
<GLDate>2013-08-21T20:53:0
<Remark />
<TotalInvoiceAmount>378.59
<CurrencyCode>USD</Currenc
<StatusCode>
<common:Code>Authorized</c
<common:Description>Author
</StatusCode>
<ClientApprovalNumber>3000
<InvoiceSource>COR</Invoic
<NumberOfLines>2</NumberOf
<InvoiceLineItems>
<InvoiceLineItem>
<OriginatingInvoiceLineID>
<POLineNumber>5</POLineNum
<LineItemDescription>1 man Electrician 2013-08-12T00:00:00</LineI
<LocationId>ATR000596</Loc
<BuildingName>Canyon Rd Store</BuildingName>
<LineItemAmount>316.000000
<GLAccount>
<CompanyId>51310</CompanyI
<GLAccountCode>51310</GLAc
<AccountBlock>51310</Accou
<GLAccountDescription>5131
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>059600000
<WorkOrderCompletedDate>20
<WorkOrderCreatedDate>2013
<CodingBlock1>Labor</Codin
<CodingBlock2>Electrical Wiring</CodingBlock2>
<CodingBlock4>1 man Electrician</CodingBlock4>
<CodingBlock5>Electrical</
</AdditionalCoding>
</InvoiceLineItem>
<InvoiceLineItem>
<OriginatingInvoiceLineID>
<POLineNumber>6</POLineNum
<LineItemDescription>wirin
<LocationId>ATR000596</Loc
<BuildingName>Canyon Rd Store</BuildingName>
<LineItemAmount>62.590000<
<GLAccount>
<CompanyId>51310</CompanyI
<GLAccountCode>51310</GLAc
<AccountBlock>51310</Accou
<GLAccountDescription>5131
</GLAccount>
<AdditionalCoding>
<ClientPONumber />
<WorkOrderNumber>059600000
<WorkOrderCompletedDate>20
<WorkOrderCreatedDate>2013
<CodingBlock1>Miscellaneou
<CodingBlock2>Electrical Wiring</CodingBlock2>
<CodingBlock4>wiring, euipment, trip charge</CodingBlock4>
<CodingBlock5>Electrical</
</AdditionalCoding>
</InvoiceLineItem>
</InvoiceLineItems>
</Invoice>
</root>
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks
Welcome.
ASKER
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="http://integration.cbre.com/schemas/gcs/batchinvoice/v2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:common="http://integration.cbre.com/schemas/gcs/common/v1" targetNamespace="http://integration.cbre.com/schemas/gcs/batchinvoice/v2" elementFormDefault="qualif
<!-- Include -->
<xs:import namespace="http://integration.cbre.com/schemas/gcs/common/v1" schemaLocation="integratio
<!-- XSD -->
<xs:complexType name="GLAccountType">
<xs:sequence>
<xs:element name="CompanyId" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>Financia
</xs:annotation>
</xs:element>
<xs:element name="GLAccountCode" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>GL Account Code (In JDE this represents the object account)</xs:documentation
</xs:annotation>
</xs:element>
<xs:element name="Subsidiary" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Subsidia
</xs:annotation>
</xs:element>
<xs:element name="SubLedger" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>More granular GL account code</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubLedgerType" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Indicate
</xs:annotation>
</xs:element>
<xs:element name="LedgerType" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Indicate
</xs:annotation>
</xs:element>
<xs:element name="CostCenter" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Cost Center</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="AccountBlock" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Combined
</xs:annotation>
</xs:element>
<xs:element name="GLAccountDescription
<xs:annotation>
<xs:documentation>Descript
</xs:annotation>
</xs:element>
<xs:element name="ClientAccountCode" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Client Account Code (usually based on mapping Client's GL Account Codes to CBRE GL Account Codes)</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="AdditionalCode">
<xs:sequence>
<xs:element name="WBSCode" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>For Project Expenses, indicates the WBS associated with the expenses</xs:documentation
</xs:annotation>
</xs:element>
<xs:element name="OriginatingProjectNu
<xs:annotation>
<xs:documentation>For Project Expenses, indicates the project number associated with the expenses</xs:documentation
</xs:annotation>
</xs:element>
<xs:element name="OriginatingProjectSy
<xs:annotation>
<xs:documentation>For Project Expenses, indicates the originating system</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="ClientPONumber" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Client's
</xs:annotation>
</xs:element>
<xs:element name="WorkOrderNumber" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>For FM Expenses, indicates the work order associated with the expense</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="WorkOrderCompletedDa
<xs:annotation>
<xs:documentation>For FM Expenses, indicates the work order completion date</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="WorkOrderCreatedDate
<xs:annotation>
<xs:documentation>For FM Expenses, indicates the work order creation date</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CodingBlock1" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingBlock2" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingBlock3" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingBlock4" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingBlock5" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingBlock6" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingDate1" type="xs:dateTime" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
<xs:element name="CodingDate2" type="xs:dateTime" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Addition
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="InvoiceLineItemType"
<xs:sequence>
<xs:element name="OriginatingInvoiceLi
<xs:annotation>
<xs:documentation>Indicate
</xs:annotation>
</xs:element>
<xs:element name="POLineNumber" type="xs:int" minOccurs="0">
<xs:annotation>
<xs:documentation>Purchase
</xs:annotation>
</xs:element>
<xs:element name="LineItemDescription"
<xs:annotation>
<xs:documentation>Descript
</xs:annotation>
</xs:element>
<xs:element name="LocationId" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>Location
</xs:annotation>
</xs:element>
<xs:element name="BuildingName" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Building
</xs:annotation>
</xs:element>
<xs:element name="LineItemAmount" type="xs:decimal">
<xs:annotation>
<xs:documentation>Amount by line amount broken out by GL Account/Additional Coding</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="TaxableLineItemAmoun
<xs:annotation>
<xs:documentation>Amount of the line item that is taxable</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="TaxAmountLineItem" type="xs:decimal" minOccurs="0">
<xs:annotation>
<xs:documentation>Amount of tax calculated on the line item (based on calculation in originating system)</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="GLAccount" type="GLAccountType" nillable="true"/>
<xs:element name="AdditionalCoding" type="AdditionalCode" nillable="true" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="ArrayOfInvoiceLineIt
<xs:sequence>
<xs:element name="InvoiceLineItem" type="InvoiceLineItemType"
</xs:sequence>
</xs:complexType>
<xs:complexType name="InvoiceType">
<xs:sequence>
<xs:element name="ClientId" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>Unique Client Identifier</xs:documentati
</xs:annotation>
</xs:element>
<xs:element name="OriginatingInvoiceId
<xs:annotation>
<xs:documentation>System generated invoice number in the originating system</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="VendorId" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>Correspo
</xs:annotation>
</xs:element>
<xs:element name="AlternativeVendorId"
<xs:annotation>
<xs:documentation>Alternat
</xs:annotation>
</xs:element>
<xs:element name="VendorInvoiceNumber"
<xs:annotation>
<xs:documentation>Supplier
</xs:annotation>
</xs:element>
<xs:element name="InvoiceDate" type="xs:dateTime">
<xs:annotation>
<xs:documentation>Supplier
</xs:annotation>
</xs:element>
<xs:element name="InvoiceReceiveDate" type="xs:dateTime">
<xs:annotation>
<xs:documentation>Date the vendor's invoice was received pr scanned</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="GLDate" type="xs:dateTime">
<xs:annotation>
<xs:documentation>Date invoice was posted to the General Ledger</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Remark" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>Remark that will appear on the pay stub</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="TotalInvoiceAmount" type="xs:decimal">
<xs:annotation>
<xs:documentation>Total amount of the invoice (should be the sum of the line items)</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CurrencyCode" type="xs:string" nillable="true">
<xs:annotation>
<xs:documentation>Currency
</xs:annotation>
</xs:element>
<xs:element name="TaxRateAreaCode" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Tax Rate applied to this invoice (only required if the invoice has taxable line items)</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="StatusCode" type="common:Codes" nillable="true">
<xs:annotation>
<xs:documentation>Indicate
</xs:annotation>
</xs:element>
<xs:element name="ClientApprovalNumber
<xs:annotation>
<xs:documentation>Client's
</xs:annotation>
</xs:element>
<xs:element name="AuthorizedBy" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Id of the user that approved the invoice</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="BatchReferenceNumber
<xs:annotation>
<xs:documentation>Referenc
</xs:annotation>
</xs:element>
<xs:element name="InvoiceSource" type="xs:string" nillable="true" minOccurs="0">
<xs:annotation>
<xs:documentation>Source of the invoice (i.e. Corrigo, Expesite)</xs:documentatio
</xs:annotation>
</xs:element>
<xs:element name="NumberOfLines" type="xs:int" minOccurs="0">
<xs:annotation>
<xs:documentation>Number of lines on the invoice</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="InvoiceLineItems" type="ArrayOfInvoiceLineIt
<xs:annotation>
<xs:documentation>Line items for the invoice</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="roottype">
<xs:sequence>
<xs:element name="Invoice" type="InvoiceType" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="root" type="roottype" nillable="true"/>
</xs:schema>