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
|
<?php
/**
* Template für die Rechnungsmodulansicht innerhalb der Bestellansicht
*/
?>
<script type="text/javascript">
function wpsg_mod_rechnungen_storno()
{
if (jQuery('#wpsg_rechnungen_gutschrift1').attr('checked') || jQuery('#wpsg_rechnungen_gutschrift2').attr('checked'))
{
window.setTimeout(function() {
location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&edit_id=<?php echo $this->view['data']['id']; ?>';
}, 1000);
}
return true;
}
jQuery(document).ready(function() {
jQuery("#wpsg_rechnungen_postbox_title").bind("click", function() {
if (jQuery(this.parentNode).hasClass("closed"))
{
jQuery.cookie("wpsg_rechnungen_field", "0", { expires: 999999 } );
}
else
{
jQuery.cookie("wpsg_rechnungen_field", "1", { expires: 999999 } );
}
} );
if (jQuery.cookie("wpsg_rechnungen_field") == "1")
{
jQuery("#wpsg_rechnungen_postbox").removeClass("closed");
}
jQuery('.wpsg_rechnungen_gutschrift').bind('change', function() {
if (jQuery('#wpsg_rechnungen_gutschrift1').attr('checked') || jQuery('#wpsg_rechnungen_gutschrift2').attr('checked'))
{
jQuery('#wpsg_mod_rechnungen_fee_layer').show();
jQuery('#wpsg_mod_rechnungen_stornopreview').show();
jQuery('#wpsg_rechnungen_stornobutton').attr('value', '<?php echo __('Rechnungskorrektur erstellen', 'wpsg'); ?>');
}
else
{
jQuery('#wpsg_mod_rechnungen_fee_layer').hide();
jQuery('#wpsg_mod_rechnungen_stornopreview').hide();
jQuery('#wpsg_rechnungen_stornobutton').attr('value', '<?php echo __('Bestellung Stornieren', 'wpsg'); ?>');
}
} );
jQuery('#wpsg_rechnungen_gutschrift0').change();
} );
</script>
<div class="postbox" id="wpsg_rechnungen">
<h3 class="wpsg_handlediv">
<span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
<span><?php echo __('Rechnungen', 'wpsg'); ?></span>
</h3>
<div class="inside">
<?php if (sizeof($this->view['mod_rechnungen']['arRechnungen']) == 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_storno']) == 0) { ?>
<p><?php echo __('Bisher keine Rechnungen geschrieben.', 'wpsg'); ?></p>
<?php } else { ?>
<table>
<?php foreach ($this->view['mod_rechnungen']['arRechnungen_gesamt'] as $r) { ?>
<tr>
<td>#<?php echo (($r['rnr'] != '')?$r['rnr']:$r['gnr']); ?>
<?php if ($r['storno'] == "0000-00-00 00:00:00") { ?>
<?php if ($r['gnr'] != "") { ?>
<?php echo wpsg_translate(__('Rechnungskorrektur vom #1#', 'wpsg'), date("d.m.Y", $r['ts_datum'])); ?>
<?php } else { ?>
<?php echo wpsg_translate(__('Rechnung geschrieben am #1#', 'wpsg'), date("d.m.Y", $r['ts_datum'])); ?>
<?php } ?>
<?php } else { ?>
<?php echo wpsg_translate(__("Rechnung storniert am #1#", "wpsg"), date("d.m.Y", $r['ts_storno'])); ?>
<?php } ?>
</td>
<td style="text-align:right;">
<?php
if ($r['rnr'] != "")
{
$rfile = $this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'], true)).'R'.$r['rnr'].'.pdf';
}
else if ($r['gnr'] != "")
{
$rfile = $this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'], true)).'G'.$r['gnr'].'.pdf';
}
?>
<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 echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id=<?php echo $this->view['data']['id']; ?>&r_id=<?php echo $r['id']; ?>&do=copy"><?php echo __("Kopie senden", "wpsg"); ?></a>
<a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&noheader=1&mod=wpsg_mod_rechnungen&do=getRechnung&edit_id=<?php echo $this->view['data']['id']; ?>&r_id=<?php echo $r['id']; ?>"><?php echo __("Ansehen", "wpsg"); ?></a>
</td>
</tr>
<?php } ?>
</table>
<br />
<?php } ?>
<?php if (sizeof($this->view['mod_rechnungen']['arRechnungen']) > 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_gesamt']) != sizeof($this->view['mod_rechnungen']['arRechnungen_storno'])) { ?>
<fieldset style="border:1px solid #999999; width:100%;">
<legend style="margin-left:7px; margin-right:10px;"><?php echo __("Bestellstorno: Rechnungskorrektur erstellen", "wpsg"); ?></legend>
<div style="padding:10px;">
<form id="storno_form" target="_blank" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&noheader=1&action=ajax&mod=wpsg_mod_rechnungen&edit_id=<?php echo $this->view['data']['id']; ?>&do=storno">
<input type="hidden" name="send" value="1" />
<label><input onclick="jQuery.cookie('wpsg_rechnungen_stornoradio', '0');" type="radio" value="0" class="wpsg_rechnungen_gutschrift" id="wpsg_rechnungen_gutschrift0" name="wpsg_rechnungen_gutschrift" /> <?php echo __("Rechnung komplett stornieren und keine Rechnungskorrektur erstellen.", "wpsg"); ?></label><br />
<label><input onclick="jQuery.cookie('wpsg_rechnungen_stornoradio', '1');" type="radio" value="1" class="wpsg_rechnungen_gutschrift" id="wpsg_rechnungen_gutschrift1" name="wpsg_rechnungen_gutschrift" /> <?php echo __("Rechnungskorrektur erstellen.", "wpsg"); ?></label><br />
<label><input onclick="jQuery.cookie('wpsg_rechnungen_stornoradio', '2');" type="radio" value="2" class="wpsg_rechnungen_gutschrift" id="wpsg_rechnungen_gutschrift2" name="wpsg_rechnungen_gutschrift" /> <?php echo __("Rechnungskorrektur erstellen und an Kunden senden.", "wpsg"); ?></label><br />
<div id="wpsg_mod_rechnungen_fee_layer" style="display:none;">
<?php echo wpsg_drawForm_Input('wpsg_mod_rechnungen_fee', __('Gebühr für Rechnungskorrektur', 'wpsg'), ''); ?>
</div>
<div class="wpsg_clear"></div><br />
<input onclick="return wpsg_mod_rechnungen_storno();" id="wpsg_rechnungen_stornobutton" class="button" type="submit" name="form_submit" value="<?php echo __("Stornieren", "wpsg"); ?>" style="float:right;" />
<input id="wpsg_mod_rechnungen_stornopreview" class="button" type="submit" name="form_submit_preview" value="<?php echo __('Vorschau', 'wpsg'); ?>" style="float:right; margin-right:10px;" />
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("[name=wpsg_rechnungen_gutschrift]").filter("[value=" + jQuery.cookie("wpsg_rechnungen_stornoradio") + "]").attr("checked","checked");
jQuery("#wpsg_rechnungen_stornobutton").bind("click", function() {
if (jQuery("#wpsg_rechnungen_gutschrift1").attr("checked") || jQuery("#wpsg_rechnungen_gutschrift2").attr("checked"))
{
//jQuery("#storno_form").attr("action", "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&noheader=1&action=ajax&mod=wpsg_mod_rechnungen&edit_id=<?php echo $this->view['data']['id']; ?>&do=storno");
jQuery("#storno_form").attr("target", "_blank");
window.setTimeout(function() {
location.href = "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&edit_id=<?php echo $this->view['data']['id']; ?>";
}, 1500);
}
else
{
//jQuery("#storno_form").attr("action", "<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_rechnungen&edit_id=<?php echo $this->view['data']['id']; ?>&do=storno");
jQuery("#storno_form").attr("target", "");
}
});
});
</script>
</form>
<div class="wpsg_hinweis"><?php echo __("Eine neue Rechnung kann erst geschrieben werden wenn alle bestehenden Rechnungen zu dieser Bestellung storniert wurden.", "wpsg"); ?></div>
<div class="wpsg_clear"></div>
</div>
</fieldset>
<?php } else { ?>
<fieldset style="border:1px solid #999999; width:100%;">
<legend style="margin-left:10px; margin-right:10px;"><?php echo __("Neue Rechnung", "wpsg"); ?></legend>
<div style="padding:5px;">
<form target="_blank" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_rechnungen&cmd=rechnung&noheader=1&edit_id=<?php echo $this->view['data']['id']; ?>">
<input type="hidden" name="send" value="1" />
<label style="height:25px; width:240px; float:left; margin-top:10px;">
<input onchange="if (this.checked) jQuery('#wpsg_rechnungen_email').show(); else jQuery('#wpsg_rechnungen_email').hide();" type="checkbox" checked="checked" value="1" name="wpsg_rechnungen_sendmail" />
<?php echo __("E-Mail an Kunden senden.", "wpsg"); ?>
</label>
<input type="text" style="display:block; width:300px; float:right;" id="wpsg_rechnungen_email" name="wpsg_rechnungen_email" value="<?php echo wpsg_hspc($this->view['data']['email']); ?>" />
<div style="clear:both; width:100%; height:5px;"></div>
<label style="height:25px; width:240px; float:left;">
<input checked="checked" onchange="if (this.checked) jQuery('#wpsg_rechnungen_faelligkeitsdatum').show(); else jQuery('#wpsg_rechnungen_faelligkeitsdatum').hide();" type="checkbox" value="1" name="wpsg_rechnungen_faelligkeit" />
<?php echo __("Fälligkeit anzeigen.", "wpsg"); ?>
</label>
<input type="text" style="display:block; width:300px; float:right;" id="wpsg_rechnungen_faelligkeitsdatum" name="wpsg_rechnungen_faelligkeitsdatum" value="<?php echo date("d.m.Y", time() + ($this->get_option("wpsg_rechnungen_faelligkeit") * 86400)); ?>" />
<div style="clear:both; width:100%; height:5px;"></div>
<label style="height:25px; width:220px; float:left;">
<input checked="checked" onchange="if (this.checked) jQuery('#wpsg_rechnungen_status').show(); else jQuery('#wpsg_rechnungen_status').hide();" type="checkbox" value="1" name="wpsg_rechnungen_status" />
<?php echo __("Neuer Status:", "wpsg"); ?>
</label>
<select style="width:300px; float:right;" id="wpsg_rechnungen_status_neu" name="wpsg_rechnungen_status_neu">
<?php foreach ($this->arStatus as $k => $v) { ?>
<option value="<?php echo $k; ?>" <?php echo (($k == 110)?'selected="selected"':''); ?>><?php echo $v; ?></option>
<?php } ?>
</select>
<div style="clear:both; width:100%; height:5px;"></div>
<label style="height:25px; width:240px; float:left;">
<input <?php echo (($this->get_option("wpsg_rechnungen_url_std") === "1")?'checked="checked"':''); ?> type="checkbox" value="1" name="wpsg_rechnungen_url" />
<?php echo __("URL Benachrichtigung", "wpsg"); ?>
</label>
<div style="clear:both; width:100%; height:5px;"></div>
<label style="height:25px; width:240px; float:left; padding-left:22px;">
<?php echo __("Rechnungsdatum", "wpsg"); ?>:
</label>
<input style="display:block;float:right; width:300px;" type="text" name="wpsg_rechnungen_datum" value="<?php echo date("d.m.Y", time()); ?>" />
<div style="clear:both; width:100%; height:5px;"></div>
<label for="wpsg_rechnungen_fusstext" style="height:25px; width:220px; padding-left:22px; float:left">
<?php echo __("Fußtext", "wpsg"); ?>
</label>
<?php
$wpsg_rechnungen_footer = $this->get_option("wpsg_rechnungen_footer");
if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = unserialize($this->get_option("wpsg_rechnungen_footer"));
if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = Array();
?>
<?php if (sizeof($wpsg_rechnungen_footer) > 0) { ?>
<select style="width:300px; float:right;" id="wpsg_rechnungen_select" onchange="jQuery('#wpsg_rechnungen_fusstext').val(this.value);">
<?php foreach ($wpsg_rechnungen_footer as $k => $v) { ?>
<option value="<?php echo wpsg_hspc($v[1]); ?>"><?php echo wpsg_hspc($v[0]); ?></option>
<?php } ?>
</select>
<?php } ?>
<div style="clear:both; width:100%; height:5px;"></div>
<div style="padding-left:25px;"><input style="width:100%;" type="text" name="wpsg_rechnungen_fusstext" id="wpsg_rechnungen_fusstext" value="" /></div>
<div style="clear:both; width:100%; height:15px;"></div>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#wpsg_rechnungen_fusstext').val(jQuery("#wpsg_rechnungen_select").val());
});
</script>
<input class="button" style="float:right;" onclick="window.setTimeout(function() { location.href = '<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=view&edit_id=<?php echo $this->view['data']['id']; ?>'; }, 1000);" name="wpsg_rechnungen_write" type="submit" value="<?php echo __("Rechnung schreiben", "wpsg"); ?>" />
<input class="button" style="float:right; margin-right:10px;" name="wpsg_rechnungen_preview" type="submit" value="<?php echo __("Vorschau", "wpsg"); ?>" />
<div style="clear:both; width:100%; height:5px;"></div>
</form>
</div>
</fieldset>
<?php } ?>
</div>
</div>
|