# only for figuring next bill date, nothing else, so, reset $sdate again
# here
$sdate = $cust_pkg->bill || $cust_pkg->setup || $time;
+ $cust_pkg->last_bill($sdate)
+ if $cust_pkg->dbdef_table->column('last_bill');
$mon += $part_pkg->freq;
until ( $mon < 12 ) { $mon -= 12; $year++; }
sub last_bill {
my $self = shift;
+ if ( $self->dbdef_table->column('manual_flag') ) {
+ return $self->setfield('last_bill', $_[1]) if @_;
+ return $self->getfield('last_bill') if $self->getfield('last_bill');
+ }
my $cust_bill_pkg = qsearchs('cust_bill_pkg', { 'pkgnum' => $self->pkgnum,
'edate' => $self->bill, } );
$cust_bill_pkg ? $cust_bill_pkg->sdate : $self->setup || 0;
-freeside (1.3.1-1) unstable; urgency=low
+freeside (1.4.1-1) unstable; urgency=low
* Initial Release.
Package: freeside
Architecture: any
Depends: freeside-lib
-Recommends: freeside-doc, freeside-ui-webui, libterm-query-perl
-Suggests: freeside-passwd-server, freeside-signup-server, freeside-session-server
+Recommends: freeside-doc, freeside-ui-web, libterm-query-perl
+Suggests: freeside-passwd-server, freeside-signup-server, freeside-session-server, freeside-selfservice-server
Description: Billing and administration package for ISPs.
Freeside is a billing and account administration package for ISPs. It stores
customer information in an SQL database, and will update UNIX passwd and
- shadow files, and configuration for sendmail, qmail, BIND and/or Apache.
- It is also useful as a central database of accounts/domains/web-space
- for a large number of machines.
+ shadow files, RADIUS users file and SQL databases, and configuration for
+ sendmail, qmail, BIND and/or Apache. It is also useful as a central database
+ of accounts/domains/web-space for a large number of machines.
Package: freeside-doc
Architecture: all
Package: freeside-lib
Architecture: all
-Depends: libdigest-md5-perl, liburi-perl, libhtml-parser-perl, libnet-perl, liblocale-codes-perl, libnet-whois-perl, libwww-perl, libbusiness-creditcard-perl, mailtools, libtimedate-perl, libdate-manip-perl, libfile-counterfile-perl, libfreezethaw-perl, libtext-template-perl, libdbd-pg-perl
+Depends: libmime-base64-perl, libdigest-md5-perl, liburi-perl, libhtml-tagset-perl, libhtml-parser-perl, libnet-perl, liblocale-codes-perl, libnet-whois-perl, libwww-perl, libbusiness-creditcard-perl, libmailtools-perl, libtimedate-perl, libdate-manip-perl, libfile-counterfile-perl, libfreezethaw-perl, libtext-template-perl, libdbd-pg-perl, libdbix-datasource-perl, libdbix-dbschema-perl, libnet-ssh-perl, libnet-scp-perl, libapache-asp-perl, libtie-ixhash-perl, libtime-duration-perl, libhtml-widgets-selectlayers-perl, libstorable-perl, libapache-dbi-perl
Description: Freeside libraries and extension API
This package contains the libraries which implement the business logic and
backend functions of Freeside, a billing and account administration package
Package: freeside-session-client
Architecture: all
Depends: ssh
+Description:
+ <rar>
+
+Package: freeside-selfservice-server
+Architecture: all
+Depends:
+Description:
+ <rar>
+
+
<!-- mason kludge -->
<%
-# <!-- $Id: REAL_cust_pkg.cgi,v 1.4 2002-07-08 13:07:40 ivan Exp $ -->
+# <!-- $Id: REAL_cust_pkg.cgi,v 1.4.4.1 2003-04-01 01:22:31 ivan Exp $ -->
my $error ='';
my $pkgnum = '';
$otaker, '</TD></TR>',
'<TR><TD ALIGN="right">Setup date</TD><TD>'.
'<INPUT TYPE="text" NAME="setup" SIZE=32 VALUE="',
- ( $setup ? time2str("%c %z (%Z)",$setup) : "" ), '"></TD></TR>',
- '<TR><TD ALIGN="right">Next bill date</TD><TD>',
+ ( $setup ? time2str("%c %z (%Z)",$setup) : "" ), '"></TD></TR>';
+
+print '<TR><TD ALIGN="right">Last bill date</TD><TD>',
+ '<INPUT TYPE="text" NAME="last_bill" SIZE=32 VALUE="',
+ ( $cust_pkg->last_bill
+ ? time2str("%c %z (%Z)", $cust_pkg->last_bill)
+ : "" ),
+ '"></TD></TR>'
+ if $cust_pkg->dbdef_table->column('last_bill');
+
+print '<TR><TD ALIGN="right">Next bill date</TD><TD>',
'<INPUT TYPE="text" NAME="bill" SIZE=32 VALUE="',
- ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '"></TD></TR>',
-;
+ ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '"></TD></TR>';
print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
time2str("%D",$susp), '</TD></TR>'
my %hash = $old->hash;
$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : '';
$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : '';
+$hash{'last_bill'} =
+ $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : '';
$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : '';
my $new = new FS::cust_pkg \%hash;
<TR>
<TH>Package</TH>
<TH><FONT SIZE=-1>Setup</FONT></TH>
+END
+
+ print '<TH><FONT SIZE=-1>Next<BR>bill</FONT></TH>'
+ if defined dbdef->table('cust_pkg')->column('last_bill');
+
+ print <<END;
<TH><FONT SIZE=-1>Next<BR>bill</FONT></TH>
<TH><FONT SIZE=-1>Susp.</FONT></TH>
<TH><FONT SIZE=-1>Expire</FONT></TH>
<TH>company</TH>
END
-if ( defined dbdef->table('cust_main')->column('ship_last') ) {
- print <<END;
- <TH>(service) name</TH>
- <TH>company</TH>
-END
-}
+ print '<TH>(service) name</TH><TH>company</TH>'
+ if defined dbdef->table('cust_main')->column('ship_last');
-print <<END;
- <TH COLSPAN=2>Services</TH>
- </TR>
-END
+ print '<TH COLSPAN=2>Services</TH></TR>';
my $n1 = '<TR>';
my(%saw,$cust_pkg);
$cust_main ? $cust_main->first : '',
$cust_main ? $cust_main->company : '',
);
+
+ my $last_bill = $cust_pkg->getfield('last_bill')
+ ? time2str("%D", $cust_pkg->getfield('last_bill') )
+ : ''
+ if defined dbdef->table('cust_pkg')->column('last_bill');
+
my($ship_last, $ship_first, $ship_company);
if ( defined dbdef->table('cust_main')->column('ship_last') ) {
($ship_last, $ship_first, $ship_company) = (
print $n1, <<END;
<TD ROWSPAN=$rowspan><A HREF="${p}view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum - $pkg</FONT></A></TD>
<TD ROWSPAN=$rowspan>$setup</TD>
+END
+
+ print "<TD ROWSPAN=$rowspan>$last_bill</TD>"
+ if defined dbdef->table('cust_pkg')->column('last_bill');
+
+ print <<END;
<TD ROWSPAN=$rowspan>$bill</TD>
<TD ROWSPAN=$rowspan>$susp</TD>
<TD ROWSPAN=$rowspan>$expire</TD>
#display packages
-#formatting
-print qq!!, &table(), "\n",
- qq!<TR><TH COLSPAN=2 ROWSPAN=2>Package</TH><TH COLSPAN=5>!,
- qq!Dates</TH><TH COLSPAN=2 ROWSPAN=2>Services</TH></TR>\n!,
- qq!<TR><TH><FONT SIZE=-1>Setup</FONT></TH><TH>!,
- qq!<FONT SIZE=-1>Next bill</FONT>!,
- qq!</TH><TH><FONT SIZE=-1>Susp.</FONT></TH><TH><FONT SIZE=-1>Expire!,
- qq!</FONT></TH>!,
- qq!<TH><FONT SIZE=-1>Cancel</FONT></TH>!,
- qq!</TR>\n!;
-
#get package info
my @packages;
if ( $conf->exists('hidecancelledpackages') ) {
@packages = sort { $a->pkgnum <=> $b->pkgnum } ($cust_main->all_pkgs);
}
+if ( @packages ) {
+ #formatting
+ print &table(), "\n",
+ qq!<TR><TH COLSPAN=2 ROWSPAN=2>Package</TH><TH COLSPAN=5>!,
+ qq!Dates</TH><TH COLSPAN=2 ROWSPAN=2>Services</TH></TR>\n<TR>!,
+ qq!<TH><FONT SIZE=-1>Setup</FONT></TH>!;
+
+ print qq!<TH><FONT SIZE=-1>Last bill</FONT></TH>!
+ if $packages[0]->dbdef_table->column('last_bill');
+
+ print qq!<TH><FONT SIZE=-1>Next bill</FONT></TH>!,
+ qq!<TH><FONT SIZE=-1>Susp.</FONT></TH>!,
+ qq!<TH><FONT SIZE=-1>Expire!</FONT></TH>!,
+ qq!<TH><FONT SIZE=-1>Cancel</FONT></TH>!,
+ qq!</TR>\n!;
+}
+
my $n1 = '<TR>';
foreach my $package (@packages) {
my $pkgnum = $package->pkgnum;
}
print '</FONT></TD>';
- for ( qw( setup bill susp expire cancel ) ) {
+ my @fields = qw( setup );
+ push @fields, qw( last_bill ) if $package->dbdef_table->column('last_bill');
+ push @fields, qw( bill susp expire cancel);
+
+ for ( @fields ) {
print "<TD ROWSPAN=$rowspan><FONT SIZE=-1>", ( $package->getfield($_)
? time2str("%D</FONT><BR><FONT SIZE=-3>%l:%M:%S%P %z</FONT>",
$package->getfield($_) )
#formatting
print "</TABLE>";
+
print <<END;
<SCRIPT>
function cust_pay_areyousure(href) {
'<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
$comment, '</TD></TR>',
'<TR><TD ALIGN="right">Setup date</TD><TD BGCOLOR="#ffffff">',
- ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '</TD></TR>',
- '<TR><TD ALIGN="right">Next bill date</TD><TD BGCOLOR="#ffffff">',
- ( $bill ? time2str("%D",$bill) : " " ), '</TD></TR>',
-;
+ ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '</TD></TR>';
+
+print '<TR><TD ALIGN="right">Last bill date</TD><TD BGCOLOR="#ffffff">',
+ ( $cust_pkg->last_bill ? time2str("%D",$cust_pkg->last_bill) : " " ),
+ '</TD></TR>'
+ if $cust_pkg->dbdef_table->column('last_bill');
+
+print '<TR><TD ALIGN="right">Next bill date</TD><TD BGCOLOR="#ffffff">',
+ ( $bill ? time2str("%D",$bill) : " " ), '</TD></TR>';
+
print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
time2str("%D",$susp), '</TD></TR>' if $susp;
print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
time2str("%D",$cancel), '</TD></TR>' if $cancel;
print '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
$otaker, '</TD></TR>',
- '</TABLE></TD></TR></TABLE>'
-;
+ '</TABLE></TD></TR></TABLE>';
unless ($expire) {
print <<END;