diff --git a/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/OroCRMAccountBundleInstaller.php b/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/OroCRMAccountBundleInstaller.php index 573a92b6105..6a53b2a397e 100644 --- a/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/OroCRMAccountBundleInstaller.php +++ b/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/OroCRMAccountBundleInstaller.php @@ -62,7 +62,7 @@ public function setAttachmentExtension(AttachmentExtension $attachmentExtension) */ public function getMigrationVersion() { - return 'v1_6'; + return 'v1_7'; } /** diff --git a/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/DropExtendConfigQuery.php b/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/DropExtendConfigQuery.php new file mode 100644 index 00000000000..9b8ae8121df --- /dev/null +++ b/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/DropExtendConfigQuery.php @@ -0,0 +1,58 @@ +info('Drop extend config values'); + $this->doExecute($logger, true); + + return $logger->getMessages(); + } + + /** + * {@inheritdoc} + */ + public function execute(LoggerInterface $logger) + { + $this->doExecute($logger); + } + + /** + * {@inheritdoc} + */ + public function doExecute(LoggerInterface $logger, $dryRun = false) + { + $updateSql = <<logQuery($logger, $updateSql, $params); + if (!$dryRun) { + $this->connection->executeUpdate($updateSql, $params); + } + } +} diff --git a/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/OroCRMSalesBundle.php b/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/OroCRMSalesBundle.php new file mode 100644 index 00000000000..940732813ed --- /dev/null +++ b/src/OroCRM/Bundle/AccountBundle/Migrations/Schema/v1_7/OroCRMSalesBundle.php @@ -0,0 +1,19 @@ +addPostQuery(new DropExtendConfigQuery()); + } +} diff --git a/src/OroCRM/Bundle/MagentoBundle/Resources/views/Order/widget/info.html.twig b/src/OroCRM/Bundle/MagentoBundle/Resources/views/Order/widget/info.html.twig index 099f2559fe0..859853ad6ed 100644 --- a/src/OroCRM/Bundle/MagentoBundle/Resources/views/Order/widget/info.html.twig +++ b/src/OroCRM/Bundle/MagentoBundle/Resources/views/Order/widget/info.html.twig @@ -10,6 +10,7 @@ {{ ui.renderProperty('orocrm.magento.order.status.label'|trans, entity.status|trans) }} {{ ui.renderProperty('orocrm.magento.order.currency.label'|trans, entity.currency) }} + {{ ui.renderProperty('orocrm.magento.order.subtotal_amount.label'|trans, entity.subtotalAmount|oro_format_currency({'currency': entity.currency})) }} {{ ui.renderProperty('orocrm.magento.order.total_amount.label'|trans, entity.totalAmount|oro_format_currency({'currency': entity.currency})) }} {{ ui.renderProperty('orocrm.magento.order.discount_amount.label'|trans, entity.discountAmount|oro_format_currency({'currency': entity.currency})) }} {{ ui.renderProperty('orocrm.magento.order.tax_amount.label'|trans, entity.taxAmount|oro_format_currency({'currency': entity.currency})) }} diff --git a/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Entity/Repository/TaskRepositoryTest.php b/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Entity/Repository/TaskRepositoryTest.php index f423d02caae..0ef65968a45 100644 --- a/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Entity/Repository/TaskRepositoryTest.php +++ b/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Entity/Repository/TaskRepositoryTest.php @@ -18,14 +18,14 @@ protected function setUp() { $metadataDriver = new AnnotationDriver( new AnnotationReader(), - 'OroCRM\Bundle\TaskBundle\Entity' + 'OroCRM\Bundle\TaskBundle\Tests\Unit\Fixtures\Entity' ); $this->em = $this->getTestEntityManager(); $this->em->getConfiguration()->setMetadataDriverImpl($metadataDriver); $this->em->getConfiguration()->setEntityNamespaces( [ - 'OroCRMTaskBundle' => 'OroCRM\Bundle\TaskBundle\Entity' + 'OroCRMTaskBundle' => 'OroCRM\Bundle\TaskBundle\Tests\Unit\Fixtures\Entity' ] ); } @@ -43,7 +43,7 @@ public function testGetTaskListByTimeIntervalQueryBuilder() $this->assertEquals( 'SELECT t.id, t.subject, t.description, t.dueDate, t.createdAt, t.updatedAt' - . ' FROM OroCRM\Bundle\TaskBundle\Entity\Task t' + . ' FROM OroCRM\Bundle\TaskBundle\Tests\Unit\Fixtures\Entity\Task t' . ' WHERE t.owner = :assignedTo AND t.dueDate >= :start AND t.dueDate <= :end', $qb->getDQL() ); diff --git a/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Fixtures/Entity/Task.php b/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Fixtures/Entity/Task.php new file mode 100644 index 00000000000..48d028cd3fc --- /dev/null +++ b/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Fixtures/Entity/Task.php @@ -0,0 +1,379 @@ +reminders = new ArrayCollection(); + } + + /** + * @param int $id + */ + public function setId($id) + { + $this->id = $id; + } + + /** + * @return int + */ + public function getId() + { + return $this->id; + } + + /** + * @param string $subject + */ + public function setSubject($subject) + { + $this->subject = $subject; + } + + /** + * @return string + */ + public function getSubject() + { + return $this->subject; + } + + /** + * @param string $description + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * @return \DateTime + */ + public function getDueDate() + { + return $this->dueDate; + } + + /** + * @return bool + */ + public function isDueDateExpired() + { + return $this->getDueDate() && $this->getDueDate() < new \DateTime(); + } + + /** + * @param \DateTime $dueDate + */ + public function setDueDate(\DateTime $dueDate = null) + { + $this->dueDate = $dueDate; + } + + /** + * @param \DateTime $createdAt + */ + public function setCreatedAt($createdAt) + { + $this->createdAt = $createdAt; + } + + /** + * @param \DateTime $updatedAt + */ + public function setUpdatedAt($updatedAt) + { + $this->updatedAt = $updatedAt; + } + + /** + * @return TaskPriority + */ + public function getTaskPriority() + { + return $this->taskPriority; + } + + /** + * @param TaskPriority $taskPriority + */ + public function setTaskPriority($taskPriority) + { + $this->taskPriority = $taskPriority; + } + + /** + * @return User + */ + public function getOwner() + { + return $this->owner; + } + + /** + * @return mixed|null + */ + public function getOwnerId() + { + return $this->getOwner() ? $this->getOwner()->getId() : null; + } + + /** + * @param User $owner + */ + public function setOwner($owner = null) + { + $this->owner = $owner; + } + + /** + * @return string + */ + public function getWorkflowStepName() + { + return $this->getWorkflowStep() ? $this->getWorkflowStep()->getName() : null; + } + + /** + * @param WorkflowItem $workflowItem + */ + public function setWorkflowItem($workflowItem) + { + $this->workflowItem = $workflowItem; + } + + /** + * @return WorkflowItem + */ + public function getWorkflowItem() + { + return $this->workflowItem; + } + + /** + * @param WorkflowItem $workflowStep + */ + public function setWorkflowStep($workflowStep) + { + $this->workflowStep = $workflowStep; + } + + /** + * @return WorkflowStep + */ + public function getWorkflowStep() + { + return $this->workflowStep; + } + + /** + * {@inheritdoc} + */ + public function getReminders() + { + return $this->reminders; + } + + /** + * {@inheritdoc} + */ + public function setReminders(Collection $reminders) + { + $this->reminders = $reminders; + } + + /** + * {@inheritdoc} + */ + public function getReminderData() + { + $result = new ReminderData(); + + $result->setSubject($this->getSubject()); + $result->setExpireAt($this->getDueDate()); + $result->setRecipient($this->getOwner()); + + return $result; + } + + /** + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->updatedAt; + } + + /** + * @ORM\PrePersist + */ + public function prePersist() + { + $this->createdAt = new \DateTime('now', new \DateTimeZone('UTC')); + $this->updatedAt = clone $this->createdAt; + } + + /** + * @ORM\PreUpdate + */ + public function preUpdate() + { + $this->updatedAt = new \DateTime('now', new \DateTimeZone('UTC')); + } + + /** + * Set organization + * + * @param Organization $organization + * @return Task + */ + public function setOrganization(Organization $organization = null) + { + $this->organization = $organization; + + return $this; + } + + /** + * Get organization + * + * @return Organization + */ + public function getOrganization() + { + return $this->organization; + } + + /** + * @return string + */ + public function __toString() + { + return (string)$this->getSubject(); + } +} diff --git a/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Fixtures/Entity/TaskPriority.php b/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Fixtures/Entity/TaskPriority.php new file mode 100644 index 00000000000..9d57518889a --- /dev/null +++ b/src/OroCRM/Bundle/TaskBundle/Tests/Unit/Fixtures/Entity/TaskPriority.php @@ -0,0 +1,108 @@ +name = $name; + } + + /** + * Get Task priority name + * + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Set Task priority label + * + * @param string $label + * @return TaskPriority + */ + public function setLabel($label) + { + $this->label = $label; + + return $this; + } + + /** + * Get task priority label + * + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Get order + * + * @return integer + */ + public function getOrder() + { + return $this->order; + } + + /** + * Set order + * + * @param string $order + * @return TaskPriority + */ + public function setOrder($order) + { + $this->order = $order; + + return $this; + } + + /** + * @return string + */ + public function __toString() + { + return (string) $this->label; + } +}