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');
36 <%= include("/elements/header.html",'Customer package - Edit dates') %>
39 # "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
40 # 'Main Menu' => popurl(2)
44 <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
45 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
46 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
47 <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
52 my($susp,$cancel,$expire)=(
53 $cust_pkg->getfield('susp'),
54 $cust_pkg->getfield('cancel'),
55 $cust_pkg->getfield('expire'),
57 my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
58 my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
59 my $otaker = $cust_pkg->getfield('otaker');
63 <FORM NAME="formname" ACTION="process/REAL_cust_pkg.cgi" METHOD="POST">
64 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%= $pkgnum %>">
67 <FONT SIZE="+1" COLOR="#ff0000">Error: <%= $error %></FONT>
72 #my $format = "%c %z (%Z)";
73 my $format = "%m/%d/%Y %T %z (%Z)";
75 #false laziness w/view/cust_main/packages.html
76 #my( $billed_or_prepaid,
77 my( $last_bill_or_renewed, $next_bill_or_prepaid_until );
78 unless ( $part_pkg->is_prepaid ) {
79 #$billed_or_prepaid = 'billed';
80 $last_bill_or_renewed = 'Last bill';
81 $next_bill_or_prepaid_until = 'Next bill';
83 #$billed_or_prepaid = 'prepaid';
84 $last_bill_or_renewed = 'Renewed';
85 $next_bill_or_prepaid_until = 'Prepaid until';
90 <%= ntable("#cccccc",2) %>
93 <TD ALIGN="right">Package number</TD>
94 <TD BGCOLOR="#ffffff"><%= $pkgnum %></TD>
98 <TD ALIGN="right">Package</TD>
99 <TD BGCOLOR="#ffffff"><%= $pkg %></TD>
103 <TD ALIGN="right">Comment</TD>
104 <TD BGCOLOR="#ffffff"><%= $comment %></TD>
108 <TD ALIGN="right">Order taker</TD>
109 <TD BGCOLOR="#ffffff"><%= $otaker %></TD>
113 <TD ALIGN="right">Setup date</TD>
115 <INPUT TYPE="text" NAME="setup" SIZE=32 ID="setup_text" VALUE="<%= ( $setup ? time2str($format, $setup) : "" ) %>">
116 <IMG SRC="../images/calendar.png" ID="setup_button" STYLE="cursor: pointer" TITLE="Select date">
121 <TD ALIGN="right"><%= $last_bill_or_renewed %> date</TD>
123 <INPUT TYPE="text" NAME="last_bill" SIZE=32 ID="last_bill_text" VALUE="<%= ( $cust_pkg->last_bill ? time2str($format, $cust_pkg->last_bill) : "" ) %>">
124 <IMG SRC="../images/calendar.png" ID="last_bill_button" STYLE="cursor: pointer" TITLE="Select date">
129 <TD ALIGN="right"><%= $next_bill_or_prepaid_until %> date</TD>
131 <INPUT TYPE="text" NAME="bill" SIZE=32 ID="bill_text" VALUE="<%= ( $bill ? time2str($format, $bill) : "" ) %>">
132 <IMG SRC="../images/calendar.png" ID="bill_button" STYLE="cursor: pointer" TITLE="Select date">
138 <TD ALIGN="right">Suspension date</TD>
139 <TD BGCOLOR="#ffffff"><%= time2str($format, $susp) %></TD>
144 <TD ALIGN="right">Expiration date</TD>
146 <INPUT TYPE="text" NAME="expire" SIZE=32 ID="expire_text" VALUE="<%= ( $expire ? time2str($format, $expire) : "" ) %>">
147 <IMG SRC="../images/calendar.png" ID="expire_button" STYLE="cursor: pointer" TITLE="Select date">
148 <BR><FONT SIZE=-1>(will <b>cancel</b> this package when the date is reached)</FONT>
152 <% if ( $cancel ) { %>
154 <TD ALIGN="right">Cancellation date</TD>
155 <TD BGCOLOR="#ffffff"><%= time2str($format, $cancel) %></TD>
161 <SCRIPT TYPE="text/javascript">
163 my @cal = qw( setup bill expire );
164 push @cal, 'last_bill'
165 if $cust_pkg->dbdef_table->column('last_bill');
166 foreach my $cal (@cal) {
169 inputField: "<%= $cal %>_text",
170 ifFormat: "%m/%d/%Y",
171 button: "<%= $cal %>_button",
176 <BR><INPUT TYPE="submit" VALUE="Apply Changes">