Subversion Repositories wpShopGermany4

Rev

Rev 8010 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php

        /**
         * Template für die Produktauswahl innerhalb der Bestellansicht
         */

    $storno_amount = $this->view['wpsg_mod_rechnungen']['storno_amount'];
    $invoice_amount = $this->view['wpsg_mod_rechnungen']['invoice_amount'];
  
    /** @var wpsg_order_product $oOrderProduct */
    $oOrderProduct = $this->view['wpsg_mod_rechnungen']['oOrderProduct'];
    
    $p = $this->view['wpsg_mod_rechnungen']['product'];
    $product_index = $this->view['wpsg_mod_rechnungen']['product']['product_index'];

        /** @var \wpsg\wpsg_invoice[] $arInvoice */
        $arInvoice = $this->callMod('wpsg_mod_rechnungen', 'getInvoiceToOrderProduct', [$oOrderProduct]);
    $arInvoiceInvoice = [];
    $arInvoiceStorno = [];
    
    foreach ($arInvoice as $oInvoice) { 
        
        if ($oInvoice->isStorno()) $arInvoiceStorno[] = $oInvoice;
        else if ($oInvoice->isInvoice()) $arInvoiceInvoice[] = $oInvoice;

    }
    
?>
<tr class="wpsg_<?php echo (($this->view['wpsg_mod_rechnungen']['i'] == 0)?'odd':'even'); ?>">  
        <td colspan="<?php echo ((sizeof($this->view['arCalculation']['tax']) > 1 || $this->get_option('wpsg_showMwstAlways') == '1')?'5':'4'); ?>">
                
        <!-- Rechnungen -->
        <label class="bg_invoice wpsg_mod_rechnungen_row" style="font-weight:normal;">   
       
            <?php if ($invoice_amount > 0) { ?>
                <div style="display:flex; flex-direction:row; gap:0.5rem; font-weight:normal; align-items:center;">
                    <span><?php echo __('Menge'); ?></span>
                    
                    <input form="invoice_form" type="hidden" name="invoice_products[<?php echo $p['order_product_id']; ?>][set]" value="0" class="" />
                    <input checked="checked" form="invoice_form" type="checkbox" class="wpsg_mod_deliverynote_product wpsg_check_amount" name="invoice_products[<?php echo $p['order_product_id']; ?>][set]" value="1" style="margin:0;" />
                    
                    <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;" />
                    
                    <span>&nbsp;<?php echo __('auf Rechnung', 'wpsg'); ?></span>
                </div>
            <?php } ?>
   
            <?php if (sizeof($arInvoiceInvoice) > 0) { ?>
            <div class="invoice_wrap">
                <span><?php echo __('Rechnungen', 'wpsg'); ?>:</span>
                <?php foreach ($arInvoiceInvoice as $oInvoice) { ?>
                    <?php echo $oInvoice->getNr(true, $oOrderProduct); ?>        
                <?php } ?>
            </div>    
            <?php } ?>
            
        </label>
                                        
        <!-- Gutschriften -->        
        <label class="bg_storno wpsg_mod_rechnungen_row" style="font-weight:normal;">   
            
            <?php if ($storno_amount > 0) { ?>
                <div style="display:flex; flex-direction:row; gap:0.5rem; font-weight:normal; align-items:center;">
                    <span><?php echo __('Menge'); ?></span>
                    
                    <input form="storno_form" type="hidden" name="storno_products[<?php echo $p['order_product_id']; ?>][set]" value="0" class="" />
                    <input form="storno_form" type="checkbox" class="wpsg_mod_deliverynote_product wpsg_check_amount" name="storno_products[<?php echo $p['order_product_id']; ?>][set]" value="1" style="margin:0;" />
                    
                    <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;" />
                    
                    <span>&nbsp;<?php echo __('Stück auf Gutschrift', 'wpsg'); ?></span>
                </div>
            <?php } ?>
            
            <?php if (sizeof($arInvoiceStorno) > 0) { ?>
            <div class="invoice_wrap">
                <span><?php echo __('Rechnungskorrekturen', 'wpsg'); ?>:</span>
                <?php foreach ($arInvoiceStorno as $oInvoice) { ?>
                    <?php echo $oInvoice->getNr(true, $oOrderProduct); ?>        
                <?php } ?>
            </div>    
            <?php } ?>
            
        </label>
            
        </td>
</tr>