From 7f089ef86f1e695fabf6b046e00f8cef14af9000 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Mar 2003 04:00:33 +0000 Subject: wide textareas --- httemplate/edit/part_export.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index bdf41e2b2..8a829e57a 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -67,7 +67,7 @@ my $widget = new HTML::Widgets::SelectLayers( } $html .= ''; } elsif ( $type eq 'textarea' ) { - $html .= qq!!; + $html .= qq!!; } elsif ( $type eq 'text' ) { $html .= qq!!; } elsif ( $type eq 'checkbox' ) { -- cgit v1.2.1 From 7f938ee850989e3bb2405dffaff72ede945b9f08 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Mar 2003 04:09:12 +0000 Subject: wrap this textbox hard --- httemplate/edit/part_export.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index 8a829e57a..31d6134e2 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -67,7 +67,8 @@ my $widget = new HTML::Widgets::SelectLayers( } $html .= ''; } elsif ( $type eq 'textarea' ) { - $html .= qq!!; + $html .= qq!!; } elsif ( $type eq 'text' ) { $html .= qq!!; } elsif ( $type eq 'checkbox' ) { -- cgit v1.2.1 From 6b081fe282b98f7075b83c107bc598d4fa3b7b2f Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Mar 2003 04:36:23 +0000 Subject: virtual wrap... --- httemplate/edit/part_export.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index 31d6134e2..839a114fb 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -67,7 +67,7 @@ my $widget = new HTML::Widgets::SelectLayers( } $html .= ''; } elsif ( $type eq 'textarea' ) { - $html .= qq!!; } elsif ( $type eq 'text' ) { $html .= qq!!; -- cgit v1.2.1 From ad90599960b1c4f44a96985e9716c1bc5d04d596 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 24 Mar 2003 08:30:35 +0000 Subject: another Pg7.3 fix --- httemplate/search/svc_acct.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi index b2ed723e2..e43f4f79b 100755 --- a/httemplate/search/svc_acct.cgi +++ b/httemplate/search/svc_acct.cgi @@ -30,7 +30,7 @@ if ( $query =~ /^UN_(.*)$/ ) { WHERE 0 < ( SELECT count(*) FROM cust_svc WHERE cust_svc.svcnum = svc_acct.svcnum - AND ( pkgnum IS NULL OR pkgnum = 0 OR pkgnum = $empty ) + AND ( pkgnum IS NULL OR pkgnum = 0 ) ) "; } -- cgit v1.2.1 From fef2bffbf0315a3bd03d63c1d049d2b2afd9f1a7 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 28 Mar 2003 21:43:11 +0000 Subject: oops in null apache export --- FS/FS/part_export/apache.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FS/FS/part_export/apache.pm b/FS/FS/part_export/apache.pm index b72c9bdb0..9161d72b3 100644 --- a/FS/FS/part_export/apache.pm +++ b/FS/FS/part_export/apache.pm @@ -1,4 +1,4 @@ -package FS::part_export::bind; +package FS::part_export::apache; use vars qw(@ISA); use FS::part_export::null; -- cgit v1.2.1 From 51ddce1cd517621308c85fac1a04e7f970ba8eba Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 28 Mar 2003 21:59:16 +0000 Subject: fix missing semicolon in apache export --- bin/apache.export | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/apache.export b/bin/apache.export index 6142c92b4..ed85df7cf 100755 --- a/bin/apache.export +++ b/bin/apache.export @@ -43,7 +43,7 @@ foreach my $export ( @exports ) { } my $user = $export->option('user'); - my $httpd_conf = $export->option('httpd_conf') + my $httpd_conf = $export->option('httpd_conf'); $rsync->exec( { src => $file, @@ -55,7 +55,7 @@ foreach my $export ( @exports ) { } -close NAMED_CONF; +close HTTPD_CONF; # ----- -- cgit v1.2.1 From 5ffebc5c151bd680cdae15e4720ba788ad51121b Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Mar 2003 02:19:44 +0000 Subject: cust_svc and svc_x methods --- FS/FS/part_export.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index b46d8439e..789e8450d 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -305,6 +305,30 @@ sub part_svc { #confess "FS::part_export::part_svc deprecated"; } +=item svc_x + +Returns a list of associate FS::svc_* records. + +=cut + +sub svc_x { + my $self = shift; + map { $_->svc_x } $self->cust_svc; +} + +=item cust_svc + +Returns a list of associated FS::cust_svc records. + +=cut + +sub cust_svc { + my $self = shift; + map { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) } + grep { qsearch('cust_svc', { 'svcpart' => $_->svcpart } ) } + $self->export_svc; +} + =item export_svc Returns a list of associated FS::export_svc records. -- cgit v1.2.1 From 7c5c428f8f102c672dd18ff0c02aaee82f5753d4 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Mar 2003 02:35:49 +0000 Subject: trim leading @. off zones --- FS/FS/part_export/www_shellcommands.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm index e5b95dc1f..b3bfdfeff 100644 --- a/FS/FS/part_export/www_shellcommands.pm +++ b/FS/FS/part_export/www_shellcommands.pm @@ -30,9 +30,12 @@ sub _export_command { } my $domain_record = $svc_www->domain_record; # or die ? my $zone = $domain_record->reczone; # or die ? - unless ( $zone =~ /\.$/ ) { + if ( $zone =~ /\.$/ ) { + $zone =~ s/\.$//; + } else { my $svc_domain = $domain_record->svc_domain; # or die ? $zone .= '.'. $svc_domain->domain; + $zone =~ s/^\@\.//; } my $svc_acct = $svc_www->svc_acct; # or die ? -- cgit v1.2.1 From 48f60f666bab22a3ca5196cf6cd573b8691e4aae Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Mar 2003 04:53:44 +0000 Subject: correct web UI for svc_www services & no more @.domain in www_shellcommands export --- FS/FS/cust_svc.pm | 2 +- FS/FS/domain_record.pm | 21 ++++++++++++++++++++- FS/FS/part_export/www_shellcommands.pm | 10 +--------- httemplate/view/svc_www.cgi | 6 +----- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 5117eff45..26e6274a1 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -290,7 +290,7 @@ sub label { $tag = $svc_x->getfield('domain'); } elsif ( $svcdb eq 'svc_www' ) { my $domain = qsearchs( 'domain_record', { 'recnum' => $svc_x->recnum } ); - $tag = $domain->reczone; + $tag = $domain->zone; } elsif ( $svcdb eq 'svc_broadband' ) { $tag = $svc_x->ip_addr; } else { diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm index 3297e6bfb..2f7e270dc 100644 --- a/FS/FS/domain_record.pm +++ b/FS/FS/domain_record.pm @@ -309,11 +309,30 @@ sub svc_domain { qsearchs('svc_domain', { svcnum => $self->svcnum } ); } +=item zone + +Returns the canonical zone name. + +=cut + +sub zone { + my $self = shift; + my $zone = $self->reczone; # or die ? + if ( $zone =~ /\.$/ ) { + $zone =~ s/\.$//; + } else { + my $svc_domain = $self->svc_domain; # or die ? + $zone .= '.'. $svc_domain->domain; + $zone =~ s/^\@\.//; + } + $zone; +} + =back =head1 VERSION -$Id: domain_record.pm,v 1.12 2003-03-20 03:41:03 ivan Exp $ +$Id: domain_record.pm,v 1.13 2003-03-29 04:53:44 ivan Exp $ =head1 BUGS diff --git a/FS/FS/part_export/www_shellcommands.pm b/FS/FS/part_export/www_shellcommands.pm index b3bfdfeff..20658c7a2 100644 --- a/FS/FS/part_export/www_shellcommands.pm +++ b/FS/FS/part_export/www_shellcommands.pm @@ -29,15 +29,7 @@ sub _export_command { ${$_} = $svc_www->getfield($_) foreach $svc_www->fields; } my $domain_record = $svc_www->domain_record; # or die ? - my $zone = $domain_record->reczone; # or die ? - if ( $zone =~ /\.$/ ) { - $zone =~ s/\.$//; - } else { - my $svc_domain = $domain_record->svc_domain; # or die ? - $zone .= '.'. $svc_domain->domain; - $zone =~ s/^\@\.//; - } - + my $zone = $domain_record->zone; # or die ? my $svc_acct = $svc_www->svc_acct; # or die ? my $username = $svc_acct->username; my $homedir = $svc_acct->dir; # or die ? diff --git a/httemplate/view/svc_www.cgi b/httemplate/view/svc_www.cgi index 9fa9661b1..442614491 100644 --- a/httemplate/view/svc_www.cgi +++ b/httemplate/view/svc_www.cgi @@ -28,11 +28,7 @@ my $email = $svc_acct->email; my $domain_record = qsearchs('domain_record', { 'recnum' => $svc_www->recnum } ) or die "svc_www: Unknown recnum ". $svc_www->recnum; -my $www = $domain_record->reczone; -unless ( $www =~ /\.$/ ) { - my $svc_domain = qsearchs('svc_domain', { svcnum=>$domain_record->svcnum } ); - $www .= '.'. $svc_domain->domain; -} +my $www = $domain_record->zone; print header('Website View', menubar( ( ( $custnum ) -- cgit v1.2.1 From 5b48517a06a9d43171d5d5a4fe57a18f8f5aa99e Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 29 Mar 2003 05:35:21 +0000 Subject: restart apache, not bind! --- bin/apache.export | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/apache.export b/bin/apache.export index ed85df7cf..399fb0377 100755 --- a/bin/apache.export +++ b/bin/apache.export @@ -51,7 +51,7 @@ foreach my $export ( @exports ) { } ) or die "rsync to $machine failed: ". join(" / ", $rsync->err); # warn $rsync->out; - ssh("root\@$machine", 'ndc reload'); + ssh("root\@$machine", 'apachectl graceful'); } -- cgit v1.2.1 From f9dbf311aeddb4356855362d586d1c4643b4f538 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 31 Mar 2003 23:48:31 +0000 Subject: add 'last_bill' column --- FS/bin/freeside-setup | 1 + 1 file changed, 1 insertion(+) diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index b3cdb3384..010ec4c14 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -609,6 +609,7 @@ sub tables_hash_hack { 'otaker', 'varchar', '', 32, 'setup', @date_type, 'bill', @date_type, + 'last_bill', @date_type, 'susp', @date_type, 'cancel', @date_type, 'expire', @date_type, -- cgit v1.2.1 From 4063ea45f3ab0a9cb2582834e55ac3afc71425f9 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 31 Mar 2003 23:49:54 +0000 Subject: added last_bill column --- httemplate/docs/schema.html | 1 + 1 file changed, 1 insertion(+) diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html index 6522b041a..593ea82a0 100644 --- a/httemplate/docs/schema.html +++ b/httemplate/docs/schema.html @@ -195,6 +195,7 @@
  • pkgpart - Package definition
  • setup - date
  • bill - next bill date +
  • last_bill - last bill date
  • susp - (past) suspension date
  • expire - (future) cancellation date
  • cancel - (past) cancellation date -- cgit v1.2.1 From f3b8b72d2a07683b2deb2774f29407e25e725b5a Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 1 Apr 2003 01:22:25 +0000 Subject: correct last_bill problems with $0 invoice (non-existant) edge cases --- FS/FS/cust_main.pm | 2 ++ FS/FS/cust_pkg.pm | 4 ++++ debian/changelog | 2 +- debian/control | 22 +++++++++++++------ httemplate/edit/REAL_cust_pkg.cgi | 18 +++++++++++----- httemplate/edit/process/REAL_cust_pkg.cgi | 2 ++ httemplate/search/cust_pkg.cgi | 31 ++++++++++++++++++--------- httemplate/view/cust_main.cgi | 35 ++++++++++++++++++++----------- httemplate/view/cust_pkg.cgi | 17 +++++++++------ 9 files changed, 93 insertions(+), 40 deletions(-) diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 6331fda6d..d1e975406 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1011,6 +1011,8 @@ sub bill { # 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++; } diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 88ffd4d17..4eea2c087 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -477,6 +477,10 @@ Useful for billing metered services. 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; diff --git a/debian/changelog b/debian/changelog index 5734b1fc8..d8283b5d9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -freeside (1.3.1-1) unstable; urgency=low +freeside (1.4.1-1) unstable; urgency=low * Initial Release. diff --git a/debian/control b/debian/control index 2f66fd395..de2820d83 100644 --- a/debian/control +++ b/debian/control @@ -8,14 +8,14 @@ Standards-Version: 3.5.2 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 @@ -25,7 +25,7 @@ Description: Documentation for freeside 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 @@ -80,3 +80,13 @@ Description: Package: freeside-session-client Architecture: all Depends: ssh +Description: + + +Package: freeside-selfservice-server +Architecture: all +Depends: +Description: + + + diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 0d2f1c238..e44acba3c 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -1,6 +1,6 @@ <% -# +# my $error =''; my $pkgnum = ''; @@ -56,11 +56,19 @@ print ntable("#cccccc",2), $otaker, '', 'Setup date'. '', - 'Next bill date', + ( $setup ? time2str("%c %z (%Z)",$setup) : "" ), '">'; + +print 'Last bill date', + 'last_bill) + : "" ), + '">' + if $cust_pkg->dbdef_table->column('last_bill'); + +print 'Next bill date', '', -; + ( $bill ? time2str("%c %z (%Z)",$bill) : "" ), '">'; print 'Suspension date', time2str("%D",$susp), '' diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi index 2e0352c76..7f5c5e49c 100755 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ b/httemplate/edit/process/REAL_cust_pkg.cgi @@ -5,6 +5,8 @@ my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); 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; diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 78a5bb3bb..3cc520fa8 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -194,6 +194,12 @@ if ( scalar(@cust_pkg) == 1 ) { Package Setup +END + + print 'Next
    bill
    ' + if defined dbdef->table('cust_pkg')->column('last_bill'); + + print <Next
    bill
    Susp. Expire @@ -203,17 +209,10 @@ if ( scalar(@cust_pkg) == 1 ) { company END -if ( defined dbdef->table('cust_main')->column('ship_last') ) { - print <(service) name - company -END -} + print '(service) namecompany' + if defined dbdef->table('cust_main')->column('ship_last'); -print <Services - -END + print 'Services'; my $n1 = ''; my(%saw,$cust_pkg); @@ -244,6 +243,12 @@ END $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) = ( @@ -270,6 +275,12 @@ END print $n1, <$pkgnum - $pkg $setup +END + + print "$last_bill" + if defined dbdef->table('cust_pkg')->column('last_bill'); + + print <$bill $susp $expire diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 6fe759bd9..9b7b5d029 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -342,17 +342,6 @@ print qq!
    Packages !, #display packages -#formatting -print qq!!, &table(), "\n", - qq!Package!, - qq!DatesServices\n!, - qq!Setup!, - qq!Next bill!, - qq!Susp.Expire!, - qq!!, - qq!Cancel!, - qq!\n!; - #get package info my @packages; if ( $conf->exists('hidecancelledpackages') ) { @@ -361,6 +350,23 @@ if ( $conf->exists('hidecancelledpackages') ) { @packages = sort { $a->pkgnum <=> $b->pkgnum } ($cust_main->all_pkgs); } +if ( @packages ) { + #formatting + print &table(), "\n", + qq!Package!, + qq!DatesServices\n!, + qq!Setup!; + + print qq!Last bill! + if $packages[0]->dbdef_table->column('last_bill'); + + print qq!Next bill!, + qq!Susp.!, + qq!Expire!!, + qq!Cancel!, + qq!\n!; +} + my $n1 = ''; foreach my $package (@packages) { my $pkgnum = $package->pkgnum; @@ -424,7 +430,11 @@ foreach my $package (@packages) { } print ''; - 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 "", ( $package->getfield($_) ? time2str("%D
    %l:%M:%S%P %z", $package->getfield($_) ) @@ -471,6 +481,7 @@ print ""; #formatting print ""; + print < function cust_pay_areyousure(href) { diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index aa3b3b15a..c3880114c 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -68,10 +68,16 @@ print &ntable("#cccccc"), '', &ntable("#cccccc",2), 'Comment', $comment, '', 'Setup date', - ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '', - 'Next bill date', - ( $bill ? time2str("%D",$bill) : " " ), '', -; + ( $setup ? time2str("%D",$setup) : "(Not setup)" ), ''; + +print 'Last bill date', + ( $cust_pkg->last_bill ? time2str("%D",$cust_pkg->last_bill) : " " ), + '' + if $cust_pkg->dbdef_table->column('last_bill'); + +print 'Next bill date', + ( $bill ? time2str("%D",$bill) : " " ), ''; + print 'Suspension date', time2str("%D",$susp), '' if $susp; print 'Expiration date', @@ -80,8 +86,7 @@ print 'Cancellation date', time2str("%D",$cancel), '' if $cancel; print 'Order taker', $otaker, '', - '' -; + ''; unless ($expire) { print < Date: Tue, 1 Apr 2003 06:55:01 +0000 Subject: cancel button for customers (closes: Bug#25) --- httemplate/misc/cust_main-cancel.cgi | 16 ++++++++++++++++ httemplate/view/cust_main.cgi | 21 +++++++++++++++++---- 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100755 httemplate/misc/cust_main-cancel.cgi diff --git a/httemplate/misc/cust_main-cancel.cgi b/httemplate/misc/cust_main-cancel.cgi new file mode 100755 index 000000000..526e128a4 --- /dev/null +++ b/httemplate/misc/cust_main-cancel.cgi @@ -0,0 +1,16 @@ +<% + +#untaint custnum +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/ || die "Illegal custnum"; +my $custnum = $1; + +my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); + +my $error = $cust_main->cancel; +eidiot($error) if $error; + +#print $cgi->redirect($p. "view/cust_main.cgi?". $cust_main->custnum); +print $cgi->redirect($p); + +%> diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 9b7b5d029..1d6243e23 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -22,10 +22,23 @@ my $custnum = $1; my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); die "Customer not found!" unless $cust_main; -print qq!Edit this customer!; -print qq! | Delete this customer! +print qq!Edit this customer!; + +print < +function cancel_areyousure(href) { + if (confirm("Perminantly delete all services and cancel this customer?") == true) + window.location.href = href; +} + +END + +print qq! | !. + 'Cancel this customer' + if $cust_main->ncancelled_pkgs; + +print qq! | !. + 'Delete this customer' if $conf->exists('deletecustomers'); unless ( $conf->exists('disable_customer_referrals') ) { -- cgit v1.2.1