From 7c12599ecf132f4755e56318b76ce3274c04cca4 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 3 May 2022 13:21:36 +0200 Subject: [PATCH] Fixed Billingaddress export to IVT --- application/IvtCustomer/IvtCustomerController.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/application/IvtCustomer/IvtCustomerController.php b/application/IvtCustomer/IvtCustomerController.php index b2ec99c4d..e6d663ba7 100644 --- a/application/IvtCustomer/IvtCustomerController.php +++ b/application/IvtCustomer/IvtCustomerController.php @@ -10,7 +10,7 @@ class IvtCustomerController extends mfBaseController { $this->redirect("Order"); } - $contact = $order->$billingaddress; + $contact = $order->billingaddress; if(!$contact) { $contact = $order->owner; } else { @@ -23,14 +23,12 @@ class IvtCustomerController extends mfBaseController { } $ivtc = new IvtCustomer($contact->customer_number); - //var_dump($ivtc); if($ivtc->id) { $return = ['status' => 'error', 'reason' => "ivt-exist"]; $this->returnJson($return); } - $ivtc->title = ""; $ivtc->nick = ""; $ivtc->pwd = ""; @@ -50,7 +48,7 @@ class IvtCustomerController extends mfBaseController { $ivtc->firstname = ""; $ivtc->surname = str_replace("\r\n", " ", str_replace("\n", " ", $contact->company)); } - $ivtc->UID = $ivtc->uid; // XXX + $ivtc->UID = $contact->uid; // XXX $ivtc->zip = $contact->zip; $ivtc->location = $contact->city; @@ -103,14 +101,14 @@ class IvtCustomerController extends mfBaseController { //var_dump($ivtc); + $this->log->debug("new IVT customer:\n".print_r($ivtc, true)); + if($ivtc->save()) { $return = ['status' => 'OK', 'reason' => ""]; } else { $return = ['status' => 'error', 'reason' => "save"]; } - $this->log->debug("new IVT customer:\n".print_r($ivtc)); - $this->returnJson($return); } } \ No newline at end of file