From: ivan Date: Fri, 12 Mar 2004 12:40:04 +0000 (+0000) Subject: add unapplycredits configuration option X-Git-Tag: freeside_1_4_2beta1~212 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=c02feb66d969a066b203ebcf80a063213fa6dc7a;p=freeside.git add unapplycredits configuration option --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 0b979cf37..df176e31d 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -357,6 +357,13 @@ httemplate/docs/config.html 'type' => 'checkbox', }, + { + 'key' => 'unapplycredits', + 'section' => 'UI', + 'description' => 'Enable "unapplication" of unclosed credits.', + 'type' => 'checkbox', + }, + { 'key' => 'dirhash', 'section' => 'shell', diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index ee5f86973..c41d2d894 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -554,6 +554,11 @@ function cust_pay_unapply_areyousure(href) { == true) window.location.href = href; } +function cust_credit_unapply_areyousure(href) { + if (confirm("Are you sure you want to unapply this credit?") + == true) + window.location.href = href; +} function cust_credit_areyousure(href) { if (confirm("Are you sure you want to delete this credit?") == true) @@ -637,9 +642,13 @@ if ( $conf->config('payby-default') ne 'HIDE' ) { $cust_credit->closed !~ /^Y/i && $conf->exists('deletecredits') ? qq! (delete)! : ''; + my $unapply = + $cust_credit->closed !~ /^Y/i && $conf->exists('unapplycredits') + ? qq! (unapply)! + : ''; push @history, "$date\tCredit #$crednum: $reason
". - "(applied to invoice #$invnum on $app_date)$delete\t\t\t$amount\t"; + "(applied to invoice #$invnum on $app_date)$delete$unapply\t\t\t$amount\t"; } }