Rajout d'un module pour gérer la TVA intracommunautaire
This commit is contained in:
37
local/modules/CustomerVatNumber/Config/config.xml
Executable file
37
local/modules/CustomerVatNumber/Config/config.xml
Executable file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<config xmlns="http://thelia.net/schema/dic/config"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||
|
||||
<services>
|
||||
<service id="customervatnumber.services" class="CustomerVatNumber\EventListeners\CustomerVatNumberEventListener">
|
||||
<argument id="request" type="service"/>
|
||||
<tag name="kernel.event_subscriber"/>
|
||||
</service>
|
||||
</services>
|
||||
|
||||
<hooks>
|
||||
<hook id="customervatnumber.hook" class="CustomerVatNumber\Hook\CustomerVatNumberHook">
|
||||
<tag name="hook.event_listener" event="register.form-bottom" type="front" method="addFormFieldInput" />
|
||||
<tag name="hook.event_listener" event="account-update.form-bottom" type="front" method="addFormFieldInput" />
|
||||
|
||||
<tag name="hook.event_listener" event="register.after-javascript-include" type="front" method="onRegisterAddJs" />
|
||||
<tag name="hook.event_listener" event="account-update.after-javascript-include" type="front" method="onFrontUpdateAddJs" />
|
||||
|
||||
<tag name="hook.event_listener" event="account.javascript-initialization" type="front" method="onFrontCustomerAccountJs" />
|
||||
|
||||
<tag name="hook.event_listener" event="customer.create-form" type="back" method="onBackCreate" />
|
||||
<tag name="hook.event_listener" event="customer-edit.bottom" type="back" method="onBackUpdate" />
|
||||
|
||||
<tag name="hook.event_listener" event="customers.js" type="back" method="onBackCreateAddJs" />
|
||||
<tag name="hook.event_listener" event="customer.edit-js" type="back" method="onBackUpdateAddJs" />
|
||||
|
||||
<tag name="hook.event_listener" event="invoice.information" type="pdf" method="invoiceInformation" />
|
||||
</hook>
|
||||
</hooks>
|
||||
|
||||
<loops>
|
||||
<loop name="customer-vat-number" class="CustomerVatNumber\Loop\CustomerVatNumberLoop" />
|
||||
</loops>
|
||||
</config>
|
||||
28
local/modules/CustomerVatNumber/Config/module.xml
Executable file
28
local/modules/CustomerVatNumber/Config/module.xml
Executable file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module xmlns="http://thelia.net/schema/dic/module"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://thelia.net/schema/dic/module http://thelia.net/schema/dic/module/module-2_2.xsd">
|
||||
<fullnamespace>CustomerVatNumber\CustomerVatNumber</fullnamespace>
|
||||
<descriptive locale="en_US">
|
||||
<title>Add a VAT number to your customer information</title>
|
||||
</descriptive>
|
||||
<descriptive locale="fr_FR">
|
||||
<title>Ajoute le numéro de TVA Intracommunautaire aux informations client</title>
|
||||
</descriptive>
|
||||
<languages>
|
||||
<language>en_US</language>
|
||||
<language>fr_FR</language>
|
||||
</languages>
|
||||
<version>1.0.0</version>
|
||||
<authors>
|
||||
<author>
|
||||
<name>Franck Allimant</name>
|
||||
<company>CQFDev</company>
|
||||
<email>thelia@cqfdev.fr</email>
|
||||
<website>www.cqfdev.fr</website>
|
||||
</author>
|
||||
</authors>
|
||||
<type>classic</type>
|
||||
<thelia>2.3.0</thelia>
|
||||
<stability>other</stability>
|
||||
</module>
|
||||
6
local/modules/CustomerVatNumber/Config/routing.xml
Executable file
6
local/modules/CustomerVatNumber/Config/routing.xml
Executable file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<routes xmlns="http://symfony.com/schema/routing"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
|
||||
</routes>
|
||||
15
local/modules/CustomerVatNumber/Config/schema.xml
Executable file
15
local/modules/CustomerVatNumber/Config/schema.xml
Executable file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<database defaultIdMethod="native" name="thelia" >
|
||||
|
||||
<table name="customer_vat_number" namespace="CustomerVatNumber\Model">
|
||||
<column name="id" primaryKey="true" required="true" type="INTEGER" />
|
||||
<column name="vat_number" required="true" type="VARCHAR" length="64" />
|
||||
|
||||
<foreign-key foreignTable="customer" name="fk_customer_vat_number_customer_id" onDelete="CASCADE" onUpdate="CASCADE">
|
||||
<reference foreign="id" local="id" />
|
||||
</foreign-key>
|
||||
|
||||
</table>
|
||||
|
||||
<external-schema filename="local/config/schema.xml" referenceOnly="true" />
|
||||
</database>
|
||||
25
local/modules/CustomerVatNumber/Config/thelia.sql
Executable file
25
local/modules/CustomerVatNumber/Config/thelia.sql
Executable file
@@ -0,0 +1,25 @@
|
||||
|
||||
# This is a fix for InnoDB in MySQL >= 4.1.x
|
||||
# It "suspends judgement" for fkey relationships until are tables are set.
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- customer_vat_number
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS `customer_vat_number`;
|
||||
|
||||
CREATE TABLE `customer_vat_number`
|
||||
(
|
||||
`id` INTEGER NOT NULL,
|
||||
`vat_number` VARCHAR(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
CONSTRAINT `fk_customer_vat_number_customer_id`
|
||||
FOREIGN KEY (`id`)
|
||||
REFERENCES `customer` (`id`)
|
||||
ON UPDATE CASCADE
|
||||
ON DELETE CASCADE
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
# This restores the fkey checks, after having unset them earlier
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
Reference in New Issue
Block a user