diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml index 1ed73ed..c0cdbce 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen.xhtml @@ -114,7 +114,8 @@ - + @@ -122,7 +123,15 @@ + a:data-id="orderitems_total"> + + + + + + @@ -164,7 +173,7 @@ //Rechnet die Preise zusammen function calculateSummary() { - var price = 0, amount = 0, sum = 0, total = 0, brutto = 0; + var price = 0, amount = 0, sum = 0, total = 0, brutto = 0, netto = 0; var summaryItems = $("[data-id='orderitem_amount']"); $(summaryItems).each(function(index, value) { var tableRow = $(this).closest('tr'); @@ -182,23 +191,30 @@ // is tax a number? if (!isNaN(inputtax.val())) { tax=convertToNumber(inputtax.val()); - console.log('tax=' +tax); + //console.log('tax=' +tax); brutto=amount + amount*(tax/100); - console.log('brutto=' +brutto); + //console.log('brutto=' +brutto); } else { brutto=amount; } - // round + // round brutto brutto = Math.round(brutto * 100) / 100; total = total + brutto; + // round total + total = Math.round(total * 100) / 100; + + netto = netto + amount; + // round net + netto = Math.round(netto * 100) / 100; // update netto column $("[data-id='orderitem_amount']",tableRow).val(convertToCurrency(amount)); - // update burtto column + // update brutto column brutto=convertToCurrency(brutto); $("[data-id='orderitem_total']",tableRow).val(brutto); // hidden field + // update display column $("[data-id='orderitem_summary']", tableRow).empty(); $("[data-id='orderitem_summary']", tableRow).append(brutto); @@ -209,12 +225,26 @@ } }); - // update total _capacity + // compute total tax + var total_tax=total-netto; + total_tax = Math.round(total_tax * 100) / 100; + + // update total netto and tax + netto=convertToCurrency(netto); total = convertToCurrency(total); - $("[data-id='orderitems_capacity']").val(total); + total_tax = convertToCurrency(total_tax); + $("[data-id='orderitems_total']").val(total); + $("[data-id='orderitems_total_netto']").val(netto); + $("[data-id='orderitems_total_tax']").val(total_tax); + + // update display... $("[data-id='orderlist_summary']", ".imixs-orderitems").empty(); $("[data-id='orderlist_summary']", ".imixs-orderitems").append(total); + $("[data-id='orderlist_summary_net']", ".imixs-orderitems").empty(); + $("[data-id='orderlist_summary_net']", ".imixs-orderitems").append(netto); + + } function convertToNumber(currency) { diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen_read.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen_read.xhtml index ea0a40e..a985eb7 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen_read.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/alexander/sub_positionen_read.xhtml @@ -50,10 +50,6 @@ - - - - @@ -63,8 +59,11 @@ - + Summe: + + diff --git a/reports/cargosoft/cargosoft-1.0.0.imixs-report b/reports/cargosoft/cargosoft-1.0.0.imixs-report index 2a445a6..c30c2e6 100644 --- a/reports/cargosoft/cargosoft-1.0.0.imixs-report +++ b/reports/cargosoft/cargosoft-1.0.0.imixs-report @@ -1 +1 @@ -$uniqueid$workflowgroup$taskid$workflowsummaryinvoice.numberinvoice.dateinvoice.totalinvoice.currencycdtr.namecdtr.ibancdtr.bicdbtr.namedbtr.ibandbtr.bicpayment.typeUTF-8Cargosoft Export - only the XSL Template is needed here!cargosoft<?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> <xsl:if test="string-length(item[@name='invoice.period']/value) > 0"> <BookingPeriod><xsl:value-of select="item[@name='invoice.period']/value" /></BookingPeriod> </xsl:if> <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"><xsl:value-of select="item[@name='invoice.number']/value" /></Reference> </References> <!-- Attachements --> <xsl:if test="item[@name='$file.count']/value > 0"> <Attachments> <xsl:for-each select="item[@name='$file']/value/item"> <Attachment> <xsl:attribute name="id"><xsl:value-of select="./value/item[@name='md5checksum']/value" /></xsl:attribute> <xsl:attribute name="version">1</xsl:attribute> <Filename><xsl:value-of select="./@name" /></Filename> <Description>Imixs-Office-Workflow</Description> <Content><xsl:value-of select="./value[2]" /></Content> </Attachment> </xsl:for-each> </Attachments> </xsl:if> </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> <ActivityType> <Codes> <Code Type="cs"><xsl:value-of select="./item[@name='category']/value" /></Code> </Codes> </ActivityType> </InvoiceRow> </xsl:for-each> </InvoiceRows> </Invoice> </xsl:template> </xsl:stylesheet>/office-alexander-logistics/reports/cargosoft/cargosoft-1.0.1.xsl \ No newline at end of file +$uniqueid$workflowgroup$taskid$workflowsummaryinvoice.numberinvoice.dateinvoice.totalinvoice.currencycdtr.namecdtr.ibancdtr.bicdbtr.namedbtr.ibandbtr.bicpayment.typeUTF-8Cargosoft Export - only the XSL Template is needed here!cargosoft<?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='order.total.net']/value" /></Value> <ExchangeRate><xsl:value-of select="item[@name='invoice.exchangerate']/value" /></ExchangeRate> </Amount> </NetAmount> <VATAmount> <Amount> <Currency> <Codes> <Code Type="cs"><xsl:value-of select="$currency" /></Code> </Codes> </Currency> <Value><xsl:value-of select="item[@name='order.total.tax']/value" /></Value> <ExchangeRate><xsl:value-of select="item[@name='invoice.exchangerate']/value" /></ExchangeRate> </Amount> </VATAmount> <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> <xsl:if test="string-length(item[@name='invoice.period']/value) > 0"> <BookingPeriod><xsl:value-of select="item[@name='invoice.period']/value" /></BookingPeriod> </xsl:if> <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"><xsl:value-of select="item[@name='invoice.number']/value" /></Reference> </References> <!-- Attachements --> <xsl:if test="item[@name='$file.count']/value > 0"> <Attachments> <xsl:for-each select="item[@name='$file']/value/item"> <Attachment> <xsl:attribute name="id"><xsl:value-of select="./value/item[@name='md5checksum']/value" /></xsl:attribute> <xsl:attribute name="version">1</xsl:attribute> <Filename><xsl:value-of select="./@name" /></Filename> <Description>Imixs-Office-Workflow</Description> <Content><xsl:value-of select="./value[2]" /></Content> </Attachment> </xsl:for-each> </Attachments> </xsl:if> </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> <ActivityType> <Codes> <Code Type="cs"><xsl:value-of select="./item[@name='category']/value" /></Code> </Codes> </ActivityType> </InvoiceRow> </xsl:for-each> </InvoiceRows> </Invoice> </xsl:template> </xsl:stylesheet>/office-alexander-logistics/reports/cargosoft/cargosoft-1.0.2.xsl \ No newline at end of file diff --git a/reports/cargosoft/cargosoft-1.0.2.xsl b/reports/cargosoft/cargosoft-1.0.2.xsl new file mode 100644 index 0000000..892119c --- /dev/null +++ b/reports/cargosoft/cargosoft-1.0.2.xsl @@ -0,0 +1,174 @@ + + + + + + + + + + + + + Imixs-Office-Workflow + Cargosoft + + + + + + + + + + + + + + + + + + + + + + + + 001 + + + + + + + INVOICE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + false + + + + false + + + + + + + + + + + + + + + + + + + + 1 + + Imixs-Office-Workflow + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file