Advertisement
Guest User

Untitled

a guest
May 24th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. - <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">
  3. <xsl:output method="xml" />
  4. - <xsl:template match="/">
  5. - <Document-Invoice xmlns="http://www.edisoft.com/documents/INVOICE">
  6. - <Invoice-Header>
  7. - <InvoiceNumber>
  8. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:FactureExternalId_RU" />
  9. </InvoiceNumber>
  10. - <InvoiceDate>
  11. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:DocumentDate" />
  12. </InvoiceDate>
  13. - <InvoiceCurrency>
  14. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:CurrencyCode" />
  15. </InvoiceCurrency>
  16. - <InvoicePaymentDueDate>
  17. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:DueDate" />
  18. </InvoicePaymentDueDate>
  19. <DocumentFunctionCode>9</DocumentFunctionCode>
  20. - <Order>
  21. - <BuyerOrderNumber>
  22. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:PurchaseOrder" />
  23. </BuyerOrderNumber>
  24. </Order>
  25. - <Delivery>
  26. - <DeliveryLocationNumber>
  27. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:OrderAccount" />
  28. </DeliveryLocationNumber>
  29. - <DeliveryDate>
  30. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:CustInvoiceTrans/v:DlvDate" />
  31. </DeliveryDate>
  32. - <DespatchNumber>
  33. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:SalesId" />
  34. </DespatchNumber>
  35. </Delivery>
  36. </Invoice-Header>
  37. - <Document-Parties>
  38. - <Sender>
  39. <ILN>4607032909996</ILN>
  40. </Sender>
  41. - <Receiver>
  42. - <ILN>
  43. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAccount" />
  44. </ILN>
  45. </Receiver>
  46. </Document-Parties>
  47. - <Invoice-Parties>
  48. - <Buyer>
  49. - <ILN>
  50. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAccount" />
  51. </ILN>
  52. - <StateCode>
  53. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvState" />
  54. </StateCode>
  55. </Buyer>
  56. - <Payer>
  57. - <ILN>
  58. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAccount" />
  59. </ILN>
  60. </Payer>
  61. - <Seller>
  62. <ILN>4607032909996</ILN>
  63. <StateCode>52</StateCode>
  64. </Seller>
  65. </Invoice-Parties>
  66. - <Invoice-Lines>
  67. - <xsl:for-each select="v:SalesInvoice/v:CustInvoiceJour/v:CustInvoiceTrans">
  68. - <Line>
  69. - <Line-Item>
  70. - <LineNumber>
  71. <xsl:value-of select="v:LineNumInt" />
  72. </LineNumber>
  73. <EAN>0000000000000</EAN>
  74. - <BuyerItemCode>
  75. <xsl:value-of select="v:ExternalItemId" />
  76. </BuyerItemCode>
  77. - <SupplierItemCode>
  78. <xsl:value-of select="v:ExternalItemId" />
  79. </SupplierItemCode>
  80. - <ItemDescription>
  81. <xsl:value-of select="v:Name" />
  82. </ItemDescription>
  83. - <InvoiceQuantity>
  84. <xsl:value-of select="v:Qty" />
  85. </InvoiceQuantity>
  86. - <InvoiceUnitNetPrice>
  87. <xsl:value-of select="v:NetSalesUnitPrice" />
  88. </InvoiceUnitNetPrice>
  89. <UnitOfMeasure>PCE</UnitOfMeasure>
  90. - <TaxRate>
  91. <xsl:value-of select="v:VATValue_RU" />
  92. </TaxRate>
  93. - <TaxCategoryCode>
  94. <xsl:value-of select="v:TaxWriteCodeExt" />
  95. </TaxCategoryCode>
  96. - <TaxAmount>
  97. <xsl:value-of select="v:TaxAmount" />
  98. </TaxAmount>
  99. - <NetAmount>
  100. <xsl:value-of select="v:LineAmount" />
  101. </NetAmount>
  102. - <GrossAmount>
  103. <xsl:value-of select="v:LineAmount" />
  104. </GrossAmount>
  105. </Line-Item>
  106. </Line>
  107. </xsl:for-each>
  108. </Invoice-Lines>
  109. - <Invoice-Summary>
  110. - <TotalLines>
  111. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:NumberOfLines" />
  112. </TotalLines>
  113. - <TotalNetAmount>
  114. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:SalesBalance" />
  115. </TotalNetAmount>
  116. - <TotalTaxAmount>
  117. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:SumTax" />
  118. </TotalTaxAmount>
  119. - <TotalGrossAmount>
  120. <xsl:value-of select="v:SalesInvoice/v:CustInvoiceJour/v:InvoiceAmount" />
  121. </TotalGrossAmount>
  122. - <Tax-Summary>
  123. - <xsl:for-each select="v:SalesInvoice/v:CustInvoiceJour/v:CustInvoiceJourTaxSpec">
  124. - <Tax-Summary-Line>
  125. - <TaxRate>
  126. <xsl:value-of select="v:TaxValue" />
  127. </TaxRate>
  128. <TaxCategoryCode>S</TaxCategoryCode>
  129. - <TaxAmount>
  130. <xsl:value-of select="v:TaxAmountCur * (1 - 2 * (v:TaxAmountCur < 0))" />
  131. </TaxAmount>
  132. - <TaxableAmount>
  133. <xsl:value-of select="v:TaxBaseAmountCur * (1 - 2 * (v:TaxBaseAmountCur < 0))" />
  134. </TaxableAmount>
  135. </Tax-Summary-Line>
  136. </xsl:for-each>
  137. </Tax-Summary>
  138. </Invoice-Summary>
  139. </Document-Invoice>
  140. </xsl:template>
  141. </xsl:stylesheet>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement