projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
df42da2
)
add spouse_birthdate, RT#17577
author
Ivan Kohler
<ivan@freeside.biz>
Mon, 7 May 2012 18:18:15 +0000
(11:18 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Mon, 7 May 2012 18:18:15 +0000
(11:18 -0700)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/cust_main/Search.pm
patch
|
blob
|
history
httemplate/edit/cust_main.cgi
patch
|
blob
|
history
httemplate/edit/cust_main/birthdate.html
patch
|
blob
|
history
httemplate/edit/process/cust_main.cgi
patch
|
blob
|
history
httemplate/search/cust_main.html
patch
|
blob
|
history
httemplate/search/report_cust_main.html
patch
|
blob
|
history
httemplate/view/cust_main/misc.html
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
4b95915
..
ea6f436
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-3521,7
+3521,14
@@
and customer address. Include units.',
{
'key' => 'cust_main-enable_birthdate',
'section' => 'UI',
{
'key' => 'cust_main-enable_birthdate',
'section' => 'UI',
- 'descritpion' => 'Enable tracking of a birth date with each customer record',
+ 'description' => 'Enable tracking of a birth date with each customer record',
+ 'type' => 'checkbox',
+ },
+
+ {
+ 'key' => 'cust_main-enable_spouse_birthdate',
+ 'section' => 'UI',
+ 'description' => 'Enable tracking of a spouse birth date with each customer record',
'type' => 'checkbox',
},
'type' => 'checkbox',
},
@@
-4658,14
+4665,14
@@
and customer address. Include units.',
{
'key' => 'cust_main-edit_signupdate',
'section' => 'UI',
{
'key' => 'cust_main-edit_signupdate',
'section' => 'UI',
- 'descri
tp
ion' => 'Enable manual editing of the signup date.',
+ 'descri
pt
ion' => 'Enable manual editing of the signup date.',
'type' => 'checkbox',
},
{
'key' => 'svc_acct-disable_access_number',
'section' => 'UI',
'type' => 'checkbox',
},
{
'key' => 'svc_acct-disable_access_number',
'section' => 'UI',
- 'descri
tp
ion' => 'Disable access number selection.',
+ 'descri
pt
ion' => 'Disable access number selection.',
'type' => 'checkbox',
},
'type' => 'checkbox',
},
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
4b0422c
..
2299c3a
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-845,6
+845,7
@@
sub tables_hashref {
'stateid', 'varchar', 'NULL', $char_d, '', '',
'stateid_state', 'varchar', 'NULL', $char_d, '', '',
'birthdate' ,@date_type, '', '',
'stateid', 'varchar', 'NULL', $char_d, '', '',
'stateid_state', 'varchar', 'NULL', $char_d, '', '',
'birthdate' ,@date_type, '', '',
+ 'spouse_birthdate' ,@date_type, '', '',
'signupdate',@date_type, '', '',
'dundate', @date_type, '', '',
'company', 'varchar', 'NULL', $char_d, '', '',
'signupdate',@date_type, '', '',
'dundate', @date_type, '', '',
'company', 'varchar', 'NULL', $char_d, '', '',
diff --git
a/FS/FS/cust_main/Search.pm
b/FS/FS/cust_main/Search.pm
index
31b89cd
..
b663c20
100644
(file)
--- a/
FS/FS/cust_main/Search.pm
+++ b/
FS/FS/cust_main/Search.pm
@@
-467,6
+467,14
@@
bool
listref of start date, end date
listref of start date, end date
+=item birthdate
+
+listref of start date, end date
+
+=item spouse_birthdate
+
+listref of start date, end date
+
=item payby
listref
=item payby
listref
@@
-599,7
+607,7
@@
sub search {
# dates
##
# dates
##
- foreach my $field (qw( signupdate )) {
+ foreach my $field (qw( signupdate
birthdate spouse_birthdate
)) {
next unless exists($params->{$field});
next unless exists($params->{$field});
@@
-610,7
+618,7
@@
sub search {
"cust_main.$field >= $beginning",
"cust_main.$field <= $ending";
"cust_main.$field >= $beginning",
"cust_main.$field <= $ending";
- if(defined $hour) {
+ if(
$field eq 'signupdate' &&
defined $hour) {
if ($dbh->{Driver}->{Name} =~ /Pg/i) {
push @where, "extract(hour from to_timestamp(cust_main.$field)) = $hour";
}
if ($dbh->{Driver}->{Name} =~ /Pg/i) {
push @where, "extract(hour from to_timestamp(cust_main.$field)) = $hour";
}
diff --git
a/httemplate/edit/cust_main.cgi
b/httemplate/edit/cust_main.cgi
index
d2c0cb7
..
1762b00
100755
(executable)
--- a/
httemplate/edit/cust_main.cgi
+++ b/
httemplate/edit/cust_main.cgi
@@
-26,7
+26,10
@@
<& cust_main/top_misc.html, $cust_main, 'custnum' => $custnum &>
%# birthdate
<& cust_main/top_misc.html, $cust_main, 'custnum' => $custnum &>
%# birthdate
-% if ( $conf->exists('cust_main-enable_birthdate') ) {
+% if ( $conf->exists('cust_main-enable_birthdate')
+% || $conf->exists('cust_main-enable_spouse_birthdate')
+% )
+% {
<BR>
<& cust_main/birthdate.html, $cust_main &>
% }
<BR>
<& cust_main/birthdate.html, $cust_main &>
% }
diff --git
a/httemplate/edit/cust_main/birthdate.html
b/httemplate/edit/cust_main/birthdate.html
index
b4e78e3
..
6d1c221
100644
(file)
--- a/
httemplate/edit/cust_main/birthdate.html
+++ b/
httemplate/edit/cust_main/birthdate.html
@@
-1,16
+1,32
@@
<% ntable("#cccccc", 2) %>
<% ntable("#cccccc", 2) %>
- <% include( '/elements/tr-input-date-field.html',
- 'birthdate',
- $cust_main->birthdate,
- 'Date of Birth',
- ( $conf->config('date_format') || "%m/%d/%Y" ),
- 1
- )
+% if ( $conf->exists('cust_main-enable_birthdate') ) {
+ <% include( '/elements/tr-input-date-field.html', {
+ 'name' => 'birthdate',
+ 'value' => $cust_main->birthdate,
+ 'label' => 'Date of Birth',
+ 'format' => ( $conf->config('date_format') || "%m/%d/%Y" ),
+ 'usedatetime' => 1,
+ 'noinit' => $noinit++,
+ })
%>
%>
+% }
+% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
+ <% include( '/elements/tr-input-date-field.html', {
+ 'name' => 'spouse_birthdate',
+ 'value' => $cust_main->spouse_birthdate,
+ 'label' => 'Spouse Date of Birth',
+ 'format' => ( $conf->config('date_format') || "%m/%d/%Y" ),
+ 'usedatetime' => 1,
+ 'noinit' => $noinit++,
+ })
+ %>
+% }
</TABLE>
<%init>
my( $cust_main, %opt ) = @_;
my $conf = new FS::Conf;
</TABLE>
<%init>
my( $cust_main, %opt ) = @_;
my $conf = new FS::Conf;
+my $noinit = 0;
+
</%init>
</%init>
diff --git
a/httemplate/edit/process/cust_main.cgi
b/httemplate/edit/process/cust_main.cgi
index
994f9b7
..
4b2ad13
100755
(executable)
--- a/
httemplate/edit/process/cust_main.cgi
+++ b/
httemplate/edit/process/cust_main.cgi
@@
-89,9
+89,11
@@
if ( $cgi->param('no_credit_limit') ) {
$new->tagnum( [ $cgi->param('tagnum') ] );
$new->tagnum( [ $cgi->param('tagnum') ] );
-my %usedatetime = ( 'birthdate' => 1 );
+my %usedatetime = ( 'birthdate' => 1,
+ 'spouse_birthdate' => 1,
+ );
-foreach my $dfield (qw( birthdate signupdate )) {
+foreach my $dfield (qw( birthdate s
pouse_birthdate s
ignupdate )) {
if ( $cgi->param($dfield) && $cgi->param($dfield) =~ /^([ 0-9\-\/]{0,10})$/) {
if ( $cgi->param($dfield) && $cgi->param($dfield) =~ /^([ 0-9\-\/]{0,10})$/) {
diff --git
a/httemplate/search/cust_main.html
b/httemplate/search/cust_main.html
index
498024b
..
bb5eae7
100755
(executable)
--- a/
httemplate/search/cust_main.html
+++ b/
httemplate/search/cust_main.html
@@
-64,14
+64,22
@@
for my $param (qw( classnum payby tagnum )) {
# parse dates
###
# parse dates
###
-foreach my $field (qw( signupdate )) {
+foreach my $field (qw( signupdate
birthdate spouse_birthdate
)) {
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
- next if $beginning == 0 && $ending == 4294967295 &&
!defined($cgi->param('signuphour')
);
+ next if $beginning == 0 && $ending == 4294967295 &&
( $field ne 'signupdate' || !defined($cgi->param('signuphour'))
);
#or $disable{$cgi->param('status')}->{$field};
#or $disable{$cgi->param('status')}->{$field};
- $search_hash{$field} = [ $beginning, $ending, $cgi->param('signuphour') ];
+ unless ( $field eq 'signupdate' ) {
+ $beginning -= 43200;
+ $ending -= 43200;
+ }
+
+ my @ary = ( $beginning, $ending );
+ push @ary, scalar($cgi->param('signuphour')) if $field eq 'signupdate';
+
+ $search_hash{$field} = \@ary;
}
}
diff --git
a/httemplate/search/report_cust_main.html
b/httemplate/search/report_cust_main.html
index
0ef5a51
..
c7a3ad9
100755
(executable)
--- a/
httemplate/search/report_cust_main.html
+++ b/
httemplate/search/report_cust_main.html
@@
-42,6
+42,34
@@
</TD>
</TR>
</TD>
</TR>
+% if ( $conf->exists('cust_main-enable_birthdate') ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Date of Birth') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'birthdate',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+% }
+
+% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Spouse Date of Birth') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'spouse_birthdate',
+ layout => 'horiz',
+ &>
+ </TABLE>
+ </TD>
+ </TR>
+% }
+
<& /elements/tr-select-cust_tag.html,
'cgi' => $cgi,
'is_report' => 1,
<& /elements/tr-select-cust_tag.html,
'cgi' => $cgi,
'is_report' => 1,
diff --git
a/httemplate/view/cust_main/misc.html
b/httemplate/view/cust_main/misc.html
index
c7a3ebf
..
813881c
100644
(file)
--- a/
httemplate/view/cust_main/misc.html
+++ b/
httemplate/view/cust_main/misc.html
@@
-116,6
+116,20
@@
% }
% }
+% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
+% my $dt = $cust_main->spouse_birthdate ne ''
+% ? DateTime->from_epoch( 'epoch' => $cust_main->spouse_birthdate,
+% 'time_zone' =>'floating',
+% )
+% : '';
+
+ <TR>
+ <TD ALIGN="right"><% mt('Spouse Date of Birth') |h %></TD>
+ <TD BGCOLOR="#ffffff"><% $dt ? $dt->strftime($date_format) : '' %></TD>
+ </TR>
+
+% }
+
% if ( $conf->exists('cust_main-require_censustract') ) {
<TR>
% if ( $conf->exists('cust_main-require_censustract') ) {
<TR>