<?xml version='1.0' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bex="urn:schemas-bex-biz:DocumentEnvelope-v1" xmlns:a="urn:schemas-bex-biz:Invoice-v3">
	<xsl:output method="xml" encoding="UTF-8"/>
	<xsl:template match="/">
		<bex:DocumentEnvelope xmlns:bex="urn:schemas-bex-biz:DocumentEnvelope-v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
			<bex:DocumentHeader>
				<bex:DocumentFrom>0000078810</bex:DocumentFrom>
				<bex:DocumentTo>152</bex:DocumentTo>
				<bex:DocumentService>beX</bex:DocumentService>
				<bex:DocumentId>
					<xsl:value-of select="concat('78810',root/Filhdr/time_stamp)"/>
				</bex:DocumentId>
				<bex:DocumentTime>
					<xsl:value-of select="root/Filhdr/time_stamp"/>
				</bex:DocumentTime>
				<bex:DocumentType>INVOICE</bex:DocumentType>
			</bex:DocumentHeader>
			<bex:Documents>
				<xsl:for-each select="root/Invoice">
					<a:Invoice xmlns="urn:schemas-bex-biz:Invoice-v3">
						<a:InvoiceType invoiceTypeCode="TAX">Tax Invoice</a:InvoiceType>
						<a:InvoiceCurrencies>
							<a:InvoiceCurrency>GBP</a:InvoiceCurrency>
						</a:InvoiceCurrencies>
						<a:InvoiceNumber>
							<xsl:value-of select="Invhdr/invoiceID"/>
						</a:InvoiceNumber>
						<a:InvoiceDate>
							<xsl:value-of select="Invhdr/tax_point_dt"/>
						</a:InvoiceDate>
						<a:TaxPointDate>
							<xsl:value-of select="Invhdr/tax_point_dt"/>
						</a:TaxPointDate>
						<a:InvoiceReferences>
							<a:PurchaseOrder>
								<a:PurchaseOrderNumber>
									<xsl:value-of select="Invhdr/cust_poID"/>
								</a:PurchaseOrderNumber>
							</a:PurchaseOrder>
						</a:InvoiceReferences>
						<a:InvoiceDates>
							<a:DespatchDate>
								<xsl:value-of select="Invhdr/tax_point_dt"/>
							</a:DespatchDate>
						</a:InvoiceDates>
						<a:InvoiceCalculation>
							<a:RoundingRule>X</a:RoundingRule>
							<a:TaxCalculation>L</a:TaxCalculation>
							<a:SettlementBeforeTax>Y</a:SettlementBeforeTax>
							<a:ItemPriceIncludesTax>N</a:ItemPriceIncludesTax>
						</a:InvoiceCalculation>
						<a:NationalInformation>
							<a:NationalInformationText>Delete as applicable : VAT : EC Article 28 Simplification invoice</a:NationalInformationText>
						</a:NationalInformation>
						<a:Supplier>
							<a:SupplierId>0000078810</a:SupplierId>
							<a:VATRegistrationId>GB703408174</a:VATRegistrationId>
							<a:Name>CALDWELLS GROUP LTD</a:Name>
							<a:Address>
								<a:Country countryCode="GB"/>
							</a:Address>
						</a:Supplier>
						<a:Buyer>
							<a:BuyerId>152</a:BuyerId>
							<a:BusinessUnit>0003</a:BusinessUnit>
							<a:DUNS>152</a:DUNS>
							<a:VATRegistrationId>GB232703787</a:VATRegistrationId>
							<a:Name>ELI LILLY AND COMPANY LTD</a:Name>
							<a:Address>
								<a:Country countryCode="GB"/>
							</a:Address>
						</a:Buyer>
						<a:DeliverTo>
							<a:Name>Eli Lilly and Company Limited</a:Name>
							<a:Address>
								<a:Address1>Speke Operations</a:Address1>
								<a:Address2>Fleming Road</a:Address2>
							</a:Address>
						</a:DeliverTo>
						<xsl:for-each select="Invlin">
							<a:InvoiceLine>
								<a:InvoiceLineType invoiceLineTypeCode="GDS">Goods and Services</a:InvoiceLineType>
								<a:InvoiceLineNumber>
									<xsl:value-of select="invoice_item"/>
								</a:InvoiceLineNumber>
								<a:PurchaseOrderLineNumber>
									<xsl:value-of select="cust_poitem"/>
								</a:PurchaseOrderLineNumber>
								<a:SuppliersProductCode>
									<xsl:value-of select="material"/>
								</a:SuppliersProductCode>
								<a:ShortItemDescription>
									<xsl:value-of select="description"/>
								</a:ShortItemDescription>
								<a:InvoicedQuantity>
									<a:Quantity>
										<xsl:value-of select="qty"/>
									</a:Quantity>
									<a:UnitOfMeasure>
										<xsl:attribute name="unitOfMeasureCode">
											<xsl:value-of select="uom"/>
										</xsl:attribute>
									</a:UnitOfMeasure>
								</a:InvoicedQuantity>
								<a:UnitPrice>
									<xsl:value-of select="price"/>
								</a:UnitPrice>
								<a:LineValue>
									<xsl:value-of select="line_value"/>
								</a:LineValue>
								<a:LineTax>
									<a:TaxCode>GB:STD</a:TaxCode>
									<a:TaxRate>
										<xsl:value-of select="vat_rate"/>
									</a:TaxRate>
									<a:TaxAmount>
										<xsl:value-of select="vat_value"/>
									</a:TaxAmount>
								</a:LineTax>
							</a:InvoiceLine>
						</xsl:for-each>
						<a:TaxSummary>
							<a:TaxCode>GB:STD</a:TaxCode>
							<a:TaxRate>17.50</a:TaxRate>
							<a:NumberOfLines>
								<xsl:value-of select="Invtlr/line_count"/>
							</a:NumberOfLines>
							<a:TotalLineValue>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:TotalLineValue>
							<a:NetValueWithSD>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:NetValueWithSD>
							<a:NetValueWithoutSD>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:NetValueWithoutSD>
							<a:TaxableAmount>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:TaxableAmount>
							<a:TaxAmount>
								<xsl:value-of select="Invtlr/vat_value"/>
							</a:TaxAmount>
							<a:AmountPayableWithSD>
								<xsl:value-of select="Invtlr/gross_value"/>
							</a:AmountPayableWithSD>
							<a:AmountPayableWithoutSD>
								<xsl:value-of select="Invtlr/gross_value"/>
							</a:AmountPayableWithoutSD>
						</a:TaxSummary>
						<a:InvoiceSummary>
							<a:NumberOfLines>
								<xsl:value-of select="Invtlr/line_count"/>
							</a:NumberOfLines>
							<a:NumberOfTaxRates>1</a:NumberOfTaxRates>
							<a:TotalLineValue>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:TotalLineValue>
							<a:NetValueWithSD>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:NetValueWithSD>
							<a:NetValueWithoutSD>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:NetValueWithoutSD>
							<a:TaxableAmount>
								<xsl:value-of select="Invtlr/goods_value"/>
							</a:TaxableAmount>
							<a:TaxAmount>
								<xsl:value-of select="Invtlr/vat_value"/>
							</a:TaxAmount>
							<a:AmountPayableWithSD>
								<xsl:value-of select="Invtlr/gross_value"/>
							</a:AmountPayableWithSD>
							<a:AmountPayableWithoutSD>
								<xsl:value-of select="Invtlr/gross_value"/>
							</a:AmountPayableWithoutSD>
						</a:InvoiceSummary>
					</a:Invoice>
				</xsl:for-each>
			</bex:Documents>
			<bex:DocumentTrailer>
				<bex:NumberOfDocuments>
					<xsl:value-of select="root/Filtlr/invoice_count"/>
				</bex:NumberOfDocuments>
			</bex:DocumentTrailer>
		</bex:DocumentEnvelope>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="import_lilly_invoices_2005&#x2D;09&#x2D;28.xml" userelativepaths="yes" externalpreview="no" url="import_lilly_invoices_2005&#x2D;09&#x2D;28.xml" htmlbaseurl="" outputurl="test_lilly_2005&#x2D;10&#x2D;04.xml" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="lilly_invoice_template_beXML3.xml" destSchemaRoot="DocumentEnvelope" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="import_lilly_invoices_2005&#x2D;09&#x2D;28.xml" srcSchemaRoot="root" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"><block path="bex:DocumentEnvelope/bex:DocumentHeader/bex:DocumentId/xsl:value&#x2D;of" x="115" y="42"/><block path="bex:DocumentEnvelope/bex:Documents/xsl:for&#x2D;each" x="121" y="88"/><block path="bex:DocumentEnvelope/bex:Documents/xsl:for&#x2D;each/a:Invoice/xsl:for&#x2D;each" x="193" y="70"/></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->