From 51984ac3d3da3006809c6866fdecd4ad83610731 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:36:04 +0000 Subject: templates!!! --- httemplate/edit/process/cust_credit.cgi | 80 +++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 httemplate/edit/process/cust_credit.cgi (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi new file mode 100755 index 000000000..3cacab26e --- /dev/null +++ b/httemplate/edit/process/cust_credit.cgi @@ -0,0 +1,80 @@ +<% +# +# $Id: cust_credit.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ +# +# Usage: post form to: +# http://server.name/path/cust_credit.cgi +# +# ivan@voicenet.com 96-dec-05 -> 96-dec-08 +# +# post a refund if $new_paybatch +# ivan@voicenet.com 96-dec-08 +# +# refunds are no longer applied against a specific payment (paybatch) +# paybatch field removed +# ivan@voicenet.com 97-apr-22 +# +# rewrite ivan@sisd.com 98-mar-16 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# $Log: cust_credit.cgi,v $ +# Revision 1.1 2001-07-30 07:36:04 ivan +# templates!!! +# +# Revision 1.7 1999/04/07 15:23:05 ivan +# don't use anchor in redirect +# +# Revision 1.6 1999/02/28 00:03:41 ivan +# removed misleading comments +# +# Revision 1.5 1999/01/25 12:09:59 ivan +# yet more mod_perl stuff +# +# Revision 1.4 1999/01/19 05:13:49 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.3 1999/01/18 22:47:51 ivan +# s/create/new/g; and use fields('table_name') +# +# Revision 1.2 1998/12/17 08:40:18 ivan +# s/CGI::Request/CGI.pm/; etc +# + +use strict; +use vars qw( $cgi $custnum $new $error ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup getotaker); +use FS::CGI qw(popurl); +use FS::Record qw(fields); +use FS::cust_credit; + +$cgi = new CGI; +cgisuidsetup($cgi); + +$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; +$custnum = $1; + +$cgi->param('otaker',getotaker); + +$new = new FS::cust_credit ( { + map { + $_, scalar($cgi->param($_)); + #} qw(custnum _date amount otaker reason) + } fields('cust_credit') +} ); + +$error=$new->insert; + +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "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/edit/process/cust_credit.cgi | 44 +-------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 3cacab26e..b52d0bd46 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,47 +1,5 @@ <% -# -# $Id: cust_credit.cgi,v 1.1 2001-07-30 07:36:04 ivan Exp $ -# -# Usage: post form to: -# http://server.name/path/cust_credit.cgi -# -# ivan@voicenet.com 96-dec-05 -> 96-dec-08 -# -# post a refund if $new_paybatch -# ivan@voicenet.com 96-dec-08 -# -# refunds are no longer applied against a specific payment (paybatch) -# paybatch field removed -# ivan@voicenet.com 97-apr-22 -# -# rewrite ivan@sisd.com 98-mar-16 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# $Log: cust_credit.cgi,v $ -# Revision 1.1 2001-07-30 07:36:04 ivan -# templates!!! -# -# Revision 1.7 1999/04/07 15:23:05 ivan -# don't use anchor in redirect -# -# Revision 1.6 1999/02/28 00:03:41 ivan -# removed misleading comments -# -# Revision 1.5 1999/01/25 12:09:59 ivan -# yet more mod_perl stuff -# -# Revision 1.4 1999/01/19 05:13:49 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.3 1999/01/18 22:47:51 ivan -# s/create/new/g; and use fields('table_name') -# -# Revision 1.2 1998/12/17 08:40:18 ivan -# s/CGI::Request/CGI.pm/; etc -# +# use strict; use vars qw( $cgi $custnum $new $error ); -- cgit v1.2.1 From d0f483f47168e01eb6c28e8fc99a62050b245132 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 04:25:04 +0000 Subject: auto-apply payments and credits, post credit UI overhaul --- httemplate/edit/process/cust_credit.cgi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index b52d0bd46..2eb431bcc 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $new $error ); @@ -31,6 +31,11 @@ if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string ); } else { + if ( $cgi->param('apply') eq 'yes' ) { + my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) + or die "unknown custnum $linknum"; + $cust_main->apply_payments; + } print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); } -- cgit v1.2.1 From 371e7a9c14b0feb83a802f624a8dceda5fecbcbf Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 15:07:06 +0000 Subject: fix posting credit --- httemplate/edit/process/cust_credit.cgi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 2eb431bcc..415000f88 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $new $error ); @@ -9,6 +9,7 @@ use FS::UID qw(cgisuidsetup getotaker); use FS::CGI qw(popurl); use FS::Record qw(fields); use FS::cust_credit; +use FS::cust_main; $cgi = new CGI; cgisuidsetup($cgi); @@ -33,7 +34,7 @@ if ( $error ) { } else { if ( $cgi->param('apply') eq 'yes' ) { my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) - or die "unknown custnum $linknum"; + or die "unknown custnum $custnum"; $cust_main->apply_payments; } print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); -- cgit v1.2.1 From 85e18d1c25a16b3d37ff87484b36a9e17d17cbcf Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 26 Dec 2001 15:11:33 +0000 Subject: apply credits!! --- httemplate/edit/process/cust_credit.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 415000f88..3bbd749ce 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $custnum $new $error ); @@ -35,7 +35,7 @@ if ( $error ) { if ( $cgi->param('apply') eq 'yes' ) { my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }) or die "unknown custnum $custnum"; - $cust_main->apply_payments; + $cust_main->apply_credits; } print $cgi->redirect(popurl(3). "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/edit/process/cust_credit.cgi | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 3bbd749ce..51fca74e3 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,32 +1,19 @@ + <% -# - -use strict; -use vars qw( $cgi $custnum $new $error ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw(popurl); -use FS::Record qw(fields); -use FS::cust_credit; -use FS::cust_main; - -$cgi = new CGI; -cgisuidsetup($cgi); $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -$custnum = $1; +my $custnum = $1; $cgi->param('otaker',getotaker); -$new = new FS::cust_credit ( { +my $new = new FS::cust_credit ( { map { $_, scalar($cgi->param($_)); #} qw(custnum _date amount otaker reason) } fields('cust_credit') } ); -$error=$new->insert; +my $error = $new->insert; if ( $error ) { $cgi->param('error', $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/edit/process/cust_credit.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index 51fca74e3..ac92631f8 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -1,4 +1,3 @@ - <% $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; -- cgit v1.2.1 From 4ae85517a9c3a8a2f61e87bc27a74eb616e396a4 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 6 Jul 2004 17:26:02 +0000 Subject: payment voiding part deux & credit card refunds! --- httemplate/edit/process/cust_credit.cgi | 4 ---- 1 file changed, 4 deletions(-) (limited to 'httemplate/edit/process/cust_credit.cgi') diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi index ac92631f8..85bfd4489 100755 --- a/httemplate/edit/process/cust_credit.cgi +++ b/httemplate/edit/process/cust_credit.cgi @@ -3,12 +3,9 @@ $cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!"; my $custnum = $1; -$cgi->param('otaker',getotaker); - my $new = new FS::cust_credit ( { map { $_, scalar($cgi->param($_)); - #} qw(custnum _date amount otaker reason) } fields('cust_credit') } ); @@ -26,5 +23,4 @@ if ( $error ) { print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum"); } - %> -- cgit v1.2.1