5 %my($susp,$adjourn,$cancel,$expire, $pkg, $comment, $setup, $bill, $otaker);
7 %my( $cust_pkg, $part_pkg );
9 %if ( $cgi->param('error') ) {
10 % $error = $cgi->param('error');
11 % $pkgnum = $cgi->param('pkgnum');
12 % if ( $error eq '_bill_areyousure' ) {
13 % my $bill = $cgi->param('bill');
14 % $error = "You are attempting to set the next bill date to $bill, which is
15 % in the past. This will charge the customer for the interval
16 % from $bill until now. Are you sure you want to do this? ".
17 % '<INPUT TYPE="checkbox" NAME="bill_areyousure" VALUE="1">';
20 % $susp = $cgi->param('susp');
21 % $adjourn = $cgi->param('adjourn');
22 % $cancel = $cgi->param('cancel');
23 % $expire = $cgi->param('expire');
24 % $pkg = $cgi->param('pkg');
25 % $comment = $cgi->param('comment');
26 % $setup = $cgi->param('setup');
27 % $bill = $cgi->param('bill');
28 % $otaker = $cgi->param('otaker');
31 % $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
32 % die "No package!" unless $cust_pkg;
33 % $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
36 % my($query) = $cgi->keywords;
37 % $query =~ /^(\d+)$/ or die "no pkgnum";
41 % $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
42 % die "No package!" unless $cust_pkg;
43 % $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
45 % ($susp,$adjourn,$cancel,$expire)=(
46 % $cust_pkg->getfield('susp'),
47 % $cust_pkg->getfield('adjourn'),
48 % $cust_pkg->getfield('cancel'),
49 % $cust_pkg->getfield('expire'),
51 % ($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
52 % ($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
53 % $otaker = $cust_pkg->getfield('otaker');
57 % #$cust_pkg->$_(str2time($cgi->param($_)) foreach qw(setup bill);
58 % $cust_pkg->setup(str2time($cgi->param('setup')));
59 % $cust_pkg->bill(str2time($cgi->param('bill')));
60 % $cust_pkg->last_bill(str2time($cgi->param('last_bill')));
63 %#my $custnum = $cust_pkg->getfield('custnum');
67 <% include("/elements/header.html",'Customer package - Edit dates') %>
70 %# "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
71 %# 'Main Menu' => popurl(2)
76 <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
77 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
78 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
79 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
81 <FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">
82 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
85 <FONT SIZE="+1" COLOR="#ff0000">Error: <% $error %></FONT>
89 %#my $format = "%c %z (%Z)";
90 %my $format = "%m/%d/%Y %T %z (%Z)";
92 %#false laziness w/view/cust_main/packages.html
93 %#my( $billed_or_prepaid,
94 %my( $last_bill_or_renewed, $next_bill_or_prepaid_until );
95 %unless ( $part_pkg->is_prepaid ) {
96 % #$billed_or_prepaid = 'billed';
97 % $last_bill_or_renewed = 'Last bill';
98 % $next_bill_or_prepaid_until = 'Next bill';
100 % #$billed_or_prepaid = 'prepaid';
101 % $last_bill_or_renewed = 'Renewed';
102 % $next_bill_or_prepaid_until = 'Prepaid until';
108 <% ntable("#cccccc",2) %>
111 <TD ALIGN="right">Package number</TD>
112 <TD BGCOLOR="#ffffff"><% $pkgnum %></TD>
116 <TD ALIGN="right">Package</TD>
117 <TD BGCOLOR="#ffffff"><% $pkg %></TD>
121 <TD ALIGN="right">Comment</TD>
122 <TD BGCOLOR="#ffffff"><% $comment %></TD>
126 <TD ALIGN="right">Order taker</TD>
127 <TD BGCOLOR="#ffffff"><% $otaker %></TD>
131 <TD ALIGN="right">Setup date</TD>
133 <INPUT TYPE="text" NAME="setup" SIZE=32 ID="setup_text" VALUE="<% ( $setup ? time2str($format, $setup) : "" ) %>">
134 <IMG SRC="../images/calendar.png" ID="setup_button" STYLE="cursor: pointer" TITLE="Select date">
139 <TD ALIGN="right"><% $last_bill_or_renewed %> date</TD>
141 <INPUT TYPE="text" NAME="last_bill" SIZE=32 ID="last_bill_text" VALUE="<% ( $cust_pkg->last_bill ? time2str($format, $cust_pkg->last_bill) : "" ) %>">
142 <IMG SRC="../images/calendar.png" ID="last_bill_button" STYLE="cursor: pointer" TITLE="Select date">
147 <TD ALIGN="right"><% $next_bill_or_prepaid_until %> date</TD>
149 <INPUT TYPE="text" NAME="bill" SIZE=32 ID="bill_text" VALUE="<% ( $bill ? time2str($format, $bill) : "" ) %>">
150 <IMG SRC="../images/calendar.png" ID="bill_button" STYLE="cursor: pointer" TITLE="Select date">
154 <TD ALIGN="right">Adjournment date</TD>
156 <INPUT TYPE="text" NAME="adjourn" SIZE=32 ID="adjourn_text" VALUE="<% ( $adjourn ? time2str($format, $adjourn) : "" ) %>">
157 <IMG SRC="../images/calendar.png" ID="adjourn_button" STYLE="cursor: pointer" TITLE="Select date">
158 <BR><FONT SIZE=-1>(will <b>suspend</b> this package when the date is reached)</FONT>
164 <TD ALIGN="right">Suspension date</TD>
165 <TD BGCOLOR="#ffffff"><% time2str($format, $susp) %></TD>
171 <TD ALIGN="right">Expiration date</TD>
173 <INPUT TYPE="text" NAME="expire" SIZE=32 ID="expire_text" VALUE="<% ( $expire ? time2str($format, $expire) : "" ) %>">
174 <IMG SRC="../images/calendar.png" ID="expire_button" STYLE="cursor: pointer" TITLE="Select date">
175 <BR><FONT SIZE=-1>(will <b>cancel</b> this package when the date is reached)</FONT>
181 <TD ALIGN="right">Cancellation date</TD>
182 <TD BGCOLOR="#ffffff"><% time2str($format, $cancel) %></TD>
189 <SCRIPT TYPE="text/javascript">
191 % my @cal = qw( setup bill expire );
192 % push @cal, 'last_bill'
193 % if $cust_pkg->dbdef_table->column('last_bill');
194 % foreach my $cal (@cal) {
198 inputField: "<% $cal %>_text",
199 ifFormat: "%m/%d/%Y",
200 button: "<% $cal %>_button",
206 <BR><INPUT TYPE="submit" VALUE="Apply Changes">