Subversion Repositories wpShopGermany4

Rev

Rev 7220 | Rev 7250 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7173 daniel 1
<?php
7179 daniel 2
 
7173 daniel 3
    /**
4
     * Template für die Produkttabelle im Backend der Bestellverwaltung
5
     */
7210 daniel 6
 
7197 daniel 7
    $arCalculation = $this->view['oCalculation']->getCalculationArray(true);
8
	$arTax = $this->view['oCalculation']->getTaxLabelArray();
9
	$arTaxShort = $this->view['oCalculation']->getTaxLabelArray(true);
10
 
7173 daniel 11
    $this->view['colspan'] = 3;
12
    if ($this->get_option('wpsg_showMwstAlways') == '1' || sizeof($arCalculation['tax']) > 1) $this->view['colspan'] ++;
13
 
14
    $this->view['arCalculation'] = $arCalculation;
7243 daniel 15
 
7197 daniel 16
    if ($this->getBackendTaxView() === WPSG_NETTO) $display = 'netto';
17
    else $display = 'brutto';
7210 daniel 18
 
7173 daniel 19
?>
20
 
21
<style>
22
 
7197 daniel 23
	.wpsg_row_small td { font-size:0.8em; }
7179 daniel 24
	#wpsg-bs .wpsg_row_small  .wpsg-glyphlink-td > span { margin-top:0px; }
7210 daniel 25
	/*.wpsg_productrow_add td { border-top:0px !important; }*/
7197 daniel 26
 
7173 daniel 27
</style>
28
 
7210 daniel 29
<?php echo wpsg_drawForm_Select('tax_mode', __('Besteuerung'), [
30
		\wpsg\wpsg_calculation::TAXMODE_SMALLBUSINESS => __('Kleinunternehmerregelung'),
31
		\wpsg\wpsg_calculation::TAXMODE_B2C => __('Endkundenbesteuerung'),
7243 daniel 32
		\wpsg\wpsg_calculation::TAXMODE_B2B => __('Firmenkundenbesteuerung (USTIdNr)')
7220 daniel 33
	], $this->view['oCalculation']->getTaxMode(), ['onchange' => 'WPSG_BE.updateCalculation();', 'help' => 'tax_mode']); ?>
7197 daniel 34
 
7210 daniel 35
<br />
36
 
7173 daniel 37
<table class="wpsg_produkte table">
7197 daniel 38
	<thead>
39
		<tr class="wpsg_kopf">
40
			<th class="wpsg_cell_name"><?php echo __('Produktname', 'wpsg'); ?></th>
41
			<th class="wpsg_cell_preis"><?php echo __('Einzelpreis', 'wpsg'); ?></th>
42
			<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
43
				<th class="wpsg_cell_mwst"><?php echo __("MwSt.", "wpsg"); ?></th>
44
			<?php } ?>
45
			<th class="wpsg_cell_menge"><?php echo __("Anzahl", "wpsg"); ?></th>
46
			<th class="wpsg_cell_gesamtpreis"><?php echo __("Gesamtpreis", "wpsg"); ?></th>
47
		</tr>
48
	</thead>
49
	<tbody>
7173 daniel 50
 
7197 daniel 51
		<tr><td colspan="<?php echo $this->view['colspan'] + 1; ?>" style="line-height:2px; height:2px; background-color:#999999; padding:0px;"></td></tr>
52
		<?php $i = 0; foreach ($arCalculation['product'] as $p) { $i ++; $product_price = $p[$display]; ?>
53
			<tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?>">
7210 daniel 54
				<td colspan="<?php echo $this->view['colspan'] + 1; ?>">
55
 
56
					<?php if (wpsg_isTrue($p['eu'])) { ?>
57
						<img src="<?php echo WPSG_URL; ?>views/gfx/eu.png" alt="<?php echo __('Produkt unterliegt der EU-Leistungsortregel', 'wpsg'); ?>" title="<?php echo __('Produkt unterliegt der EU-Leistungsortregel', 'wpsg'); ?>" height="14" />
58
					<?php } ?>
59
 
7197 daniel 60
					<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id=<?php echo $p['product_id']; ?>" title="<?php echo __('Zum Produkt', 'wpsg'); ?>">
61
						<?php echo wpsg_hspc($this->getProductName($p['product_id'])); ?>
62
					</a>
63
					<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Produkt bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Product.editProduct(<?php echo $p['order_product_id']; ?>);"><span class="glyphicon glyphicon-pencil"></span></a>
7210 daniel 64
					<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Produkt löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Product.removeProduct(<?php echo $p['order_product_id']; ?>);"><span class="glyphicon glyphicon-trash"></span></a>
7197 daniel 65
				</td>
7210 daniel 66
			</tr>
67
			<tr class="wpsg_<?php echo (($i % 2 == 0)?'odd':'even'); ?> wpsg_productrow_add">
68
				<td class="wpsg_cell_name"></td>
7197 daniel 69
				<td class="wpsg_cell_preis"><?php echo wpsg_ff($product_price); ?> <?php echo $this->get_option('wpsg_currency'); ?></td>
7243 daniel 70
				<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
71
					<td class="wpsg_cell_mwst"><?php
72
 
73
						echo (($p['brutto'] === $p['netto'])?wpsg_ff(0, '%'):$arTaxShort[$p['tax_key']]);
74
 
75
					?></td>
7197 daniel 76
				<?php } ?>
77
				<td class="wpsg_cell_menge"><?php echo wpsg_hspc($p['amount']); ?></td>
78
				<td class="wpsg_cell_gesamtpreis"><?php echo wpsg_ff($p['amount'] * $product_price); ?> <?php echo $this->get_option('wpsg_currency'); ?></td>
79
			</tr>
80
			<?php $this->callMods('order_view_row', array(&$p, $i)); ?>
81
			<tr><td colspan="<?php echo $this->view['colspan'] + 1; ?>" style="line-height:2px; height:2px; background-color:#999999; padding:0px;"></td></tr>
82
		<?php } ?>
83
 
84
		<?php // Gutscheine  ?>
85
		<?php if (wpsg_isSizedArray($arCalculation['voucher'])) { ?>
86
 
87
			<?php foreach ($arCalculation['voucher'] as $v) { ?>
7179 daniel 88
 
7197 daniel 89
				<tr class="wpsg_row_discount wpsg_row_small">
90
					<td colspan="" class="wpsg_cell_mwst_label">
91
 
92
						<div>
93
							<?php echo __('Gutschein', 'wpsg'); ?>
94
 
95
							<?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
96
								<?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
97
							<?php } else { ?>
98
								<?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
99
							<?php } ?>
100
 
101
							<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.editVoucher();"><span class="glyphicon glyphicon-pencil"></span></a>
102
							<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Gutschein löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Voucher.removeVoucher();"><span class="glyphicon glyphicon-trash"></span></a>
103
						</div>
104
						<div>
105
							Code: <?php echo $v['code']; ?>
106
						</div>
107
 
108
					</td>
109
					<td class="wpsg_cell_preis">
110
 
111
						<?php if (strpos($v['set'], '%') === false) { ?>
112
							<?php echo wpsg_ff($arCalculation['sum']['voucher_'.$display], $this->get_option('wpsg_currency')); ?>
113
						<?php } else { ?>
114
							<?php echo wpsg_ff($v['set'], '%'); ?>
115
						<?php } ?>
116
 
117
					</td>
118
					<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
119
						<td class="wpsg_cell_mwst"><?php echo $arTaxShort[$v['tax_key']]; ?></td>
120
					<?php } ?>
121
					<td>1</td>
122
					<td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis">
123
						<?php echo wpsg_ff($arCalculation['sum']['voucher_'.$display]); ?> <?php echo $this->get_option('wpsg_currency'); ?>
124
					</td>
125
				</tr>
126
 
127
			<?php } ?>
128
			<tr><td colspan="<?php echo $this->view['colspan'] + 1; ?>" style="line-height:2px; height:2px; background-color:#999999; padding:0px;"></td></tr>
129
 
130
		<?php } ?>
131
 
132
		<tr class="wpsg_row_summe">
133
			<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_summe_label">
134
 
135
				<?php if ($this->get_option('wpsg_kleinunternehmer') == '1') { ?>
7179 daniel 136
 
7197 daniel 137
					<?php echo wpsg_translate(__('Summe (zzgl. #1#)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').'</a>'); ?>
138
 
139
				<?php } else { ?>
140
 
141
					<?php if ($this->get_option('wpsg_preisangaben') == WPSG_NETTO) { ?>
142
						<?php echo wpsg_translate(__('Summe (zzgl. #1#, zzgl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').'</a>'); ?>
143
					<?php } else { ?>
144
						<?php echo wpsg_translate(__('Summe (zzgl. #1#, inkl. MwSt.)', 'wpsg'), '<a href="'.$this->getURL(wpsg_ShopController::URL_VERSANDKOSTEN).'" target="_blank">'.__('Versandkosten', 'wpsg').'</a>'); ?>
145
					<?php } ?>
146
 
147
				<?php } ?>
148
 
149
			</td>
150
			<td class="wpsg_cell_summe_value wpsg_cell_gesamtpreis">
151
 
152
				<?php echo wpsg_ff($arCalculation['sum']['productsum_'.$display]); ?> <?php echo $this->get_option('wpsg_currency'); ?>
153
 
154
			</td>
155
		</tr>
156
 
157
		<?php // Versandkosten  ?>
158
		<?php $price_shipping = $arCalculation['sum']['shipping_'.$display]; ?>
159
		<?php if ($price_shipping != 0 || $this->get_option('wpsg_hideemptyshipping') != '1') { ?>
160
			<tr class="wpsg_row_shipping">
161
				<td class="wpsg_cell_shipping_label" colspan="2">
162
					<?php echo __('Versandkosten', 'wpsg'); ?>
163
					<?php echo __('  ('.$this->arShipping[$arCalculation['shipping'][0]['shipping_key']]['name'].')', 'wpsg'); ?>
164
					<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Versandart ändern', 'wpsg'); ?>"  onclick="return WPSG_BE_Pay_Ship.changeShippingPayment();"><span class="glyphicon glyphicon-pencil"></span></a>
165
				</td>
166
				<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
167
				<td><?php echo $arTaxShort[$arCalculation['shipping'][0]['tax_key']]; ?></td>
168
				<?php } ?>
169
				<td class="wpsg_cell_shipping_value wpsg_cell_gesamtpreis" colspan="2">
170
					<span id="wpsg_cell_shipping_value"><?php echo wpsg_ff($price_shipping); ?> </span>
171
					<?php echo $this->get_option('wpsg_currency'); ?>
172
				</td>
173
			</tr>
174
		<?php } ?>
175
 
176
		<?php // Zahlungskosten  ?>
177
		<?php $price_payment = $arCalculation['sum']['payment_'.$display]; ?>
178
		<?php if ($price_payment != 0 || $this->get_option('wpsg_hideemptypayment') != '1') { ?>
179
			<tr class="wpsg_row_payment">
180
				<td colspan="2" class="wpsg_cell_payment_label">
181
					<?php echo __('Zahlungsart', 'wpsg'); ?>
182
					<?php echo __('  ('.$this->arPayment[$arCalculation['payment'][0]['payment_key']]['name'].')', 'wpsg'); ?>
183
					<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Zahlungsart ändern', 'wpsg'); ?>" onclick="return WPSG_BE_Pay_Ship.changeShippingPayment();"><span class="glyphicon glyphicon-pencil"></span></a>
184
				</td>
185
				<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
186
					<td><?php echo $arTaxShort[$arCalculation['payment'][0]['tax_key']]; ?></td>
187
				<?php } ?>
188
				<td class="wpsg_cell_payment_value wpsg_cell_gesamtpreis" colspan="2">
189
					<span id="wpsg_cell_payment_value"><?php echo wpsg_ff($price_payment); ?> </span>
190
					<?php echo $this->get_option('wpsg_currency'); ?>
191
				</td>
192
			</tr>
193
		<?php } ?>
194
 
195
		<?php // Rabatte  ?>
196
		<?php if (wpsg_isSizedArray($arCalculation['discount'])) { ?>
197
			<?php foreach ($arCalculation['discount'] as $d) { ?>
198
				<tr class="wpsg_row_discount wpsg_row_small">
199
					<td colspan="" class="wpsg_cell_mwst_label">
7179 daniel 200
 
7197 daniel 201
						<?php echo __('Rabatt', 'wpsg'); ?>
202
 
7179 daniel 203
						<?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
204
							<?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
205
						<?php } else { ?>
206
							<?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
207
						<?php } ?>
208
 
7197 daniel 209
						<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Rabatt bearbeiten', 'wpsg'); ?>" onclick="return WPSG_BE_Discount.editDiscount();"><span class="glyphicon glyphicon-pencil"></span></a>
210
						<a href="#" class="wpsg-glyphlink-td" title="<?php echo __('Rabatt löschen', 'wpsg'); ?>" onclick="return WPSG_BE_Discount.removeDiscount();"><span class="glyphicon glyphicon-trash"></span></a>
211
 
212
					</td>
213
					<td class="wpsg_cell_preis">
214
 
7198 daniel 215
						<?php if (strpos($d['set'], '%') === false) { ?>
216
							<?php echo wpsg_ff($arCalculation['sum']['discount_'.$display], $this->get_option('wpsg_currency')); ?>
7197 daniel 217
						<?php } else { ?>
7198 daniel 218
							<?php echo wpsg_ff($d['set'], '%'); ?>
7197 daniel 219
						<?php } ?>
220
 
221
					</td>
222
					<?php if (sizeof($arCalculation['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1') { ?>
223
						<td class="wpsg_cell_mwst"><?php echo $arTaxShort[$d['tax_key']]; ?></td>
224
					<?php } ?>
225
					<td></td>
226
					<td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis">
227
						<?php echo wpsg_ff($arCalculation['sum']['discount_'.$display]); ?> <?php echo $this->get_option('wpsg_currency'); ?>
228
					</td>
229
				</tr>
230
			<?php } ?>
231
		<?php } ?>
232
 
233
		<?php if ($this->getBackendTaxView() === WPSG_NETTO) { ?>
234
 
235
			<tr class="wpsg_row_gesamt">
236
				<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_summe_label">
237
					<?php echo __('Summe', 'wpsg'); ?>
238
					<?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
7179 daniel 239
				</td>
7197 daniel 240
				<td class="wpsg_cell_gesamt_value wpsg_cell_gesamtpreis">
241
					<?php echo wpsg_ff($arCalculation['sum'][$display]); ?> <?php echo $this->get_option('wpsg_currency'); ?>
7179 daniel 242
				</td>
7197 daniel 243
			</tr>
244
			<?php foreach ($arCalculation['tax'] as $tax) { if ($tax['sum'] > 0 && $tax['key'] != '0') { ?>
245
				<tr class="wpsg_row_mwst wpsg_row_small">
246
					<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_mwst_label">
247
						<?php echo wpsg_translate(__('zuzüglich MwSt. (#1#)', 'wpsg'), $arTax[$tax['key']]); ?>
248
					</td>
249
					<td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis">
250
						<?php echo wpsg_ff($tax['sum']); ?> <?php echo $this->get_option('wpsg_currency'); ?>
251
					</td>
252
				</tr>
253
			<?php } } ?>
254
			<tr class="wpsg_row_gesamt">
255
				<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_summe_label">
256
					<strong><?php echo __('Gesamtsumme', 'wpsg'); ?></strong>
257
					<?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
7179 daniel 258
				</td>
7197 daniel 259
				<td class="wpsg_cell_gesamt_value wpsg_cell_gesamtpreis">
260
					<strong><?php echo wpsg_ff($arCalculation['sum']['brutto']); ?> <?php echo $this->get_option('wpsg_currency'); ?></strong>
261
				</td>
7179 daniel 262
			</tr>
263
 
7197 daniel 264
		<?php } else { ?>
7173 daniel 265
 
7197 daniel 266
			<tr class="wpsg_row_gesamt">
267
				<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_summe_label">
268
					<strong><?php echo __('Gesamtsumme', 'wpsg'); ?></strong>
269
					<?php if ($this->getBackendTaxView() === WPSG_BRUTTO) { ?>
270
						<?php echo __('(inkl. MwSt.)', 'wpsg'); ?>
271
					<?php } else { ?>
272
						<?php echo __('(zzgl. MwSt.)', 'wpsg'); ?>
7179 daniel 273
					<?php } ?>
7197 daniel 274
				</td>
275
				<td class="wpsg_cell_gesamt_value wpsg_cell_gesamtpreis">
276
					<strong><?php echo wpsg_ff($arCalculation['sum']['brutto']); ?> <?php echo $this->get_option('wpsg_currency'); ?></strong>
277
				</td>
278
			</tr>
279
			<?php foreach ($arCalculation['tax'] as $tax) { if ($tax['sum'] > 0 && $tax['key'] != '0') { ?>
280
				<tr class="wpsg_row_mwst wpsg_row_small">
281
					<td colspan="<?php echo $this->view['colspan']; ?>" class="wpsg_cell_mwst_label">
282
						<?php if ($this->get_option('wpsg_kleinunternehmer') == '1') { ?>
283
							<?php echo $this->get_option('wpsg_kleinunternehmer_text'); ?>
284
						<?php } else { ?>
285
							<?php echo wpsg_translate(__('darin enthaltene MwSt. (#1#)', 'wpsg'), $arTax[$tax['key']]); ?>
286
						<?php } ?>
287
					</td>
288
					<td class="wpsg_cell_mwst_value wpsg_cell_gesamtpreis">
289
						<?php echo wpsg_ff($tax['sum']); ?> <?php echo $this->get_option('wpsg_currency'); ?>
290
					</td>
291
				</tr>
292
			<?php } } ?>
293
 
294
		<?php } ?>
295
 
296
	</tbody>
297
</table>
7216 daniel 298
 
299
<?php wpsg_debug($arCalculation);  ?>
7210 daniel 300