Beispiel #1
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
  * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
  *
  * @return void
  */
 protected function hydrateShipmentMethodToOrderTransfer(SpySalesOrder $orderEntity, OrderTransfer $orderTransfer)
 {
     $shipmentMethodTransfer = new ShipmentMethodTransfer();
     $shipmentMethodEntity = $orderEntity->getShipmentMethod();
     if (!empty($shipmentMethodEntity)) {
         $shipmentMethodTransfer->fromArray($shipmentMethodEntity->toArray(), true);
         $shipmentMethodTransfer->setCarrierName($shipmentMethodEntity->getShipmentCarrier()->getName());
         $orderTransfer->setShipmentMethod($shipmentMethodTransfer);
     }
 }
Beispiel #2
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $salesOrderEntity
  *
  * @return void
  */
 protected function addShipmentExpense(SpySalesOrder $salesOrderEntity)
 {
     $shipmentEntity = $salesOrderEntity->getShipmentMethod();
     $shipmentExpense = new SpySalesExpense();
     $shipmentExpense->setFkSalesOrder($salesOrderEntity->getIdSalesOrder());
     $shipmentExpense->setName($shipmentEntity->getName());
     $shipmentExpense->setType(ShipmentConstants::SHIPMENT_EXPENSE_TYPE);
     $shipmentExpense->setGrossPrice($shipmentEntity->getDefaultPrice());
     $shipmentExpense->save();
 }