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(-) (limited to 'httemplate') 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(-) (limited to 'httemplate') 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(-) (limited to 'httemplate') 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(-) (limited to 'httemplate') 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 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 --- httemplate/view/svc_www.cgi | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'httemplate') 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 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(+) (limited to 'httemplate') 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 --- 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 +++++++++------ 5 files changed, 70 insertions(+), 33 deletions(-) (limited to 'httemplate') 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 (limited to 'httemplate') 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