diff options
Diffstat (limited to 'views/mods')
| -rw-r--r-- | views/mods/mod_rechnungen/settings_edit.phtml | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/views/mods/mod_rechnungen/settings_edit.phtml b/views/mods/mod_rechnungen/settings_edit.phtml index c2579de..60d5695 100644 --- a/views/mods/mod_rechnungen/settings_edit.phtml +++ b/views/mods/mod_rechnungen/settings_edit.phtml @@ -5,6 +5,21 @@ */
use horstoeko\zugferd\ZugferdProfiles;
+
+ $ArrZugferdProfile = [
+ 0 => __('Keine E-Rechnungsdaten erzeugen', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_MINIMUM => __('EN16931 Minimum', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_BASIC => __('EN16931 Basic', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_BASICWL => __('EN16931 Basic WL', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_EN16931 => __('EN16931 Comfort', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_EXTENDED => __('EN16931 Extended', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_XRECHNUNG => __('EN16931 XRechnung 1', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2 => __('EN16931 XRechnung 2', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_1 => __('EN16931 XRechnung 2.1', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_2 => __('EN16931 XRechnung 2.2', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_3 => __('EN16931 XRechnung 2.3', 'wpsg'),
+ 100 + ZugferdProfiles::PROFILE_XRECHNUNG_3 => __('EN16931 XRechnung 3', 'wpsg'),
+ ]
?>
@@ -184,40 +199,35 @@ </div>
<div id="tab3" role="tabpanel" class="tab-pane" >
- <?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_einvoice', __('E-Rechnung', 'wpsg'), [
- 0 => __('Keine E-Rechnungsdaten erzeugen', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_MINIMUM => __('EN16931 Minimum', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_BASIC => __('EN16931 Basic', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_BASICWL => __('EN16931 Basic WL', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_EN16931 => __('EN16931 Comfort', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_EXTENDED => __('EN16931 Extended', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_XRECHNUNG => __('EN16931 XRechnung 1', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2 => __('EN16931 XRechnung 2', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_1 => __('EN16931 XRechnung 2.1', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_2 => __('EN16931 XRechnung 2.2', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_XRECHNUNG_2_3 => __('EN16931 XRechnung 2.3', 'wpsg'),
- 100 + ZugferdProfiles::PROFILE_XRECHNUNG_3 => __('EN16931 XRechnung 3', 'wpsg'),
- ], $this->get_option('wpsg_mod_rechnungen_einvoice'), ['help' => 'wpsg_mod_rechnungen_einvoice']); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_einvoice', __('E-Rechnung', 'wpsg'), $ArrZugferdProfile, $this->get_option('wpsg_mod_rechnungen_einvoice'), ['help' => 'wpsg_mod_rechnungen_einvoice']); ?>
<p style="line-height:normal; margin-bottom:1rem; margin-top:1rem; display:none; font-style:italic;" id="wpsg_mod_rechnungen_einvoice_description"><?php echo __('Die Platzhalter können bei den Formatfeldern und dem Dateinamen verwendet werden. Der Platzhalter %nr% sollte dabei immer Verwendung finden.', 'wpsg'); ?></p>
-
+ <?php
+
+ array_walk($ArrZugferdProfile, function(&$v, $k) {
+
+ $v = [ 'description' => ZugferdProfiles::PROFILEDEF[$k - 100]['description']??null ];
+
+ });
+
+ ?>
<script>
- const eInvoiceProfileDev = <?php echo json_encode(ZugferdProfiles::PROFILEDEF); ?>;
+ const eInvoiceProfileDev = <?php echo json_encode($ArrZugferdProfile); ?>;
const el_wpsg_mod_rechnungen_einvoice_description = document.getElementById('wpsg_mod_rechnungen_einvoice_description');
document.getElementById('wpsg_mod_rechnungen_einvoice').addEventListener('change', ev => {
- if (eInvoiceProfileDev[ev.target.value] !== undefined) {
+ if (eInvoiceProfileDev[ev.target.value] !== null) {
el_wpsg_mod_rechnungen_einvoice_description.innerText = eInvoiceProfileDev[ev.target.value].description;
el_wpsg_mod_rechnungen_einvoice_description.style.display = 'block';
-
+
} else {
el_wpsg_mod_rechnungen_einvoice_description.style.display = 'hidden';
-
- }
+
+ }
});
|
