2975 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die Produktauswahl innerhalb der Bestellansicht
|
|
|
5 |
*/
|
|
|
6 |
|
8007 |
daniel |
7 |
$storno_amount = $this->view['wpsg_mod_rechnungen']['storno_amount'];
|
|
|
8 |
$invoice_amount = $this->view['wpsg_mod_rechnungen']['invoice_amount'];
|
|
|
9 |
|
|
|
10 |
/** @var wpsg_order_product $oOrderProduct */
|
|
|
11 |
$oOrderProduct = $this->view['wpsg_mod_rechnungen']['oOrderProduct'];
|
|
|
12 |
|
|
|
13 |
$p = $this->view['wpsg_mod_rechnungen']['product'];
|
|
|
14 |
$product_index = $this->view['wpsg_mod_rechnungen']['product']['product_index'];
|
8010 |
daniel |
15 |
|
|
|
16 |
/** @var \wpsg\wpsg_invoice[] $arInvoice */
|
|
|
17 |
$arInvoice = $this->callMod('wpsg_mod_rechnungen', 'getInvoiceToOrderProduct', [$oOrderProduct]);
|
|
|
18 |
$arInvoiceInvoice = [];
|
|
|
19 |
$arInvoiceStorno = [];
|
|
|
20 |
|
|
|
21 |
foreach ($arInvoice as $oInvoice) {
|
|
|
22 |
|
|
|
23 |
if ($oInvoice->isStorno()) $arInvoiceStorno[] = $oInvoice;
|
|
|
24 |
else if ($oInvoice->isInvoice()) $arInvoiceInvoice[] = $oInvoice;
|
|
|
25 |
|
|
|
26 |
}
|
|
|
27 |
|
2975 |
daniel |
28 |
?>
|
8007 |
daniel |
29 |
<tr class="wpsg_<?php echo (($this->view['wpsg_mod_rechnungen']['i'] == 0)?'odd':'even'); ?>">
|
|
|
30 |
<td colspan="<?php echo ((sizeof($this->view['arCalculation']['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'5':'4'); ?>">
|
8010 |
daniel |
31 |
|
|
|
32 |
<!-- Rechnungen -->
|
|
|
33 |
<label class="bg_invoice wpsg_mod_rechnungen_row" style="font-weight:normal;">
|
|
|
34 |
|
8007 |
daniel |
35 |
<?php if ($invoice_amount > 0) { ?>
|
8010 |
daniel |
36 |
<div style="display:flex; flex-direction:row; gap:0.5rem; font-weight:normal; align-items:center;">
|
|
|
37 |
<span><?php echo __('Menge'); ?></span>
|
8007 |
daniel |
38 |
|
8057 |
daniel |
39 |
<input form="invoice_form" type="hidden" name="invoice_products[<?php echo $p['order_product_id']; ?>][set]" value="0" class="" />
|
8063 |
daniel |
40 |
<input checked="checked" form="invoice_form" type="checkbox" class="wpsg_mod_deliverynote_product wpsg_check_amount_invoice" name="invoice_products[<?php echo $p['order_product_id']; ?>][set]" value="1" style="margin:0;" />
|
8007 |
daniel |
41 |
|
|
|
42 |
<input form="invoice_form" name="invoice_products[<?php echo $p['order_product_id']; ?>][amount]" type="number" max="<?php echo $invoice_amount; ?>" min="1" value="<?php echo min($invoice_amount, $p['amount']); ?>" style="padding:0; font-size:14px; line-height:22px; min-height:initial; height:22px; width:50px; text-indent:5px; border:1px solid black; margin:0;" />
|
|
|
43 |
|
8010 |
daniel |
44 |
<span> <?php echo __('auf Rechnung', 'wpsg'); ?></span>
|
|
|
45 |
</div>
|
8007 |
daniel |
46 |
<?php } ?>
|
8010 |
daniel |
47 |
|
|
|
48 |
<?php if (sizeof($arInvoiceInvoice) > 0) { ?>
|
|
|
49 |
<div class="invoice_wrap">
|
|
|
50 |
<span><?php echo __('Rechnungen', 'wpsg'); ?>:</span>
|
|
|
51 |
<?php foreach ($arInvoiceInvoice as $oInvoice) { ?>
|
|
|
52 |
<?php echo $oInvoice->getNr(true, $oOrderProduct); ?>
|
|
|
53 |
<?php } ?>
|
|
|
54 |
</div>
|
|
|
55 |
<?php } ?>
|
8007 |
daniel |
56 |
|
8010 |
daniel |
57 |
</label>
|
|
|
58 |
|
|
|
59 |
<!-- Gutschriften -->
|
|
|
60 |
<label class="bg_storno wpsg_mod_rechnungen_row" style="font-weight:normal;">
|
|
|
61 |
|
8007 |
daniel |
62 |
<?php if ($storno_amount > 0) { ?>
|
8010 |
daniel |
63 |
<div style="display:flex; flex-direction:row; gap:0.5rem; font-weight:normal; align-items:center;">
|
|
|
64 |
<span><?php echo __('Menge'); ?></span>
|
8007 |
daniel |
65 |
|
8057 |
daniel |
66 |
<input form="storno_form" type="hidden" name="storno_products[<?php echo $p['order_product_id']; ?>][set]" value="0" class="" />
|
8063 |
daniel |
67 |
<input form="storno_form" type="checkbox" class="wpsg_mod_deliverynote_product wpsg_check_amount_storno" name="storno_products[<?php echo $p['order_product_id']; ?>][set]" value="1" style="margin:0;" />
|
8007 |
daniel |
68 |
|
8010 |
daniel |
69 |
<input form="storno_form" oninput="event.target.previousElementSibling.checked = true;" onchange="event.target.previousElementSibling.checked = true;" name="storno_products[<?php echo $p['order_product_id']; ?>][amount]" type="number" max="<?php echo $storno_amount; ?>" min="1" value="<?php echo min($storno_amount, $p['amount']); ?>" style="padding:0; font-size:14px; line-height:22px; min-height:initial; height:22px; width:50px; text-indent:5px; border:1px solid black; margin:0;" />
|
8007 |
daniel |
70 |
|
|
|
71 |
<span> <?php echo __('Stück auf Gutschrift', 'wpsg'); ?></span>
|
8010 |
daniel |
72 |
</div>
|
|
|
73 |
<?php } ?>
|
8007 |
daniel |
74 |
|
8010 |
daniel |
75 |
<?php if (sizeof($arInvoiceStorno) > 0) { ?>
|
|
|
76 |
<div class="invoice_wrap">
|
|
|
77 |
<span><?php echo __('Rechnungskorrekturen', 'wpsg'); ?>:</span>
|
|
|
78 |
<?php foreach ($arInvoiceStorno as $oInvoice) { ?>
|
|
|
79 |
<?php echo $oInvoice->getNr(true, $oOrderProduct); ?>
|
|
|
80 |
<?php } ?>
|
|
|
81 |
</div>
|
8007 |
daniel |
82 |
<?php } ?>
|
|
|
83 |
|
8010 |
daniel |
84 |
</label>
|
|
|
85 |
|
2975 |
daniel |
86 |
</td>
|
|
|
87 |
</tr>
|