}
#recover all data from guarantor address phone ,fax...
-if ( defined($guarantorid) and
- ( $category_type eq 'C' || $category_type eq 'P' ) and
- $guarantorid ne '' and
- $guarantorid ne '0' ) {
+if ( $guarantorid and ( $category_type eq 'C' || $category_type eq 'P' )) {
if (my $guarantordata=GetMember(borrowernumber => $guarantorid)) {
$guarantorinfo=$guarantordata->{'surname'}." , ".$guarantordata->{'firstname'};
if ( !defined($data{'contactname'}) or $data{'contactname'} eq '' or
$template->param('typeloop' => \@typeloop);
# test in city
-$select_city=getidcity($data{'city'}) if defined $guarantorid and ($guarantorid ne '0');
+if ( $guarantorid ) {
+ $select_city = getidcity($data{city});
+}
($default_city=$select_city) if ($step eq 0);
if (!defined($select_city) or $select_city eq '' ){
$default_city = &getidcity($data{'city'});
$template->param(
nodouble => $nodouble,
borrowernumber => $borrowernumber, #register number
- guarantorid => (defined($borrower_data->{'guarantorid'})) ? $borrower_data->{'guarantorid'} : $guarantorid,
+ guarantorid => (($borrower_data->{'guarantorid'})) ? $borrower_data->{'guarantorid'} : $guarantorid,
ethcatpopup => $ethcatpopup,
relshiploop => \@relshipdata,
city_loop => $city_arrayref,
my $catcode;
if ( $category_type eq 'C') {
- if ($data->{'guarantorid'} ne '0' ) {
+ if ($data->{guarantorid} ) {
my $data2 = GetMember( 'borrowernumber' => $data->{'guarantorid'} );
foreach (qw(address city B_address B_city phone mobile zipcode country B_country)) {
$data->{$_} = $data2->{$_};
elsif ( $op eq 'update' ) {
my $member = GetMember('borrowernumber'=>$borrowernumber);
- $member->{'guarantorid'} = '0';
+ $member->{'guarantorid'} = 0;
$member->{'categorycode'} = $catcode;
my $borcat = GetBorrowercategory($catcode);
$member->{'category_type'} = $borcat->{'category_type'};