From 6412f71a3557249225abf5eb2096ebad1729c585 Mon Sep 17 00:00:00 2001 From: jeff Date: Sat, 1 Sep 2001 21:52:20 +0000 Subject: add cust_credit_bill relating multiple invoices to credits --- httemplate/edit/cust_credit_bill.cgi | 81 ++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 httemplate/edit/cust_credit_bill.cgi (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi new file mode 100755 index 000000000..df495a668 --- /dev/null +++ b/httemplate/edit/cust_credit_bill.cgi @@ -0,0 +1,81 @@ +<% +# + +use strict; +use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $_date $amount $reason $cust_credit ); +use Date::Format; +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup getotaker); +use FS::CGI qw(header popurl); +use FS::Record qw(qsearch fields); +use FS::cust_credit; +use FS::cust_bill; + + +$cgi = new CGI; +cgisuidsetup($cgi); + +if ( $cgi->param('error') ) { + #$cust_credit_bill = new FS::cust_credit_bill ( { + # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') + #} ); + $crednum = $cgi->param('crednum'); + $amount = $cgi->param('amount'); + #$refund = $cgi->param('refund'); + $invnum = $cgi->param('invnum'); +} else { + ($query) = $cgi->keywords; + $query =~ /^(\d+)$/; + $crednum = $1; + $amount = ''; + #$refund = 'yes'; + $invnum = ''; +} +$_date = time; + +$otaker = getotaker; + +$p1 = popurl(1); + +print $cgi->header( '-expires' => 'now' ), header("Apply Credit", ''); +print qq!Error: !, $cgi->param('error'), + "" + if $cgi->param('error'); +print < +
+END
+
+die unless $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } );
+
+print qq!Credit #!, $crednum, qq!!;
+
+print qq!\nInvoice # ";
+
+print qq!\nDate: !, time2str("%D",$_date), qq!!;
+
+print qq!\nAmount \$!;
+
+#print qq! Also post refund!;
+
+print <
+
+
+END + +print < + + +END + +%> -- cgit v1.2.1 From dbfb0ae501d5acba37f9348476d94b99a4c92450 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 2 Sep 2001 07:49:52 +0000 Subject: things are starting to work again, sorta. --- httemplate/edit/cust_credit_bill.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index df495a668..c4cd34eab 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $_date $amount $reason $cust_credit ); @@ -40,7 +40,7 @@ $p1 = popurl(1); print $cgi->header( '-expires' => 'now' ), header("Apply Credit", ''); print qq!Error: !, $cgi->param('error'), - "" + "

" if $cgi->param('error'); print < @@ -52,7 +52,7 @@ die unless $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); print qq!Credit #!, $crednum, qq!!; print qq!\nInvoice # !; +my $credited = $cust_credit->credited; + +print "Credit # $crednum". + qq!!. + '
Date: '. time2str("%D", $cust_credit->_date). ''. + '
Amount: $'. $cust_credit->amount. ''. + "
Unapplied amount: \$$credited". + '
Reason: '. $cust_credit->reason. '' + ; + +my @cust_bill = grep $_->owed != 0, + qsearch('cust_bill', { 'custnum' => $cust_credit->custnum } ); + +print < +function changed(what) { + cust_bill = what.options[what.selectedIndex].value; +END -print qq!\nInvoice # "; -print qq!\nDate: !, time2str("%D",$_date), qq!!; +print < +END -print qq!\nAmount \$!; +print qq!
Invoice #"; -#print qq! Also post refund!; +print qq!
Amount \$!; print <
-
+ END print < Date: Fri, 26 Oct 2001 10:24:56 +0000 Subject: cache foo *sigh* --- httemplate/edit/cust_credit_bill.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 13bad1852..d2d50cbf6 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $amount $reason $cust_credit ); @@ -38,7 +38,7 @@ $otaker = getotaker; $p1 = popurl(1); -print $cgi->header( '-expires' => 'now' ), header("Apply Credit", ''); +print $cgi->header( @FS::CGI::header ), header("Apply Credit", ''); print qq!Error: !, $cgi->param('error'), "

" if $cgi->param('error'); -- cgit v1.2.1 From c14a267229fc0d6f2d2afdebab3bd34d825df2ef Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Oct 2001 14:54:07 +0000 Subject: get rid of header foo in individual templates --- httemplate/edit/cust_credit_bill.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index d2d50cbf6..2b41cc216 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $amount $reason $cust_credit ); @@ -38,7 +38,7 @@ $otaker = getotaker; $p1 = popurl(1); -print $cgi->header( @FS::CGI::header ), header("Apply Credit", ''); +print header("Apply Credit", ''); print qq!Error: !, $cgi->param('error'), "

" if $cgi->param('error'); -- cgit v1.2.1 From 91135a208282b03644cc766ed917b64fe24f374c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 18 Dec 2001 19:30:31 +0000 Subject: apply payment webinterface --- httemplate/edit/cust_credit_bill.cgi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 2b41cc216..a00734949 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,9 +1,8 @@ <% -# +# use strict; use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $amount $reason $cust_credit ); -use Date::Format; use CGI; use CGI::Carp qw(fatalsToBrowser); use Date::Format; -- 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/cust_credit_bill.cgi | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index a00734949..3748202a5 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,21 +1,7 @@ + <% -# - -use strict; -use vars qw( $cgi $query $custnum $invnum $otaker $p1 $crednum $amount $reason $cust_credit ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use Date::Format; -use FS::UID qw(cgisuidsetup getotaker); -use FS::CGI qw(header popurl); -use FS::Record qw(qsearch fields); -use FS::cust_credit; -use FS::cust_bill; - - -$cgi = new CGI; -cgisuidsetup($cgi); +my($crednum, $amount, $invnum); if ( $cgi->param('error') ) { #$cust_credit_bill = new FS::cust_credit_bill ( { # map { $_, scalar($cgi->param($_)) } fields('cust_credit_bill') @@ -25,7 +11,7 @@ if ( $cgi->param('error') ) { #$refund = $cgi->param('refund'); $invnum = $cgi->param('invnum'); } else { - ($query) = $cgi->keywords; + my($query) = $cgi->keywords; $query =~ /^(\d+)$/; $crednum = $1; $amount = ''; @@ -33,9 +19,9 @@ if ( $cgi->param('error') ) { $invnum = ''; } -$otaker = getotaker; +my $otaker = getotaker; -$p1 = popurl(1); +my $p1 = popurl(1); print header("Apply Credit", ''); print qq!Error: !, $cgi->param('error'), @@ -45,7 +31,8 @@ print < END -die unless $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +my $cust_credit = qsearchs('cust_credit', { 'crednum' => $crednum } ); +die "credit $crednum not found!" unless $cust_credit; my $credited = $cust_credit->credited; -- 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/cust_credit_bill.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 3748202a5..7528d85fc 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,4 +1,3 @@ - <% my($crednum, $amount, $invnum); -- 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/edit/cust_credit_bill.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/edit/cust_credit_bill.cgi') diff --git a/httemplate/edit/cust_credit_bill.cgi b/httemplate/edit/cust_credit_bill.cgi index 7528d85fc..1a97e1312 100755 --- a/httemplate/edit/cust_credit_bill.cgi +++ b/httemplate/edit/cust_credit_bill.cgi @@ -1,3 +1,4 @@ + <% my($crednum, $amount, $invnum); -- cgit v1.2.1