Skip to content

Commit 31765e1

Browse files
authored
[UPMERGE] 2.0 -> 2.1 (#392)
This PR has been generated automatically. For more details see [upmerge_pr.yaml](/Sylius/InvoicingPlugin/blob/1.0/.github/workflows/upmerge_pr.yaml). **Remember!** The upmerge should always be merged with using `Merge pull request` button. In case of conflicts, please resolve them manually with usign the following commands: ``` git fetch upstream gh pr checkout <this-pr-number> git merge upstream/2.1 -m "Resolve conflicts between 2.0 and 2.1" ``` If you use other name for the upstream remote, please replace `upstream` with the name of your remote pointing to the `Sylius/InvoicingPlugin` repository. Once the conflicts are resolved, please run `git merge --continue` and push the changes to this PR.
2 parents 48be817 + fe341c1 commit 31765e1

File tree

88 files changed

+3757
-2995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+3757
-2995
lines changed

.github/workflows/build.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,6 @@ jobs:
207207
name: Run analysis
208208
run: composer analyse
209209

210-
-
211-
name: Run PHPSpec
212-
run: vendor/bin/phpspec run --ansi -f progress --no-interaction
213-
214210
-
215211
name: Run PHPUnit
216212
run: vendor/bin/phpunit --colors=always

.github/workflows/upmerge_pr.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
-
2424
base_branch: "1.0"
2525
target_branch: "2.0"
26+
-
27+
base_branch: "2.0"
28+
target_branch: "2.1"
2629

2730
steps:
2831
-

README.md

Lines changed: 11 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -17,125 +17,22 @@
1717
SyliusInvoicingPlugin creates new immutable invoice when the order is in given state (default: created) and allows
1818
both customer and admin to download invoices related to the order.
1919

20-
![Screenshot showing invoice](docs/screenshot_invoice.png)
21-
![Screenshot showing invoice browsing page in administration panel](docs/screenshot_admin.png)
20+
---
2221

23-
## Business value
22+
## Documentation
2423

25-
The primary aim of Invoicing Plugin is to create a document representing Customer's will to buy particular products and
26-
pay for them.
24+
📖 Full documentation is available here:
25+
👉 [Invoicing Plugin Documentation](https://docs.sylius.com/invoicing-plugin)
2726

28-
An Invoice can also be treated as a proof of placing an Order. Thus, it is downloadable as .pdf file and can be sent to
29-
Customer manually by the Administrator or automatically once an Order is paid.
30-
31-
Additional feature of the plugin that fulfills Invoicing domain is the ability to set billing data on a Seller.
32-
33-
## Installation
34-
35-
#### Beware!
36-
37-
This installation instruction assumes that you're using Symfony Flex. If you don't, take a look at the
38-
[legacy installation instruction](docs/legacy_installation.md). However, we strongly encourage you to use
39-
Symfony Flex, it's much quicker!
40-
41-
1. Require plugin with composer:
42-
43-
```bash
44-
composer require sylius/invoicing-plugin
45-
```
46-
47-
> Remember to allow community recipes with `composer config extra.symfony.allow-contrib true` or during plugin installation process
48-
49-
2. Apply migrations to your database:
50-
51-
```bash
52-
bin/console doctrine:migrations:migrate
53-
```
54-
55-
3. Default configuration assumes enabled PDF file generation. If you don't want to use that feature change your app configuration:
56-
57-
```yaml
58-
# config/packages/sylius_invoicing.yaml
59-
sylius_invoicing:
60-
pdf_generator:
61-
enabled: false
62-
```
63-
64-
Otherwise, check if you have wkhtmltopdf binary. If not, you can download it [here](https://wkhtmltopdf.org/downloads.html).
65-
66-
In case wkhtmltopdf is not located in `/usr/local/bin/wkhtmltopdf` modify the `WKHTMLTOPDF_PATH` environment variable in the `.env` file:
67-
68-
```
69-
WKHTMLTOPDF_PATH=/usr/local/bin/wkhtmltopdf # Change this! :)
70-
```
71-
72-
4. If you want to generate invoices for orders placed before plugin's installation run the following command using your terminal:
73-
74-
```bash
75-
bin/console sylius-invoicing:generate-invoices
76-
```
77-
78-
## Extension points
79-
80-
The majority of actions contained in the SyliusInvoicingPlugin are executed after an event related to the change of the Order’s state.
81-
82-
Here is an example using Symfony’s workflow:
83-
84-
```xml
85-
<service id="sylius_invoicing_plugin.event_listener.workflow.payment.produce_order_payment_paid"
86-
class="Sylius\InvoicingPlugin\EventListener\Workflow\Payment\ProduceOrderPaymentPaidListener">
87-
<argument type="service" id="sylius_invoicing_plugin.event_producer.order_payment_paid" />
88-
89-
<tag name="kernel.event_listener" event="workflow.sylius_payment.completed.complete" priority="100" />
90-
</service>
91-
```
92-
93-
Additionally, the Invoice model is treated as a Resource.
94-
95-
You can read more about Resources here:
96-
97-
<http://docs.sylius.com/en/latest/components_and_bundles/bundles/SyliusResourceBundle/index.html>.
98-
99-
Hence, the template for displaying the list of Invoices is defined in the `routing.yml` file:
100-
101-
```yaml
102-
sylius_invoicing_invoice:
103-
resource: |
104-
alias: sylius_invoicing.invoice
105-
section: admin
106-
templates: "@SyliusAdmin\\Crud"
107-
only: ['index']
108-
grid: sylius_invoicing_invoice
109-
permission: true
110-
vars:
111-
all:
112-
subheader: sylius_invoicing.ui.manage_invoices
113-
index:
114-
icon: inbox
115-
type: sylius.resource
116-
```
117-
118-
Another aspect that can be both replaced and customized is displaying Invoices list on Order show view.
119-
Code responsible for displaying Invoices related to the Order is injected to existing Sylius template using
120-
Sonata events. You can read about customizing templates via events here:
121-
122-
<http://docs.sylius.com/en/latest/customization/template.html>
123-
124-
### Invoices files
125-
126-
By default, when the order is paid, an immutable Invoice pdf file is saved on the server. The save directory is specified
127-
with `%sylius_invoicing.invoice_save_path%` parameter, that can be overridden if needed.
27+
## Security issues
12828

129-
There is no direct relation between `Sylius\InvoicingPlugin\Entity\Invoice` entity and its file. It's resolved based on
130-
the `Invoice::$number`, which is defined in `Sylius\InvoicingPlugin\Provider\InvoiceFileProviderInterface` service.
131-
By overriding this service, you can change a logic that is used to retrieve the invoice file.
29+
If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly.
30+
Instead, all security issues must be sent to `security@sylius.com`.
13231

133-
## Fixtures
32+
## Community
13433

135-
You can add `ShopBillingData` fixtures into a yaml to add Channel ShopBillingData info to your installation.
136-
More instructions on the [fixtures configuration instructions](docs/fixtures.md).
34+
For online communication, we invite you to chat with us and other users on [Sylius Slack](https://sylius.com/slack).
13735

138-
## Security issues
36+
## License
13937

140-
If you think that you have found a security issue, please do not use the issue tracker and do not post it publicly.
141-
Instead, all security issues must be sent to `security@sylius.com`.
38+
This plugin is released under the [MIT License](LICENSE).

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,12 @@
3737
"friends-of-behat/variadic-extension": "^1.6",
3838
"matthiasnoback/symfony-config-test": "^5.1",
3939
"matthiasnoback/symfony-dependency-injection-test": "^5.1",
40-
"phpspec/phpspec": "^7.5",
4140
"phpstan/extension-installer": "^1.4",
4241
"phpstan/phpstan": "^1.12",
4342
"phpstan/phpstan-doctrine": "^1.5",
4443
"phpstan/phpstan-symfony": "^1.4",
4544
"phpstan/phpstan-webmozart-assert": "^1.2",
46-
"phpunit/phpunit": "^9.5",
45+
"phpunit/phpunit": "^10.5",
4746
"polishsymfonycommunity/symfony-mocker-container": "^1.0",
4847
"sylius-labs/coding-standard": "^4.4",
4948
"sylius/test-application": "^2.0.0@alpha",
@@ -70,10 +69,10 @@
7069
"analyse": [
7170
"@composer validate --strict",
7271
"vendor/bin/phpstan analyse -c phpstan.neon -l max",
73-
"vendor/bin/ecs check src/ spec/"
72+
"vendor/bin/ecs check src/"
7473
],
7574
"fix": [
76-
"vendor/bin/ecs check --fix src/ spec/"
75+
"vendor/bin/ecs check --fix src/"
7776
]
7877
},
7978
"config": {

docs/fixtures.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/legacy_installation.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

docs/screenshot_admin.png

-289 KB
Binary file not shown.

docs/screenshot_invoice.png

-89.8 KB
Binary file not shown.

phpspec.yml.dist

Lines changed: 0 additions & 4 deletions
This file was deleted.

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
<phpunit
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.1/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
66
colors="true"
77
bootstrap="vendor/sylius/test-application/config/bootstrap.php"
88
>
99
<testsuites>
10-
<testsuite name="SyliusInvoicingPlugin Test Suite">
10+
<testsuite name="sylius_invoicing_plugin_test_suite">
1111
<directory>tests</directory>
1212
</testsuite>
1313
</testsuites>

0 commit comments

Comments
 (0)