summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2019-07-31 18:54:21 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2019-07-31 18:54:21 +0000
commite96b183e33afb4038b2e39868f32ebf94a59ba83 (patch)
tree92e15cdbff9e5929b98c4efce24a041b6cd253c8 /views/mods
parent1a8f06b6cf1bfd781c236f44d42a13166fbeac36 (diff)
- Gutschein/Coupon
- Task #681 git-svn-id: https://[internal]/wordpress/plugins/wpsg4@7490 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_gutschein/add.phtml11
-rw-r--r--views/mods/mod_gutschein/basket_row_end_coupon.phtml2
-rw-r--r--views/mods/mod_gutschein/index.phtml7
-rw-r--r--views/mods/mod_gutschein/mail_order_end.phtml27
-rw-r--r--views/mods/mod_gutschein/mail_order_end_html.phtml50
-rw-r--r--views/mods/mod_rechnungen/accounting_pdf.phtml133
-rw-r--r--views/mods/mod_rechnungen/invoice_pdf.phtml136
7 files changed, 292 insertions, 74 deletions
diff --git a/views/mods/mod_gutschein/add.phtml b/views/mods/mod_gutschein/add.phtml
index b6b4b6a..3166f21 100644
--- a/views/mods/mod_gutschein/add.phtml
+++ b/views/mods/mod_gutschein/add.phtml
@@ -4,6 +4,16 @@
* Template für die Maske eines neuen Gutscheins
*/
+ $used = 0;
+
+ if (wpsg_isSizedInt($_REQUEST['voucher_id'])) {
+
+ $oVoucher = wpsg_voucher::getInstance($_REQUEST['voucher_id']);
+
+ $used = $oVoucher->getUsedAmount();
+
+ }
+
?>
<div class="content form-horizontal">
@@ -13,6 +23,7 @@
<?php wpsg_drawForm_AdminboxStart(); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_gutschein_value', __('Betrag', 'wpsg'), wpsg_ff($this->view['mod_gutschein']['value'])); ?>
+ <?php echo wpsg_drawForm_Input(false, __('Bereits verwendet'), wpsg_ff($used), ['field_id' => 'wpsg_voucher_used', 'readonly' => true]); ?>
<div style="margin-top:-15px;">
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_gutschein_coupon', __('Als Wertgutschein behandeln', 'wpsg'), $this->view['mod_gutschein']['coupon']); ?>
diff --git a/views/mods/mod_gutschein/basket_row_end_coupon.phtml b/views/mods/mod_gutschein/basket_row_end_coupon.phtml
index 95f8f43..070f8a7 100644
--- a/views/mods/mod_gutschein/basket_row_end_coupon.phtml
+++ b/views/mods/mod_gutschein/basket_row_end_coupon.phtml
@@ -25,7 +25,7 @@
<?php } ?>
<div class="value"><?php
- echo '-'.wpsg_ff($gs[$display_brutto_netto], $this->get_option('wpsg_currency'));
+ echo wpsg_ff($gs[$display_brutto_netto], $this->get_option('wpsg_currency'));
if (strpos($gs['set'], '%') !== false) {
diff --git a/views/mods/mod_gutschein/index.phtml b/views/mods/mod_gutschein/index.phtml
index 4582533..fd47af7 100644
--- a/views/mods/mod_gutschein/index.phtml
+++ b/views/mods/mod_gutschein/index.phtml
@@ -80,7 +80,8 @@
</tr>
</thead>
<tbody>
- <?php foreach ($this->view['arData'] as $oVoucher) { ?>
+ <?php /** @var wpsg_voucher $oVoucher */
+ foreach ($this->view['arData'] as $oVoucher) { ?>
<tr>
<td class="col_checkbox">
@@ -107,8 +108,10 @@
<td class="col_end"><?php echo wpsg_formatTimestamp($oVoucher->end_date, true); ?></td>
<td class="col_value"><span><?php
- if ($oVoucher->calc_typ == 'w') echo wpsg_ff($oVoucher->value, $this->get_option('wpsg_currency'));
+ if ($oVoucher->calc_typ == 'w') echo wpsg_ff($oVoucher->getFreeAmount(), $this->get_option('wpsg_currency'));
else if ($oVoucher->calc_typ == 'p') echo wpsg_ff($oVoucher->value, '%');
+
+ if ($oVoucher->calc_typ == 'w' && $oVoucher->getUsedAmount() > 0) echo ' <span title="'.__('Original Betrag', 'wpsg').'">('.wpsg_ff($oVoucher->value, $this->get_option('wpsg_currency')).')</span>';
?></span><?php
diff --git a/views/mods/mod_gutschein/mail_order_end.phtml b/views/mods/mod_gutschein/mail_order_end.phtml
new file mode 100644
index 0000000..8289750
--- /dev/null
+++ b/views/mods/mod_gutschein/mail_order_end.phtml
@@ -0,0 +1,27 @@
+<?php
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 31.07.2019
+ * Time: 17:15
+ */
+
+ namespace wpsg;
+
+ $arCalculation = $this->view['basket']['arCalculation'];
+
+ if ($this->getFrontendTaxView() === WPSG_BRUTTO) $display_brutto_netto = 'brutto';
+ else $display_brutto_netto = 'netto';
+
+ echo "\r\n";
+
+ foreach ($arCalculation['coupon'] as $gs) {
+
+ echo ' '.wpsg_pad_right(__('Wertgutschein', 'wpsg').' '.((wpsg_isSizedString($gs['code']))?'('.$gs['code'].')':''), 37);
+ echo wpsg_pad_left(wpsg_ff($gs[$display_brutto_netto], $this->get_option('wpsg_currency')), 34)."\r\n";
+
+ }
+
+ echo ' '.wpsg_pad_right(__('Zu zahlen', 'wpsg'), 37);
+ echo wpsg_pad_left(wpsg_ff($arCalculation['topay_brutto'], $this->get_option('wpsg_currency')), 34)."\r\n";
+ \ No newline at end of file
diff --git a/views/mods/mod_gutschein/mail_order_end_html.phtml b/views/mods/mod_gutschein/mail_order_end_html.phtml
new file mode 100644
index 0000000..fc543aa
--- /dev/null
+++ b/views/mods/mod_gutschein/mail_order_end_html.phtml
@@ -0,0 +1,50 @@
+<?php
+
+ /**
+ * User: Daschmi (daschmi@daschmi.de)
+ * Date: 31.07.2019
+ * Time: 17:15
+ */
+
+ namespace wpsg;
+
+ $arCalculation = $this->view['basket']['arCalculation'];
+
+ if ($this->getFrontendTaxView() === WPSG_BRUTTO) $display_brutto_netto = 'brutto';
+ else $display_brutto_netto = 'netto';
+
+?>
+
+<?php foreach ($arCalculation['coupon'] as $gs) { ?>
+
+ <tr class="totalrow">
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name" colspan="3"><?php echo __('Wertgutschein', 'wpsg'); ?> <?php echo ((wpsg_isSizedString($gs['code']))?'('.$gs['code'].')':''); ?>:</td>
+ <?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_mwst"></td>
+ <?php } ?>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_amount">&nbsp;</td>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_sum"><?php
+
+ echo wpsg_ff($gs[$display_brutto_netto], $this->get_option('wpsg_currency'));
+
+ if (strpos($gs['set'], '%') !== false) {
+
+ echo '<span class="procent_payship">('.wpsg_ff(wpsg_tf($gs['set']), '%').')</span>';
+
+ }
+
+ ?></td>
+ </tr>
+
+<?php } ?>
+
+<tr class="totalrow">
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name" colspan="2"><?php echo __('Zu zahlen', 'wpsg'); ?>:</td>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_price">&nbsp;</td>
+ <?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_mwst"></td>
+ <?php } ?>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_amount">&nbsp;</td>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_sum"><strong><?php echo wpsg_ff($this->view['basket']['arCalculation']['topay_brutto'], $this->get_option('wpsg_currency')); ?></strong></td>
+</tr>
+ \ No newline at end of file
diff --git a/views/mods/mod_rechnungen/accounting_pdf.phtml b/views/mods/mod_rechnungen/accounting_pdf.phtml
index d7a3d81..f21d95e 100644
--- a/views/mods/mod_rechnungen/accounting_pdf.phtml
+++ b/views/mods/mod_rechnungen/accounting_pdf.phtml
@@ -29,6 +29,11 @@
// Anzahl an Produkten pro Seite
$prod_break = $this->get_option('wpsg_rechnungen_pdfperpage');
+ $arCalculation = $this->view['basket']['arCalculation'];
+
+ if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
+ else $taxdisplay = 'brutto';
+
// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
if ($this->get_option('wpsg_kleinunternehmer') == '1')
{
@@ -429,6 +434,7 @@
} // produkte
// Gutschein
+ /*
if ((isset($this->view['basket']['gs'])) && ($this->view['basket']['gs_value'] > 0))
{
@@ -452,23 +458,6 @@
$pdf->setXY($prod_left + 112, $prod_top + $offset);
$pdf->Cell(15, 8, '1', 1, 0, 'C');
- /*
- if ($this->view['basket']['gs']['calc'] == 'w')
- {
-
- $gs_value_einzel = '-'.wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency'));
- $gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency'));
-
- }
- else if ($this->view['basket']['gs']['calc'] == 'p')
- {
-
- $gs_value_einzel = '-'.wpsg_ff($this->view['basket']['gs']['value'], '%');
- $gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
-
- }
- */
-
$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
@@ -481,6 +470,45 @@
$offset += 8;
}
+ */
+ if (wpsg_isSizedArray($this->view['basket']['arCalculation']['voucher'])) {
+
+ foreach ($this->view['basket']['arCalculation']['voucher'] as $v) {
+
+ $pdf->SetFont('Arial', '', 9);
+ $pdf->setXY($prod_left, $prod_top + $offset);
+ $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
+
+ $pdf->setXY($prod_left + 10, $prod_top + $offset);
+ $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
+
+ if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ {
+
+ $mwst = __('anteilig', 'wpsg');
+
+ $pdf->setXY($prod_left + 97, $prod_top + $offset);
+ $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
+
+ }
+
+ $pdf->setXY($prod_left + 112, $prod_top + $offset);
+ $pdf->Cell(15, 8, '1', 1, 0, 'C');
+
+ $gs_value_einzel = wpsg_ff($v[$taxdisplay.'_single'], $this->get_option('wpsg_currency'));
+ $gs_value_gesamt = wpsg_ff($v[$taxdisplay], $this->get_option('wpsg_currency'));
+
+ $pdf->setXY($prod_left + 127, $prod_top + $offset);
+ $pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
+
+ $pdf->setXY($prod_left + 152, $prod_top + $offset);
+ $pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
+
+ $offset += 8;
+
+ }
+
+ }
// Versandkosten
if ($this->view['basket']['sum']['preis_shipping'] != '' && $this->view['basket']['sum']['preis_shipping'] != 0)
@@ -727,7 +755,7 @@
{
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("Summe", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$offset += 5;
@@ -740,12 +768,12 @@
{
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -755,7 +783,7 @@
$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -766,7 +794,7 @@
{
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -778,7 +806,7 @@
{
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] - $this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -794,23 +822,60 @@
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("Rabatt", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
}
-
- $offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
- $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
- /* Endbetrag wird fett ausgegeben */
- $pdf->setFont('Arial', 'B', '9');
- $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- $pdf->setFont('Arial', '', '9');
+ // Wertgutschein
+ if ($arCalculation['sum']['topay_brutto'] !== $arCalculation['sum']['brutto']) {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("Bruttobetrag", "wpsg"));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ $pdf->setFont('Arial', '', '9');
+ $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ foreach ($arCalculation['coupon'] as $c) {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __('Wertgutschein', 'wpsg').' '.((wpsg_isSizedString($c['code']))?'('.$c['code'].')':''));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ $pdf->setFont('Arial', '', '9');
+ $pdf->Cell(37, 8, wpsg_ff($c[$taxdisplay], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ }
+
+ $offset += 5;
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ /* Endbetrag wird fett ausgegeben */
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ } else {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
- /* Endbetrag wird normal ausgegeben */
- //$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ /* Endbetrag wird fett ausgegeben */
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ /* Endbetrag wird normal ausgegeben */
+ //$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+
+ }
if ($this->get_option('wpsg_kleinunternehmer') == '1')
{
diff --git a/views/mods/mod_rechnungen/invoice_pdf.phtml b/views/mods/mod_rechnungen/invoice_pdf.phtml
index 7d9c543..9b4fb37 100644
--- a/views/mods/mod_rechnungen/invoice_pdf.phtml
+++ b/views/mods/mod_rechnungen/invoice_pdf.phtml
@@ -30,6 +30,11 @@
// Anzahl an Produkten pro Seite
$prod_break = $this->get_option('wpsg_rechnungen_pdfperpage');
+ $arCalculation = $this->view['basket']['arCalculation'];
+
+ if ($this->getFrontendTaxView() === WPSG_NETTO) $taxdisplay = 'netto';
+ else $taxdisplay = 'brutto';
+
// Damit die Steuer bei der Kleinunternehmerregelung nicht angezeigt wird leer ich den Array sicherheitshalber
if ($this->get_option('wpsg_kleinunternehmer') == '1')
{
@@ -443,6 +448,7 @@
} // produkte
// Gutschein
+ /*
if ((isset($this->view['basket']['gs'])) && abs($this->view['basket']['gs_value']) > 0)
{
@@ -465,24 +471,7 @@
$pdf->setXY($prod_left + 112, $prod_top + $offset);
$pdf->Cell(15, 8, '1', 1, 0, 'C');
-
- /*
- if ($this->view['basket']['gs']['calc'] == 'w')
- {
-
- $gs_value_einzel = '-'.wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency'));
- $gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['gs']['value'], $this->get_option('wpsg_currency'));
-
- }
- else if ($this->view['basket']['gs']['calc'] == 'p')
- {
-
- $gs_value_einzel = '-'.wpsg_ff($this->view['basket']['gs']['value'], '%');
- $gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
-
- }
- */
-
+
$gs_value_einzel = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
$gs_value_gesamt = '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency'));
@@ -495,7 +484,46 @@
$offset += 8;
}
-
+ */
+ if (wpsg_isSizedArray($this->view['basket']['arCalculation']['voucher'])) {
+
+ foreach ($this->view['basket']['arCalculation']['voucher'] as $v) {
+
+ $pdf->SetFont('Arial', '', 9);
+ $pdf->setXY($prod_left, $prod_top + $offset);
+ $pdf->Cell(10, 8, $pnr.'.', 1, 0, 'C'); $pnr ++;
+
+ $pdf->setXY($prod_left + 10, $prod_top + $offset);
+ $pdf->Cell( ((sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')?87:102), 8, wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $v['code']), 1, 0, 'L');
+
+ if (sizeof($this->view['basket']['mwst']) >= 1 || $this->get_option('wpsg_showMwstAlways') == '1')
+ {
+
+ $mwst = __('anteilig', 'wpsg');
+
+ $pdf->setXY($prod_left + 97, $prod_top + $offset);
+ $pdf->Cell(15, 8, $mwst, 1, 0, 'C');
+
+ }
+
+ $pdf->setXY($prod_left + 112, $prod_top + $offset);
+ $pdf->Cell(15, 8, '1', 1, 0, 'C');
+
+ $gs_value_einzel = wpsg_ff($v[$taxdisplay.'_single'], $this->get_option('wpsg_currency'));
+ $gs_value_gesamt = wpsg_ff($v[$taxdisplay], $this->get_option('wpsg_currency'));
+
+ $pdf->setXY($prod_left + 127, $prod_top + $offset);
+ $pdf->Cell(25, 8, $gs_value_einzel, 1, 0, 'R');
+
+ $pdf->setXY($prod_left + 152, $prod_top + $offset);
+ $pdf->Cell(25, 8, $gs_value_gesamt, 1, 0, 'R');
+
+ $offset += 8;
+
+ }
+
+ }
+
// Versandkosten
if ($this->view['basket']['sum']['preis_shipping'] != '' && $this->view['basket']['sum']['preis_shipping'] != 0)
{
@@ -741,7 +769,7 @@
{
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("Summe", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("Summe", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$offset += 5;
@@ -754,12 +782,12 @@
{
$pdf->Text($prod_left, $prod_top + $offset, __("Es ergibt sich folgender Gesamtbetrag", "wpsg").':');
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("BRUTTOBETRAG", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff(0, $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -769,7 +797,7 @@
$pdf->Text($prod_left, $prod_top + $offset, __("Der Gesamtbetrag setzt sich wie folgt zusammen", "wpsg"));
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("NETTOBETRAG", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_netto'] + $this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -780,7 +808,7 @@
{
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. ", "wpsg").wpsg_ff($mw['value'], '%'));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($mw['sum'], $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -792,7 +820,7 @@
{
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("MwSt. GESAMT", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'] - $this->view['basket']['sum']['preis_gesamt_netto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
@@ -808,23 +836,57 @@
$offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("Rabatt", "wpsg"));
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("Rabatt", "wpsg"));
$pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
$pdf->Cell(37, 8, '-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 0, 0, 'R');
}
+
+ // Wertgutschein
+ if ($arCalculation['sum']['topay_brutto'] !== $arCalculation['sum']['brutto']) {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("Bruttobetrag", "wpsg"));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ $pdf->setFont('Arial', '', '9');
+ $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ foreach ($arCalculation['coupon'] as $c) {
+
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __('Wertgutschein', 'wpsg').' '.((wpsg_isSizedString($c['code']))?'('.$c['code'].')':''));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ $pdf->setFont('Arial', '', '9');
+ $pdf->Cell(37, 8, wpsg_ff($c[$taxdisplay], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ }
+
+ $offset += 5;
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("ZU ZAHLEN", "wpsg"));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ /* Endbetrag wird fett ausgegeben */
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Cell(37, 8, wpsg_ff($arCalculation['sum']['topay_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ } else {
- $offset += 5;
- $pdf->Text($prod_left + 100, $prod_top + $offset, __("SUMME", "wpsg"));
- $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
-
- /* Endbetrag wird fett ausgegeben */
- $pdf->setFont('Arial', 'B', '9');
- $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
- $pdf->setFont('Arial', '', '9');
-
- /* Endbetrag wird normal ausgegeben */
- //$pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $offset += 5;
+ $pdf->Text($prod_left + 80, $prod_top + $offset, __("SUMME", "wpsg"));
+ $pdf->setXY($prod_left + 140, $prod_top + $offset - 5);
+
+ /* Endbetrag wird fett ausgegeben */
+ $pdf->setFont('Arial', 'B', '9');
+ $pdf->Cell(37, 8, wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 0, 0, 'R');
+ $pdf->setFont('Arial', '', '9');
+
+ }
if ($this->get_option('wpsg_kleinunternehmer') == '1')
{