Skip to content

Commit

Permalink
UPDATE Order export (Debit data)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Bächtle committed Sep 17, 2013
1 parent 9312e6a commit 182b1a7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
2 changes: 2 additions & 0 deletions Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
define('IMPORT_ITEM_CATEGORY_SYNC', 1);
define('IMPORT_ITEM_CATEGORY_NO_SYNC', 0);

define('MOP_DEBIT', 3);

/**
* This class is called first when starting the plentymarkets plugin. It initializes and cleans all important data.
* It also provides cronjob functionality for an initial execution of the plentymarkets plugin.
Expand Down
42 changes: 24 additions & 18 deletions Components/Export/Entity/PlentymarketsExportEntityOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -262,46 +262,52 @@ protected function exportOrder()

$Object_OrderHead->ReferrerID = $referrerId;


$Object_Order->OrderHead = $Object_OrderHead;


$Object_OrderHead->OrderInfos = array();

// Debit data
if (isset($this->order['customer']['debit']['accountHolder']) && $Object_OrderHead->MethodOfPaymentID == MOP_DEBIT)
{
$info = 'Account holder: '. $this->order['customer']['debit']['accountHolder'] . chr(10);
$info .= 'Bank name: '. $this->order['customer']['debit']['bankName'] . chr(10);
$info .= 'Bank code: '. $this->order['customer']['debit']['bankCode'] . chr(10);
$info .= 'Account number: '. $this->order['customer']['debit']['account'] . chr(10);

$Object_OrderInfo = new PlentySoapObject_OrderInfo();
$Object_OrderInfo->Info = $info;
$Object_OrderInfo->InfoCustomer = 0;
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp();
$Object_OrderHead->OrderInfos[] = $Object_OrderInfo;
}

if (!empty($this->order['internalComment']))
{
$Object_OrderInfo = new PlentySoapObject_OrderInfo();
$Object_OrderInfo->Info = $this->order['internalComment']; // string
$Object_OrderInfo->InfoCustomer = 0; // int
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp(); // int
$Object_OrderInfo->InfoID = null; // int
$Object_OrderInfo->InfoUser = null; // int
$Object_OrderInfo->Info = $this->order['internalComment'];
$Object_OrderInfo->InfoCustomer = 0;
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp();
$Object_OrderHead->OrderInfos[] = $Object_OrderInfo;
}

if (!empty($this->order['customerComment']))
{
$Object_OrderInfo = new PlentySoapObject_OrderInfo();
$Object_OrderInfo->Info = $this->order['customerComment']; // string
$Object_OrderInfo->InfoCustomer = 1; // int
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp(); // int
$Object_OrderInfo->InfoID = null; // int
$Object_OrderInfo->InfoUser = null; // int
$Object_OrderInfo->Info = $this->order['customerComment'];
$Object_OrderInfo->InfoCustomer = 1;
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp();
$Object_OrderHead->OrderInfos[] = $Object_OrderInfo;
}

if (!empty($this->order['comment']))
{
$Object_OrderInfo = new PlentySoapObject_OrderInfo();
$Object_OrderInfo->Info = $this->order['comment']; // string
$Object_OrderInfo->InfoCustomer = 1; // int
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp(); // int
$Object_OrderInfo->InfoID = null; // int
$Object_OrderInfo->InfoUser = null; // int
$Object_OrderInfo->Info = $this->order['comment'];
$Object_OrderInfo->InfoCustomer = 1;
$Object_OrderInfo->InfoDate = $this->order['orderTime']->getTimestamp();
$Object_OrderHead->OrderInfos[] = $Object_OrderInfo;
}


$Object_Order->OrderItems = array();

foreach ($this->order['details'] as $item)
Expand Down

0 comments on commit 182b1a7

Please sign in to comment.