summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/mailtemplates/html/customer.phtml2
-rw-r--r--views/mailtemplates/html/order.phtml32
-rw-r--r--views/mailtemplates/kundenmail.phtml2
-rw-r--r--views/mailtemplates/order.phtml41
-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
-rw-r--r--views/order/backendEdit/addVoucher.phtml16
-rw-r--r--views/order/product_table.phtml2
-rw-r--r--views/order/view.phtml2
-rw-r--r--views/warenkorb/basket.phtml2
15 files changed, 359 insertions, 106 deletions
diff --git a/views/mailtemplates/html/customer.phtml b/views/mailtemplates/html/customer.phtml
index 60d1b2b..9832fba 100644
--- a/views/mailtemplates/html/customer.phtml
+++ b/views/mailtemplates/html/customer.phtml
@@ -131,7 +131,7 @@
</tr>
<tr>
<td style="padding:2px; line-height:100%; vertical-align:middle;" class="col0"><?php echo __('Rechnungsbetrag', 'wpsg'); ?>:</td>
- <td style="padding:2px; line-height:100%; vertical-align:middle;" class="col1"><strong><?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?></strong></td>
+ <td style="padding:2px; line-height:100%; vertical-align:middle;" class="col1"><strong><?php echo wpsg_ff($this->view['basket']['arCalculation']['topay_brutto'], $this->get_option('wpsg_currency')); ?></strong></td>
</tr>
<?php if ($this->get_option('wpsg_kleinunternehmer') != '1') { ?>
<tr>
diff --git a/views/mailtemplates/html/order.phtml b/views/mailtemplates/html/order.phtml
index 0b5bfbd..efc3e19 100644
--- a/views/mailtemplates/html/order.phtml
+++ b/views/mailtemplates/html/order.phtml
@@ -1,4 +1,9 @@
-<div class="baskettable_wrap">
+<?php
+
+ if ($this->getFrontendTaxView() === WPSG_BRUTTO) $display_brutto_netto = 'brutto';
+ else $display_brutto_netto = 'netto';
+
+?><div class="baskettable_wrap">
<table class="baskettable" cellpadding="2" cellspacing="0" style="cell-padding:4px;">
<tr class="head">
<th valign="middle" style="cell-padding:4px; padding:4px; line-height:100%; vertical-align:middle;" class="col_pos"><?php echo __('Pos', 'wpsg'); ?></th>
@@ -69,18 +74,20 @@
</tr>
<?php } ?>
<?php } ?>
- <?php if (isset($this->view['basket']['gs'])) { ?>
- <tr class="voucherrow">
- <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_pos"><?php echo $i + 1; ?>.</td>
- <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name"><?php echo wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $this->view['basket']['gs']['code']); ?></td>
- <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_price"><?php echo wpsg_ff($this->view['basket']['gs']['value'], (($this->view['basket']['gs']['calc'] == 'w')?$this->get_option('wpsg_currency'):'%')); ?></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"><?php echo __('anteilig', 'wpsg'); ?></td>
+ <?php if (wpsg_isSizedArray($this->view['basket']['arCalculation']['voucher'])) { $bLine = true; ?>
+ <?php foreach ($this->view['basket']['arCalculation']['voucher'] as $gs) { ?>
+ <tr class="voucherrow">
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_pos"> <?php print_r($gs); ?></td>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_name"><?php echo wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $gs['code']); ?></td>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_price"><?php echo wpsg_ff($gs['set'], ((strpos($gs['set'], '%') !== false)?'%':$this->get_option('wpsg_currency'))); ?></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"><?php echo __('Anteilig', 'wpsg'); ?></td>
+ <?php } ?>
+ <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_amount">1</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')); ?></td>
+ </tr>
<?php } ?>
- <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_amount">1</td>
- <td style="padding:4px; line-height:100%; vertical-align:middle;" class="col_sum"><?php echo '-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency')); ?></td>
- </tr>
- <?php } ?>
+ <?php } ?>
<tr class="spacer">
<td style="padding:4px; line-height:100%; vertical-align:middle;" class="td_bt" colspan="<?php echo ((sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'6':'5'); ?>">&nbsp;</td>
</tr>
@@ -188,6 +195,7 @@
<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']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?></strong></td>
</tr>
+ <?php $this->callMods('mail_order_end', [$this->view['basket']['arCalculation'], true]); ?>
</table>
</div>
diff --git a/views/mailtemplates/kundenmail.phtml b/views/mailtemplates/kundenmail.phtml
index f219fae..dababfc 100644
--- a/views/mailtemplates/kundenmail.phtml
+++ b/views/mailtemplates/kundenmail.phtml
@@ -63,7 +63,7 @@
<?php echo wpsg_pad_right(__('Kundennummer', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['knr']; ?>
<?php echo wpsg_pad_right(__('Bestellnummer', 'wpsg').':', 35); ?><?php echo $this->view['basket']['checkout']['onr']; ?>
<?php echo wpsg_pad_right(__('Bestelldatum', 'wpsg').':', 35); ?><?php echo date("d.m.Y H:i:s", $this->view['basket']['checkout']['datum']); ?>
-<?php echo wpsg_pad_right(__('Rechnungsbetrag', 'wpsg').':', 35); ?><?php echo wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')); ?>
+<?php echo wpsg_pad_right(__('Rechnungsbetrag', 'wpsg').':', 35); ?><?php echo wpsg_ff($this->view['basket']['arCalculation']['topay_brutto'], $this->get_option('wpsg_currency')); ?>
<?php if ($this->get_option('wpsg_kleinunternehmer')) { ?>
<?php echo $this->get_option('wpsg_kleinunternehmer_text'); ?>
diff --git a/views/mailtemplates/order.phtml b/views/mailtemplates/order.phtml
index a174502..68ace58 100644
--- a/views/mailtemplates/order.phtml
+++ b/views/mailtemplates/order.phtml
@@ -1,4 +1,9 @@
-<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { $prod_col = 25; } else { $prod_col = 35; } ?>
+<?php
+
+ if ($this->getFrontendTaxView() === WPSG_BRUTTO) $display_brutto_netto = 'brutto';
+ else $display_brutto_netto = 'netto';
+
+?><?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { $prod_col = 25; } else { $prod_col = 35; } ?>
<?php echo wpsg_pad_right(__('Pos', 'wpsg'), 5); ?>
<?php echo wpsg_pad_right(__('Produkt', 'wpsg'), $prod_col); ?>
@@ -29,16 +34,27 @@
<?php } ?>
<?php } ?>
-<?php if (isset($this->view['basket']['gs'])) { ?>
-<?php echo wpsg_pad_right(($i + 1).'.', 5); ?>
-<?php echo wpsg_pad_right(wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $this->view['basket']['gs']['code']), $prod_col); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['gs']['value'], (($this->view['basket']['gs']['calc'] == 'w')?$this->get_option('wpsg_currency'):'%')).' ', 15); ?>
-<?php if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
-<?php echo wpsg_pad_left(__('anteilig', 'wpsg').' ', 10); ?>
-<?php } ?>
-<?php echo wpsg_pad_left('1', 6); ?>
-<?php echo wpsg_pad_left('-'.wpsg_ff($this->view['basket']['sum']['gs'], $this->get_option('wpsg_currency')), 15); ?>
-<?php } ?>
+<?php if (wpsg_isSizedArray($this->view['basket']['arCalculation']['voucher'])) {
+
+ foreach ($this->view['basket']['arCalculation']['voucher'] as $gs) {
+
+ echo wpsg_pad_right(' ', 5);
+ echo wpsg_pad_right(wpsg_translate(__('Gutschein (#1#)', 'wpsg'), $gs['code']), $prod_col);
+ echo wpsg_pad_left(wpsg_ff($gs['set'], ((strpos($gs['set'], '%') !== false)?'%':$this->get_option('wpsg_currency'))).' ', 15);
+
+ if (sizeof($this->view['basket']['mwst']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') {
+
+ echo wpsg_pad_left(__('anteilig', 'wpsg').' ', 10);
+
+ }
+
+ echo wpsg_pad_left('1', 6);
+ echo wpsg_pad_left(wpsg_ff($gs[$display_brutto_netto], $this->get_option('wpsg_currency')), 15);
+ echo "\r\n";
+
+ }
+
+} ?>
<?php if (isset($this->view['basket']['sum']['preis_rabatt']) && $this->view['basket']['sum']['preis_rabatt'] > 0) { ?>
<?php echo wpsg_pad_right(__('Abzüglich Rabatt', 'wpsg'), 40); ?>
<?php echo wpsg_pad_left('-'.wpsg_ff($this->view['basket']['sum']['preis_rabatt'], $this->get_option('wpsg_currency')), 31); ?>
@@ -102,6 +118,7 @@
<?php echo wpsg_pad_left(' ', 61); ?>---------------
<?php echo wpsg_pad_right(__('Gesamtpreis:', 'wpsg'), 37); ?>
-<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 34); ?>
+<?php echo wpsg_pad_left(wpsg_ff($this->view['basket']['sum']['preis_gesamt_brutto'], $this->get_option('wpsg_currency')), 34); ?>
+<?php $this->callMods('mail_order_end', [$this->view['basket']['arCalculation'], false]); ?>
<?php $this->callMods('mail_aftercalculation', array(&$this->view['basket']['checkout']['o_id'])); ?> \ No newline at end of file
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')
{
diff --git a/views/order/backendEdit/addVoucher.phtml b/views/order/backendEdit/addVoucher.phtml
index 88d8e2b..497b4c4 100644
--- a/views/order/backendEdit/addVoucher.phtml
+++ b/views/order/backendEdit/addVoucher.phtml
@@ -19,24 +19,31 @@
'code' => '',
'id' => 0,
'set' => 0,
- 'type' => 'voucher'
+ 'type' => 'voucher',
];
+ //wpsg_debug(array_merge($arCalculation['voucher'], $arCalculation['coupon']));
+ //wpsg_Debug($_REQUEST);
+
// Voucher suchen
foreach (array_merge($arCalculation['voucher'], $arCalculation['coupon']) as $v) {
if ($v['order_voucher_id'] == $_REQUEST['order_voucher_id']) {
+
+ $order_voucher_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_ORDER_VOUCHER."` WHERE `id` = '".wpsg_q($_REQUEST['order_voucher_id'])."' ");
$voucher = $v;
+ //if ($order_voucher_db['coupon'] === '1') $voucher['type'] = 'coupon';
+
}
}
$strVal = ((isset($voucher['set']))?$voucher['set']:0);
- if (strpos($strVal, '%') !== false) $strVal = wpsg_ff(wpsg_tf($strVal), '%');
- else $strVal = wpsg_ff(wpsg_tf($strVal), $this->get_option('wpsg_currency'));
+ if (strpos($strVal, '%') !== false) $strVal = wpsg_ff(abs(wpsg_tf($strVal)), '%');
+ else $strVal = wpsg_ff(abs(wpsg_tf($strVal)), $this->get_option('wpsg_currency'));
?>
@@ -74,6 +81,9 @@
jQuery('#be_voucher_id').val(ui.item.id);
jQuery('#be_voucher_amount').val(ui.item.gs_value);
+ if (ui.item.coupon === '1') jQuery('#be_voucher_coupon').prop('checked', true);
+ else jQuery('#be_voucher_coupon').prop('checked', false);
+
jQuery('#be_voucher_search').val('');
return false;
diff --git a/views/order/product_table.phtml b/views/order/product_table.phtml
index 244ee56..0eb1666 100644
--- a/views/order/product_table.phtml
+++ b/views/order/product_table.phtml
@@ -387,5 +387,5 @@
</tbody>
</table>
-<?php //wpsg_debug($arCalculation); ?>
+<?php // wpsg_debug($arCalculation); ?>
\ No newline at end of file
diff --git a/views/order/view.phtml b/views/order/view.phtml
index e275f50..fd0670c 100644
--- a/views/order/view.phtml
+++ b/views/order/view.phtml
@@ -69,7 +69,7 @@
<?php if ($this->hasMod('wpsg_mod_gutschein')) { ?>
- <a href="" id="LinkGutscheinNeu" onclick="return WPSG_BE_Voucher.editVoucher(<?php echo $_REQUEST['edit_id']; ?>);"><span class="glyphicon glyphicon-plus"></span>
+ <a href="" id="LinkGutscheinNeu" onclick="return WPSG_BE_Voucher.editVoucher(-1);"><span class="glyphicon glyphicon-plus"></span>
<?php echo __("Gutschein bearbeiten", "wpsg"); ?>
diff --git a/views/warenkorb/basket.phtml b/views/warenkorb/basket.phtml
index 632c662..0c4c169 100644
--- a/views/warenkorb/basket.phtml
+++ b/views/warenkorb/basket.phtml
@@ -10,7 +10,7 @@
//wpsg_debug($this->arShipping);
//wpsg_debug(__('Deutschland', 'wpsg'));
-
+
if ($this->getFrontendTaxView() === WPSG_BRUTTO) $display_brutto_netto = 'brutto';
else $display_brutto_netto = 'netto';