Lines 211-223
if ( ( $op eq 'insert' ) and !$nodouble ) {
Link Here
|
211 |
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) { |
211 |
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) { |
212 |
if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) { |
212 |
if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) { |
213 |
$guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'}; |
213 |
$guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'}; |
214 |
if ( !defined($data{'contactname'}) or $data{'contactname'} eq '' or |
214 |
$newdata{'contactfirstname'}= $guarantordata->{'firstname'}; |
215 |
$data{'contactname'} ne $guarantordata->{'surname'} ) { |
215 |
$newdata{'contactname'} = $guarantordata->{'surname'}; |
216 |
$newdata{'contactfirstname'}= $guarantordata->{'firstname'}; |
216 |
$newdata{'contacttitle'} = $guarantordata->{'title'}; |
217 |
$newdata{'contactname'} = $guarantordata->{'surname'}; |
217 |
if ( $op eq 'add' ) { |
218 |
$newdata{'contacttitle'} = $guarantordata->{'title'}; |
|
|
219 |
foreach (qw(streetnumber address streettype address2 |
218 |
foreach (qw(streetnumber address streettype address2 |
220 |
zipcode country city phone phonepro mobile fax email emailpro branchcode)) { |
219 |
zipcode country city state phone phonepro mobile fax email emailpro branchcode |
|
|
220 |
B_streetnumber B_streettype B_address B_address2 |
221 |
B_city B_state B_zipcode B_country B_email B_phone)) { |
221 |
$newdata{$_} = $guarantordata->{$_}; |
222 |
$newdata{$_} = $guarantordata->{$_}; |
222 |
} |
223 |
} |
223 |
} |
224 |
} |
Lines 225-236
if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
Link Here
|
225 |
} |
226 |
} |
226 |
|
227 |
|
227 |
###############test to take the right zipcode, country and city name ############## |
228 |
###############test to take the right zipcode, country and city name ############## |
228 |
if (!defined($guarantorid) or $guarantorid eq '' or $guarantorid eq '0') { |
229 |
# set only if parameter was passed from the form |
229 |
# set only if parameter was passed from the form |
230 |
$newdata{'city'} = $input->param('city') if defined($input->param('city')); |
230 |
$newdata{'city'} = $input->param('city') if defined($input->param('city')); |
231 |
$newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode')); |
231 |
$newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode')); |
232 |
$newdata{'country'} = $input->param('country') if defined($input->param('country')); |
232 |
$newdata{'country'} = $input->param('country') if defined($input->param('country')); |
|
|
233 |
} |
234 |
|
233 |
|
235 |
#builds default userid |
234 |
#builds default userid |
236 |
if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){ |
235 |
if ( (defined $newdata{'userid'}) && ($newdata{'userid'} eq '')){ |
Lines 677-683
$template->param(CGIbranch=>$CGIbranch) if ($CGIbranch);
Link Here
|
677 |
$template->param( |
676 |
$template->param( |
678 |
nodouble => $nodouble, |
677 |
nodouble => $nodouble, |
679 |
borrowernumber => $borrowernumber, #register number |
678 |
borrowernumber => $borrowernumber, #register number |
680 |
guarantorid => (($borrower_data->{'guarantorid'})) ? $borrower_data->{'guarantorid'} : $guarantorid, |
679 |
guarantorid => ($borrower_data->{'guarantorid'} || $guarantorid), |
681 |
ethcatpopup => $ethcatpopup, |
680 |
ethcatpopup => $ethcatpopup, |
682 |
relshiploop => \@relshipdata, |
681 |
relshiploop => \@relshipdata, |
683 |
city_loop => $city_arrayref, |
682 |
city_loop => $city_arrayref, |