Fixed first and lastname in ivt sync

This commit is contained in:
Frank Schubert
2021-10-09 15:33:47 +02:00
parent 84f8dfa709
commit f3c70679e5
2 changed files with 5 additions and 4 deletions
@@ -42,7 +42,10 @@ class IvtCustomerController extends mfBaseController {
$ivtc->bill_row4 = "";
$ivtc->id = $contact->customer_number;
$ivtc->firstname = $contact->firstname;
$ivtc->surname = $contact->lastname;
$ivtc->company = str_replace("\r\n", " ", str_replace("\n", " ", $contact->company));
if($contact->company) {
$ivtc->firstname = "";
$ivtc->surname = str_replace("\r\n", " ", str_replace("\n", " ", $contact->company));
@@ -95,8 +98,6 @@ class IvtCustomerController extends mfBaseController {
//var_dump($ivtc);
if($ivtc->save()) {
$return = ['status' => 'OK', 'reason' => ""];
} else {