X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history%2Fcredit.html;h=85911a03f3969b52e1615cbc7a013cc966e1a48d;hb=9192ae1275e778f890d75c07066ddd2e4cabaa26;hp=81be1cd7a579fc4d76f7067d5f890a3b361083aa;hpb=b5d5f7680d0736ff0150b337cd29026135fb2e34;p=freeside.git diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index 81be1cd7a..85911a03f 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -130,7 +130,7 @@ my $void = ''; $void = ' ('. include( '/elements/popup_link.html', 'label' => emt('void'), - 'action' => "${p}misc/void-cust_credit.cgi?". + 'action' => "${p}misc/void-cust_credit.html?". $cust_credit->crednum, 'actionlabel' => emt('Void credit'), ). @@ -139,14 +139,23 @@ $void = ' ('. && $opt{'Void credit'}; my $unapply = ''; -$unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum, - emt('Are you sure you want to unapply this credit?'), - '', - emt('unapply') - ) - if $cust_credit->closed !~ /^Y/i - && scalar(@cust_credit_bill) - && $opt{'Unapply credit'}; + +if ($opt{'Unapply credit'} && !$cust_credit->closed) { + my $refund_to_unapply = $cust_credit->refund_to_unapply; + my $usepre = $refund_to_unapply && @cust_credit_bill; + $unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum, + emt('Are you sure you want to unapply this credit from invoices?'), + emt('Keep this credit, but dissociate it from the invoices it is currently applied against'), + emt('unapply') . ($usepre ? ' ' . emt('invoices') : '') + ) + if @cust_credit_bill; + $unapply .= areyousure_link("${p}misc/unapply-cust_credit_refund.cgi?".$cust_credit->crednum, + emt('Are you sure you want to unapply this credit from refunds?'), + emt('Keep this credit, but dissociate it from the refunds it is currently applied to'), + emt('unapply') . ($usepre ? ' ' . emt('refunds') : '') + ) + if $refund_to_unapply; +} my $reason = $cust_credit->reason; $reason = $reason ? " ($reason)" : '';