Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-8" ?>
- - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w="http://schemas.microsoft.com/dynamics/2008/01/documents/Message" xmlns:v="http://schemas.microsoft.com/dynamics/2008/01/documents/SalesInvoice">
- <xsl:output method="xml" />
- - <xsl:template match="/">
- - <Document-Invoice xmlns="http://www.edisoft.com/documents/INVOICE">
- - <Invoice-Header>
- - <InvoiceNumber>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:FactureExternalId_RU" />
- </InvoiceNumber>
- - <InvoiceDate>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:DocumentDate" />
- </InvoiceDate>
- - <InvoiceCurrency>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:CurrencyCode" />
- </InvoiceCurrency>
- - <InvoicePaymentDueDate>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:DueDate" />
- </InvoicePaymentDueDate>
- <DocumentFunctionCode>9</DocumentFunctionCode>
- - <Order>
- - <BuyerOrderNumber>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:PurchaseOrder" />
- </BuyerOrderNumber>
- </Order>
- - <Delivery>
- - <DeliveryLocationNumber>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:OrderAccount" />
- </DeliveryLocationNumber>
- - <DeliveryDate>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:CustInvoiceTrans/v:DlvDate" />
- </DeliveryDate>
- - <DespatchNumber>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:SalesId" />
- </DespatchNumber>
- </Delivery>
- </Invoice-Header>
- - <Document-Parties>
- - <Sender>
- <ILN>4607032909996</ILN>
- </Sender>
- - <Receiver>
- - <ILN>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAccount" />
- </ILN>
- </Receiver>
- </Document-Parties>
- - <Invoice-Parties>
- - <Buyer>
- - <ILN>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAccount" />
- </ILN>
- - <StateCode>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvState" />
- </StateCode>
- </Buyer>
- - <Payer>
- - <ILN>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAccount" />
- </ILN>
- </Payer>
- - <Seller>
- <ILN>4607032909996</ILN>
- <StateCode>52</StateCode>
- </Seller>
- </Invoice-Parties>
- - <Invoice-Lines>
- - <xsl:for-each select="v:SalesInvoice/v:CustInvoiceJour/v:CustInvoiceTrans">
- - <Line>
- - <Line-Item>
- - <LineNumber>
- <xsl:value-of select="v:LineNumInt" />
- </LineNumber>
- <EAN>0000000000000</EAN>
- - <BuyerItemCode>
- <xsl:value-of select="v:ExternalItemId" />
- </BuyerItemCode>
- - <SupplierItemCode>
- <xsl:value-of select="v:ExternalItemId" />
- </SupplierItemCode>
- - <ItemDescription>
- <xsl:value-of select="v:Name" />
- </ItemDescription>
- - <InvoiceQuantity>
- <xsl:value-of select="v:Qty" />
- </InvoiceQuantity>
- - <InvoiceUnitNetPrice>
- <xsl:value-of select="v:NetSalesUnitPrice" />
- </InvoiceUnitNetPrice>
- <UnitOfMeasure>PCE</UnitOfMeasure>
- - <TaxRate>
- <xsl:value-of select="v:VATValue_RU" />
- </TaxRate>
- - <TaxCategoryCode>
- <xsl:value-of select="v:TaxWriteCodeExt" />
- </TaxCategoryCode>
- - <TaxAmount>
- <xsl:value-of select="v:TaxAmount" />
- </TaxAmount>
- - <NetAmount>
- <xsl:value-of select="v:LineAmount" />
- </NetAmount>
- - <GrossAmount>
- <xsl:value-of select="v:LineAmount" />
- </GrossAmount>
- </Line-Item>
- </Line>
- </xsl:for-each>
- </Invoice-Lines>
- - <Invoice-Summary>
- - <TotalLines>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:NumberOfLines" />
- </TotalLines>
- - <TotalNetAmount>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:SalesBalance" />
- </TotalNetAmount>
- - <TotalTaxAmount>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:SumTax" />
- </TotalTaxAmount>
- - <TotalGrossAmount>
- <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAmount" />
- </TotalGrossAmount>
- - <Tax-Summary>
- - <xsl:for-each select="v:SalesInvoice/v:CustInvoiceJour/v:CustInvoiceJourTaxSpec">
- - <Tax-Summary-Line>
- - <TaxRate>
- <xsl:value-of select="v:TaxValue" />
- </TaxRate>
- <TaxCategoryCode>S</TaxCategoryCode>
- - <TaxAmount>
- <xsl:value-of select="v:TaxAmountCur * (1 - 2 * (v:TaxAmountCur < 0))" />
- </TaxAmount>
- - <TaxableAmount>
- <xsl:value-of select="v:TaxBaseAmountCur * (1 - 2 * (v:TaxBaseAmountCur < 0))" />
- </TaxableAmount>
- </Tax-Summary-Line>
- </xsl:for-each>
- </Tax-Summary>
- </Invoice-Summary>
- </Document-Invoice>
- </xsl:template>
- </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement