summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/view/cust_main/payment_history.html5
-rw-r--r--httemplate/view/cust_main/payment_history/credit.html37
-rw-r--r--httemplate/view/cust_main/payment_history/invoice.html13
-rw-r--r--httemplate/view/cust_main/payment_history/payment.html59
-rw-r--r--httemplate/view/cust_main/payment_history/refund.html30
-rw-r--r--httemplate/view/cust_main/payment_history/voided_payment.html21
6 files changed, 70 insertions, 95 deletions
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index e561c703e..49d6ff4cd 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -478,4 +478,9 @@ sub translate_payby_refund {
$payby;
};
+sub areyousure_link {
+ my ($url,$msg,$title,$label) = (shift,shift,shift,shift);
+ ' (<A HREF="javascript:areyousure(\''.$url.'\',\''.$msg.'\')" TITLE="'.$title.'">'.$label.'</A>)';
+}
+
</%init>
diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html
index ae388eb54..ffe613340 100644
--- a/httemplate/view/cust_main/payment_history/credit.html
+++ b/httemplate/view/cust_main/payment_history/credit.html
@@ -121,32 +121,21 @@ if ( scalar(@cust_credit_bill) == 0
}
#
my $delete = '';
-if ( $cust_credit->closed !~ /^Y/i
-
- #s'pose deleting a credit isn't bad like deleting a payment
- # and this needs to be generally available until we have credit voiding..
- #&& $conf->exists('deletecredits')
-
- && $curuser->access_right('Delete credit')
- )
-{
- $delete = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/delete-cust_credit.cgi?!. $cust_credit->crednum.
- qq!', 'Are you sure you want to delete this credit?')">!.
- qq!delete</A>)!;
-}
+$delete = areyousure_link("${p}misc/delete-cust_credit.cgi?".$cust_credit->crednum,
+ mt('Are you sure you want to delete this credit?'),
+ '',
+ mt('delete')
+ )
+if ( $cust_credit->closed !~ /^Y/i && $curuser->access_right('Delete credit') );
my $unapply = '';
-if ( $cust_credit->closed !~ /^Y/i
- && scalar(@cust_credit_bill)
- && $curuser->access_right('Unapply credit')
- )
-{
- $unapply = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/unapply-cust_credit.cgi?!. $cust_credit->crednum.
- qq!', 'Are you sure you want to unapply this credit?')">!.
- qq!unapply</A>)!;
-}
+$unapply = areyousure_link("${p}misc/unapply-cust_credit.cgi?".$cust_credit->crednum,
+ mt('Are you sure you want to unapply this credit?'),
+ '',
+ mt('unapply')
+ )
+if ( $cust_credit->closed !~ /^Y/i && scalar(@cust_credit_bill)
+ && $curuser->access_right('Unapply credit') );
my $reason = $cust_credit->reason
? ' ('. $cust_credit->reason. ')'
diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html
index fe14d3e54..29389ef77 100644
--- a/httemplate/view/cust_main/payment_history/invoice.html
+++ b/httemplate/view/cust_main/payment_history/invoice.html
@@ -20,13 +20,12 @@ my $link = $curuser->access_right('View invoices')
: '';
my $delete = '';
-if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ) {
- $delete = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/delete-cust_bill.html?$invnum',!.
- qq!'Are you sure you want to delete this invoice?')"!.
- qq! TITLE="Delete this invoice from the database completely"!.
- mt('delete') . '</A>)';
-}
+$delete = areyousure_link("${p}misc/delete-cust_bill.html?$invnum",
+ mt('Are you sure you want to delete this invoice?'),
+ mt('Delete this invoice from the database completely'),
+ mt('delete')
+ )
+ if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') );
my $events = '';
#1.9
diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html
index 61486518e..7df16cf87 100644
--- a/httemplate/view/cust_main/payment_history/payment.html
+++ b/httemplate/view/cust_main/payment_history/payment.html
@@ -169,7 +169,15 @@ if ( $cust_pay->closed !~ /^Y/i
}
my $void = '';
-if ( $cust_pay->closed !~ /^Y/i
+my $voidmsg = $cust_pay->payby =~ /^(CARD|CHEK)$/
+ ? ' (' . mt('do not send anything to the payment gateway').')'
+ : '';
+$void = areyousure_link("${p}misc/void-cust_pay.cgi?".$cust_pay->paynum,
+ mt('Are you sure you want to void this payment?'),
+ mt('Void this payment from the database') . $voidmsg,
+ mt('void')
+ )
+ if ( $cust_pay->closed !~ /^Y/i
&& ( ( $cust_pay->payby eq 'CARD'
&& $curuser->access_right('Credit card void')
)
@@ -180,43 +188,24 @@ if ( $cust_pay->closed !~ /^Y/i
&& $curuser->access_right('Regular void')
)
)
- )
-{
- $void = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/void-cust_pay.cgi?!. $cust_pay->paynum.
- qq!', 'Are you sure you want to void this payment?')"!.
- qq! TITLE="Void this payment from the database!.
- ( $cust_pay->payby =~ /^(CARD|CHEK)$/
- ? ' (do not send anything to the payment gateway)'
- : ''
- ). '"'.
- qq!>void</A>)!;
-}
+ );
my $delete = '';
-if ( $cust_pay->closed !~ /^Y/i
- && $opt{'deletepayments'}
- && $curuser->access_right('Delete payment')
- )
-{
- $delete = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/delete-cust_pay.cgi?!. $cust_pay->paynum.
- qq!', 'Are you sure you want to delete this payment?')"!.
- qq! TITLE="Delete this payment from the database completely - not recommended"!.
- qq!>delete</A>)!;
-}
+$delete = areyousure_link("${p}misc/delete-cust_pay.cgi?".$cust_pay->paynum,
+ mt('Are you sure you want to delete this payment?'),
+ mt('Delete this payment from the database completely - not recommended'),
+ mt('delete')
+ )
+ if ( $cust_pay->closed !~ /^Y/i && $opt{'deletepayments'}
+ && $curuser->access_right('Delete payment') );
my $unapply = '';
-if ( $cust_pay->closed !~ /^Y/i
- && scalar(@cust_bill_pay)
- && $curuser->access_right('Unapply payment')
- )
-{
- $unapply = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/unapply-cust_pay.cgi?!. $cust_pay->paynum.
- qq!', 'Are you sure you want to unapply this payment?')"!.
- qq! TITLE="Keep this payment, but dissociate it from the invoices it is currently applied against"!.
- qq!>unapply</A>)!;
-}
+$unapply = areyousure_link("${p}misc/unapply-cust_pay.cgi?".$cust_pay->paynum,
+ mt('Are you sure you want to unapply this payment?'),
+ mt('Keep this payment, but dissociate it from the invoices it is currently applied against'),
+ mt('unapply')
+ )
+ if ( $cust_pay->closed !~ /^Y/i && scalar(@cust_bill_pay)
+ && $curuser->access_right('Unapply payment') );
</%init>
diff --git a/httemplate/view/cust_main/payment_history/refund.html b/httemplate/view/cust_main/payment_history/refund.html
index 154525d54..813836b64 100644
--- a/httemplate/view/cust_main/payment_history/refund.html
+++ b/httemplate/view/cust_main/payment_history/refund.html
@@ -1,6 +1,6 @@
-<% $refund %>
-(<% $payby. $payinfo %>)
-<% mt('by') |h %> <% $cust_refund->otaker %><% $view %><% $delete %>
+<% $refund %>
+(<% "$payby$payinfo" %>)
+<% "$view$delete" %>
<%init>
my( $cust_refund, %opt ) = @_;
@@ -14,8 +14,10 @@ my $payinfo = $payby eq 'CARD'
$payby = translate_payby_refund($payby,$payinfo);
-my $refund = mt('Refund');
-$refund = '<B><FONT COLOR="#FF0000">' . mt('Unapplied Refund') . '</FONT></B>'
+my $refund = mt("Refund by [_1]",$cust_refund->otaker);
+$refund = '<B><FONT COLOR="#FF0000">'
+ . mt("Unapplied Refund by [_1]",$cust_refund->otaker)
+ . '</FONT></B>'
if $cust_refund->unapplied > 0;
my $view =
@@ -29,17 +31,13 @@ my $view =
my $delete = '';
-if ( $cust_refund->closed !~ /^Y/i
- && $opt{'deleterefunds'}
- && $curuser->access_right('Delete refund')
- )
-{
- $delete = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/delete-cust_refund.cgi?!. $cust_refund->refundnum.
- qq!', 'Are you sure you want to delete this refund?')"!.
- qq! TITLE="!.mt('Delete this refund from the database completely - not recommended').
- ">".mt('delete')."</A>)";
-}
+$delete = areyousure_link("${p}misc/delete-cust_refund.cgi?".$cust_refund->refundnum,
+ mt('Are you sure you want to delete this refund?'),
+ mt('Delete this refund from the database completely - not recommended'),
+ mt('delete')
+ )
+ if ( $cust_refund->closed !~ /^Y/i && $opt{'deleterefunds'}
+ && $curuser->access_right('Delete refund') );
</%init>
diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html
index 0a8cd1077..f4ffc23bd 100644
--- a/httemplate/view/cust_main/payment_history/voided_payment.html
+++ b/httemplate/view/cust_main/payment_history/voided_payment.html
@@ -34,19 +34,14 @@ if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) {
}
my $unvoid = '';
-if ( $cust_pay_void->closed !~ /^Y/i
- && $curuser->access_right('Unvoid')
- )
-{
- $unvoid = qq! (<A HREF="javascript:areyousure('!.
- qq!${p}misc/unvoid-cust_pay_void.cgi?!. $cust_pay_void->paynum.
- qq!', 'Are you sure you want to unvoid this payment?')"!.
- qq! TITLE="!.mt('Unvoid this payment from the database').
- ( $cust_pay_void->payby =~ /^(CARD|CHEK)$/
+my $unvoidmsg = $cust_pay_void->payby =~ /^(CARD|CHEK)$/
? ' ('.mt('do not send anything to the payment gateway') .')'
- : ''
- ). '"'.
- '>'.mt('unvoid').'</A>)';
-}
+ : '';
+$unvoid = areyousure_link("${p}misc/unvoid-cust_pay_void.cgi?".$cust_pay_void->paynum,
+ mt('Are you sure you want to unvoid this payment?'),
+ mt('Unvoid this payment from the database') . $unvoidmsg,
+ mt('unvoid')
+ )
+ if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid') );
</%init>