office-alexander-logistics/reports/cargosoft/test/cargosoft-1.0.-muster.xsl

202 lines
No EOL
5.2 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" />
<xsl:variable name="subject"
select="/data/document/item[@name='_subject']/value" />
<xsl:variable name="currency"
select="/data/document/item[@name='_currency']/value" />
<xsl:variable name="invoiceid"
select="/data/document/item[@name='_invoicenumber']/value" />
<xsl:variable name="gegenkonto"
select="/data/document/item[@name='_kreditor_konto']/value" />
<Invoices version="2020.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Message>
<SenderID>Imixs-Office-Workflow</SenderID>
<ReceiverID>Cargosoft</ReceiverID>
<MessageID>1</MessageID>
<MessageDate>
<DateTime><xsl:value-of select="$date" /></DateTime>
</MessageDate>
</Message>
<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="/data/document/item[@name='numsequencenumber']/value" /></InvoiceNumber>
<InvoiceType>
<Codes>
<Code Type="cs">INVOICE</Code>
</Codes>
</InvoiceType>
<InvoiceCurrency>
<Codes>
<Code Type="cs"><xsl:value-of select="/data/document/item[@name='invoice.currency']/value" /></Code>
</Codes>
</InvoiceCurrency>
<InvoiceAmount>
<NetAmount>
<Amount isDomesticCurrency="true">
<Currency>
<Codes>
<Code Type="cs">EUR</Code>
</Codes>
</Currency>
<Value>500</Value>
</Amount>
</NetAmount>
<VATInformation>
<VATAmount>
<Amount isDomesticCurrency="true">
<Currency>
<Codes>
<Code Type="cs">EUR</Code>
</Codes>
</Currency>
<Value>0</Value>
</Amount>
</VATAmount>
</VATInformation>
</InvoiceAmount>
<CollectionInvoice>false</CollectionInvoice>
<Booked>false</Booked>
<InvoiceDate>2016-07-06T00:00:00.0Z</InvoiceDate>
<InvoiceAddress type="CN">
<Codes>
<Code Type="cs">9999999</Code>
</Codes>
</InvoiceAddress>
<References>
<Reference type="cs">201606-ABS1425131</Reference>
</References>
</InvoiceHeader>
<InvoiceRows>
<InvoiceRow>
<Row>1</Row>
<FileNumber>999-201606-99999</FileNumber>
<InvoiceAmount>
<NetAmount>
<Amount isDomesticCurrency="true">
<Currency>
<Codes>
<Code Type="cs">EUR</Code>
</Codes>
</Currency>
<Value>300.00</Value>
</Amount>
</NetAmount>
<VATInformation>
<VAT>
<Codes>
<Code Type="cs">45</Code>
</Codes>
</VAT>
</VATInformation>
</InvoiceAmount>
<ActivityType>
<Codes>
<Code Type="cs">ACT</Code>
</Codes>
</ActivityType>
</InvoiceRow>
</InvoiceRows>
</Invoice>
<consolidate>
<xsl:attribute name="consolidatedAmount"><xsl:value-of
select="/data/document/item[@name='_amount_brutto']/value" /></xsl:attribute>
<xsl:attribute name="consolidatedDate"><xsl:value-of
select="format-dateTime($date, '[Y0001]-[M01]-[D01]')" /></xsl:attribute>
<xsl:attribute name="consolidatedInvoiceId"><xsl:value-of
select="$invoiceid" /></xsl:attribute>
<xsl:attribute name="consolidatedCurrencyCode"><xsl:value-of
select="$currency" /></xsl:attribute>
<xsl:for-each
select="/data/document/item[@name='_childitems']/value">
<accountsPayableLedger>
<date>
<xsl:value-of
select="format-dateTime($date, '[Y0001]-[M01]-[D01]')" />
</date>
<amount>
<xsl:value-of select="./item[@name='_amount']/value" />
</amount>
<accountNo>
<xsl:value-of select="./item[@name='_konto']/value" />
</accountNo>
<buCode>
<xsl:value-of select="./item[@name='_tax']/value" />
</buCode>
<information>
<xsl:value-of select="$subject" />
</information>
<currencyCode>
<xsl:value-of select="$currency" />
</currencyCode>
<invoiceId>
<xsl:value-of select="$invoiceid" />
</invoiceId>
<bpAccountNo>
<xsl:value-of select="$gegenkonto" />
</bpAccountNo>
</accountsPayableLedger>
</xsl:for-each>
</consolidate>
</Invoices>
</xsl:template>
</xsl:stylesheet>