private function createDocumentFromOrder(Order $order)
 {
     $document = new Document();
     $billingAddress = $order->getBillingAddress();
     $productLines = $this->createProductLinesFromOrder($order);
     $total = 0;
     foreach ($productLines as $productLine) {
         $total += $productLine->getTotal();
     }
     $document->setBillingAddress($billingAddress->getName())->setCurrency($billingAddress->getCountry()->getCurrency())->setCustomerName($order->getCustomer()->getContact()->getName())->setOrderNumber($order->getId())->setProductLines($productLines)->setTotal($total)->setType('invoice');
     return $document;
 }
Beispiel #2
0
 public function getLogContext()
 {
     return array('documentId' => $this->document->getId(), 'orderNumber' => $this->document->getOrderNumber());
 }