X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_credit.cgi;h=36109cf5d8c89924a5014e8f0eda437bf778b766;hb=4104f4e3d1b387296b16b4a035b4b7f42e0c5977;hp=3bfbfc8c4a46f9388dbeb8f7b61fc180b0b0363a;hpb=91387f8f489e561deaf1de052d80ef800a4970a3;p=freeside.git diff --git a/httemplate/edit/cust_credit.cgi b/httemplate/edit/cust_credit.cgi index 3bfbfc8c4..36109cf5d 100755 --- a/httemplate/edit/cust_credit.cgi +++ b/httemplate/edit/cust_credit.cgi @@ -1,19 +1,64 @@ -<% -# - -use strict; -use vars qw( $cgi $query $custnum $otaker $p1 $crednum $_date $amount $reason ); -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(fields); -#use FS::cust_credit; - -$cgi = new CGI; -cgisuidsetup($cgi); +<% include('/elements/header-popup.html', 'Enter Credit') %> + +<% include('/elements/error.html') %> + +
+ + + + + + + +Credit +<% ntable("#cccccc", 2) %> + + + Date + <% time2str("%D",$_date) %> + + + + Amount + $ + + +% +%#print qq! Also post refund!; +% + +<% include('/elements/tr-select-reason.html', + 'field' => 'reasonnum', + 'reason_class' => 'R', + 'control_button' => 'document.credit_popup.submit', + ) +%> + + + Auto-apply
to invoices + + + + +
+ +
+ +
+ + +<%once> + +my $conf = new FS::Conf; + + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Post credit'); + +my($custnum, $amount, $reason); if ( $cgi->param('error') ) { #$cust_credit = new FS::cust_credit ( { # map { $_, scalar($cgi->param($_)) } fields('cust_credit') @@ -23,55 +68,17 @@ if ( $cgi->param('error') ) { #$refund = $cgi->param('refund'); $reason = $cgi->param('reason'); } else { - ($query) = $cgi->keywords; + my($query) = $cgi->keywords; $query =~ /^(\d+)$/; $custnum = $1; $amount = ''; #$refund = 'yes'; $reason = ''; } -$_date = time; - -$otaker = getotaker; - -$p1 = popurl(1); +my $_date = time; -print $cgi->header( @FS::CGI::header ), header("Post Credit", ''); -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); -print < -END +my $otaker = getotaker; -$crednum = ""; -print qq!Credit #!, $crednum ? $crednum : " (NEW)", qq!!; +my $p1 = popurl(1); -print qq!
Customer #$custnum!; - -print qq!!; - -print qq!
Date: !, time2str("%D",$_date), qq!!; - -print qq!
Amount \$!; -print qq!!; - -#print qq! Also post refund!; - -print qq!!; - -print qq!
Reason !; - -print < - -END - -print < - - -END - -%> +