Subversion Repositories wpShopGermany4

Rev

Rev 8370 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1092 daniel 1
<?php
2
 
3
	/**
4
	 * Template für die Rechnungsmodulansicht innerhalb der Bestellansicht
5
	 */
8453 daniel 6
	use horstoeko\zugferd\ZugferdProfiles;
7
	use wpsg\mod_invoice\eInvoice;
1092 daniel 8
 
9
?>
8010 daniel 10
 
11
<div id="wpsg_mod_rechnungen_order_view">
12
 
13
    <?php echo wpsg_drawForm_AdminboxStart(__('Rechnungen', 'wpsg'));  ?>
14
 
15
        <?php if (sizeof($this->view['mod_rechnungen']['arRechnungen']) == 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_storno']) == 0) { ?>
16
 
5720 daniel 17
        <p><?php echo __('Bisher keine Rechnungen geschrieben.', 'wpsg'); ?></p>
8010 daniel 18
 
19
        <?php } else { ?>
20
 
21
            <div class="grid">
22
 
23
                <?php foreach ($this->view['mod_rechnungen']['arRechnungen_gesamt'] as $r) {
24
 
25
                    $oInvoice = \wpsg\wpsg_invoice::getInstance($r['id']);
26
 
5720 daniel 27
                    ?>
8453 daniel 28
 
8010 daniel 29
                    <div>
30
                        <?php echo $oInvoice->getDate(true); ?>
5720 daniel 31
                    </div>
8010 daniel 32
                    <div>
33
                        <?php echo $oInvoice->getNr(true); ?>
34
                    </div>
8453 daniel 35
					<div>
36
						<div id="e_invoice_app_<?php echo $oInvoice->getId(); ?>"></div>
37
						<script type="module">
38
 
39
							import { initEInvoiceApp } from '<?php echo wpsg_ShopController::getShop()->getRessourceURL('mods/mod_rechnungen/js/e_invoice_app.module.js'); ?>';
40
 
41
							initEInvoiceApp(document.getElementById('e_invoice_app_<?php echo $oInvoice->getId(); ?>'), {
42
								'invoice_id': <?php echo $oInvoice->getId(); ?>,
43
								'template_url': '<?php echo wpsg_ShopController::getShop()->getRessourceURL('mods/mod_rechnungen/html/e_invoice_app.html'); ?>',
44
								'default_profile': <?php echo intval(wpsg_ShopController::getShop()->get_option('wpsg_mod_rechnungen_einvoice')); ?>,
45
								'arProfile': <?php echo json_encode([
46
									100 + ZugferdProfiles::PROFILE_MINIMUM => ['label' => __('EN16931 Minimum', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_MINIMUM)],
47
									100 + ZugferdProfiles::PROFILE_BASIC => ['label' => __('EN16931 Basic', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_BASIC)],
48
									100 + ZugferdProfiles::PROFILE_BASICWL => ['label' => __('EN16931 Basic WL', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_BASICWL)],
49
									100 + ZugferdProfiles::PROFILE_EN16931 => ['label' => __('EN16931 Comfort', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_EN16931)],
50
									100 + ZugferdProfiles::PROFILE_EXTENDED => ['label' => __('EN16931 Extended', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_EXTENDED)],
51
									100 + ZugferdProfiles::PROFILE_XRECHNUNG => ['label' => __('EN16931 XRechnung 1', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_XRECHNUNG)],
52
									100 + ZugferdProfiles::PROFILE_XRECHNUNG_2 => ['label' => __('EN16931 XRechnung 2', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_XRECHNUNG_2)],
53
									100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_1 => ['label' => __('EN16931 XRechnung 2.1', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_XRECHNUNG_2_1)],
54
									100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_2 => ['label' => __('EN16931 XRechnung 2.2', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_XRECHNUNG_2_2)],
55
									100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_3 => ['label' => __('EN16931 XRechnung 2.3', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_XRECHNUNG_2_3)],
56
									100 + ZugferdProfiles::PROFILE_XRECHNUNG_3 => ['label' => __('EN16931 XRechnung 3', 'wpsg'), 'url' => eInvoice::buildUrl($oInvoice->getId(), ZugferdProfiles::PROFILE_XRECHNUNG_3)]
57
								]); ?>
58
							});
59
 
60
						</script>
61
					</div>
8369 daniel 62
                    <div style="text-align:right; white-space:nowrap;">
8370 daniel 63
 
64
						<?php /*
8369 daniel 65
						<a target="_blank" href="<?php
66
 
67
							echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$_REQUEST['edit_id'].'&r_id='.$r['id'].'&do=rebuildadmin', 'wpsg-mod_invoice-order_ajax-rebuildadmin-'.$_REQUEST['edit_id']);
68
 
69
						?>" style="color:red;"><?php echo __('Neu erstellen', 'wpsg'); ?></a>
8370 daniel 70
 						*/ ?>
8369 daniel 71
 
8010 daniel 72
                        <a target="_blank" onclick="if (!confirm('<?php echo __('Sind Sie sicher, dass Sie eine Kopie dieser Rechnung/Rechnungskorrektur erneut an den Kunden senden möchten?', 'wpsg'); ?>')) return false;" href="<?php
73
 
8255 karl 74
                            if ($r['o_id'] == '0') {
8130 karl 75
                                // Multirechnung
8255 karl 76
                                $r_o_ids = array_map('intval', explode(',', $r['o_ids']));
8369 daniel 77
                                echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$_REQUEST['edit_id'].'&r_id='.$r['id'].'&do=copy', 'wpsg-mod_invoice-order_ajax-copy-'.$_REQUEST['edit_id']);
8130 karl 78
                            } else {
79
                                // normale Rechnung
8369 daniel 80
                                echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$_REQUEST['edit_id'].'&r_id='.$r['id'].'&do=copy', 'wpsg-mod_invoice-order_ajax-copy-'.$_REQUEST['edit_id']);
8130 karl 81
                            }
82
 
8010 daniel 83
                        ?>"><?php echo ' &nbsp;'.__("Kopie senden", "wpsg"); ?></a>&nbsp;
84
 
85
                    </div>
86
 
87
                <?php } ?>
8453 daniel 88
 
89
 
8010 daniel 90
 
5720 daniel 91
            </div>
8010 daniel 92
 
93
        <?php } ?>
94
 
95
    <?php echo wpsg_drawForm_AdminboxEnd(); ?>
96
 
97
</div>
98
 
99
<style>
100
 
8453 daniel 101
    #wpsg_mod_rechnungen_order_view .grid { display:grid; width:100%; grid-template-columns:150px 1fr 250px 150px; row-gap:0.5rem; column-gap:1rem; align-items:center; }
8010 daniel 102
 
8453 daniel 103
	.e_invoice_app { position:relative; user-select:none;
104
		& > .handler { border:1px solid black; padding:0.25rem 0.5rem; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; width:100%; cursor:pointer; background-color:white; position:relative;
105
			&:after { width:0; height:0; border-top:5px solid transparent; border-bottom:5px solid transparent; border-left:5px solid #2c699e; content:' '; position:absolute; right:5px; top:50%; transform:translateY(-50%); transition:all 0.4s; }
106
		}
107
		& > .layer { position:absolute; max-height:0; overflow:hidden; width:100%; transition:all 0.4s; z-index:1;
108
			& > .inner { border:1px solid black; padding:0.25rem 0.5rem; margin-top:-1px; display:flex; flex-direction:column; gap:0.25rem; background-color:white;
109
				& > a:not(:last-child) { border-bottom:1px solid black; }
110
				& > a.default { font-weight:bold; }
111
			}
112
		}
113
		&.open {
114
			& > .layer { max-height:500px; }
115
			& > .handler:after { transform:translateY(-50%) rotate(90deg); }
116
		}
117
	}
118
 
8010 daniel 119
</style>