summaryrefslogtreecommitdiff
path: root/httemplate/edit/cust_main/birthdate.html
blob: e1adbd3bd13efb803243ca510621e0104c6d5f58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<% ntable("#cccccc", 2) %>

% # maybe put after the contact names?

% my $id_country = $conf->config('national_id-country');
%  if ( $id_country ) {
%   if ( $id_country eq 'MY' ) {
%     my($old, $nric) = ( '', '');
%     if ( $cust_main->national_id =~ /^\d{6}\-\d{2}\-\d{4}$/ ) {
%       $nric = $cust_main->national_id;
%     } else { # elsif ( $cust_main->national_id =~ /^\w\d{9}$/ ) {
%       $old = $cust_main->national_id;
%     #} else {
%     #  warn "unknown national_id format";
%#       <INPUT TYPE="hidden" NAME="national_id0" VALUE="<% $cust_main->national_id |h %>">
%     }

      <% include( '/elements/tr-input-text.html',
                    'field' => 'national_id1',
                    'value' => $nric,
                    'label' => 'NRIC',
                )
      %>
      <% include( '/elements/tr-input-text.html',
                    'field' => 'national_id2',
                    'value' => $old,
                    'label' => 'Old IC/Passport',
                )
      %>

%   } else {
%     warn "unknown national_id-country $id_country";
%   }
% }

% 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++,
            })
  %>
% }

% 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>

my( $cust_main, %opt ) = @_;
my $conf = new FS::Conf;

my $noinit = 0;

</%init>