Skip to content

Commit

Permalink
Update doliconnect.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ptibogxiv committed Apr 15, 2019
1 parent 7e5ca0c commit 1b5a4b3
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions doliconnect.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,12 @@ function dolibarr() {
} else {
if ( $dolibarr->fk_soc == 0 ) {

if ( $current_user->billing_type == 'mor' ) { $name = $current_user->billing_company;
if ( $current_user->billing_type == 'mor' ) {
if (!empty($current_user->billing_company)) { $name = $current_user->billing_company; }
else { $name = $current_user->user_login; }
} else {
$name = $current_user->user_firstname." ".$current_user->user_lastname;
if (!empty($current_user->user_firstname) && !empty($current_user->user_lastname)) { $name = $current_user->user_firstname." ".$current_user->user_lastname; }
else { $name = $current_user->user_login; }
}

$rdr = [
Expand Down Expand Up @@ -273,10 +276,13 @@ function doliconnector($current_user = null) {

} else {

if ( $current_user->billing_type == 'mor' ) { $name = $user->billing_company;
if ( $current_user->billing_type == 'mor' ) {
if (!empty($current_user->billing_company)) { $name = $current_user->billing_company; }
else { $name = $current_user->user_login; }
} else {
$name = $user->user_firstname." ".$user->user_lastname;
}
if (!empty($current_user->user_firstname) && !empty($current_user->user_lastname)) { $name = $current_user->user_firstname." ".$current_user->user_lastname; }
else { $name = $current_user->user_login; }
}

$rdr = [
'name' => $name,
Expand Down

0 comments on commit 1b5a4b3

Please sign in to comment.