From 51984ac3d3da3006809c6866fdecd4ad83610731 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:36:04 +0000 Subject: templates!!! --- httemplate/misc/bill.cgi | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100755 httemplate/misc/bill.cgi (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi new file mode 100755 index 000000000..d09fc45dc --- /dev/null +++ b/httemplate/misc/bill.cgi @@ -0,0 +1,62 @@ +<% +# +# $Id: bill.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: bill.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.5 1999/08/12 04:32:21 ivan +# hidecancelledcustomers +# +# Revision 1.4 1999/01/19 05:14:02 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.3 1998/12/23 03:01:13 ivan +# $cgi->keywords instead of $cgi->query_string +# +# Revision 1.2 1998/12/17 09:12:41 ivan +# s/CGI::(Request|Base)/CGI.pm/; +# + +use strict; +use vars qw( $cgi $query $custnum $cust_main $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup); +use FS::CGI qw(popurl eidiot); +use FS::Record qw(qsearchs); +use FS::cust_main; + +$cgi = new CGI; +&cgisuidsetup($cgi); + +#untaint custnum +($query) = $cgi->keywords; +$query =~ /^(\d*)$/; +$custnum = $1; +$cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); +die "Can't find customer!\n" unless $cust_main; + +$error = $cust_main->bill( +# 'time'=>$time + ); +&eidiot($error) if $error; + +$error = $cust_main->collect( +# 'invoice-time'=>$time, +# 'batch_card'=> 'yes', + 'batch_card'=> 'no', + 'report_badcard'=> 'yes', + ); +&eidiot($error) if $error; + +print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); + +%> -- cgit v1.2.1 From 3d671921441ba8422650b54435a1959ad1d4c71d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 21 Aug 2001 02:31:57 +0000 Subject: remove $Log$ messages. whew. --- httemplate/misc/bill.cgi | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index d09fc45dc..cc7938308 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -1,29 +1,5 @@ <% -# -# $Id: bill.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: bill.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.5 1999/08/12 04:32:21 ivan -# hidecancelledcustomers -# -# Revision 1.4 1999/01/19 05:14:02 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.3 1998/12/23 03:01:13 ivan -# $cgi->keywords instead of $cgi->query_string -# -# Revision 1.2 1998/12/17 09:12:41 ivan -# s/CGI::(Request|Base)/CGI.pm/; -# +# use strict; use vars qw( $cgi $query $custnum $cust_main $error ); -- cgit v1.2.1 From fbcb45dfe5a1bce7981fe4527176b9fdf2ec54b7 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 3 Sep 2001 22:07:39 +0000 Subject: fix more bugs --- httemplate/misc/bill.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index cc7938308..43c7c576d 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $cust_main $error ); @@ -25,6 +25,9 @@ $error = $cust_main->bill( ); &eidiot($error) if $error; +$cust_main->apply_payments; +$cust_main->apply_credits; + $error = $cust_main->collect( # 'invoice-time'=>$time, # 'batch_card'=> 'yes', -- cgit v1.2.1 From a984fa561b6493ae41215c3d26013767f9ce79cb Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 Oct 2001 12:16:42 +0000 Subject: print reasons with credits on invoices use straight eval, not Safe::reval in cust_main::bill for now, as i have no idea how to call methods on a share()'ed scalar. hmm. add cust_pkg::cust_main method s/eidiot/idiot/ in httemplate/misc/bill.cgi --- httemplate/misc/bill.cgi | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index 43c7c576d..48da25562 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -1,12 +1,13 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $cust_main $error ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl eidiot); +#use FS::CGI qw(popurl eidiot); +use FS::CGI qw(popurl idiot); use FS::Record qw(qsearchs); use FS::cust_main; @@ -23,19 +24,24 @@ die "Can't find customer!\n" unless $cust_main; $error = $cust_main->bill( # 'time'=>$time ); -&eidiot($error) if $error; - -$cust_main->apply_payments; -$cust_main->apply_credits; - -$error = $cust_main->collect( -# 'invoice-time'=>$time, -# 'batch_card'=> 'yes', - 'batch_card'=> 'no', - 'report_badcard'=> 'yes', - ); -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); - +#&eidiot($error) if $error; + +unless ( $error ) { + $cust_main->apply_payments; + $cust_main->apply_credits; + + $error = $cust_main->collect( + # 'invoice-time'=>$time, + # 'batch_card'=> 'yes', + 'batch_card'=> 'no', + 'report_badcard'=> 'yes', + ); +} +#&eidiot($error) if $error; + +if ( $error ) { + &idiot($error); +} else { + print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); +} %> -- cgit v1.2.1 From 1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/misc/bill.cgi | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index 48da25562..731309585 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -1,27 +1,14 @@ + <% -# - -use strict; -use vars qw( $cgi $query $custnum $cust_main $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -#use FS::CGI qw(popurl eidiot); -use FS::CGI qw(popurl idiot); -use FS::Record qw(qsearchs); -use FS::cust_main; - -$cgi = new CGI; -&cgisuidsetup($cgi); #untaint custnum -($query) = $cgi->keywords; +my($query) = $cgi->keywords; $query =~ /^(\d*)$/; -$custnum = $1; -$cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); +my $custnum = $1; +my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum}); die "Can't find customer!\n" unless $cust_main; -$error = $cust_main->bill( +my $error = $cust_main->bill( # 'time'=>$time ); #&eidiot($error) if $error; -- cgit v1.2.1 From 22a35047ecdffff80110e06cc08fc84f9ddba9b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 13:21:31 +0000 Subject: removed from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/misc/bill.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index 731309585..8c21fe1bb 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -1,4 +1,3 @@ - <% #untaint custnum -- cgit v1.2.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/misc/bill.cgi | 3 +++ 1 file changed, 3 insertions(+) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index 8c21fe1bb..6f523a52c 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -26,6 +26,9 @@ unless ( $error ) { #&eidiot($error) if $error; if ( $error ) { +%> + +<% &idiot($error); } else { print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum"); -- cgit v1.2.1 From f21edcf70602d7f2ea314d65382bd8c40f51d530 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 10 Jun 2002 22:48:03 +0000 Subject: also retry cards when user clicks "Bill now" (closes: Bug#417) --- httemplate/misc/bill.cgi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index 6f523a52c..f048e5559 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -18,9 +18,10 @@ unless ( $error ) { $error = $cust_main->collect( # 'invoice-time'=>$time, - # 'batch_card'=> 'yes', - 'batch_card'=> 'no', - 'report_badcard'=> 'yes', + #'batch_card'=> 'yes', + #'batch_card'=> 'no', + #'report_badcard'=> 'yes', + 'retry_card' => 'yes', ); } #&eidiot($error) if $error; -- cgit v1.2.1 From 3464d4c767130711e724fbd96e391e03fa3a1796 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 22 Jun 2003 14:21:57 +0000 Subject: fix the credit card retry on change or manual "retry_card" to ONCE per invoice --- httemplate/misc/bill.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/misc/bill.cgi') diff --git a/httemplate/misc/bill.cgi b/httemplate/misc/bill.cgi index f048e5559..44d85b880 100755 --- a/httemplate/misc/bill.cgi +++ b/httemplate/misc/bill.cgi @@ -21,7 +21,8 @@ unless ( $error ) { #'batch_card'=> 'yes', #'batch_card'=> 'no', #'report_badcard'=> 'yes', - 'retry_card' => 'yes', + #'retry_card' => 'yes', + 'retry' => 'yes', ); } #&eidiot($error) if $error; -- cgit v1.2.1