5 %if ( $cgi->param('error') ) {
6 % $error = $cgi->param('error');
7 % $pkgnum = $cgi->param('pkgnum');
8 % if ( $error eq '_bill_areyousure' ) {
9 % my $bill = $cgi->param('bill');
10 % $error = "You are attempting to set the next bill date to $bill, which is
11 % in the past. This will charge the customer for the interval
12 % from $bill until now. Are you sure you want to do this? ".
13 % '<INPUT TYPE="checkbox" NAME="bill_areyousure" VALUE="1">';
16 % my($query) = $cgi->keywords;
17 % $query =~ /^(\d+)$/ or die "no pkgnum";
22 %my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
23 %die "No package!" unless $cust_pkg;
24 %my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
27 % #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill);
28 % $cust_pkg->setup(str2time($cgi->param('setup')));
29 % $cust_pkg->bill(str2time($cgi->param('bill')));
30 % $cust_pkg->last_bill(str2time($cgi->param('last_bill')));
33 %#my $custnum = $cust_pkg->getfield('custnum');
37 <% include("/elements/header.html",'Customer package - Edit dates') %>
40 %# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
41 %# 'Main Menu' => popurl(2)
46 <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
47 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
48 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
49 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
53 %my($susp,$cancel,$expire)=(
54 % $cust_pkg->getfield('susp'),
55 % $cust_pkg->getfield('cancel'),
56 % $cust_pkg->getfield('expire'),
58 %my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
59 %my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
60 %my $otaker = $cust_pkg->getfield('otaker');
65 <FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">
66 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
69 <FONT SIZE="+1" COLOR="#ff0000">Error: <% $error %></FONT>
73 %#my $format = "%c %z (%Z)";
74 %my $format = "%m/%d/%Y %T %z (%Z)";
76 %#false laziness w/view/cust_main/packages.html
77 %#my( $billed_or_prepaid,
78 %my( $last_bill_or_renewed, $next_bill_or_prepaid_until );
79 %unless ( $part_pkg->is_prepaid ) {
80 % #$billed_or_prepaid = 'billed';
81 % $last_bill_or_renewed = 'Last bill';
82 % $next_bill_or_prepaid_until = 'Next bill';
84 % #$billed_or_prepaid = 'prepaid';
85 % $last_bill_or_renewed = 'Renewed';
86 % $next_bill_or_prepaid_until = 'Prepaid until';
92 <% ntable("#cccccc",2) %>
95 <TD ALIGN="right">Package number</TD>
96 <TD BGCOLOR="#ffffff"><% $pkgnum %></TD>
100 <TD ALIGN="right">Package</TD>
101 <TD BGCOLOR="#ffffff"><% $pkg %></TD>
105 <TD ALIGN="right">Comment</TD>
106 <TD BGCOLOR="#ffffff"><% $comment %></TD>
110 <TD ALIGN="right">Order taker</TD>
111 <TD BGCOLOR="#ffffff"><% $otaker %></TD>
115 <TD ALIGN="right">Setup date</TD>
117 <INPUT TYPE="text" NAME="setup" SIZE=32 ID="setup_text" VALUE="<% ( $setup ? time2str($format, $setup) : "" ) %>">
118 <IMG SRC="../images/calendar.png" ID="setup_button" STYLE="cursor: pointer" TITLE="Select date">
123 <TD ALIGN="right"><% $last_bill_or_renewed %> date</TD>
125 <INPUT TYPE="text" NAME="last_bill" SIZE=32 ID="last_bill_text" VALUE="<% ( $cust_pkg->last_bill ? time2str($format, $cust_pkg->last_bill) : "" ) %>">
126 <IMG SRC="../images/calendar.png" ID="last_bill_button" STYLE="cursor: pointer" TITLE="Select date">
131 <TD ALIGN="right"><% $next_bill_or_prepaid_until %> date</TD>
133 <INPUT TYPE="text" NAME="bill" SIZE=32 ID="bill_text" VALUE="<% ( $bill ? time2str($format, $bill) : "" ) %>">
134 <IMG SRC="../images/calendar.png" ID="bill_button" STYLE="cursor: pointer" TITLE="Select date">
140 <TD ALIGN="right">Suspension date</TD>
141 <TD BGCOLOR="#ffffff"><% time2str($format, $susp) %></TD>
147 <TD ALIGN="right">Expiration date</TD>
149 <INPUT TYPE="text" NAME="expire" SIZE=32 ID="expire_text" VALUE="<% ( $expire ? time2str($format, $expire) : "" ) %>">
150 <IMG SRC="../images/calendar.png" ID="expire_button" STYLE="cursor: pointer" TITLE="Select date">
151 <BR><FONT SIZE=-1>(will <b>cancel</b> this package when the date is reached)</FONT>
157 <TD ALIGN="right">Cancellation date</TD>
158 <TD BGCOLOR="#ffffff"><% time2str($format, $cancel) %></TD>
165 <SCRIPT TYPE="text/javascript">
167 % my @cal = qw( setup bill expire );
168 % push @cal, 'last_bill'
169 % if $cust_pkg->dbdef_table->column('last_bill');
170 % foreach my $cal (@cal) {
174 inputField: "<% $cal %>_text",
175 ifFormat: "%m/%d/%Y",
176 button: "<% $cal %>_button",
182 <BR><INPUT TYPE="submit" VALUE="Apply Changes">