1092 |
daniel |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Template für die Rechnungsmodulansicht innerhalb der Bestellansicht
|
|
|
5 |
*/
|
|
|
6 |
|
|
|
7 |
?>
|
|
|
8 |
|
|
|
9 |
<script type="text/javascript">
|
2759 |
daniel |
10 |
|
|
|
11 |
function wpsg_mod_rechnungen_storno()
|
|
|
12 |
{
|
|
|
13 |
|
|
|
14 |
if (jQuery('#wpsg_rechnungen_gutschrift1').attr('checked') || jQuery('#wpsg_rechnungen_gutschrift2').attr('checked'))
|
|
|
15 |
{
|
|
|
16 |
|
|
|
17 |
window.setTimeout(function() {
|
7620 |
daniel |
18 |
location.href = '<?php
|
|
|
19 |
|
|
|
20 |
echo wpsg_admin_url('Order', 'view', ['edit_id' => $this->view['data']['id']]);
|
|
|
21 |
|
|
|
22 |
?>';
|
2759 |
daniel |
23 |
}, 1000);
|
|
|
24 |
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
return true;
|
|
|
28 |
|
|
|
29 |
}
|
|
|
30 |
|
1092 |
daniel |
31 |
jQuery(document).ready(function() {
|
|
|
32 |
|
|
|
33 |
jQuery("#wpsg_rechnungen_postbox_title").bind("click", function() {
|
|
|
34 |
if (jQuery(this.parentNode).hasClass("closed"))
|
|
|
35 |
{
|
|
|
36 |
|
|
|
37 |
jQuery.cookie("wpsg_rechnungen_field", "0", { expires: 999999 } );
|
|
|
38 |
|
|
|
39 |
}
|
|
|
40 |
else
|
|
|
41 |
{
|
|
|
42 |
|
|
|
43 |
jQuery.cookie("wpsg_rechnungen_field", "1", { expires: 999999 } );
|
|
|
44 |
|
|
|
45 |
}
|
|
|
46 |
} );
|
|
|
47 |
|
|
|
48 |
if (jQuery.cookie("wpsg_rechnungen_field") == "1")
|
|
|
49 |
{
|
|
|
50 |
|
|
|
51 |
jQuery("#wpsg_rechnungen_postbox").removeClass("closed");
|
|
|
52 |
}
|
2759 |
daniel |
53 |
|
|
|
54 |
jQuery('.wpsg_rechnungen_gutschrift').bind('change', function() {
|
|
|
55 |
|
7899 |
daniel |
56 |
if (jQuery('#wpsg_rechnungen_gutschrift1').prop('checked') || jQuery('#wpsg_rechnungen_gutschrift2').prop('checked'))
|
2759 |
daniel |
57 |
{
|
|
|
58 |
|
|
|
59 |
jQuery('#wpsg_mod_rechnungen_fee_layer').show();
|
|
|
60 |
jQuery('#wpsg_mod_rechnungen_stornopreview').show();
|
4389 |
daniel |
61 |
jQuery('#wpsg_rechnungen_stornobutton').attr('value', '<?php echo __('Rechnungskorrektur erstellen', 'wpsg'); ?>');
|
2759 |
daniel |
62 |
|
|
|
63 |
}
|
|
|
64 |
else
|
|
|
65 |
{
|
|
|
66 |
|
|
|
67 |
jQuery('#wpsg_mod_rechnungen_fee_layer').hide();
|
|
|
68 |
jQuery('#wpsg_mod_rechnungen_stornopreview').hide();
|
7899 |
daniel |
69 |
jQuery('#wpsg_rechnungen_stornobutton').attr('value', '<?php echo __('Rechnung stornieren', 'wpsg'); ?>');
|
2759 |
daniel |
70 |
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
} );
|
|
|
74 |
|
|
|
75 |
jQuery('#wpsg_rechnungen_gutschrift0').change();
|
1092 |
daniel |
76 |
|
|
|
77 |
} );
|
|
|
78 |
|
|
|
79 |
</script>
|
|
|
80 |
|
5720 |
daniel |
81 |
<?php echo wpsg_drawForm_AdminboxStart(__('Rechnungen', 'wpsg')); ?>
|
1092 |
daniel |
82 |
|
5720 |
daniel |
83 |
<?php if (sizeof($this->view['mod_rechnungen']['arRechnungen']) == 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_storno']) == 0) { ?>
|
|
|
84 |
<p><?php echo __('Bisher keine Rechnungen geschrieben.', 'wpsg'); ?></p>
|
|
|
85 |
<?php } else { ?>
|
|
|
86 |
<table>
|
|
|
87 |
<?php foreach ($this->view['mod_rechnungen']['arRechnungen_gesamt'] as $r) { ?>
|
|
|
88 |
<tr>
|
|
|
89 |
<td>#<?php echo (($r['rnr'] != '')?$r['rnr']:$r['gnr']); ?>
|
2759 |
daniel |
90 |
|
5720 |
daniel |
91 |
<?php if ($r['storno'] == "0000-00-00 00:00:00") { ?>
|
|
|
92 |
<?php if ($r['gnr'] != "") { ?>
|
|
|
93 |
<?php echo wpsg_translate(__('Rechnungskorrektur vom #1#', 'wpsg'), date("d.m.Y", $r['ts_datum'])); ?>
|
|
|
94 |
<?php } else { ?>
|
|
|
95 |
<?php echo wpsg_translate(__('Rechnung geschrieben am #1#', 'wpsg'), date("d.m.Y", $r['ts_datum'])); ?>
|
|
|
96 |
<?php } ?>
|
|
|
97 |
<?php } else { ?>
|
|
|
98 |
<?php echo wpsg_translate(__("Rechnung storniert am #1#", "wpsg"), date("d.m.Y", $r['ts_storno'])); ?>
|
|
|
99 |
<?php } ?>
|
2759 |
daniel |
100 |
|
5720 |
daniel |
101 |
</td>
|
|
|
102 |
<td style="text-align:right;">
|
1094 |
daniel |
103 |
|
5720 |
daniel |
104 |
<?php
|
1093 |
daniel |
105 |
|
5720 |
daniel |
106 |
if ($r['rnr'] != "")
|
|
|
107 |
{
|
|
|
108 |
$rfile = $this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'], true)).'R'.$r['rnr'].'.pdf';
|
|
|
109 |
}
|
|
|
110 |
else if ($r['gnr'] != "")
|
|
|
111 |
{
|
|
|
112 |
$rfile = $this->callMod('wpsg_mod_rechnungen', 'getFilePath', array($this->view['data']['id'], true)).'G'.$r['gnr'].'.pdf';
|
|
|
113 |
}
|
1093 |
daniel |
114 |
|
5720 |
daniel |
115 |
?>
|
1093 |
daniel |
116 |
|
7553 |
daniel |
117 |
<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
|
|
|
118 |
|
|
|
119 |
echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_rechnungen&noheader=1&action=ajax&edit_id='.$this->view['data']['id'].'&r_id='.$r['id'].'&do=copy', 'wpsg-mod_invoice-order_ajax-copy-'.$this->view['data']['id']);
|
5720 |
daniel |
120 |
|
7553 |
daniel |
121 |
?>"><?php echo ' '.__("Kopie senden", "wpsg"); ?></a>
|
|
|
122 |
<a target="_blank" href="<?php
|
|
|
123 |
|
7580 |
daniel |
124 |
echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&noheader=1&mod=wpsg_mod_rechnungen&do=getRechnung&edit_id='.$this->view['data']['id'].'&r_id='.$r['id'], 'wpsg-mod_invoice-order_ajax-getRechnung-'.$r['id']);
|
7553 |
daniel |
125 |
|
|
|
126 |
?>"><?php echo __("Ansehen", "wpsg"); ?></a>
|
|
|
127 |
|
5720 |
daniel |
128 |
</td>
|
|
|
129 |
</tr>
|
|
|
130 |
<?php } ?>
|
|
|
131 |
</table>
|
|
|
132 |
<br />
|
|
|
133 |
<?php } ?>
|
|
|
134 |
|
|
|
135 |
<?php if (sizeof($this->view['mod_rechnungen']['arRechnungen']) > 0 && sizeof($this->view['mod_rechnungen']['arRechnungen_gesamt']) != sizeof($this->view['mod_rechnungen']['arRechnungen_storno'])) { ?>
|
6367 |
hartmut |
136 |
<fieldset style="border:0px solid #999999; width:100%;">
|
|
|
137 |
<legend ><?php echo __("Bestellstorno: Rechnungskorrektur erstellen", "wpsg"); ?></legend>
|
5720 |
daniel |
138 |
<div style="padding:10px;">
|
|
|
139 |
<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">
|
7553 |
daniel |
140 |
|
|
|
141 |
<?php \wp_nonce_field('wpsg-mod_invoice-order_ajax-storno-'.$this->view['data']['id']); ?>
|
|
|
142 |
|
5720 |
daniel |
143 |
<input type="hidden" name="send" value="1" />
|
|
|
144 |
|
|
|
145 |
<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 />
|
|
|
146 |
<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 />
|
|
|
147 |
<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 />
|
|
|
148 |
|
|
|
149 |
<div id="wpsg_mod_rechnungen_fee_layer" style="display:none;">
|
|
|
150 |
<?php echo wpsg_drawForm_Input('wpsg_mod_rechnungen_fee', __('Gebühr für Rechnungskorrektur', 'wpsg'), ''); ?>
|
|
|
151 |
</div>
|
|
|
152 |
|
|
|
153 |
<div class="wpsg_clear"></div><br />
|
|
|
154 |
|
7899 |
daniel |
155 |
<br />
|
|
|
156 |
|
|
|
157 |
<?php echo wpsg_drawForm_Select('wpsg_mod_rechnungen_new_state', __('Neuer Bestellstatus', 'wpsg'), ['-1' => __('Keine Änderung', 'wpsg')] + $this->arStatus, wpsg_ShopController::STATUS_STORNIERT); ?>
|
|
|
158 |
|
|
|
159 |
<br />
|
|
|
160 |
|
5720 |
daniel |
161 |
<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;" />
|
|
|
162 |
<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;" />
|
|
|
163 |
|
|
|
164 |
<script type="text/javascript">
|
|
|
165 |
|
|
|
166 |
jQuery(document).ready(function() {
|
|
|
167 |
|
7899 |
daniel |
168 |
jQuery("[name=wpsg_rechnungen_gutschrift]").filter("[value=" + jQuery.cookie("wpsg_rechnungen_stornoradio") + "]").prop("checked","checked");
|
5720 |
daniel |
169 |
|
|
|
170 |
jQuery("#wpsg_rechnungen_stornobutton").bind("click", function() {
|
|
|
171 |
|
7899 |
daniel |
172 |
if (jQuery("#wpsg_rechnungen_gutschrift1").prop("checked") || jQuery("#wpsg_rechnungen_gutschrift2").prop("checked"))
|
5720 |
daniel |
173 |
{
|
|
|
174 |
|
|
|
175 |
//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");
|
|
|
176 |
jQuery("#storno_form").attr("target", "_blank");
|
|
|
177 |
|
|
|
178 |
window.setTimeout(function() {
|
7580 |
daniel |
179 |
location.href = "<?php
|
|
|
180 |
|
|
|
181 |
echo wpsg_admin_url('Order', 'view', ['edit_id' => $this->view['data']['id']]);
|
|
|
182 |
|
|
|
183 |
?>";
|
5720 |
daniel |
184 |
}, 1500);
|
|
|
185 |
|
|
|
186 |
}
|
|
|
187 |
else
|
|
|
188 |
{
|
|
|
189 |
|
|
|
190 |
//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");
|
|
|
191 |
jQuery("#storno_form").attr("target", "");
|
|
|
192 |
|
|
|
193 |
}
|
|
|
194 |
|
|
|
195 |
});
|
|
|
196 |
|
|
|
197 |
});
|
|
|
198 |
|
|
|
199 |
</script>
|
|
|
200 |
|
|
|
201 |
</form>
|
7899 |
daniel |
202 |
|
|
|
203 |
<div class="wpsg_clear"></div><br />
|
|
|
204 |
|
5720 |
daniel |
205 |
<div class="wpsg_hinweis"><?php echo __("Eine neue Rechnung kann erst geschrieben werden wenn alle bestehenden Rechnungen zu dieser Bestellung storniert wurden.", "wpsg"); ?></div>
|
|
|
206 |
<div class="wpsg_clear"></div>
|
|
|
207 |
</div>
|
|
|
208 |
</fieldset>
|
|
|
209 |
<?php } else { ?>
|
|
|
210 |
|
|
|
211 |
<fieldset>
|
|
|
212 |
<legend><?php echo __("Neue Rechnung", "wpsg"); ?></legend>
|
|
|
213 |
|
|
|
214 |
<div>
|
|
|
215 |
|
6453 |
thomas |
216 |
<form target="_blank" method="post" id="rechnungen_order_backend" 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']; ?>">
|
7553 |
daniel |
217 |
|
|
|
218 |
<?php \wp_nonce_field('wpsg-mod_invoice-order_ajax-rechnung-'.$this->view['data']['id']); ?>
|
|
|
219 |
|
5720 |
daniel |
220 |
<input type="hidden" name="send" value="1" />
|
|
|
221 |
|
|
|
222 |
<label style="height:25px; width:240px; float:left; margin-top:10px;">
|
|
|
223 |
<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" />
|
6081 |
hartmut |
224 |
<?php echo __("E-Mail an Kunden senden", "wpsg"); ?>
|
5720 |
daniel |
225 |
</label>
|
|
|
226 |
<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']); ?>" />
|
|
|
227 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
228 |
|
|
|
229 |
<label style="height:25px; width:240px; float:left;">
|
|
|
230 |
<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" />
|
6081 |
hartmut |
231 |
<?php echo __("Fälligkeit anzeigen", "wpsg"); ?>
|
5720 |
daniel |
232 |
</label>
|
7301 |
florian |
233 |
<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)); ?>" />
|
5720 |
daniel |
234 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
235 |
|
|
|
236 |
<label style="height:25px; width:220px; float:left;">
|
|
|
237 |
<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" />
|
6081 |
hartmut |
238 |
<?php echo __("Neuer Status", "wpsg"); ?>
|
5720 |
daniel |
239 |
</label>
|
|
|
240 |
<select style="width:300px; float:right;" id="wpsg_rechnungen_status_neu" name="wpsg_rechnungen_status_neu">
|
|
|
241 |
<?php foreach ($this->arStatus as $k => $v) { ?>
|
|
|
242 |
<option value="<?php echo $k; ?>" <?php echo (($k == 110)?'selected="selected"':''); ?>><?php echo $v; ?></option>
|
|
|
243 |
<?php } ?>
|
|
|
244 |
</select>
|
|
|
245 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
246 |
|
|
|
247 |
<label style="height:25px; width:240px; float:left;">
|
|
|
248 |
<input <?php echo (($this->get_option("wpsg_rechnungen_url_std") === "1")?'checked="checked"':''); ?> type="checkbox" value="1" name="wpsg_rechnungen_url" />
|
|
|
249 |
<?php echo __("URL Benachrichtigung", "wpsg"); ?>
|
|
|
250 |
</label>
|
|
|
251 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
252 |
|
|
|
253 |
<label style="height:25px; width:240px; float:left; padding-left:22px;">
|
6081 |
hartmut |
254 |
<?php echo __("Rechnungsdatum", "wpsg"); ?>
|
5720 |
daniel |
255 |
</label>
|
6453 |
thomas |
256 |
<input style="display:block;float:right; width:300px;" type="text" id="wpsg_rechnungen_datum" name="wpsg_rechnungen_datum" value="<?php echo date("d.m.Y", time()); ?>" />
|
5720 |
daniel |
257 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
258 |
|
|
|
259 |
<label for="wpsg_rechnungen_fusstext" style="height:25px; width:220px; padding-left:22px; float:left">
|
|
|
260 |
<?php echo __("Fußtext", "wpsg"); ?>
|
|
|
261 |
</label>
|
|
|
262 |
|
|
|
263 |
<?php
|
|
|
264 |
|
|
|
265 |
$wpsg_rechnungen_footer = $this->get_option("wpsg_rechnungen_footer");
|
7541 |
daniel |
266 |
|
5720 |
daniel |
267 |
if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = unserialize($this->get_option("wpsg_rechnungen_footer"));
|
|
|
268 |
if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = Array();
|
|
|
269 |
|
7541 |
daniel |
270 |
$default = $this->get_option('wpsg_rechnungen_foottext_standard');
|
|
|
271 |
|
5720 |
daniel |
272 |
?>
|
|
|
273 |
|
|
|
274 |
<?php if (sizeof($wpsg_rechnungen_footer) > 0) { ?>
|
|
|
275 |
<select style="width:300px; float:right;" id="wpsg_rechnungen_select" onchange="jQuery('#wpsg_rechnungen_fusstext').val(this.value);">
|
|
|
276 |
<?php foreach ($wpsg_rechnungen_footer as $k => $v) { ?>
|
7541 |
daniel |
277 |
<option value="<?php echo wpsg_hspc($v[1]); ?>" <?php echo ((intval($default) === intval($k))?'selected="selected"':''); ?>><?php echo wpsg_hspc($v[0]); ?></option>
|
5720 |
daniel |
278 |
<?php } ?>
|
|
|
279 |
</select>
|
|
|
280 |
<?php } ?>
|
|
|
281 |
|
|
|
282 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
283 |
<div style="padding-left:25px;"><input style="width:100%;" type="text" name="wpsg_rechnungen_fusstext" id="wpsg_rechnungen_fusstext" value="" /></div>
|
|
|
284 |
<div style="clear:both; width:100%; height:15px;"></div>
|
|
|
285 |
|
|
|
286 |
<script type="text/javascript">
|
|
|
287 |
|
|
|
288 |
jQuery(document).ready(function() {
|
|
|
289 |
jQuery('#wpsg_rechnungen_fusstext').val(jQuery("#wpsg_rechnungen_select").val());
|
|
|
290 |
});
|
|
|
291 |
|
|
|
292 |
</script>
|
|
|
293 |
|
7580 |
daniel |
294 |
<input class="button" style="float:right;" onclick="window.setTimeout(function() { location.href = '<?php
|
|
|
295 |
|
|
|
296 |
echo wpsg_admin_url('Order', 'view', ['edit_id' => $this->view['data']['id']]);
|
|
|
297 |
|
|
|
298 |
?>'; }, 1000);" name="wpsg_rechnungen_write" type="submit" value="<?php echo __("Rechnung schreiben", "wpsg"); ?>" />
|
5720 |
daniel |
299 |
<input class="button" style="float:right; margin-right:10px;" name="wpsg_rechnungen_preview" type="submit" value="<?php echo __("Vorschau", "wpsg"); ?>" />
|
|
|
300 |
|
|
|
301 |
<div style="clear:both; width:100%; height:5px;"></div>
|
|
|
302 |
|
|
|
303 |
</form>
|
|
|
304 |
</div>
|
|
|
305 |
</fieldset>
|
|
|
306 |
|
|
|
307 |
<?php } ?>
|
|
|
308 |
|
|
|
309 |
<?php echo wpsg_drawForm_AdminboxEnd(); ?>
|