projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4447019
)
add anniversary date, RT#18631
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 26 Jul 2012 21:02:58 +0000
(14:02 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 26 Jul 2012 21:02:58 +0000
(14:02 -0700)
FS/FS/Conf.pm
patch
|
blob
|
history
FS/FS/Schema.pm
patch
|
blob
|
history
FS/FS/cust_main.pm
patch
|
blob
|
history
FS/FS/cust_main/Import.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
9ff921c
..
da29a05
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-3589,6
+3589,13
@@
and customer address. Include units.',
},
{
},
{
+ 'key' => 'cust_main-enable_anniversary_date',
+ 'section' => 'UI',
+ 'description' => 'Enable tracking of an anniversary date with each customer record',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'cust_main-edit_calling_list_exempt',
'section' => 'UI',
'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
'key' => 'cust_main-edit_calling_list_exempt',
'section' => 'UI',
'description' => 'Display the "calling_list_exempt" checkbox on customer edit.',
diff --git
a/FS/FS/Schema.pm
b/FS/FS/Schema.pm
index
c35388b
..
097799b
100644
(file)
--- a/
FS/FS/Schema.pm
+++ b/
FS/FS/Schema.pm
@@
-846,6
+846,7
@@
sub tables_hashref {
'stateid_state', 'varchar', 'NULL', $char_d, '', '',
'birthdate' ,@date_type, '', '',
'spouse_birthdate' ,@date_type, '', '',
'stateid_state', 'varchar', 'NULL', $char_d, '', '',
'birthdate' ,@date_type, '', '',
'spouse_birthdate' ,@date_type, '', '',
+ 'anniversary_date' ,@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.pm
b/FS/FS/cust_main.pm
index
765e90e
..
10f8268
100644
(file)
--- a/
FS/FS/cust_main.pm
+++ b/
FS/FS/cust_main.pm
@@
-1775,8
+1775,10
@@
sub check {
|| $self->ut_textn('custbatch')
|| $self->ut_name('last')
|| $self->ut_name('first')
|| $self->ut_textn('custbatch')
|| $self->ut_name('last')
|| $self->ut_name('first')
- || $self->ut_snumbern('birthdate')
|| $self->ut_snumbern('signupdate')
|| $self->ut_snumbern('signupdate')
+ || $self->ut_snumbern('birthdate')
+ || $self->ut_snumbern('spouse_birthdate')
+ || $self->ut_snumbern('anniversary_date')
|| $self->ut_textn('company')
|| $self->ut_text('address1')
|| $self->ut_textn('address2')
|| $self->ut_textn('company')
|| $self->ut_text('address1')
|| $self->ut_textn('address2')
diff --git
a/FS/FS/cust_main/Import.pm
b/FS/FS/cust_main/Import.pm
index
6681f9e
..
ee14cba
100644
(file)
--- a/
FS/FS/cust_main/Import.pm
+++ b/
FS/FS/cust_main/Import.pm
@@
-375,7
+375,8
@@
sub batch_import {
}
$cust_main{$_} = parse_datetime($cust_main{$_})
}
$cust_main{$_} = parse_datetime($cust_main{$_})
- foreach grep $cust_main{$_}, qw( birthdate spouse_birthdate );
+ foreach grep $cust_main{$_},
+ qw( birthdate spouse_birthdate anniversary_date );
my $invoicing_list = $cust_main{'invoicing_list'}
? [ delete $cust_main{'invoicing_list'} ]
my $invoicing_list = $cust_main{'invoicing_list'}
? [ delete $cust_main{'invoicing_list'} ]
diff --git
a/FS/FS/cust_main/Search.pm
b/FS/FS/cust_main/Search.pm
index
ec1bd3d
..
a55b573
100644
(file)
--- a/
FS/FS/cust_main/Search.pm
+++ b/
FS/FS/cust_main/Search.pm
@@
-477,6
+477,10
@@
listref of start date, end date
listref of start date, end date
listref of start date, end date
+=item anniversary_date
+
+listref of start date, end date
+
=item payby
listref
=item payby
listref
@@
-618,7
+622,7
@@
sub search {
# dates
##
# dates
##
- foreach my $field (qw( signupdate birthdate spouse_birthdate )) {
+ foreach my $field (qw( signupdate birthdate spouse_birthdate
anniversary_date
)) {
next unless exists($params->{$field});
next unless exists($params->{$field});
diff --git
a/httemplate/edit/cust_main.cgi
b/httemplate/edit/cust_main.cgi
index
7b3e181
..
414043e
100755
(executable)
--- a/
httemplate/edit/cust_main.cgi
+++ b/
httemplate/edit/cust_main.cgi
@@
-28,6
+28,7
@@
%# birthdate
% if ( $conf->exists('cust_main-enable_birthdate')
% || $conf->exists('cust_main-enable_spouse_birthdate')
%# birthdate
% if ( $conf->exists('cust_main-enable_birthdate')
% || $conf->exists('cust_main-enable_spouse_birthdate')
+% || $conf->exists('cust_main-enable_anniversary_date')
% )
% {
<BR>
% )
% {
<BR>
diff --git
a/httemplate/edit/cust_main/birthdate.html
b/httemplate/edit/cust_main/birthdate.html
index
6d1c221
..
5ea8e18
100644
(file)
--- a/
httemplate/edit/cust_main/birthdate.html
+++ b/
httemplate/edit/cust_main/birthdate.html
@@
-10,6
+10,7
@@
})
%>
% }
})
%>
% }
+
% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
<% include( '/elements/tr-input-date-field.html', {
'name' => 'spouse_birthdate',
% if ( $conf->exists('cust_main-enable_spouse_birthdate') ) {
<% include( '/elements/tr-input-date-field.html', {
'name' => 'spouse_birthdate',
@@
-21,6
+22,19
@@
})
%>
% }
})
%>
% }
+
+% if ( $conf->exists('cust_main-enable_anniversary_date') ) {
+ <% include( '/elements/tr-input-date-field.html', {
+ 'name' => 'anniversary_date',
+ 'value' => $cust_main->anniversary_date,
+ 'label' => 'Anniversary Date',
+ 'format' => ( $conf->config('date_format') || "%m/%d/%Y" ),
+ 'usedatetime' => 1,
+ 'noinit' => $noinit++,
+ })
+ %>
+% }
+
</TABLE>
<%init>
</TABLE>
<%init>
diff --git
a/httemplate/edit/process/cust_main.cgi
b/httemplate/edit/process/cust_main.cgi
index
15dd461
..
0e383af
100755
(executable)
--- a/
httemplate/edit/process/cust_main.cgi
+++ b/
httemplate/edit/process/cust_main.cgi
@@
-93,9
+93,12
@@
$new->tagnum( [ $cgi->param('tagnum') ] );
my %usedatetime = ( 'birthdate' => 1,
'spouse_birthdate' => 1,
my %usedatetime = ( 'birthdate' => 1,
'spouse_birthdate' => 1,
+ 'anniversary_date' => 1,
);
);
-foreach my $dfield (qw( birthdate spouse_birthdate signupdate )) {
+foreach my $dfield (qw(
+ signupdate birthdate spouse_birthdate anniversary_date
+)) {
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
e164b98
..
f75b451
100755
(executable)
--- a/
httemplate/search/cust_main.html
+++ b/
httemplate/search/cust_main.html
@@
-61,7
+61,7
@@
for my $param (qw( classnum refnum payby tagnum )) {
# parse dates
###
# parse dates
###
-foreach my $field (qw( signupdate birthdate spouse_birthdate )) {
+foreach my $field (qw( signupdate birthdate spouse_birthdate
anniversary_date
)) {
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
diff --git
a/httemplate/search/report_cust_main.html
b/httemplate/search/report_cust_main.html
index
39cf695
..
526bce2
100755
(executable)
--- a/
httemplate/search/report_cust_main.html
+++ b/
httemplate/search/report_cust_main.html
@@
-76,6
+76,20
@@
</TR>
% }
</TR>
% }
+% if ( $conf->exists('cust_main-enable_anniversary_date') ) {
+ <TR>
+ <TD ALIGN="right" VALIGN="center"><% mt('Anniversary Date') |h %></TD>
+ <TD>
+ <TABLE>
+ <& /elements/tr-input-beginning_ending.html,
+ prefix => 'anniversary_date',
+ 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
813881c
..
5872beb
100644
(file)
--- a/
httemplate/view/cust_main/misc.html
+++ b/
httemplate/view/cust_main/misc.html
@@
-130,6
+130,20
@@
% }
% }
+% if ( $conf->exists('cust_main-enable_anniversary_date') ) {
+% my $dt = $cust_main->anniversary_date ne ''
+% ? DateTime->from_epoch( 'epoch' => $cust_main->anniversary_date,
+% 'time_zone' =>'floating',
+% )
+% : '';
+
+ <TR>
+ <TD ALIGN="right"><% mt('Anniversary Date') |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>