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

Fix CASE WHEN clause in AbstractReportRepository for PostgreSQL compatibility #24

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0', '8.1', '8.2']
sylius: ["~1.11.0", "~1.12.0", "~1.13.0"]
exclude:
- php: '8.2'
sylius: '~1.11.0'
- php: '8.0'
sylius: '~1.12.0'
- php: '8.0'
sylius: '~1.13.0'
php: ['8.1', '8.2', '8.3']
sylius: ["~1.12.0", "~1.13.0", "1.14.0"]

steps:
- name: Setup PHP
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2']
php: ['8.1', '8.2', '8.3']

env:
SYMFONY_ARGS: --no-tls
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
/.phpunit.result.cache
/node_modules
/yarn.lock
.idea/
2 changes: 1 addition & 1 deletion .php-version.dist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2
8.3
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DEFAULT_GOAL := help
SHELL=/bin/bash
APP_DIR=tests/Application
SYLIUS_VERSION=1.13.0
SYLIUS_VERSION=1.14.0
SYMFONY=cd ${APP_DIR} && symfony
COMPOSER=symfony composer
CONSOLE=${SYMFONY} console
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ A simple plugin to have sales reports in Sylius

## Compatibility

| Sylius Version | PHP Version |
|---|---|
| 1.11 | 8.0 - 8.1 |
| 1.12 | 8.1 - 8.2 |
| 1.13 | 8.1 - 8.2 |
| Sylius Version | PHP Version |
|----------------|-----------------|
| 1.12 | 8.1 - 8.2 - 8.3 |
| 1.13 | 8.1 - 8.2 - 8.3 |
| 1.14 | 8.1 - 8.2 - 8.3 |

## Installation

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"description": "A simple plugin to have sales reports in Sylius",
"license": "MIT",
"require": {
"php": "^8.0",
"sylius/sylius": ">=1.11 <1.14"
"php": "^8.1",
"sylius/sylius": ">=1.12 <2.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.16",
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yaml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.8'
services:
database:
image: mysql:8.0
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/AbstractReportRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ protected function getSelectColumns(bool $isItemUnit = false, bool $isItem = fal
($isItemUnit ? 'CONCAT(item.productName, \' \' ,item.variantName) as variant_name' : ($isItem ? 'CONCAT(element.productName, \' \' , element.variantName) as variant_name' : '\'\' as variant_name')),

// Adjustments
$isItemUnit ? 'item.unitPrice - (CASE WHEN tax_adjustment.neutral = 1 THEN tax_adjustment.amount ELSE 0 END) as without_tax' : '0 as without_tax',
$isItemUnit ? 'item.unitPrice - (CASE WHEN tax_adjustment.neutral = true THEN tax_adjustment.amount ELSE 0 END) as without_tax' : '0 as without_tax',
// Only retrieve without_tax price for item units
'(COALESCE(order_promotion_adjustment.amount, 0) + COALESCE(order_item_promotion_adjustment.amount, 0) + COALESCE(order_shipping_promotion_adjustment.amount, 0) + COALESCE(order_unit_promotion_adjustment.amount, 0)) AS without_tax_promo',
'shipping_adjustment.amount as without_tax_shipping',
Expand Down
39 changes: 39 additions & 0 deletions src/Resources/translations/messages.de.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
monsieurbiz:
sales_reports:
ui:
title: 'Umsatzberichte'
subtitle: 'Sehen Sie Ihre Umsatzberichte an'
day_report: 'Tagesbericht'
day_report_for: 'Tagesbericht für den %date% für %channel%'
period_report: 'Zeitraum-Bericht'
period_report_for: 'Zeitraum-Bericht vom %from% bis %to% für %channel%'
global_report: 'Gesamtbericht'
average_report: 'Durchschnittsbericht'
number_of_orders: 'Anzahl der Bestellungen:'
product_report: 'Produktbericht'
product_variant_report: 'Produktvariantenbericht'
option_report: 'Optionsbericht'
option_value_report: 'Optionswert-Bericht'
statistics: 'Statistiken'
form:
channel:
label: 'Kanal'
date:
label: 'Bestimmter Tag'
from_date:
label: 'Von'
to_date:
label: 'Bis'
view:
amount_without_tax: 'Betrag ohne Steuern'
promo_amount_without_tax: 'Aktionsbetrag ohne Steuern'
shipping_amount_without_tax: 'Versandbetrag ohne Steuern'
tax_amount: 'Steuerbetrag'
total_amount: 'Gesamtbetrag mit Steuern'
number_of_orders: 'Anzahl der Bestellungen'
product_name: 'Produktname'
product_variant_name: 'Produktvariantenname'
no_result: 'Kein Ergebnis'
option_name: 'Optionsname'
option_value: 'Optionswert'
total: 'Gesamt'
Loading