5 <& /elements/one_time_charge_link.html,
7 #one of these is required (except when form_only is true)
9 'prospectnum' => $prospectnum,
17 % unless ( $opt{form_only} ) {
19 <SCRIPT TYPE="text/javascript">
21 function taxproductmagic(which) {
24 var elements = which.form.elements;
25 for (var i = 0; i<elements.length; i++) {
27 if (elements[i].name == 'taxproductnum'){
28 document.getElementById('taxproductnum').value = elements[i].value;
31 if (elements[i].name == 'taxproductnum_description'){
35 if (str.length){str += ';';}
38 if ( elements[i].type == 'checkbox' || elements[i].type == 'radio' ) {
39 if ( elements[i].checked == true ) {
40 value = elements[i].value;
45 value = elements[i].value;
47 str += elements[i].name + '=' + escape(value);
50 document.getElementById('charge_storage').value = str;
52 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);
55 function taxproductquickchargemagic() {
56 var str = document.getElementById('charge_storage').value;
57 if (str.length){str += ';';}
58 str += 'magic=taxproductnum;taxproductnum=';
59 str += escape(document.getElementById('taxproductnum').value);
61 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 %>);
65 function taxoverridemagic(which) {
67 var elements = which.ownerDocument.QuickChargeForm.elements;
68 for (var i = 0; i<elements.length; i++) {
69 if (elements[i].name == 'tax_override'){
70 document.getElementById('tax_override').value = elements[i].value;
73 if (str.length){str += ';';}
74 str += elements[i].name + '=' + escape(elements[i].value);
76 document.getElementById('charge_storage').value = str;
78 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);
81 function taxoverridequickchargemagic() {
82 var str = document.getElementById('charge_storage').value;
83 if (str.length){str += ';';}
84 str += 'magic=taxoverride;tax_override=';
85 str += document.getElementById('tax_override').value;
87 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 %>);
94 % unless ( $opt{no_form} ) {
95 <FORM NAME='quickcharge' STYLE="margin:0; padding:0; display:inline">
97 % taxproductnum tax_override charge_storage taxproductnum_description
99 <INPUT NAME="<% $_ %>" ID="<% $_ %>" TYPE="hidden">
104 % unless ( $opt{form_only} ) {
105 <& /elements/popup_link.html,
106 'action' => $p. 'edit/quick-charge.html?'. $query,
107 'label' => emt('One-time charge'),
108 'actionlabel' => emt('One-time charge'),
109 'color' => '#333399',
111 'height' => 460, #more for more room for lines of add'l description?
119 my $query = $opt{custnum} ? 'custnum='.$opt{custnum}
120 : 'prospectnum='.$opt{prospectnum};
121 $query .= ';quotationnum='.$opt{quotationnum} if $opt{quotationnum};