diff options
author | ivan <ivan> | 2004-01-09 22:39:29 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-01-09 22:39:29 +0000 |
commit | 867f85c5692b9aa56a38cb68ec5285efa549ed79 (patch) | |
tree | 7ba01e3179abc4d57062e91a562efca121533863 | |
parent | fc5dd67d84d0d8ba64954fe256ee8c71dbf006d8 (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 8397fb90b..8f783d9a5 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 } ); |