Bugfix für Bestellungen mit mehr als 30 Details

This commit is contained in:
Andreas Österreicher
2011-03-17 14:43:13 +00:00
parent a6d3349a09
commit 40db447b4e
2 changed files with 199 additions and 15 deletions
+15 -3
View File
@@ -136,16 +136,22 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo " <telefon><![CDATA[$telefon]]></telefon>\n";
echo " <fax><![CDATA[$fax]]></fax>\n";
echo " </empfaenger>\n";
echo " <details>\n";
$details = new wawi_bestelldetail();
$details->getAllDetailsFromBestellung($bestellung->bestellung_id);
$summe_netto=0;
$summe_brutto=0;
$summe_mwst=0;
$i=0;
echo " <details>\n";
foreach($details->result as $row)
{
if($i==28)
{
echo "</details>\n";
echo "<details_1>\n";
}
echo " <detail>\n";
echo " <position><![CDATA[$row->position]]></position>\n";
echo " <menge><![CDATA[$row->menge]]></menge>\n";
@@ -162,8 +168,14 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
$summe_brutto+=$summe_brutto_detail;
$summe_netto+=$row->menge*$row->preisprove;
$summe_mwst+=$row->menge*$row->preisprove/100*$row->mwst;
$i++;
}
echo " </details>\n";
if($i>=28)
echo " </details_1>\n";
else
echo " </details>\n";
echo " <aufteilungen_1>\n";
$anzAufteilungen = sizeof($aufteilung->result);
$i = 0;
+184 -12
View File
@@ -382,8 +382,8 @@
<fo:table table-layout="fixed" border-collapse="collapse" border-width="0.2mm" border-style="solid">
<fo:table-column column-width="7mm"/>
<fo:table-column column-width="9.4mm"/>
<fo:table-column column-width="6.2mm"/>
<fo:table-column column-width="79.4mm"/>
<fo:table-column column-width="7.2mm"/>
<fo:table-column column-width="78.4mm"/>
<fo:table-column column-width="34.8mm"/>
<fo:table-column column-width="14.8mm"/>
<fo:table-column column-width="19.8mm"/>
@@ -401,12 +401,12 @@
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="7mm">
<fo:block font-size="8pt" font-weight="bold" content-width="8mm">
<!-- ve -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="79mm">
<fo:block font-size="8pt" font-weight="bold" content-width="78mm">
<!-- bezeichnung -->
</fo:block>
</fo:table-cell>
@@ -444,12 +444,12 @@
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="7mm">
<fo:block font-size="8pt" font-weight="bold" content-width="8mm">
<!-- ve -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="79mm">
<fo:block font-size="8pt" font-weight="bold" content-width="78mm">
<!-- bezeichnung -->
</fo:block>
</fo:table-cell>
@@ -484,8 +484,8 @@
<fo:table table-layout="fixed" border-collapse="collapse">
<fo:table-column column-width="7mm"/>
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="7mm"/>
<fo:table-column column-width="80mm"/>
<fo:table-column column-width="8mm"/>
<fo:table-column column-width="79mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="15mm"/>
<fo:table-column column-width="20mm"/>
@@ -503,12 +503,12 @@
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="7mm" text-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="8mm" text-align="center">
VE
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="80mm" text-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="79mm" text-align="center">
Bezeichnung
</fo:block>
</fo:table-cell>
@@ -539,6 +539,8 @@
</fo:block-container>
<xsl:apply-templates select="details_1"/>
<!-- Fusszeile -->
<fo:block-container position="absolute" top="240mm" left="10mm">
<fo:block font-size="10pt">
@@ -649,6 +651,176 @@
</fo:flow>
</fo:page-sequence>
</xsl:template>
<xsl:template match="details_1">
<!-- Wenn zu viele Details vorhanden sind, dann eine neue seite beginnen und den Rest der Tabelle zeichnen -->
<fo:block font-size="16pt"
font-family="sans-serif"
space-after.optimum="15pt"
text-align="center"
break-before="page">
</fo:block>
<!-- Tabelle die ueber der Bestelldetail Tabelle liegt, um die vertikalen Linien zu Zeichnen -->
<fo:block-container position="absolute" top="25mm" left="9.8mm">
<fo:table table-layout="fixed" border-collapse="collapse" border-width="0.2mm" border-style="solid">
<fo:table-column column-width="7mm"/>
<fo:table-column column-width="9.4mm"/>
<fo:table-column column-width="7.2mm"/>
<fo:table-column column-width="78.4mm"/>
<fo:table-column column-width="34.8mm"/>
<fo:table-column column-width="14.8mm"/>
<fo:table-column column-width="19.8mm"/>
<fo:table-column column-width="11.8mm"/>
<fo:table-body>
<fo:table-row line-height="10pt">
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="7mm">
<!-- pos -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="10mm">
<!-- menge -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="8mm">
<!-- ve -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="78mm">
<!-- bezeichnung -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="34mm">
<!-- aritikelnummer -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="15mm">
<!-- Preis/VE -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="20mm">
<!-- Summe [EUR] -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-bottom-style="solid" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="12mm">
<!-- UST -->
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row line-height="185mm">
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="7mm">
<!-- pos -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="10mm">
<!-- menge -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="8mm">
<!-- ve -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="78mm">
<!-- bezeichnung -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="34mm">
<!-- aritikelnummer -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="15mm">
<!-- Preis/VE -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="20mm">
<!-- Summe [EUR] -->
</fo:block>
</fo:table-cell>
<fo:table-cell border-width="0.2mm" border-left-style="solid">
<fo:block font-size="8pt" font-weight="bold" content-width="12mm">
<!-- UST -->
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</fo:block-container>
<!-- Bestelldetails 2. Tabelle fuer neue Seite -->
<fo:block-container position="absolute" top="25mm" left="10mm">
<fo:table table-layout="fixed" border-collapse="collapse">
<fo:table-column column-width="7mm"/>
<fo:table-column column-width="10mm"/>
<fo:table-column column-width="8mm"/>
<fo:table-column column-width="79mm"/>
<fo:table-column column-width="35mm"/>
<fo:table-column column-width="15mm"/>
<fo:table-column column-width="20mm"/>
<fo:table-column column-width="12mm"/>
<fo:table-body>
<fo:table-row line-height="10pt">
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="7mm" text-align="center">
Pos
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="10mm" text-align="center">
Menge
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="8mm" text-align="center">
VE
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="80mm" text-align="center">
Bezeichnung
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="35mm" text-align="center">
ArtikelNr
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="15mm" text-align="center">
Preis/VE
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="20mm" text-align="center">
Summe [EUR]
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" font-weight="bold" content-width="12mm" text-align="center">
UST
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:apply-templates select="detail"/>
</fo:table-body>
</fo:table>
</fo:block-container>
</xsl:template>
<xsl:template match="details">
<xsl:apply-templates select="detail"/>
</xsl:template>
@@ -665,12 +837,12 @@
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" content-width="7mm" text-align="center">
<fo:block font-size="8pt" content-width="8mm" text-align="center">
<xsl:value-of select="verpackungseinheit" />
</fo:block>
</fo:table-cell>
<fo:table-cell display-align="center">
<fo:block font-size="8pt" content-width="79mm" padding-left="1mm">
<fo:block font-size="8pt" content-width="78mm" padding-left="1mm">
<xsl:value-of select="beschreibung" />
</fo:block>
</fo:table-cell>