2 namespace Valuation\Service;
9 * @var \Doctrine\ORM\EntityManager
13 * @var \Valuation\Entity\XmlRpc
15 protected $client = null;
17 * @var \Valuation\Entity\Valuation
19 protected $valuation = null;
25 * Utility to log api requests.
26 * @param string $methodName
27 * @param array $packet
28 * @param string $status
30 protected function logRequest($methodName, array $packet, $status = 'OK')
32 $log = new \Valuation\Entity\XmlRpcRequestLog();
33 $log->fromArray(array(
34 'xmlRpcClient' => $this->client,
35 'clientApiId' => isset($packet['apiId'])
38 'ipAddress' => $_SERVER['REMOTE_ADDR'],
39 'valuation' => $this->valuation,
40 'methodName' => $methodName,
41 'packet' => serialize($packet),
44 $this->em->persist($log);
45 $this->em->flush($log);
51 * @param string $apiId
52 * @param string $password
55 public function Authenticate($ApiId, $Password)
57 $this->em = \Utility\Registry::getEntityManager();
58 $this->client = $this->em->getRepository('Valuation\\Entity\\XmlRpc')
60 'clientApiId' => $ApiId
62 if (is_null($this->client)
63 || md5($Password) != $this->client->passwordHash
64 || $this->client->archived)
66 $this->logRequest(__METHOD__, array('apiId' => $ApiId), 'System Authentication Failure');
67 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('System Authentication Failure.', 001);
69 $this->client->ipAddress = $_SERVER['REMOTE_ADDR'];
70 $this->em->flush($this->client);
71 $this->logRequest(__METHOD__, array('apiId' => $ApiId));
72 return $this->client->authToken;
75 protected function checkAuth($AuthToken)
77 $this->em = \Utility\Registry::getEntityManager();
78 $this->client = $this->em->getRepository('Valuation\\Entity\\XmlRpc')
80 'authToken' => $AuthToken,
81 'ipAddress' => $_SERVER['REMOTE_ADDR']
83 if (is_null($this->client) || $this->client->archived)
85 $this->logRequest(__METHOD__, array('authToken' => $AuthToken), 'System Authentication Failure.');
86 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('System Authentication Failure.', 001);
90 protected function tempAuth($email)
92 \Utility\Registry::clearAuthData();
93 \Utility\Registry::clearSessionData();
94 $user = $this->em->getRepository('\User\Entity\Profile')
95 ->findOneBy(array('email' => $email));
96 if (is_null($user) || $user->archived)
98 $this->logRequest(__METHOD__, array('email' => $email), 'User Authentication Failure.');
99 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('User Authentication Failure.', 001);
101 $authData = $user->toArray(array(
102 'company', 'tradeCenter', 'group', 'groupDivision', 'permissions',
103 'city', 'region', 'contact', 'manager'
105 if ($authData['company']['jobState'] != 'Active')
107 $this->logRequest(__METHOD__, array('email' => $email), 'Dealership Authentication Failure due to suspension.');
108 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Dealership Authentication Failure due to suspension.', 002);
110 if ($authData['jobState'] != 'Active')
112 $this->logRequest(__METHOD__, array('email' => $email), 'User Authentication Failure due to suspension.');
113 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('User Authentication Failure due to suspension.', 003);
115 \Utility\Registry::setAuthData($authData);
118 protected function getDataList($AuthToken, $entity, $fields = false, $extraFields = '', array $simplify = array())
120 list($module, $mid, $short) = explode('\\', $entity);
121 if (false === $fields)
127 $selection = 'partial ' . $short . '.{' . $fields . '}' . $extraFields;
129 $data = $this->em->createQuery(
130 'SELECT ' . $selection . ' FROM ' . $entity . ' ' . $short
134 if (!empty($simplify))
136 foreach ($data as $i => $row)
138 $response[$i] = array();
139 foreach ($row[0] as $field => $value)
141 $response[$i][ucfirst($field)] = $value;
143 foreach ($simplify as $field)
145 $response[$i][ucfirst($field)] = $row[$field];
151 foreach ($data as $i => $row)
153 $response[$i] = array();
154 foreach ($data[$i] as $field => $value)
156 $response[$i][ucfirst($field)] = $value;
160 return array('List' => $response);
164 * @param string $AuthToken
167 public function GetVehicleYearData($AuthToken)
169 $this->checkAuth($AuthToken);
170 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
171 return $this->getDataList($AuthToken, 'Stock\\Entity\\Year');
175 * @param string $AuthToken
178 public function GetVehicleCategoryData($AuthToken)
180 $this->checkAuth($AuthToken);
181 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
182 return $this->getDataList($AuthToken, 'Stock\\Entity\\Category');
186 * @param string $AuthToken
189 public function GetVehicleMakeData($AuthToken)
191 $this->checkAuth($AuthToken);
192 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
193 return $this->getDataList(
195 'Stock\\Entity\\Make',
196 'id,name,created,updated,archived'
201 * @param string $AuthToken
204 public function GetVehicleModelData($AuthToken)
206 $this->checkAuth($AuthToken);
207 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
208 return $this->getDataList(
210 'Stock\\Entity\\Model',
211 'id,name,created,updated,archived',
212 ', IDENTITY(Model.make) as makeId',
218 * @param string $AuthToken
221 public function GetVehicleTypeData($AuthToken)
223 $this->checkAuth($AuthToken);
224 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
225 return $this->getDataList(
227 'Stock\\Entity\\Type',
228 'id,name,mmCode,introMonth,discMonth,created,updated,archived',
229 ', IDENTITY(Type.model) as modelId , IDENTITY(Type.introYear) as introYearId , IDENTITY(Type.discYear) as discYearId',
230 array('modelId', 'introYearId', 'discYearId')
235 * @param string $AuthToken
238 public function GetVehicleFuelData($AuthToken)
240 $this->checkAuth($AuthToken);
241 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
242 return $this->getDataList($AuthToken, 'Stock\\Entity\\FuelType');
246 * @param string $AuthToken
249 public function GetVehicleTransmissionData($AuthToken)
251 $this->checkAuth($AuthToken);
252 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
253 return $this->getDataList($AuthToken, 'Stock\\Entity\\TransmissionType');
257 * @param string $AuthToken
260 public function GetVehicleConditionData($AuthToken)
262 $this->checkAuth($AuthToken);
263 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
264 return $this->getDataList($AuthToken, 'Stock\\Entity\\Condition');
268 * @param string $AuthToken
271 public function GetVehicleExteriorColourData($AuthToken)
273 $this->checkAuth($AuthToken);
274 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
275 return $this->getDataList($AuthToken, 'Stock\\Entity\\ExteriorColour');
279 * @param string $AuthToken
282 public function GetVehicleInteriorColourData($AuthToken)
284 $this->checkAuth($AuthToken);
285 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
286 return $this->getDataList($AuthToken, 'Stock\\Entity\\InteriorColour');
290 * @param string $AuthToken
293 public function GetVehicleUpholsteryData($AuthToken)
295 $this->checkAuth($AuthToken);
296 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
297 return $this->getDataList($AuthToken, 'Stock\\Entity\\Upholstery');
301 * @param string $AuthToken
304 public function GetVehiclePapersData($AuthToken)
306 $this->checkAuth($AuthToken);
307 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
308 return $this->getDataList($AuthToken, 'Stock\\Entity\\Paper');
312 * @param string $AuthToken
315 public function GetVehicleNatisData($AuthToken)
317 $this->checkAuth($AuthToken);
318 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
319 return $this->getDataList($AuthToken, 'Stock\\Entity\\Natis');
323 * @param string $AuthToken
326 public function GetVehicleAccessoryData($AuthToken)
328 $this->checkAuth($AuthToken);
329 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
330 return $this->getDataList($AuthToken, 'Stock\\Entity\\Accessory');
334 * @param string $AuthToken
337 public function GetVehicleComponentData($AuthToken)
339 $this->checkAuth($AuthToken);
340 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
341 return $this->getDataList($AuthToken, 'Stock\\Entity\\Damage');
345 * @param string $AuthToken
348 /*public function GetStockList($AuthToken)
350 $this->checkAuth($AuthToken);
351 if ('GEMS' != $this->client->clientName)
353 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Access Denied.', 099);
355 $this->logRequest(__METHOD__, array('authToken' => $AuthToken));
356 return $this->getDataList($AuthToken, 'Stock\\Entity\\Damage');
360 * @param string $AuthToken
361 * @param string $email
362 * @param struct $valuation
365 public function CreateValuation($AuthToken, $Email, array $Valuation)
368 $this->checkAuth($AuthToken);
369 $this->tempAuth($Email);
371 #-> Mandatory field checks.
373 'authToken' => $AuthToken,
375 'valuation' => $Valuation
377 $requiredString = array(
383 $requiredNumeric = array(
386 $requiredReference = array(
387 'VehicleYearId' => 'Stock\\Entity\\Year',
388 'VehicleTypeId' => 'Stock\\Entity\\Type',
389 'VehicleFuelTypeId' => 'Stock\\Entity\\FuelType',
390 'VehicleTransmissionTypeId' => 'Stock\\Entity\\TransmissionType'
392 foreach ($requiredString as $field)
394 if (!isset($Valuation[$field]) || 0 == strlen($Valuation[$field]))
396 $this->logRequest(__METHOD__, $packet, 'Required field not provided or empty: ' . $field);
397 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Required field not provided or empty: ' . $field, 010);
400 foreach ($requiredNumeric as $field)
402 if (!isset($Valuation[$field]) || 0 == strlen($Valuation[$field]) || !is_numeric($Valuation[$field]))
404 $this->logRequest(__METHOD__, $packet, 'Required field not provided or not numeric: ' . $field);
405 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Required field not provided or not numeric: ' . $field, 011);
408 foreach ($requiredReference as $field => $entityName)
410 if (!isset($Valuation[$field]) || 0 == strlen($Valuation[$field]) || !is_numeric($Valuation[$field]))
412 $this->logRequest(__METHOD__, $packet, 'Required field not provided or not numeric: ' . $field);
413 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Required field not provided or not numeric: ' . $field, 013);
415 $record = $this->em->find($entityName, $Valuation[$field]);
416 if (is_null($record))
418 $this->logRequest(__METHOD__, $packet, 'Required field not a valid reference: ' . $field);
419 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Required field not a valid reference: ' . $field, 012);
421 $Valuation[$field] = $record;
424 #-> Verify remaining fields.
425 if (isset($Valuation['id']))
427 unset($Valuation['id']);
429 $remainingNumeric = array();
430 foreach ($remainingNumeric as $field)
432 if (isset($Valuation[$field]) && null != $Valuation[$field] && !is_numeric($Valuation[$field]))
434 $this->logRequest(__METHOD__, $packet, 'Optional field not null or numeric: ' . $field);
435 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Optional field not null or numeric: ' . $field, 014);
438 $remainingReference = array(
439 'VehicleConditionId' => 'Stock\\Entity\\Condition',
440 'VehicleExteriorColourId' => 'Stock\\Entity\\ExteriorColour',
441 'VehicleInteriorColourId' => 'Stock\\Entity\\InteriorColour',
442 'VehicleUpholsteryId' => 'Stock\\Entity\\Upholstery',
443 'VehiclePapersId' => 'Stock\\Entity\\Paper',
444 'VehicleNatisId' => 'Stock\\Entity\\Natis'
446 foreach ($remainingReference as $field => $entityName)
448 if (!isset($Valuation[$field]) || 0 == strlen($Valuation[$field]) || !is_numeric($Valuation[$field]))
450 if (isset($Valuation[$field]))
452 unset($Valuation[$field]);
456 $record = $this->em->find($entityName, $Valuation[$field]);
457 if (is_null($record))
459 $this->logRequest(__METHOD__, $packet, 'Optional field not null or a valid reference: ' . $field);
460 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Optional field not null or a valid reference: ' . $field, 015);
462 $Valuation[$field] = $record;
465 #-> Verify valid urls on images.
466 $urlValidator = new \Zend\Validator\Uri();
467 for ($i = 1; $i <= 8; $i++)
469 $field = 'VehiclePhoto' . $i . 'URL';
470 if (isset($Valuation[$field]) && !is_null($Valuation[$field]))
472 if (!$urlValidator->isValid($Valuation[$field]))
474 $this->logRequest(__METHOD__, $packet, 'Optional field not null or valid url: ' . $field);
475 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Optional field not null or a valid url: ' . $field, 016);
480 #-> Verify damages collection.
481 if (isset($Valuation['Damages']))
483 foreach ($Valuation['Damages'] as $i => $damageEntry)
485 if (!isset($damageEntry['VehicleComponentId']) || 0 == strlen($damageEntry['VehicleComponentId']) || !is_numeric($damageEntry['VehicleComponentId']))
487 $this->logRequest(__METHOD__, $packet, 'Damages section required field not provided or not numeric: VehicleComponentId');
488 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Damages section required field not provided or not numeric: VehicleComponentId', 017);
490 $record = $this->em->find('Stock\\Entity\\Damage', $damageEntry['VehicleComponentId']);
491 if (is_null($record))
493 $this->logRequest(__METHOD__, $packet, 'Damages section required field not a valid reference: VehicleComponentId');
494 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Damages section required field not a valid reference: VehicleComponentId', 018);
496 $Valuation['Damages'][$i]['VehicleComponentId'] = $record;
497 if (isset($damageEntry['Amount']) && !is_numeric($damageEntry['Amount']))
499 $this->logRequest(__METHOD__, $packet, 'Damages section required field not numeric: Amount');
500 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Damages section required field not numeric: Amount', 019);
505 #-> Verify accessories collection.
506 if (isset($Valuation['Accessories']))
508 foreach ($Valuation['Accessories'] as $i => $accessoryEntry)
510 if (!isset($accessoryEntry['VehicleAccessoryId']) || 0 == strlen($accessoryEntry['VehicleAccessoryId']) || !is_numeric($accessoryEntry['VehicleAccessoryId']))
512 $this->logRequest(__METHOD__, $packet, 'Accessories section required field not provided or not numeric: VehicleAccessoryId');
513 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Accessories section required field not provided or not numeric: VehicleAccessoryId', 020);
515 $record = $this->em->find('Stock\\Entity\\Accessory', $accessoryEntry['VehicleAccessoryId']);
516 if (is_null($record))
518 $this->logRequest(__METHOD__, $packet, 'Accessories section required field not a valid reference: VehicleAccessoryId');
519 throw new \Zend\XmlRpc\Server\Exception\RuntimeException('Accessories section required field not a valid reference: VehicleAccessoryId', 021);
521 $Valuation['Accessories'][$i]['VehicleAccessoryId'] = $record;
525 #-> Collect trade and retail values.
526 $result = \Utility\Comms\TransUnion::searchByMmCode(
527 $Valuation['VehicleTypeId']->mmCode,
528 $Valuation['VehicleYearId']->name
530 if (is_array($result)
531 && isset($result['VehicleDetails'])
532 && isset($result['VehicleDetails'][0])
533 && isset($result['VehicleDetails'][0]['Value']))
535 $Valuation['tradePrice'] = $result['VehicleDetails'][0]['Value']['TradePrice'];
536 $Valuation['retailPrice'] = $result['VehicleDetails'][0]['Value']['RetailPrice'];
537 $Valuation['listPrice'] = $result['VehicleDetails'][0]['Value']['ListPrice'];
541 $Valuation['tradePrice'] = 0.0;
542 $Valuation['retailPrice'] = 0.0;
543 $Valuation['listPrice'] = 0.0;
546 # ------------------------------------------------------------------------------ #
547 #-> Validation complete, create stock, damages, accessories and valuation entries.
548 #-> Create stock entry.
549 $stock = new \Stock\Entity\Stock();
550 $stock->tradePrice = $Valuation['tradePrice'];
551 $stock->retailPrice = $Valuation['retailPrice'];
552 $stock->listPrice = $Valuation['listPrice'];
553 isset($Valuation['VehicleYearId'])
554 && $stock->vehicleYear = $Valuation['VehicleYearId'];
555 isset($Valuation['VehicleTypeId'])
556 && $stock->type = $Valuation['VehicleTypeId'];
557 isset($Valuation['RegistrationNumber'])
558 && $stock->registrationNumber = $Valuation['RegistrationNumber'];
559 isset($Valuation['VehicleFuelTypeId'])
560 && $stock->fuelType = $Valuation['VehicleFuelTypeId'];
561 isset($Valuation['VehicleTransmissionTypeId'])
562 && $stock->transmissionType = $Valuation['VehicleTransmissionTypeId'];
563 isset($Valuation['VinNumber'])
564 && $stock->vinNumber = $Valuation['VinNumber'];
565 isset($Valuation['EngineNumber'])
566 && $stock->engineNumber = $Valuation['EngineNumber'];
567 isset($Valuation['Km'])
568 && $stock->km = $Valuation['Km'];
569 isset($Valuation['VehicleConditionId'])
570 && $stock->condition = $Valuation['VehicleConditionId'];
571 isset($Valuation['VehicleExteriorColourId'])
572 && $stock->exteriorColour = $Valuation['VehicleExteriorColourId'];
573 isset($Valuation['VehicleInteriorColourId'])
574 && $stock->interiorColour = $Valuation['VehicleInteriorColourId'];
575 isset($Valuation['VehicleUpholsteryId'])
576 && $stock->upholstery = $Valuation['VehicleUpholsteryId'];
577 isset($Valuation['VehiclePapersId'])
578 && $stock->papers = $Valuation['VehiclePapersId'];
579 isset($Valuation['VehicleNatisId'])
580 && $stock->natisc = $Valuation['VehicleNatisId'];
581 isset($Valuation['natis'])
582 && $stock->spareKeys = $Valuation['natis'];
583 isset($Valuation['FullServiceHistory'])
584 && $stock->fullServiceHistory = $Valuation['FullServiceHistory'];
585 isset($Valuation['FullServiceHistoryNotes'])
586 && $stock->fshNotes = $Valuation['FullServiceHistoryNotes'];
587 isset($Valuation['PreviousRepairs'])
588 && $stock->previousRepairsNoted = $Valuation['PreviousRepairs'];
589 isset($Valuation['PreviousRepairsNotes'])
590 && $stock->previousRepairsNotes = $Valuation['PreviousRepairsNotes'];
591 isset($Valuation['AccessoryNotes'])
592 && $stock->accessoryNotes = $Valuation['AccessoryNotes'];
593 isset($Valuation['DamageNotes'])
594 && $stock->damageNotes = $Valuation['DamageNotes'];
596 $this->em->persist($stock);
597 $this->em->flush($stock);
598 $stock->postInsert();
599 $this->em->flush($stock);
601 #-> Log images so that we can download them later.
613 for ($i = 1; $i <= 8; $i++)
615 $field = 'VehiclePhoto' . $i . 'URL';
616 $urlField = $images[$i] . 'ImageUrl';
617 if (isset($Valuation[$field]) && !is_null($Valuation[$field]))
619 if (is_null($stockImages))
621 $stockImages = new \Stock\Entity\StockImages();
622 $stockImages->stock = $stock;
624 $stockImages->$urlField = $Valuation[$field];
627 if (!is_null($stockImages))
629 $this->em->persist($stockImages);
630 $this->em->flush($stockImages);
633 #-> Log vehicle accessories.
634 foreach ($Valuation['Accessories'] as $item)
636 $accessory = new \Stock\Entity\StockAccessory();
637 $accessory->stock = $stock;
638 $accessory->accessory = $item['VehicleAccessoryId'];
639 $this->em->persist($accessory);
643 #-> Log vehicle damages.
645 foreach ($Valuation['Damages'] as $item)
647 $damage = new \Stock\Entity\StockDamage();
648 $damage->stock = $stock;
649 $damage->damage = $item['VehicleComponentId'];
650 $damage->amount = $item['Amount'];
651 $this->em->persist($damage);
652 $total += $damage->amount;
654 $stock->damageTotal = $total;
657 #-> Create valuation entry.
658 $this->valuation = new \Valuation\Entity\Valuation();
659 $this->valuation->xmlRpcClient = $this->client;
660 $this->valuation->stock = $stock;
661 $this->valuation->tradeRetailRequested = true;
662 $this->valuation->jobState = 'New Valuation';
663 isset($Valuation['ItemId'])
664 && $this->valuation->sfItemId = $Valuation['ItemId'];
665 isset($Valuation['CustomerName'])
666 && $this->valuation->firstName = $Valuation['CustomerName'];
667 isset($Valuation['CustomerSurname'])
668 && $this->valuation->familyName = $Valuation['CustomerSurname'];
669 isset($Valuation['CustomerIdNumber'])
670 && $this->valuation->idNumber = $Valuation['CustomerIdNumber'];
671 isset($Valuation['CustomerMobile'])
672 && $this->valuation->mobile = $Valuation['CustomerMobile'];
673 isset($Valuation['CustomerEmail'])
674 && $this->valuation->email = $Valuation['CustomerEmail'];
675 isset($Valuation['Department'])
676 && $this->valuation->department = $Valuation['Department'];
677 $this->em->persist($this->valuation);
678 $this->em->flush($this->valuation);
679 $this->valuation->postInsert();
680 $this->em->flush($this->valuation);
681 $stock->valuation = $this->valuation;
682 $this->em->flush($stock);
684 #-> Collect list of valuators to send to.
685 $userBin = new \User\DataBin\Profile();
686 $filters = $userBin->getValuationFilters();
687 $valuators = $this->em->getRepository('User\\Entity\\Profile')
689 if (!empty($valuators))
691 $serviceInput = new \Workspace\Utility\ServiceInput();
692 $valuationService = new \Valuation\Service\Valuation();
693 $valuationService->setWorkflow(\Utility\Registry::getServiceManager()->get('Valuation'));
694 $valuationService->generateHistoryList(array(), $this->valuation, $this->valuation, new \Workspace\Utility\ServiceInputParams());
696 $this->valuation->queueStatus = 1;
697 $this->em->flush($this->valuation);
698 $authData = \Utility\Registry::getAuthData();
700 $fromCompanyId = isset($authData['company']['id']) ? $authData['company']['id'] : null;
701 $fromProfileId = isset($authData['id']) ? $authData['id'] : null;
704 $params['firstName'] = $authData['firstName'];
705 $params['familyName'] = $authData['familyName'];
706 $params['customer_name'] = $this->valuation->firstName;
707 $params['customer_family_name'] = $this->valuation->familyName;
708 $params['vehicle_reg'] = is_null($stock->registrationNumber)
710 : $stock->registrationNumber;
711 $oNotify = new \Utility\Comms\Notification();
712 $templateName = 'valuation-mobile-new';
714 $toCompanyId = $fromCompanyId;
716 foreach ($valuators as $valuator)
718 $valuator = $valuator->toArray();
719 $toProfileId = $valuator['id'];
720 $mobile = $valuator['mobile'];
721 $oNotify->sendFromTemplate(
722 $fromCompanyId, $fromProfileId,
723 $toCompanyId, $toProfileId,
733 $this->logRequest(__METHOD__, $packet);
735 'TradePrice' => $Valuation['tradePrice'],
736 'RetailPrice' => $Valuation['retailPrice'],
737 'ListPrice' => $Valuation['listPrice']