projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
611624b
)
proper use of date_format config for international date formats, RT#7009
author
ivan
<ivan>
Mon, 8 Mar 2010 10:57:06 +0000
(10:57 +0000)
committer
ivan
<ivan>
Mon, 8 Mar 2010 10:57:06 +0000
(10:57 +0000)
18 files changed:
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/cust_bill.pm
patch
|
blob
|
history
httemplate/edit/REAL_cust_pkg.cgi
patch
|
blob
|
history
httemplate/edit/cust_credit.cgi
patch
|
blob
|
history
httemplate/edit/cust_pay.cgi
patch
|
blob
|
history
httemplate/edit/cust_refund.cgi
patch
|
blob
|
history
httemplate/edit/elements/ApplicationCommon.html
patch
|
blob
|
history
httemplate/edit/quick-charge.html
patch
|
blob
|
history
httemplate/elements/tr-input-beginning_ending.html
patch
|
blob
|
history
httemplate/elements/tr-input-date-field.html
patch
|
blob
|
history
httemplate/misc/cancel_pkg.html
patch
|
blob
|
history
httemplate/misc/delay_susp_pkg.html
patch
|
blob
|
history
httemplate/misc/order_pkg.html
patch
|
blob
|
history
httemplate/search/report_prepaid_income.html
patch
|
blob
|
history
httemplate/view/cust_main/payment_history.html
patch
|
blob
|
history
httemplate/view/cust_main/payment_history/credit.html
patch
|
blob
|
history
httemplate/view/cust_main/payment_history/payment.html
patch
|
blob
|
history
httemplate/view/cust_main/payment_history/voided_payment.html
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
909502f
..
aa6ad1b
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-730,6
+730,7
@@
worry that config_items is freeside-specific and icky.
'type' => 'select',
'select_hash' => [
'%m/%d/%Y' => 'MM/DD/YYYY',
'type' => 'select',
'select_hash' => [
'%m/%d/%Y' => 'MM/DD/YYYY',
+ '%d/%m/%Y' => 'DD/MM/YYYY',
'%Y/%m/%d' => 'YYYY/MM/DD',
],
},
'%Y/%m/%d' => 'YYYY/MM/DD',
],
},
diff --git
a/FS/FS/cust_bill.pm
b/FS/FS/cust_bill.pm
index
85628fb
..
28a7257
100644
(file)
--- a/
FS/FS/cust_bill.pm
+++ b/
FS/FS/cust_bill.pm
@@
-1,7
+1,7
@@
package FS::cust_bill;
use strict;
package FS::cust_bill;
use strict;
-use vars qw( @ISA $DEBUG $me $conf $money_char $date_format );
+use vars qw( @ISA $DEBUG $me $conf $money_char $date_format
$rdate_format
);
use vars qw( $invoice_lines @buf ); #yuck
use Fcntl qw(:flock); #for spool_csv
use List::Util qw(min max);
use vars qw( $invoice_lines @buf ); #yuck
use Fcntl qw(:flock); #for spool_csv
use List::Util qw(min max);
@@
-43,8
+43,9
@@
$me = '[FS::cust_bill]';
#ask FS::UID to run this stuff for us later
FS::UID->install_callback( sub {
$conf = new FS::Conf;
#ask FS::UID to run this stuff for us later
FS::UID->install_callback( sub {
$conf = new FS::Conf;
- $money_char = $conf->config('money_char') || '$';
- $date_format = $conf->config('date_format') || '%x';
+ $money_char = $conf->config('money_char') || '$';
+ $date_format = $conf->config('date_format') || '%x';
+ $rdate_format = $conf->config('date_format') || '%m/%d/%Y';
} );
=head1 NAME
} );
=head1 NAME
@@
-2293,7
+2294,7
@@
sub print_generic {
'template' => $template, #params{'template'},
'notice_name' => ($params{'notice_name'} || 'Invoice'),#escape_function?
'current_charges' => sprintf("%.2f", $self->charged),
'template' => $template, #params{'template'},
'notice_name' => ($params{'notice_name'} || 'Invoice'),#escape_function?
'current_charges' => sprintf("%.2f", $self->charged),
- 'duedate' => $self->due_date2str(
'%m/%d/%Y'
), #date_format?
+ 'duedate' => $self->due_date2str(
$rdate_format
), #date_format?
#customer info
'custnum' => $cust_main->display_custnum,
#customer info
'custnum' => $cust_main->display_custnum,
@@
-3153,7
+3154,7
@@
sub balance_due_msg {
my $msg = 'Balance Due';
return $msg unless $self->terms;
if ( $self->due_date ) {
my $msg = 'Balance Due';
return $msg unless $self->terms;
if ( $self->due_date ) {
- $msg .= ' - Please pay by '. $self->due_date2str(
'%x'
);
+ $msg .= ' - Please pay by '. $self->due_date2str(
$date_format
);
} elsif ( $self->terms ) {
$msg .= ' - '. $self->terms;
}
} elsif ( $self->terms ) {
$msg .= ' - '. $self->terms;
}
@@
-3165,7
+3166,7
@@
sub balance_due_date {
my $duedate = '';
if ( $conf->exists('invoice_default_terms')
&& $conf->config('invoice_default_terms')=~ /^\s*Net\s*(\d+)\s*$/ ) {
my $duedate = '';
if ( $conf->exists('invoice_default_terms')
&& $conf->config('invoice_default_terms')=~ /^\s*Net\s*(\d+)\s*$/ ) {
- $duedate = time2str(
"%m/%d/%Y"
, $self->_date + ($1*86400) );
+ $duedate = time2str(
$rdate_format
, $self->_date + ($1*86400) );
}
$duedate;
}
}
$duedate;
}
@@
-3190,7
+3191,7
@@
Returns a string with the date, for example: "3/20/2008"
sub _date_pretty {
my $self = shift;
sub _date_pretty {
my $self = shift;
- time2str(
'%x'
, $self->_date);
+ time2str(
$date_format
, $self->_date);
}
use vars qw(%pkg_category_cache);
}
use vars qw(%pkg_category_cache);
@@
-3825,9
+3826,7
@@
sub _items_previous {
foreach ( @pr_cust_bill ) {
my $date = $conf->exists('invoice_show_prior_due_date')
? 'due '. $_->due_date2str($date_format)
foreach ( @pr_cust_bill ) {
my $date = $conf->exists('invoice_show_prior_due_date')
? 'due '. $_->due_date2str($date_format)
- : time2str('%x', $_->_date); # date_format here, too,
- # but fix _items_cust_bill_pkg,
- # header, others?
+ : time2str($date_format, $_->_date);
push @b, {
'description' => 'Previous Balance, Invoice #'. $_->invnum. " ($date)",
#'pkgpart' => 'N/A',
push @b, {
'description' => 'Previous Balance, Invoice #'. $_->invnum. " ($date)",
#'pkgpart' => 'N/A',
@@
-3996,8
+3995,8
@@
sub _items_cust_bill_pkg {
? "Usage charges" : $desc;
unless ( $conf->exists('disable_line_item_date_ranges') ) {
? "Usage charges" : $desc;
unless ( $conf->exists('disable_line_item_date_ranges') ) {
- $description .= " (" . time2str(
"%x"
, $cust_bill_pkg->sdate).
- " - ". time2str(
"%x"
, $cust_bill_pkg->edate). ")";
+ $description .= " (" . time2str(
$date_format
, $cust_bill_pkg->sdate).
+ " - ". time2str(
$date_format
, $cust_bill_pkg->edate). ")";
}
my @d = ();
}
my @d = ();
@@
-4089,8
+4088,8
@@
sub _items_cust_bill_pkg {
if ( $cust_bill_pkg->recur != 0 ) {
push @b, {
'description' => "$desc (".
if ( $cust_bill_pkg->recur != 0 ) {
push @b, {
'description' => "$desc (".
- time2str(
"%x"
, $cust_bill_pkg->sdate). ' - '.
- time2str(
"%x"
, $cust_bill_pkg->edate). ')',
+ time2str(
$date_format
, $cust_bill_pkg->sdate). ' - '.
+ time2str(
$date_format
, $cust_bill_pkg->edate). ')',
'amount' => sprintf("%.2f", $cust_bill_pkg->recur),
};
}
'amount' => sprintf("%.2f", $cust_bill_pkg->recur),
};
}
@@
-4134,7
+4133,7
@@
sub _items_credits {
# " (". time2str("%x",$_->cust_credit->_date) .")".
# $reason,
'description' => 'Credit applied '.
# " (". time2str("%x",$_->cust_credit->_date) .")".
# $reason,
'description' => 'Credit applied '.
- time2str(
"%x"
,$_->cust_credit->_date). $reason,
+ time2str(
$date_format
,$_->cust_credit->_date). $reason,
'amount' => sprintf("%.2f",$_->amount),
};
}
'amount' => sprintf("%.2f",$_->amount),
};
}
@@
-4154,7
+4153,7
@@
sub _items_payments {
push @b, {
'description' => "Payment received ".
push @b, {
'description' => "Payment received ".
- time2str(
"%x"
,$_->cust_pay->_date ),
+ time2str(
$date_format
,$_->cust_pay->_date ),
'amount' => sprintf("%.2f", $_->amount )
};
}
'amount' => sprintf("%.2f", $_->amount )
};
}
diff --git
a/httemplate/edit/REAL_cust_pkg.cgi
b/httemplate/edit/REAL_cust_pkg.cgi
index
c312138
..
18d4415
100755
(executable)
--- a/
httemplate/edit/REAL_cust_pkg.cgi
+++ b/
httemplate/edit/REAL_cust_pkg.cgi
@@
-94,7
+94,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $column %>_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $column %>_text",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "<% $column %>_button",
align: "BR"
});
button: "<% $column %>_button",
align: "BR"
});
@@
-129,20
+129,16
@@
<% include('/elements/footer.html') %>
<% include('/elements/footer.html') %>
-<%once>
-
-#my $format = "%c %z (%Z)";
-my $format = "%m/%d/%Y %T %z (%Z)";
-
-#false laziness w/view/cust_main/packages.html
-#my( $billed_or_prepaid,
-
-</%once>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates');
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Edit customer package dates');
+my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
+my $format = $date_format. ' %T %z (%Z)';
+
my $error = '';
my( $pkgnum, $cust_pkg );
my $error = '';
my( $pkgnum, $cust_pkg );
diff --git
a/httemplate/edit/cust_credit.cgi
b/httemplate/edit/cust_credit.cgi
index
febf281
..
dc80847
100755
(executable)
--- a/
httemplate/edit/cust_credit.cgi
+++ b/
httemplate/edit/cust_credit.cgi
@@
-14,7
+14,7
@@
<TR>
<TD ALIGN="right">Date</TD>
<TR>
<TD ALIGN="right">Date</TD>
- <TD BGCOLOR="#ffffff"><% time2str(
"%D",
$_date) %></TD>
+ <TD BGCOLOR="#ffffff"><% time2str(
$date_format,
$_date) %></TD>
</TR>
<TR>
</TR>
<TR>
@@
-64,12
+64,10
@@
</FORM>
</BODY>
</HTML>
</FORM>
</BODY>
</HTML>
-<%
once
>
+<%
init
>
my $conf = new FS::Conf;
my $conf = new FS::Conf;
-
-</%once>
-<%init>
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post credit');
diff --git
a/httemplate/edit/cust_pay.cgi
b/httemplate/edit/cust_pay.cgi
index
07e5198
..
a6b73b1
100755
(executable)
--- a/
httemplate/edit/cust_pay.cgi
+++ b/
httemplate/edit/cust_pay.cgi
@@
-26,7
+26,7
@@
Payment
<TR>
<TD ALIGN="right">Date</TD>
<TD COLSPAN=2>
<TR>
<TD ALIGN="right">Date</TD>
<TD COLSPAN=2>
- <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str(
"%m/%d/%Y %r"
,$_date) %>">
+ <INPUT TYPE="text" NAME="_date" ID="_date_text" VALUE="<% time2str(
$date_format.' %r'
,$_date) %>">
<IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="Select date">
</TD>
</TR>
<IMG SRC="../images/calendar.png" ID="_date_button" STYLE="cursor: pointer" TITLE="Select date">
</TD>
</TR>
@@
-34,7
+34,7
@@
Payment
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "_date_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "_date_text",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "_date_button",
align: "BR"
});
button: "_date_button",
align: "BR"
});
@@
-100,7
+100,8
@@
Payment
my $conf = new FS::Conf;
my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
+my $money_char = $conf->config('money_char') || '$';
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Post payment');
diff --git
a/httemplate/edit/cust_refund.cgi
b/httemplate/edit/cust_refund.cgi
index
34e3812
..
59417b4
100755
(executable)
--- a/
httemplate/edit/cust_refund.cgi
+++ b/
httemplate/edit/cust_refund.cgi
@@
-41,7
+41,7
@@
</TR>
<TR>
</TR>
<TR>
- <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str(
"%D",
$cust_pay->_date) %></TD>
+ <TD ALIGN="right">Date</TD><TD BGCOLOR="#ffffff"><% time2str(
$date_format,
$cust_pay->_date) %></TD>
</TR>
<TR>
</TR>
<TR>
@@
-93,7
+93,7
@@
<TR>
<TD ALIGN="right">Date</TD>
<TR>
<TD ALIGN="right">Date</TD>
- <TD BGCOLOR="#ffffff"><% time2str(
"%D",
$_date) %></TD>
+ <TD BGCOLOR="#ffffff"><% time2str(
$date_format,
$_date) %></TD>
</TR>
<TR>
</TR>
<TR>
@@
-134,6
+134,8
@@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Refund payment');
my $conf = new FS::Conf;
unless $FS::CurrentUser::CurrentUser->access_right('Refund payment');
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
my $custnum = $cgi->param('custnum');
my $refund = $cgi->param('refund');
my $payby = $cgi->param('payby');
my $custnum = $cgi->param('custnum');
my $refund = $cgi->param('refund');
my $payby = $cgi->param('payby');
diff --git
a/httemplate/edit/elements/ApplicationCommon.html
b/httemplate/edit/elements/ApplicationCommon.html
index
4595705
..
7b1050a
100644
(file)
--- a/
httemplate/edit/elements/ApplicationCommon.html
+++ b/
httemplate/edit/elements/ApplicationCommon.html
@@
-54,7
+54,7
@@
Examples:
<TR>
<TD ALIGN="right">Date: </TD>
<TR>
<TD ALIGN="right">Date: </TD>
- <TD><B><% time2str(
"%D"
, $src->_date) %></B></TD>
+ <TD><B><% time2str(
$date_format
, $src->_date) %></B></TD>
</TR>
<TR>
</TR>
<TR>
@@
-354,7
+354,7
@@
function src_amount_changed () {
<OPTION VALUE="">Select <% $dst_thing %>
% foreach my $dst ( @dst ) {
<OPTION VALUE="">Select <% $dst_thing %>
% foreach my $dst ( @dst ) {
- <OPTION<% $dst->$dst_pkey eq $dst_pkeyvalue ? ' SELECTED' : '' %> VALUE="<% $dst->$dst_pkey %>">#<% $dst->$dst_pkey %> - <% time2str(
"%D"
, $dst->_date) %> - $<% $dst->$dst_unapplied %>
+ <OPTION<% $dst->$dst_pkey eq $dst_pkeyvalue ? ' SELECTED' : '' %> VALUE="<% $dst->$dst_pkey %>">#<% $dst->$dst_pkey %> - <% time2str(
$date_format
, $dst->_date) %> - $<% $dst->$dst_unapplied %>
% }
</SELECT>
% }
</SELECT>
@@
-399,7
+399,8
@@
function myOnLoadFunction () {
my %opt = @_;
my $conf = new FS::Conf;
my %opt = @_;
my $conf = new FS::Conf;
-my $money_char = $conf->config('money_char') || '$';
+my $money_char = $conf->config('money_char') || '$';
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
my $src_thing = ucfirst($opt{'src_thing'});
my $src_table = $opt{'src_table'};
my $src_thing = ucfirst($opt{'src_thing'});
my $src_table = $opt{'src_table'};
diff --git
a/httemplate/edit/quick-charge.html
b/httemplate/edit/quick-charge.html
index
c96fa6c
..
64ad3a2
100644
(file)
--- a/
httemplate/edit/quick-charge.html
+++ b/
httemplate/edit/quick-charge.html
@@
-147,7
+147,7
@@
function bill_now_changed (what) {
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "start_date_button",
align: "BR"
});
button: "start_date_button",
align: "BR"
});
@@
-250,6
+250,7
@@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('One-time charge');
my $conf = new FS::Conf;
unless $FS::CurrentUser::CurrentUser->access_right('One-time charge');
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
my $custnum = $1;
$cgi->param('custnum') =~ /^(\d+)$/ or die 'illegal custnum';
my $custnum = $1;
diff --git
a/httemplate/elements/tr-input-beginning_ending.html
b/httemplate/elements/tr-input-beginning_ending.html
index
8a1dd62
..
2aa5974
100644
(file)
--- a/
httemplate/elements/tr-input-beginning_ending.html
+++ b/
httemplate/elements/tr-input-beginning_ending.html
@@
-11,7
+11,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>beginning_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>beginning_text",
- ifFormat: "
%m/%d/%Y<%
$time_format %>",
+ ifFormat: "
<% $date_format.
$time_format %>",
button: "<% $opt{prefix} %>beginning_button",
align: "BR"
<% $input_time %>
button: "<% $opt{prefix} %>beginning_button",
align: "BR"
<% $input_time %>
@@
-30,7
+30,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>ending_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "<% $opt{prefix} %>ending_text",
- ifFormat: "
%m/%d/%Y<%
$time_format %>",
+ ifFormat: "
<% $date_format.
$time_format %>",
button: "<% $opt{prefix} %>ending_button",
align: "BR"
<% $input_time %>
button: "<% $opt{prefix} %>ending_button",
align: "BR"
<% $input_time %>
@@
-54,6
+54,10
@@
my $previous_request_count = '';
my %opt = @_;
my %opt = @_;
+my $conf = new FS::Conf;
+
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
$opt{prefix} = '' unless defined $opt{prefix};
$opt{prefix} .= '_' if $opt{prefix};
diff --git
a/httemplate/elements/tr-input-date-field.html
b/httemplate/elements/tr-input-date-field.html
index
2a731e1
..
ff4996f
100644
(file)
--- a/
httemplate/elements/tr-input-date-field.html
+++ b/
httemplate/elements/tr-input-date-field.html
@@
-21,8
+21,8
@@
});
</SCRIPT>
});
</SCRIPT>
-
<%init>
<%init>
+
my($name, $value, $label, $format, $usedatetime);
if ( ref($_[0]) ) {
my $opt = shift;
my($name, $value, $label, $format, $usedatetime);
if ( ref($_[0]) ) {
my $opt = shift;
@@
-35,7
+35,10
@@
if ( ref($_[0]) ) {
($name, $value, $label, $format, $usedatetime) = @_;
}
($name, $value, $label, $format, $usedatetime) = @_;
}
-$format = "%m/%d/%Y" unless $format;
+my $conf = new FS::Conf;
+
+$format ||= $conf->config('date_format') || '%m/%d/%Y';
+
$label = $name unless $label;
if ( $value =~ /\S/ ) {
$label = $name unless $label;
if ( $value =~ /\S/ ) {
diff --git
a/httemplate/misc/cancel_pkg.html
b/httemplate/misc/cancel_pkg.html
index
607ce13
..
67d2847
100755
(executable)
--- a/
httemplate/misc/cancel_pkg.html
+++ b/
httemplate/misc/cancel_pkg.html
@@
-31,7
+31,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "expire_date",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "expire_date",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "expire_button",
align: "BR"
});
button: "expire_button",
align: "BR"
});
@@
-58,7
+58,10
@@
<%init>
<%init>
-my $date = time2str("%m/%d/%Y", time);
+my %conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
+my $date = time2str($date_format, time);
my($pkgnum, $reasonnum);
if ( $cgi->param('error') ) {
my($pkgnum, $reasonnum);
if ( $cgi->param('error') ) {
diff --git
a/httemplate/misc/delay_susp_pkg.html
b/httemplate/misc/delay_susp_pkg.html
index
d4a6da1
..
5d6a2bd
100755
(executable)
--- a/
httemplate/misc/delay_susp_pkg.html
+++ b/
httemplate/misc/delay_susp_pkg.html
@@
-25,7
+25,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "dun_date",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "dun_date",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "dun_button",
align: "BR"
});
button: "dun_button",
align: "BR"
});
@@
-42,7
+42,10
@@
<%init>
<%init>
-my $date = time2str("%m/%d/%Y", time);
+my %conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
+my $date = time2str($date_format, time);
my($pkgnum);
if ( $cgi->param('error') ) {
my($pkgnum);
if ( $cgi->param('error') ) {
diff --git
a/httemplate/misc/order_pkg.html
b/httemplate/misc/order_pkg.html
index
864e832
..
666099a
100644
(file)
--- a/
httemplate/misc/order_pkg.html
+++ b/
httemplate/misc/order_pkg.html
@@
-60,7
+60,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "start_date_text",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "start_date_button",
align: "BR"
});
button: "start_date_button",
align: "BR"
});
@@
-107,6
+107,7
@@
die "access denied"
unless $curuser->access_right('Order customer package');
my $conf = new FS::Conf;
unless $curuser->access_right('Order customer package');
my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
my $custnum = $1;
$cgi->param('custnum') =~ /^(\d+)$/ or die "no custnum";
my $custnum = $1;
diff --git
a/httemplate/search/report_prepaid_income.html
b/httemplate/search/report_prepaid_income.html
index
d707bd8
..
04801be
100644
(file)
--- a/
httemplate/search/report_prepaid_income.html
+++ b/
httemplate/search/report_prepaid_income.html
@@
-44,7
+44,7
@@
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "date_text",
<SCRIPT TYPE="text/javascript">
Calendar.setup({
inputField: "date_text",
- ifFormat: "
%m/%d/%Y
",
+ ifFormat: "
<% $date_format %>
",
button: "date_button",
align: "BR"
});
button: "date_button",
align: "BR"
});
@@
-58,4
+58,7
@@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+my $conf = new FS::Conf;
+my $date_format = $conf->config('date_format') || '%m/%d/%Y';
+
</%init>
</%init>
diff --git
a/httemplate/view/cust_main/payment_history.html
b/httemplate/view/cust_main/payment_history.html
index
56a2c4d
..
0dc4c41
100644
(file)
--- 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">
<TR ID="balance_forward_row">
<TD CLASS="grid" BGCOLOR="#dddddd">
- <% time2str(
"%D",
$date) %>
+ <% time2str(
$date_format,
$date) %>
</TD>
<TD CLASS="grid" BGCOLOR="#dddddd">
</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>
(<A HREF="javascript:void(0);" onClick="show_history();">show prior history</A>)
</TD>
@@
-297,7
+297,7
@@
<A NAME="<% $target %>">
% }
<A NAME="<% $target %>">
% }
- <% time2str(
"%D",
$item->{'date'}) %>
+ <% time2str(
$date_format,
$item->{'date'}) %>
% if ( $target && $target{$target} == 1 ) {
</A>
% if ( $target && $target{$target} == 1 ) {
</A>
@@
-355,6
+355,7
@@
my( $cust_main ) = @_;
my $custnum = $cust_main->custnum;
my $conf = new FS::Conf;
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;
my $curuser = $FS::CurrentUser::CurrentUser;
@@
-376,7
+377,7
@@
my @history = ();
my %opt = (
( map { $_ => scalar($conf->config($_)) }
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 )
),
( 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
88bbe9b
..
75038cc
100644
(file)
--- 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( $cust_credit, %opt ) = @_;
+my $date_format = $opt{'date_format'} || '%m/%d/%Y';
+
my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
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
&& 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>';
} else {
#complicated
$desc .= '<BR>';
@@
-75,11
+77,11
@@
if ( scalar(@cust_credit_bill) == 0
'$'. $app->amount.
' '. $app->applied_to_invoice.
'<BR>';
'$'. $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.
} 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";
'<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
bcfa808
..
6ec9fdb
100644
(file)
--- 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( $cust_pay, %opt ) = @_;
+my $date_format = $opt{'date_format'} || '%m/%d/%Y';
+
my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
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
&& 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>';
} else {
#complicated
$desc .= '<BR>';
@@
-98,11
+100,11
@@
if ( scalar(@cust_bill_pay) == 0
'$'. $app->amount.
' '. $app->applied_to_invoice.
'<BR>';
'$'. $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.
} 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";
'<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
6103727
..
be68ff0
100644
(file)
--- 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>
<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 ) = @_;
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;
my $curuser = $FS::CurrentUser::CurrentUser;
my $payby = $cust_pay_void->payby;