Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reports correct sum with currencies and label #3937

Merged
merged 2 commits into from
Jan 27, 2016

Conversation

fcaraballo
Copy link

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets #3715
License MIT
Doc PR no
  • Added field exchange_rate to sylius_order in order to save the exchange rate for the time the order was placed
  • Updated query for reports in order to count check the exchange rate (o.total * o.exchange_rate)
  • Behat for reports feature "Getting the correct sum with exchange rate"
  • Table label: if there's a base currency it will show it. For e.g. TOTAL SUM IN GBP
  • Created method for getting the channel base currency (getBaseCurrency)
  • Behats and PHPSpec updated

@@ -52,4 +52,4 @@ function it_sets_currency_on_order(

$this->processOrderCurrency($event);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be reverted.

@fcaraballo
Copy link
Author

Updated for review

@@ -28,7 +28,7 @@ class SalesTotalDataFetcher extends TimePeriod
private $orderRepository;

/**
* @param OrderRepositoryInterface $orderRepository
* @param OrderRepositoryInterface $orderRepository
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be reverted.

@fcaraballo
Copy link
Author

Updated for review

@pjedrzejewski
Copy link
Member

@fcaraballo Could you rebase, please? :) Thanks!

@fcaraballo fcaraballo force-pushed the order-exchange-rate branch 2 times, most recently from 1989ed7 to ed2427a Compare January 26, 2016 09:54
@@ -148,7 +148,16 @@ public function thereAreOrders(TableNode $table)

$this->createPayment($order, $paymentMethod);

$order->setCurrency('EUR');
if (isset($data['currency']) && '' !== trim($data['currency'])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you need to check and add trim?

$currency = isset($data['currency']) ? trim($data['currency']) : 'EUR';
$order->setCurrency($currency);

Should be enough?

@fcaraballo fcaraballo force-pushed the order-exchange-rate branch 2 times, most recently from 86c3895 to 8cea3fd Compare January 27, 2016 10:49
pjedrzejewski pushed a commit that referenced this pull request Jan 27, 2016
Reports correct sum with currencies and label
@pjedrzejewski pjedrzejewski merged commit ca23188 into Sylius:master Jan 27, 2016
@pjedrzejewski
Copy link
Member

Thanks Fernando! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants