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
|
<SCRIPT TYPE="text/javascript">
function taxproductmagic(which) {
var str = '';
var elements = which.form.elements;
for (var i = 0; i<elements.length; i++) {
if (elements[i].name == 'taxproductnum'){
document.getElementById('taxproductnum').value = elements[i].value;
continue;
}
if (elements[i].name == 'taxproductnum_description'){
continue;
}
if (str.length){str += ';';}
var value = '';
if ( elements[i].type == 'checkbox' || elements[i].type == 'radio' ) {
if ( elements[i].checked == true ) {
value = elements[i].value;
//} else {
// value = '';
}
} else {
value = elements[i].value;
}
str += elements[i].name + '=' + escape(value);
}
document.getElementById('charge_storage').value = str;
cClick();
overlib( OLiframeContent('<% $p %>/browse/part_pkg_taxproduct.cgi?_type=select&id=taxproductnum&onclick=taxproductquickchargemagic&taxproductnum='+document.getElementById('taxproductnum').value, 1000, 400, 'tax_product_popup'), CAPTION, 'Select product', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK);
}
function taxproductquickchargemagic() {
var str = document.getElementById('charge_storage').value;
if (str.length){str += ';';}
str += 'magic=taxproductnum;taxproductnum=';
str += escape(document.getElementById('taxproductnum').value);
cClick();
overlib( OLiframeContent('<% $p %>/edit/quick-charge.html?'+str, 545, 336, 'One-time charge'), CAPTION, 'One-time charge', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '#333399', CGCOLOR, '#333399', CLOSETEXT, <% mt('Close') |js_string %>);
}
function taxoverridemagic(which) {
var str = '';
var elements = which.ownerDocument.QuickChargeForm.elements;
for (var i = 0; i<elements.length; i++) {
if (elements[i].name == 'tax_override'){
document.getElementById('tax_override').value = elements[i].value;
continue;
}
if (str.length){str += ';';}
str += elements[i].name + '=' + escape(elements[i].value);
}
document.getElementById('charge_storage').value = str;
cClick();
overlib( OLiframeContent('<% $p %>/edit/part_pkg_taxoverride.html?element_name=tax_override;onclick=taxoverridequickchargemagic;selected='+document.getElementById('tax_override').value, 1100, 600, 'tax_product_popup'), CAPTION, 'Edit product tax overrides', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK);
}
function taxoverridequickchargemagic() {
var str = document.getElementById('charge_storage').value;
if (str.length){str += ';';}
str += 'magic=taxoverride;tax_override=';
str += document.getElementById('tax_override').value;
cClick();
overlib( OLiframeContent('<% $p %>/edit/quick-charge.html?'+str, 545, 336, 'One-time charge'), CAPTION, 'One-time charge', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '#333399', CGCOLOR, '#333399', CLOSETEXT, <% mt('Close') |js_string %>);
}
</SCRIPT>
<FORM NAME='quickcharge' STYLE="margin:0; padding:0; display:inline"><INPUT NAME="taxproductnum" ID="taxproductnum" TYPE="hidden"><INPUT NAME="tax_override" ID="tax_override" TYPE="hidden"><INPUT NAME="charge_storage" ID="charge_storage" TYPE="hidden"><INPUT NAME="taxproductnum_description" ID="taxproductnum_description" TYPE="hidden"></FORM>
<% include('/elements/popup_link.html', {
'action' => $p.'edit/quick-charge.html?custnum='. $cust_main->custnum,
'label' => emt('One-time charge'),
'actionlabel' => emt('One-time charge'),
'color' => '#333399',
'width' => 763,
'height' => 460, #more for more room for lines of add'l description?
})
%>
<%init>
my($cust_main) = @_;
</%init>
|