Lines 94-103
elsif ( $op eq 'add_validate' ) {
Link Here
|
94 |
my $is_a_modif = $input->param("is_a_modif"); |
94 |
my $is_a_modif = $input->param("is_a_modif"); |
95 |
|
95 |
|
96 |
my $contractstart_dt = eval { dt_from_string( $input->param('contractstartdate') ); }; |
96 |
my $contractstart_dt = eval { dt_from_string( $input->param('contractstartdate') ); }; |
97 |
$contractstart_dt = dt_from_string if ( ! $contractstart_dt ); |
|
|
98 |
|
99 |
my $contractend_dt = eval { dt_from_string( $input->param('contractenddate') ); }; |
97 |
my $contractend_dt = eval { dt_from_string( $input->param('contractenddate') ); }; |
100 |
$contractend_dt = dt_from_string if ( ! $contractend_dt ); |
98 |
unless ( $contractstart_dt and $contractend_dt ) { |
|
|
99 |
my $today = dt_from_string; |
100 |
$contractstart_dt ||= $today; |
101 |
$contractend_dt ||= $today; |
102 |
} |
101 |
|
103 |
|
102 |
if ( $is_a_modif ) { |
104 |
if ( $is_a_modif ) { |
103 |
ModContract({ |
105 |
ModContract({ |
Lines 161-169
if ( $op eq 'list' ) {
Link Here
|
161 |
my @contracts = @{GetContracts( { booksellerid => $booksellerid } )}; |
163 |
my @contracts = @{GetContracts( { booksellerid => $booksellerid } )}; |
162 |
|
164 |
|
163 |
# format dates |
165 |
# format dates |
164 |
for ( @contracts ) { |
166 |
for my $contract ( @contracts ) { |
165 |
$$_{contractstartdate} = output_pref({ dt => dt_from_string( $$_{contractstartdate} ), dateonly => 1 }); |
167 |
$contract->{contractstartdate} = output_pref({ dt => dt_from_string( $contract->{contractstartdate} ), dateonly => 1 }); |
166 |
$$_{contractenddate} = output_pref({ dt => dt_from_string( $$_{contractenddate} ), dateonly => 1 }), |
168 |
$contract->{contractenddate} = output_pref({ dt => dt_from_string( $contract->{contractenddate} ), dateonly => 1 }), |
167 |
} |
169 |
} |
168 |
|
170 |
|
169 |
$template->param(loop => \@contracts); |
171 |
$template->param(loop => \@contracts); |
170 |
- |
|
|