151 lines
No EOL
4.4 KiB
XML
151 lines
No EOL
4.4 KiB
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
<xsl:stylesheet
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
|
|
<xsl:strip-space elements="*" />
|
|
<xsl:output method="xml" indent="yes" encoding="UTF-8"
|
|
standalone="yes" />
|
|
|
|
<xsl:template match="/">
|
|
|
|
<xsl:variable name="date"
|
|
select="/data/document/item[@name='$modified']/value" />
|
|
|
|
<Invoices version="2020.2"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
|
|
<Message>
|
|
<SenderID>Imixs-Office-Workflow</SenderID>
|
|
<ReceiverID>Cargosoft</ReceiverID>
|
|
<MessageID><xsl:value-of select="/data/document/item[@name='$uniqueid']/value" /></MessageID>
|
|
<MessageDate>
|
|
<DateTime><xsl:value-of select="$date" /></DateTime>
|
|
</MessageDate>
|
|
</Message>
|
|
|
|
<xsl:apply-templates
|
|
select="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'Cargosoft-Export']" />
|
|
</Invoices>
|
|
|
|
</xsl:template>
|
|
|
|
<!-- This template builds invoice info -->
|
|
<xsl:template
|
|
match="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'Cargosoft-Export']">
|
|
|
|
<xsl:variable name="date" select="item[@name='$modified']/value"/>
|
|
<xsl:variable name="currency" select="item[@name='invoice.currency']/value"/>
|
|
|
|
|
|
<Invoice>
|
|
<InvoiceHeader>
|
|
<Client>
|
|
<Codes>
|
|
<!-- Als Typ muss „cs“ übermittelt werden und im Code wird
|
|
dann der Cargosoft Mandant erwartet. -->
|
|
<Code Type="cs">001</Code>
|
|
</Codes>
|
|
</Client>
|
|
<!-- Hier muss eine eindeutige Belegnummer für jeden einzelnen
|
|
Beleg übermittelt werden. Es muss sich um eine Nummer
|
|
handeln, die pro Beleg hochgezählt wird und darf sich nicht
|
|
überschneiden mit dem CargoSoft Belegnummernkreis.
|
|
Daher den Nummernkreis vorher mit CargoSoft absprechen. -->
|
|
<InvoiceNumber><xsl:value-of select="item[@name='numsequencenumber']/value" /></InvoiceNumber>
|
|
<InvoiceType>
|
|
<Codes>
|
|
<Code Type="cs">INVOICE</Code>
|
|
</Codes>
|
|
</InvoiceType>
|
|
<InvoiceCurrency>
|
|
<Codes>
|
|
<Code Type="cs"><xsl:value-of select="$currency" /></Code>
|
|
</Codes>
|
|
</InvoiceCurrency>
|
|
<InvoiceAmount>
|
|
<NetAmount>
|
|
<Amount>
|
|
<Currency>
|
|
<Codes>
|
|
<Code Type="cs"><xsl:value-of select="$currency" /></Code>
|
|
</Codes>
|
|
</Currency>
|
|
<Value><xsl:value-of select="item[@name='invoice.total']/value" /></Value>
|
|
<ExchangeRate><xsl:value-of select="item[@name='invoice.exchangerate']/value" /></ExchangeRate>
|
|
</Amount>
|
|
</NetAmount>
|
|
<VATInformation>
|
|
<VATAmount>
|
|
<Amount isDomesticCurrency="true">
|
|
<Currency>
|
|
<Codes>
|
|
<Code Type="cs"><xsl:value-of select="$currency" /></Code>
|
|
</Codes>
|
|
</Currency>
|
|
<Value>0</Value>
|
|
</Amount>
|
|
</VATAmount>
|
|
</VATInformation>
|
|
</InvoiceAmount>
|
|
<CollectionInvoice>false</CollectionInvoice>
|
|
<Booked>false</Booked>
|
|
<InvoiceDate><xsl:value-of select="item[@name='invoice.date']/value" /></InvoiceDate>
|
|
|
|
|
|
<InvoiceAddress type="CN">
|
|
<Codes>
|
|
<Code Type="cs"><xsl:value-of select="item[@name='cdtr.number']/value" /></Code>
|
|
</Codes>
|
|
</InvoiceAddress>
|
|
|
|
<!--
|
|
<References>
|
|
<Reference type="cs">201606-ABS1425131</Reference>
|
|
</References>
|
|
-->
|
|
</InvoiceHeader>
|
|
<InvoiceRows>
|
|
|
|
<xsl:for-each
|
|
select="item[@name='_childitems']/value">
|
|
<InvoiceRow>
|
|
<Row><xsl:value-of select="./item[@name='numpos']/value" /></Row>
|
|
<FileNumber><xsl:value-of select="./item[@name='name']/value" /></FileNumber>
|
|
<InvoiceAmount>
|
|
<NetAmount>
|
|
<Amount>
|
|
<Currency>
|
|
<Codes>
|
|
<Code Type="cs"><xsl:value-of select="$currency" /></Code>
|
|
</Codes>
|
|
</Currency>
|
|
<Value><xsl:value-of select="./item[@name='amount']/value" /></Value>
|
|
</Amount>
|
|
</NetAmount>
|
|
<VATInformation>
|
|
<VAT>
|
|
<Codes>
|
|
<Code Type="cs"><xsl:value-of select="./item[@name='tax']/value" /></Code>
|
|
</Codes>
|
|
</VAT>
|
|
</VATInformation>
|
|
</InvoiceAmount>
|
|
<BookingPeriod><xsl:value-of select="./item[@name='period']/value" /></BookingPeriod>
|
|
<ActivityType>
|
|
<Codes>
|
|
<Code Type="cs">ACT</Code>
|
|
</Codes>
|
|
</ActivityType>
|
|
</InvoiceRow>
|
|
</xsl:for-each>
|
|
</InvoiceRows>
|
|
</Invoice>
|
|
|
|
|
|
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
|
|
</xsl:stylesheet> |