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

View File

@@ -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 {

View File

@@ -561,8 +561,8 @@ class OrderController extends mfBaseController {
$email->setBody($body);
$email->setFrom($from, $from_name);
$email->setTo($to);
$email->setHeader("X-xinon-oid", $order->id);
$email->setHeader("X-xinon-pid", $product->id);
$email->setHeader("X-Xinon-Oid", $order->id);
$email->setHeader("X-Xinon-Pid", $product->id);
$email->addAttachment($pdfpath, null, $pdfname, "application/pdf");
$email->send();
}