From c085c3ba3bd0677719407ce613dd24466f05abe2 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 9 Jan 2004 22:39:22 +0000 Subject: [PATCH] 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 --- FS/FS/cust_credit.pm | 2 ++ httemplate/view/cust_main.cgi | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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! (delete)! + : ''; push @history, $cref->{_date} . "\t" . qq!!. 'Unapplied credit #' . $cref->{crednum} . ": ". - $cref->{reason} . "\t\t\t" . $credit->credited . "\t"; + $cref->{reason} . "$delete\t\t\t" . $credit->credited . "\t"; } my(@refunds)=qsearch('cust_refund',{'custnum'=> $custnum } ); -- 2.11.0