-<& /elements/header-popup.html, mt('One-time charge'), '',
- ( $cgi->param('error') ? '' : 'onload="addRow()"' ),
+% if ( $quotationnum && ! $cust_main ) {
+<& /elements/header.html, mt('Quotation #[_1]: add one-time charge', $quotationnum) &>
+% } else {
+<& /elements/header-cust_main.html,
+ view => $quotationnum ? 'quotations' : 'packages',
+ cust_main => $cust_main,
+ etc => $cgi->param('error') ? '' : 'onload="addRow()"',
&>
+<h2><% $quotationnum
+ ? emt('Quotation #[_1]: add one-time charge', $quotationnum)
+ : mt('One-time charge')
+ %></h2>
+% }
-<LINK REL="stylesheet" TYPE="text/css" HREF="<%$fsurl%>elements/calendar-win2k-2.css" TITLE="win2k-2">
-<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar_stripped.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-en.js"></SCRIPT>
-<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/calendar-setup.js"></SCRIPT>
+<& /elements/init_calendar.html &>
+<SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/xregexp-all.js"></SCRIPT>
<& /elements/error.html &>
function validate_quick_charge () {
var pkg = document.QuickChargeForm.pkg.value;
- var pkg_regex = /^([\w \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]]*)$/ ;
+ var pkg_regex = XRegExp('^([\\p{L}\\p{N} \_\!\@\#\$\%\&\(\)\+\;\:\'\"\,\.\?\/\=\\-\\[\\]]*)$');
var amount = document.QuickChargeForm.amount.value;
var amount_regex = /^\s*\$?\s*(\d*(\.?\d{1,2}))\s*$/ ;
var rval = true;
</SCRIPT>
+<P>
+% if ( $prospect_main ) {
+<& /elements/small_prospect_view.html, $prospect_main &>
+% }
+</P>
+
<FORM ACTION = "process/quick-charge.cgi"
NAME = "QuickChargeForm"
ID = "QuickChargeForm"
<INPUT TYPE="hidden" NAME="prospectnum" VALUE="<% $prospect_main ? $prospect_main->prospectnum : '' %>">
<INPUT TYPE="hidden" NAME="quotationnum" VALUE="<% $quotationnum %>">
-<TABLE ID="QuickChargeTable" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 STYLE="background-color: #cccccc">
+<TABLE ID="QuickChargeTable" CLASS="fsinnerbox">
-% if ( $cust_pkg ) {
+% if ( $cust_pkg ) { #modify one-time charge
<INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $cust_pkg->pkgnum %>">
% my $field = '/elements/tr-input-text.html';
noinit => 1,
}
&>
-% }
+
+ <& /elements/tr-checkbox.html,
+ label => emt('Invoice this charge separately'),
+ field => 'separate_bill',
+ value => 'Y',
+ curr_value => $cust_pkg->get('separate_bill'),
+ &>
+ <TR>
+ <TD ALIGN="right"><% mt('Tax exempt') |h %> </TD>
+ <TD><INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y" <% $cgi->param('setuptax') ? 'CHECKED' : '' %>></TD>
+ </TR>
+
+ <& /elements/tr-select-taxclass.html, 'curr_value' => $part_pkg->get('taxclass') &>
+
+ <& /elements/tr-select-taxproduct.html,
+ 'label' => emt('Tax product'),
+ 'curr_value' => $part_pkg->get('taxproductnum')
+ &>
+% }
% } else { # new one-time charge
<TR>
- <TD ALIGN="right"><% mt('Amount to charge') |h %> </TD>
+ <TH ALIGN="right"><% mt('Amount to charge') |h %> </TH>
<TD>
<% $money_char %><INPUT TYPE = "text"
NAME = "amount"
% if ( $conf->exists('invoice-unitprice') ) {
<TR>
- <TD ALIGN="right"><% mt('Quantity') |h %> </TD>
+ <TH ALIGN="right"><% mt('Quantity') |h %> </TH>
<TD>
<INPUT TYPE = "text"
NAME = "quantity"
% unless ( $quotationnum ) {
<TR>
- <TD ALIGN="right"><% mt('Invoice now') |h %></TD>
+ <TH ALIGN="right"><% mt('Invoice now') |h %></TH>
<TD>
<INPUT TYPE = "checkbox"
NAME = "bill_now"
% # false laziness w/misc/order_pkg.html
<TR>
- <TD ALIGN="right"><% mt('Charge date') |h %> </TD>
+ <TH ALIGN="right"><% mt('Charge date') |h %> </TH>
<TD>
<INPUT TYPE = "text"
NAME = "start_date"
});
</SCRIPT>
+<& /elements/tr-checkbox.html,
+ label => emt('Invoice this charge separately'),
+ field => 'separate_bill',
+ value => 'Y'
+&>
+
% }
% if ( ! $quotationnum && $cust_main->payby =~ /^(CARD|CHEK)$/ ) {
% }
<TR>
- <TD ALIGN="right"><% mt('Tax exempt') |h %> </TD>
+ <TH ALIGN="right"><% mt('Tax exempt') |h %> </TH>
<TD><INPUT TYPE="checkbox" NAME="setuptax" VALUE="Y" <% $cgi->param('setuptax') ? 'CHECKED' : '' %>></TD>
</TR>
-<& /elements/tr-select-taxclass.html, 'curr_value' => $cgi->param('taxclass') &>
+<& /elements/tr-select-taxclass.html, 'curr_value' => scalar($cgi->param('taxclass')) &>
-<& /elements/tr-select-taxproduct.html, 'label' => emt('Tax product'), 'onclick' => 'parent.taxproductmagic(this);', 'curr_value' => $cgi->param('taxproductnum') &>
+<& /elements/tr-select-taxproduct.html,
+ 'label' => emt('Tax product'),
+ 'curr_value' => scalar($cgi->param('taxproductnum')),
+&>
-<& /elements/tr-select-taxoverride.html, 'onclick' => 'parent.taxoverridemagic(this);', 'curr_value' => $cgi->param('tax_override') &>
+<& /elements/tr-select-taxoverride.html,
+ 'curr_value' => scalar($cgi->param('tax_override')),
+&>
% } # if !$cust_pkg
<TR>
- <TD ALIGN="right"><% mt('Description') |h %> </TD>
+ <TH ALIGN="right"><% mt('Description') |h %> </TH>
<TD>
<INPUT TYPE = "text"
NAME = "pkg"
</TD>
</TR>
+% my $row = 0;
+% # quotation details are handled by quotation_pkg_detail records, added via link from view/quotation.html
+% # the details below get attached to the part_pkg record, and there's no way to edit that from quotations
+% unless ($quotationnum) {
<TR>
<TD></TD>
<TD><FONT SIZE="-1"><% mt('Optional additional description (also printed on invoice):') |h %> </FONT></TD>
</TR>
-% my $row = 0;
-% foreach (@description) {
+% foreach (@description) {
<TR>
<TD></TD>
<TD>
>
</TD>
</TR>
-% $row++;
-% }
+% $row++;
+% }
+% }
</TABLE>
</SCRIPT>
-</BODY>
-</HTML>
+%my %footer_args = (
+% formvalidation => {
+% QuickChargeForm => {
+% validate_fields => {
+% quantity => 'digits: true, min: 1, required: true',
+% },
+% },
+% },
+%);
+% if ( $quotationnum ) {
+ <& /elements/footer.html, %footer_args &>
+% } else {
+ <& /elements/footer-cust_main.html, %footer_args &>
+% }
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;