invoice-refund-view.php
4.52 KB
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Edit CE Hours</title>
<style type="text/css">
html, body { margin:0px; padding:0;}
.title-link {
color:#f7bd55;
font-size: 12px;
font-weight: bold;
text-align: left;
line-height: 1.75em;
background: #3b0d32;
border: solid 1px #FFF;
border-bottom: solid 1px #999;
cursor: default;
padding: 0em; padding:3px 10px 3px 10px;
margin: 0em;
}
form {
display: block;
margin-right:20px;
}
table.item-listings tr th { text-align:left; border-bottom:1px solid #ccc; }
table.item-listings tr td { text-aling:left; border-bottom:1px solid #e8e8e8; }
table.item-listings tr th,
table.item-listings tr td { padding: 4px 5px; }
.dashboard-section-title { font-weight:bold; color:#3b0d32; }
</style>
</head>
<body>
<div style="display:block; width:750px; margin-bottom:0px;">
<div class="title-link" style="display:block;color:#f7bd55; font-size: 12px;font-weight: bold;text-align: left;line-height: 1.75em; background-color: #3b0d32; border: solid 1px #FFF; border-bottom: solid 1px #999; cursor: default; padding: 0em; padding:3px 10px 3px 10px; margin: 0em;">Refund: <?php echo $invoice->post_title; ?></div>
<div style="padding:10px;">
<form id="invoice_refund_form">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="border-collapse:collapse;" class="item-listings">
<tr>
<th>Item Description</th>
<th width="140">Refund?</th>
</tr>
<?php
$items = get_post_meta($invoice->ID, 'items', true);
foreach($items as $key=>$item):
?>
<tr>
<td>
<?php
if ( isset($item['post_id']) && $item['post_id'] > 0) {
$p = get_post($item['post_id']);
echo $p->post_title;
} else {
echo $item['description'];
}
?>
</td>
<td><input type="checkbox" checked="checked" name="keys[<?php echo $key?>]" /> <span style="color:#999;font-size:11px;">(-$<?php echo number_format($item['total'], 2, ".", "");?>)</span></td>
</tr>
<?php endforeach; ?>
</table>
<div style="border-top:1px solid #ccc;padding-top:8px;margin-top:25px;">
<table cellpadding="0" cellspacing="0" width="100%" border="0" style="border-collapse:collapse;">
<tr>
<td>
<input name="force_cancellation_fee" value="on" type="checkbox" checked="checked" /> <label>Apply cancellation fee?</label>
</td>
<td width="400" style="text-align:right;">
<input type="submit" value="Apply Changes" /> <input type="button" value="Cancel Changes" id="refund_cancel_btn" />
</td>
</tr>
</table>
</div>
</form>
</div>
</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#invoice_refund_form').ajaxForm({
url: '/wp-admin/admin-ajax.php'
, data: ({ajax:"yes", action: 'issue_invoice_refund', invoice_id: <?php echo $invoice->ID?>})
, dataType: 'json'
, type: 'POST'
, success: function(data) {
if (data.success == 'true') {
document.location.href = document.location.href;
} else {
jAlert(data.msg, 'Server Error Encountered');
}
}
});
$('#refund_cancel_btn').click(function(e) {
e.preventDefault();
$.colorbox.close();
});
});
</script>
</body>
</html>