diff options
author | ivan <ivan> | 2004-01-09 22:39:22 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-01-09 22:39:22 +0000 |
commit | c085c3ba3bd0677719407ce613dd24466f05abe2 (patch) | |
tree | 225d0a34038316ae9ae644d705513d9900294e2a | |
parent | c8d3cff6e3026ac4f5dc59930220489ebe3d542f (diff) |
credit deletions: need to use Date::Format and FS::Misc qw(send_email) in cust_credit.pm, need a link to delete unapplied credits too
-rw-r--r-- | FS/FS/cust_credit.pm | 2 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/FS/FS/cust_credit.pm b/FS/FS/cust_credit.pm index 90f9b59ed..19a54534f 100644 --- a/FS/FS/cust_credit.pm +++ b/FS/FS/cust_credit.pm @@ -2,8 +2,10 @@ package FS::cust_credit; use strict; use vars qw( @ISA $conf $unsuspendauto ); +use Date::Format; use FS::UID qw( dbh getotaker ); use FS::Record qw( qsearch qsearchs ); +use FS::Misc qw(send_email); use FS::cust_main; use FS::cust_refund; use FS::cust_credit_bill; diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 8123b2f82..ee5f86973 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -668,12 +668,16 @@ if ( $conf->config('payby-default') ne 'HIDE' ) { qsearch('cust_credit',{'custnum'=>$custnum}); foreach my $credit (@credits) { my($cref)=$credit->hashref; + my $delete = + $credit->closed !~ /^Y/i && $conf->exists('deletecredits') + ? qq! (<A HREF="javascript:cust_credit_areyousure('${p}misc/delete-cust_credit.cgi?!. $credit->crednum. qq!')">delete</A>)! + : ''; push @history, $cref->{_date} . "\t" . qq!<A HREF="! . popurl(2). qq!edit/cust_credit_bill.cgi?!. $cref->{crednum} . qq!">!. '<b><font size="+1" color="#ff0000">Unapplied credit #' . $cref->{crednum} . "</font></b></A>: ". - $cref->{reason} . "\t\t\t" . $credit->credited . "\t"; + $cref->{reason} . "$delete\t\t\t" . $credit->credited . "\t"; } my(@refunds)=qsearch('cust_refund',{'custnum'=> $custnum } ); |