• This repository has been archived on 16/Aug/2021
  • Stars
    star
    22
  • Rank 1,013,498 (Top 21 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This plugin enables generating invoices in Sylius platform application.

Overview

This plugin enables generating invoices in Sylius platform application. It adds a VAT number field for the billing address during the checkout and allows to download the invoice in the admin panel view.

Support

We work on amazing eCommerce projects on top of Sylius and Pimcore. Need some help or additional resources for a project? Write us an email on [email protected] or visit our website! 🚀

Demo

We created a demo app with some useful use-cases of the plugin! Visit demo.bitbag.shop to take a look at it. The admin can be accessed under demo.bitbag.shop/admin link and sylius: sylius credentials.

Installation

$ composer require bitbag/invoicing-plugin:dev-master

Add plugin dependencies to your AppKernel.php file:

public function registerBundles()
{
    return array_merge(parent::registerBundles(), [
        ...
        
        new \Knp\Bundle\SnappyBundle\KnpSnappyBundle(),
        new \BitBag\SyliusInvoicingPlugin\BitBagSyliusInvoicingPlugin(),
    ]);
}

Note

This plugin uses wkhtmltopdf under the hood wrapped into KnpSnappyBundle. It requires you to install the wkthmltopdf binary. Read more in the KnpSnappyBundle docs and on Wkhtmltopdf website.

Import required config in your app/config/config.yml file:

# app/config/config.yml

imports:
    ...
    
    - { resource: "@BitBagSyliusInvoicingPlugin/Resources/config/config.yml" }

Import routing in your app/config/routing.yml file:

# app/config/routing.yml
...

bitbag_sylius_invoicing_plugin:
    resource: '@BitBagSyliusInvoicingPlugin/Resources/config/routing.yml'

Finish the installation by updating/migrating the database schema:

$ bin/console doctrine:schema:update --force

Usage

To see what templates you need to override in order to enable this plugin on your storefront, browse Twig files from /tests/Application/app/Resources/SyliusShopBundle path of this plugin.

To override the invoice template, override the invoice.html.twig file of this plugin, which you should do in app/Resources/BitBagSyliusInvoicingPlugin/views/invoice.html.twig file of your local project or in the theme path, in case you are using multiple themes.

In your admin panel, add the company data. So far, only single company data is supported.

In order to see the ability to download invoice, in the checkout, confirm a billing address and fill the VAT number. Make sure you customized your local SyliusShopBundle templates like described above. Then, in the admin panel, you should see a button to download the invoice for an order, which has the billing address with VAT number fulfilled (which in your case, shoul be the last one).

Customization

Available services you can decorate and forms you can extend

  bitbag_sylius_invoicing_plugin.controller.action.download_order_invoice                      BitBag\SyliusInvoicingPlugin\Controller\Action\DownloadOrderInvoice                                       
  bitbag_sylius_invoicing_plugin.controller.company_data                                       Sylius\Bundle\ResourceBundle\Controller\ResourceController                                                
  bitbag_sylius_invoicing_plugin.controller.invoice                                            Sylius\Bundle\ResourceBundle\Controller\ResourceController                                                
  bitbag_sylius_invoicing_plugin.event_listener.company_data                                   BitBag\SyliusInvoicingPlugin\Menu\CompanyDataMenuBuilder                                                  
  bitbag_sylius_invoicing_plugin.event_listener.order_show                                     BitBag\SyliusInvoicingPlugin\Menu\DownloadInvoiceMenuBuilder                                              
  bitbag_sylius_invoicing_plugin.factory.company_data                                          Sylius\Component\Resource\Factory\Factory                                                                 
  bitbag_sylius_invoicing_plugin.factory.invoice                                               Sylius\Component\Resource\Factory\Factory                                                                 
  bitbag_sylius_invoicing_plugin.file_generator.invoice_filename                               BitBag\SyliusInvoicingPlugin\FileGenerator\InvoicePdfFilenameGenerator                                        
  bitbag_sylius_invoicing_plugin.file_generator.invoice_file                                   BitBag\SyliusInvoicingPlugin\FileGenerator\InvoicePdfFileGenerator                                        
  bitbag_sylius_invoicing_plugin.form.extension.address                                        BitBag\SyliusInvoicingPlugin\Form\Extension\AddressTypeExtension                                          
  bitbag_sylius_invoicing_plugin.form.type.company_data                                        BitBag\SyliusInvoicingPlugin\Form\Type\CompanyDataType                                                    
  bitbag_sylius_invoicing_plugin.form.type.invoice                                             BitBag\SyliusInvoicingPlugin\Form\Type\InvoiceType                                                        
  bitbag_sylius_invoicing_plugin.manager.company_data                                          alias for "doctrine.orm.default_entity_manager"                                                           
  bitbag_sylius_invoicing_plugin.manager.invoice                                               alias for "doctrine.orm.default_entity_manager"                                                           
  bitbag_sylius_invoicing_plugin.repository.company_data                                       BitBag\SyliusInvoicingPlugin\Repository\CompanyDataRepository                                             
  bitbag_sylius_invoicing_plugin.repository.invoice                                            BitBag\SyliusInvoicingPlugin\Repository\InvoiceRepository                                                 
  bitbag_sylius_invoicing_plugin.resolver.company_data                                         BitBag\SyliusInvoicingPlugin\Resolver\CompanyDataResolver                                                 
  bitbag_sylius_invoicing_plugin.resolver.invoice_file                                         BitBag\SyliusInvoicingPlugin\Resolver\InvoiceFileResolver                                                 
  bitbag_sylius_invoicing_plugin.validator.vat_number                                          BitBag\SyliusInvoicingPlugin\Validator\Constraints\VatNumberValidator

Parameters you can override in your parameters.yml(.dist) file

parameters:
    wkhtmltopdf_binary_path: /usr/local/bin/wkhtmltopdf
    invoices_root_dir: "%kernel.project_dir%/var/invoices"

Testing

$ composer install
$ cd tests/Application
$ yarn install
$ yarn run gulp
$ bin/console assets:install web -e test
$ bin/console doctrine:schema:create -e test
$ bin/console server:run 127.0.0.1:8080 -d web -e test
$ open http://localhost:8080
$ bin/behat
$ bin/phpspec run

Contribution

Learn more about our contribution workflow on http://docs.sylius.org/en/latest/contributing/.

More Repositories

1

SyliusCmsPlugin

Content management system for eCommerce apps created on Sylius platform. Built with Sylius code quality, flexibility, BDD.
PHP
221
star
2

OpenMarketplace

Open-source Multi-Vendor Marketplace platform based on Sylius and Symfony.
PHP
176
star
3

SyliusElasticsearchPlugin

Elasticsearch integration for Sylius apps.
PHP
119
star
4

SyliusWishlistPlugin

This plugin allows you to integrate wishlist features with Sylius platform app.
PHP
61
star
5

SyliusMolliePlugin

Sylius Mollie payment gateway integration.
PHP
55
star
6

SyliusVueStorefrontPlugin

Sylius plugin integrating Sylius with Vue Storefront
PHP
45
star
7

SyliusMailChimpPlugin

Simple MailChimp integration with Sylius eCommerce framework.
PHP
42
star
8

BitBagBible

BitBag coding standards that rock!
36
star
9

SyliusShippingExportPlugin

Shipping export management architecture for Sylius based apps.
PHP
27
star
10

SyliusPayUPlugin

PayU payment plugin for Sylius applications.
PHP
23
star
11

SyliusPrzelewy24Plugin

This plugin allows you to integrate Przelewy24 payments in your Sylius instance.
PHP
18
star
12

SyliusProductBundlePlugin

This plugin allows you to create new products by bundling existing products together.
PHP
18
star
13

SyliusAdyenPlugin_old

Sylius Adyen payments integration.
PHP
17
star
14

SyliusVueStorefront2Plugin

SyliusVueStorefront2Plugin provides everything you need to integrate your Sylius back-end with Vue Storefront 2.
PHP
17
star
15

SyliusMercanetBnpParibasPlugin

BnpParibas Mercanet payment gateway for Sylius based applications.
PHP
15
star
16

SyliusAdyenPlugin

Development environment for the new version of the Adyen Plugin
PHP
10
star
17

SyliusDHL24PlShippingExportPlugin

DHL Shipping export plugin for Sylius platform applications.
PHP
9
star
18

SyliusBraintreePlugin

Sylius Braintree payment gateway integration.
PHP
8
star
19

SyliusBonusPointsPlugin

The plugin extends Sylius with simple bonus points loyalty program and applies special actions for users depending on the points score.
PHP
7
star
20

SyliusAmazonPayPlugin

This plugin allows you to integrate AmazonPay payments in your Sylius instance.
PHP
7
star
21

SyliusRawHtml

Starting point for Sylius shop template development with HTML structure adjusted to Behat elements definition.
HTML
6
star
22

SyliusCrossSellingPlugin

The plugin adds a new section, “Related Products” to the product page. Displays products that were purchased with the current product recently, and if there is not enough data, displays products with the same taxons.
PHP
6
star
23

ShopwareInPostPlugin

This plugin allows you to integrate InPost with Shopware
PHP
4
star
24

SyliusCoinbasePlugin

Sylius Coinbase integration
PHP
4
star
25

SyliusBDD

This repository was created for the BitBagBlog tutorial about BDD workflow in Sylius eCommerce framework.
PHP
4
star
26

SyliusMailTemplatePlugin

Sylius MailTemplate allows us to customize any email handled by Sylius Mailer. When an email is sent the plugin tries to figure out if custom template for the kind of email exists, if yes it replaces the default email with our custom one.
JavaScript
4
star
27

SyliusShippingSubscriptionPlugin

Virtual product - subscription for free shipping
PHP
3
star
28

SyliusInPostPlugin

A dedicated solution for shipment management fully integrated with InPost operator. It allows to export orders via API and generate a shipping label(s) in response.
PHP
3
star
29

SyliusVueStorefront2Frontend

Front-end part of SyliusVueStorefront2 integration
Vue
3
star
30

SyliusPocztaPolskaShippingExportPlugin

PHP
2
star
31

SyliusProductAttributeGroupsPlugin

Plugin allows you to create groups which can be associated with product attributes.
PHP
2
star
32

SyliusBlacklistPlugin

This plugin allows counteracting suspicious behavior in eCommerce by blocking the possibility of purchases using automatic rules or manual analysis of customer behavior.
PHP
2
star
33

coding-standard

PHP
1
star
34

BitBagShopwareAppSystemBundle

PHP
1
star
35

SyliusDPDPlShippingExportPlugin

PHP
1
star
36

pp-client

Poczta Polska SOAP client
PHP
1
star
37

SyliusAgreementPlugin

PHP
1
star
38

SyliusSmashPromotionPlugin

PHP
1
star
39

BitBagShopwareOrlenPaczkaPlugin

Integration with the Polish Post Office, Orlen pick-up point
PHP
1
star
40

SyliusBannerPlugin

Banner management plugin
PHP
1
star
41

SyliusMulticartPlugin

PHP
1
star