1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
|
<?php
/**
* Template für die Einstellungen des Rechnungen Moduls
*/
?>
<div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab1" aria-controls="home" role="tab" data-toggle="tab"><?php echo __('Vordefinierte Textfelder', 'wpsg'); ?></a></li>
<li role="presentation"><a href="#tab2" aria-controls="profile" role="tab" data-toggle="tab"><?php echo __('Fußzeile', 'wpsg'); ?></a></li>
<li role="presentation"><a href="#tab3" aria-controls="messages" role="tab" data-toggle="tab"><?php echo __('Sonstiges', 'wpsg'); ?></a></li>
</ul>
<div class="tab-content">
<div id="tab1" role="tabpanel" class="tab-pane active" >
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_adresszeile', __('Adresszeile', 'wpsg'), $this->get_option('wpsg_rechnungen_adresszeile')); ?>
<!--
<div class="wpsg_hinweis"><?php echo __('Diese Zeile wird klein oberhalb der Kundenadresse platziert', 'wpsg'); ?></div>
<br />
-->
<?php echo wpsg_drawForm_TextStart(); ?>
<div style="position:relative;">
<?php if ($this->view['bp'] === false) { ?>
<p><?php echo __('Es wurde bisher kein Briefpapier hochgeladen', 'wpsg'); ?></p>
<?php } else { ?>
<a href="<?php echo $this->view['bp']; ?>" target="_blank"><?php echo __('Derzeitiges Briefpapier', 'wpsg'); ?></a>
<?php } ?>
<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp" data-wpsg-tip="mod_rechnung_bp" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_bp"></a>
<input type="file" name="wpsg_rechnungen_bp">
<?php $strSuffix = ''; if ($this->view['bp'] !== false) { $strSuffix = '
<label>
<input type="checkbox" name="wpsg_rechnungen_bp_del" value="1" /> '.__('Löschen', 'wpsg').'
</label>';
echo __($strSuffix);
} ?>
</div>
<?php echo wpsg_drawForm_TextEnd(__('Briefpapier (PDF/JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_rechnungen_bp')); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
<div style="position:relative;">
<?php if ($this->view['logo'] === false) { ?>
<p><?php echo __('Es wurde bisher kein Logo hochgeladen', 'wpsg'); ?></p>
<?php } else { ?>
<a href="<?php echo stripslashes($this->view['logo']); ?>" target="_blank"><?php echo __('Derzeitiges Logo', 'wpsg'); ?></a>
<?php } ?>
<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign form-control-feedback" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo" data-wpsg-tip="mod_rechnung_logo" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_logo"></a>
<input type="file" name="wpsg_rechnungen_logo">
<?php $logo_pos = $this->get_option("wpsg_rechnungen_logo_position"); ?>
<?php $defaultAlign = !isset($logo_pos) || empty($logo_pos) ? "align-buttons-active" : ""; ?>
<?php $alignLeft = $logo_pos === 'left' ? "align-buttons-active" : ""; ?>
<?php $alignCenter = $logo_pos === 'center' ? "align-buttons-active" : ""; ?>
<?php $alignRight = $logo_pos === 'right' ? "align-buttons-active" : ""; ?>
<?php $logo_transparency = $this->get_option("wpsg_rechnungen_logo_transparency") ?: "0%"; ?>
<?php $strSuffix = ''; if ($this->view['logo'] !== false) { $strSuffix = '
<div class="row">
<div class="col-md-4">
<div class="align-buttons">
<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-left '.$alignLeft.'" name="wpsg_rechnungen_logo_position_left" value="" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo linksbündig ausrichten").'">
<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-center '.$alignCenter.'" name="wpsg_rechnungen_logo_position_center" value="" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo zentrieren").'">
<input type="input" data-toggle="tooltip" class="logo-align-button logo-align-button-right '.$alignRight.' '.$defaultAlign.'" name="wpsg_rechnungen_logo_position_right" value="" onclick="handleLogoAlignClick($(this))" onkeydown="return false;" onfocus="return false;" autocomplete="off" title="'.__("Logo rechtsbündig ausrichten").'">
</div>
</div>
<div class="col-md-8 logo-transparency">
<label>
<input type="text" name="wpsg_rechnungen_logo_transparency" value="'.$logo_transparency.'" /> '.__('Logodeckkraft', 'wpsg').'
</label>
</div>
<div class="col-md-12">
<label>
<input type="checkbox" name="wpsg_rechnungen_logo_del" value="1" /> '.__('Löschen', 'wpsg').'
</label>
</div>
</div>';
echo __($strSuffix);
} ?>
<button class="button wpsg_rechnungen_preview" style="float:right; margin-right:10px;" name="wpsg_rechnungen_preview" type="button">
<?php echo __("Vorschau", "wpsg"); ?>
</button>
</div>
<?php echo wpsg_drawForm_TextEnd(__('Logo (JPG)', 'wpsg'), array('noP' => true, 'helps' => 'wpsg_rechnungen_bp')); ?>
<!--
<div class="wpsg_hinweis"><?php echo __('Das Briefpapier wird hinter die gesamte Seite gelegt, das Logo wird standardmäßig rechts oben auf jeder Seite platziert. (96 dpi)', 'wpsg'); ?></div>
<br />
-->
<table class="table table-body-striped wpsg_mod_deliverynote_fieldtable">
<thead>
<tr>
<th class="col_bezeichnung"><?php echo __('Bezeichnung', 'wpsg'); ?></th>
<th class="col_freitext"><?php echo __('Freitext', 'wpsg'); ?></th>
<th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
<th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
<th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
<th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
<th class="col_action"></th>
</tr>
</thead>
<tbody>
<?php foreach ($this->view['fields'] as $f => $field_name) { ?>
<tr>
<td><?php echo wpsg_getStr($field_name); ?></td>
<td>
<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][text]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['text']); ?>" />
</td>
<td>
<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][x]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['x']); ?>" />
</td>
<td>
<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][y]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['y']); ?>" />
</td>
<td>
<input type="text" style="width:100%;" name="text[<?php echo $f; ?>][color]" value="<?php echo wpsg_getStr($this->view['arTexte'][$f]['color']); ?>" />
</td>
<td>
<select name="text[<?php echo $f; ?>][fontsize]" style="width:100%;">
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "8")?'selected="selected"':''); ?> value="8">8</option>
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "9")?'selected="selected"':''); ?> value="9">9</option>
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "10")?'selected="selected"':''); ?> value="10">10</option>
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "11")?'selected="selected"':''); ?> value="11">11</option>
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "12")?'selected="selected"':''); ?> value="12">12</option>
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "13")?'selected="selected"':''); ?> value="13">13</option>
<option <?php echo ((wpsg_getStr($this->view['arTexte'][$f]['fontsize']) == "14")?'selected="selected"':''); ?> value="14">14</option>
</select>
</td>
<td>
<label><input type="checkbox" value="1" name="text[<?php echo $f; ?>][aktiv]" <?php echo ((wpsg_isSizedInt($this->view['arTexte'][$f]['aktiv']))?'checked="checked"':''); ?> /> <?php echo __("Aktiv", "wpsg"); ?></label>
<a style="float:right; position:relative;" class="glyphicon glyphicon-question-sign" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_fieldconfig" data-wpsg-tip="mod_rechnung_fieldconfig" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_rechnung_fieldconfig"></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<br />
<input style="float:right;" class="button" onclick="if (!confirm('<?php echo __('Sind Sie sich sicher? Ihre bisherigen Einstellungen gehen verloren!', 'wpsg'); ?>')) return false; else location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=<?php echo $_REQUEST['modul']; ?>&do=reset&noheader=1';" type="button" value="<?php echo __('Standardeinstellungen laden', 'wpsg'); ?>" />
<div class="info">
<p style="line-height:normal;">
<?php echo __('Die Angaben für X (Abstand von Links) und Y (Abstand von Oben) werden in mm eingetragen.', 'wpsg'); ?><br />
<?php echo __('Die Farbe wird im Hexadezimalformat angegeben (#FFFFFF für weiß, #000000 für schwarz).', 'wpsg'); ?>
</p>
</div>
<br />
</div>
<div id="tab2" role="tabpanel" class="tab-pane" >
<div id="foottext_list"><?php echo $this->view['foottext_list']; ?></div>
<br />
<a title="<?php echo __('Neue Fußzeile anlegen', 'wpsg'); ?>" href="" class="" onclick="return wpsg_addFooter();"><span class="glyphicon wpsg-glyphicon glyphicon-plus"></span><?php echo __('Neue Fußzeile anlegen.', 'wpsg'); ?></a>
<br /><br />
<div class="info">
<p style="line-height:normal;">
<?php echo __('Hier können Sie Texte vordefinieren, die sie unter die Rechnung setzen können.', 'wpsg'); ?>
</p>
</div>
</div>
<div id="tab3" role="tabpanel" class="tab-pane" >
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_url', __('URL Benachrichtigung', 'wpsg'), $this->get_option('wpsg_rechnungen_url'), array('help' => 'wpsg_rechnung_url')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_auto', __('Rechnungserstellung', 'wpsg'), array(
'0' => __('Manuell', 'wpsg'),
'1' => __('Bei Bestellung', 'wpsg'),
'2' => __('Bei Zahlung', 'wpsg')
), $this->get_option('wpsg_mod_rechnungen_auto'), array('help' => 'wpsg_mod_rechnungen_auto')); ?>
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_faelligkeit', __('Fälligkeit in Tagen', 'wpsg'), $this->get_option('wpsg_rechnungen_faelligkeit'), array('help' => 'wpsg_rechnungen_faelligkeit')); ?>
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_pdfperpage', __('Anzahl an Produkten pro Seite (PDF)', 'wpsg'), $this->get_option('wpsg_rechnungen_pdfperpage'), array('help' => 'wpsg_rechnungen_pdfperpage')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_pbeschreibung', __('Produktbeschreibung auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_pbeschreibung'), array('help' => 'wpsg_rechnungen_pbeschreibung')); ?>
<?php if ($this->hasMod('wpsg_mod_produktattribute') == '1') {?>
<?php echo wpsg_drawForm_Checkbox('wpsg_rechnungen_produktattribute', __('Produktattribute auf der Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_rechnungen_produktattribute'), array('help' => 'wpsg_rechnungen_produktattribute')); ?>
<?php }?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showgutschriftrechnung', __('Rechnungsnummer auf Rechnungskorrektur anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showgutschriftrechnung'), array('help' => 'wpsg_mod_rechnungen_showgutschriftrechnung')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showpv', __('Produktvariablen auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showpv'), array('help' => 'wpsg_mod_rechnungen_showpv')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_showov', __('Bestellvariablen auf Rechnung anzeigen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_showov'), array('help' => 'wpsg_mod_rechnungen_showov')); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_rechnungen_hideCountry', __('Land auf Rechnung verbergen', 'wpsg'), $this->get_option('wpsg_mod_rechnungen_hideCountry'), array('help' => 'wpsg_mod_rechnungen_hideCountry')); ?>
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_start', __('Startnummer (Rechnungen)', 'wpsg'), $this->get_option('wpsg_rechnungen_start'), array('help' => 'wpsg_rechnungen_start')); ?>
<?php echo wpsg_drawForm_Input('wpsg_gutschrift_start', __('Startnummer (Rechnungskorrektur)', 'wpsg'), $this->get_option('wpsg_gutschrift_start'), array('help' => 'wpsg_gutschrift_start')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_gutschrifttax', __('Mehrwertsteuersatz für Bearbeitungsgebühr', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_rechnungen_gutschrifttax'), array('help' => 'wpsg_mod_rechnungen_gutschrifttax')); ?>
<?php echo wpsg_drawForm_Input('wpsg_rechnungen_format', __('Format (Rechnungen)', 'wpsg'), $this->get_option('wpsg_rechnungen_format'), array('help' => 'wpsg_rechnungen_format')); ?>
<?php echo wpsg_drawForm_Input('wpsg_gutschrift_format', __('Format (Rechnungskorrektur)', 'wpsg'), $this->get_option('wpsg_gutschrift_format'), array('help' => 'wpsg_gutschrift_format')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_anr', __('Artikelnummer anzeigen', 'wpsg'), array(
'0' => __('Nicht anzeigen', 'wpsg'),
'1' => __('In Spalte "Nr." zeigen', 'wpsg'),
'2' => __('Als extra Zeile anzeigen', 'wpsg')
), $this->get_option('wpsg_mod_rechnungen_anr'), array('help' => 'wpsg_mod_rechnungen_anr')); ?>
<?php echo wpsg_drawForm_TextStart(); ?>
<div class="info">
<p style="line-height:normal;">
%nr% - <?php echo __('Fortlaufende Rechnungs- bzw. Rechnungskorrekturnummer', 'wpsg'); ?><br />
%Jahr% - <?php echo __('Das aktuelle Jahr (4 Stellig)', 'wpsg'); ?><br />
%Monat% - <?php echo __('Der aktuelle Monat (01 - 12)', 'wpsg'); ?><br />
%Tag% - <?php echo __('Der Tag des Monats (01 - 31)', 'wpsg'); ?><br />
</p>
</div>
<p style="line-height:normal;"><?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 echo wpsg_drawForm_TextEnd(__('Mögliche Platzhalter für Rechnungen und Rechnungskorrektur', 'wpsg'), array('noP' => true)); ?>
</div>
</div>
</div>
<script type="text/javascript">/* <![CDATA[ */
jQuery(document).ready(function() {
jQuery('#wpsg_tab').wpsg_tab( {
'cookiename': 'wpsg_rechnungen_tab',
'tab2': function() {
jQuery('.tablink').show();
}
} );
let onloadActiveBtn = $(".align-buttons-active")[0];
if(onloadActiveBtn)
{
if(!onloadActiveBtn.value.includes("selected"))
onloadActiveBtn.value += " selected";
}
$(".wpsg_rechnungen_preview").click(function(){ wpsg_rechnungen_preview(); });
} );
/**
* Stellt sicher, dass immer nur ein Button der align-buttons die highlight Klasse hat
*/
function handleLogoAlignClick(pressedEl)
{
if(pressedEl.hasClass("align-buttons-active")) return;
else
{
pressedEl.addClass("align-buttons-active");
pressedEl[0].value = pressedEl[0].value + " selected";
jQuery.each($(".logo-align-button"), function(index, element) {
if(element.classList.contains("align-buttons-active") && element !== pressedEl[0]){
var values = element.value.split(" ");
element.value = values[0];
element.classList.remove("align-buttons-active");
return false;
}
});
}
} // function handleLogoAlignClick()
// Verhindern der Weiterleitung nach dem Klick auf einen Align Button
$(".logo-align-button").click(function() { return false; });
/**
* Wird beim Klicken auf den Vorschau Button ausgelöst
*/
function wpsg_rechnungen_preview()
{
let url = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=orderAjax&noheader=1&wpsg_rechnungen_preview=1";
window.open(url, '_blank');
return false;
} // function wpsg_rechnungen_preview()
/**
* Wird beim anlegen einer neuen Fußzeile aufgerufen
*/
function wpsg_addFooter()
{
jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
jQuery.ajax( {
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=add&noheader=1',
success: function(data) {
jQuery('#foottext_list').html(data);
}
} );
return false;
} // function wpsg_addFooter()
/**
* Wird beim entfernen einer Fußzeile aufgerufen
*/
function wpsg_removeFooter(foot_id)
{
if (!confirm('<?php echo __('Sind Sie sich sicher, dass Sie diese Fußzeile löschen möchten?', 'wpsg'); ?>')) return false;
jQuery('#foottext_list').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
jQuery.ajax( {
url: '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_rechnungen&do=removeFooter&noheader=1',
data: {
foot_id: foot_id
},
success: function(data) {
jQuery('#foottext_list').html(data);
}
} );
return false;
} // function wpsg_removeFooter()
/* ]]> */</script>
|