diff options
author | ivan <ivan> | 2010-03-08 10:57:06 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-03-08 10:57:06 +0000 |
commit | 06a85a88bfdb0d3fc79ee055eb8327658dfe63ab (patch) | |
tree | 239e526d182be4b3a8824811fde923fbd50621f5 /httemplate/view | |
parent | 611624bc08f525d19e1bd548a7d005aa73a53145 (diff) |
proper use of date_format config for international date formats, RT#7009
Diffstat (limited to 'httemplate/view')
4 files changed, 18 insertions, 11 deletions
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 56a2c4dde..0dc4c41d5 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -205,11 +205,11 @@ <TR ID="balance_forward_row"> <TD CLASS="grid" BGCOLOR="#dddddd"> - <% time2str("%D",$date) %> + <% time2str($date_format, $date) %> </TD> <TD CLASS="grid" BGCOLOR="#dddddd"> - <I>Starting balance on <% time2str("%D",$date) %></I> + <I>Starting balance on <% time2str($date_format, $date) %></I> (<A HREF="javascript:void(0);" onClick="show_history();">show prior history</A>) </TD> @@ -297,7 +297,7 @@ <A NAME="<% $target %>"> % } - <% time2str("%D",$item->{'date'}) %> + <% time2str($date_format, $item->{'date'}) %> % if ( $target && $target{$target} == 1 ) { </A> @@ -355,6 +355,7 @@ my( $cust_main ) = @_; my $custnum = $cust_main->custnum; my $conf = new FS::Conf; +my $date_format = $conf->config('date_format') || '%m/%d/%Y'; my $curuser = $FS::CurrentUser::CurrentUser; @@ -376,7 +377,7 @@ my @history = (); my %opt = ( ( map { $_ => scalar($conf->config($_)) } - qw( card_refund-days ) + qw( card_refund-days date_format ) ), ( map { $_ => $conf->exists($_) } qw( deleteinvoices deletepayments deleterefunds pkg-balances ) diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index 88bbe9bd9..75038cc56 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -4,6 +4,8 @@ by <% $cust_credit->otaker %><% "$reason$desc$apply$delete$unapply" %> my( $cust_credit, %opt ) = @_; +my $date_format = $opt{'date_format'} || '%m/%d/%Y'; + my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; @@ -64,7 +66,7 @@ if ( scalar(@cust_credit_bill) == 0 && scalar(@cust_credit_refund) == 1 && $cust_credit->credited == 0 ) { #applied to one refund - $desc .= ' refunded on '. time2str("%D", $cust_credit_refund[0]->_date); + $desc .= ' refunded on '. time2str($date_format, $cust_credit_refund[0]->_date); } else { #complicated $desc .= '<BR>'; @@ -75,11 +77,11 @@ if ( scalar(@cust_credit_bill) == 0 '$'. $app->amount. ' '. $app->applied_to_invoice. '<BR>'; - #' on '. time2str("%D", $app->_date). + #' on '. time2str($date_format, $app->_date). } elsif ( $app->isa('FS::cust_credit_refund') ) { $desc .= ' '. '$'. $app->amount. - ' refunded on '. time2str("%D", $app->_date). + ' refunded on '. time2str($date_format, $app->_date). '<BR>'; } else { die "$app is not a FS::cust_credit_bill or a FS::cust_credit_refund"; diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index bcfa808db..6ec9fdb96 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -4,6 +4,8 @@ my( $cust_pay, %opt ) = @_; +my $date_format = $opt{'date_format'} || '%m/%d/%Y'; + my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; @@ -87,7 +89,7 @@ if ( scalar(@cust_bill_pay) == 0 && scalar(@cust_pay_refund) == 1 && $cust_pay->unapplied == 0 ) { #applied to one refund - $desc .= ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date); + $desc .= ' refunded on '. time2str($date_format, $cust_pay_refund[0]->_date); } else { #complicated $desc .= '<BR>'; @@ -98,11 +100,11 @@ if ( scalar(@cust_bill_pay) == 0 '$'. $app->amount. ' '. $app->applied_to_invoice. '<BR>'; - #' on '. time2str("%D", $cust_bill_pay->_date). + #' on '. time2str($date_format, $cust_bill_pay->_date). } elsif ( $app->isa('FS::cust_pay_refund') ) { $desc .= ' '. '$'. $app->amount. - ' refunded on '. time2str("%D", $app->_date). + ' refunded on '. time2str($date_format, $app->_date). '<BR>'; } else { die "$app is not a FS::cust_bill_pay or FS::cust_pay_refund"; diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index 610372721..be68ff091 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -1,10 +1,12 @@ <DEL>Payment <% $info %></DEL> -<I>voided <% time2str("%D", $cust_pay_void->void_date) %> +<I>voided <% time2str($date_format, $cust_pay_void->void_date) %> by <% $cust_pay_void->otaker %></I><% $unvoid %> <%init> my( $cust_pay_void, %opt ) = @_; +my $date_format = $opt{'date_format'} || '%m/%d/%Y'; + my $curuser = $FS::CurrentUser::CurrentUser; my $payby = $cust_pay_void->payby; |