Skip to content
Snippets Groups Projects
Commit d18097da authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Prepare database to manage different vat rate with same rate value.

parent 3111b56b
No related branches found
No related tags found
No related merge requests found
......@@ -140,3 +140,13 @@ ALTER TABLE llx_accounting_bookkeeping ADD COLUMN tms timestamp;
ALTER TABLE llx_accounting_account ADD UNIQUE INDEX uk_accounting_account (account_number, entity, fk_pcg_version);
ALTER TABLE llx_c_payment_term change fdm type_cdr tinyint
ALTER TABLE llx_facturedet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_facture_fourn_det ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_commandedet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_commande_fournisseurdet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_propaldet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
ALTER TABLE llx_supplier_proposaldet ADD COLUMN vat_src_code varchar(10) DEFAULT '' AFTER tva_tx;
\ No newline at end of file
......@@ -28,6 +28,7 @@ create table llx_commande_fournisseurdet
ref varchar(50), -- supplier product ref
label varchar(255), -- product label
description text,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3) DEFAULT 0, -- taux tva
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type
......
......@@ -28,7 +28,8 @@ create table llx_commandedet
fk_product integer NULL,
label varchar(255) DEFAULT NULL,
description text,
tva_tx double(6,3), -- vat rate
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3), -- Vat rate
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate
......
......@@ -31,6 +31,7 @@ create table llx_facture_fourn_det
pu_ttc double(24,8), -- unit price with tax
qty real, -- quantity of product/service
remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3), -- TVA taux product/service
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type
......
......@@ -26,15 +26,16 @@ create table llx_facturedet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_facture integer NOT NULL,
fk_parent_line integer NULL,
fk_parent_line integer NULL,
fk_product integer NULL, -- Doit pouvoir etre nul pour ligne detail sans produits
label varchar(255) DEFAULT NULL,
description text,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3), -- Vat rate (example 20%)
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type
localtax1_type varchar(10) NULL, -- localtax1 type
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate
localtax2_type varchar(10) NULL, -- localtax2 type
localtax2_type varchar(10) NULL, -- localtax2 type
qty real, -- Quantity (exemple 2)
remise_percent real DEFAULT 0, -- % de la remise ligne (exemple 20%)
remise real DEFAULT 0, -- Montant calcule de la remise % sur PU HT (exemple 20)
......@@ -43,13 +44,13 @@ create table llx_facturedet
price double(24,8), -- Deprecated (Do not use)
total_ht double(24,8), -- Total HT de la ligne toute quantite et incluant remise ligne et globale
total_tva double(24,8), -- Total TVA de la ligne toute quantite et incluant remise ligne et globale
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line
total_localtax2 double(24,8) DEFAULT 0, -- total LocalTax2 for total quantity of line
total_localtax1 double(24,8) DEFAULT 0, -- Total LocalTax1 for total quantity of line
total_localtax2 double(24,8) DEFAULT 0, -- Total LocalTax2 for total quantity of line
total_ttc double(24,8), -- Total TTC de la ligne toute quantite et incluant remise ligne et globale
product_type integer DEFAULT 0,
date_start datetime DEFAULT NULL, -- date debut si service
date_end datetime DEFAULT NULL, -- date fin si service
info_bits integer DEFAULT 0, -- TVA NPR ou non
date_start datetime DEFAULT NULL, -- date start if service
date_end datetime DEFAULT NULL, -- date end if service
info_bits integer DEFAULT 0, -- VAT NPR or not (for france only)
buy_price_ht double(24,8) DEFAULT 0, -- buying price
fk_product_fournisseur_price integer DEFAULT NULL, -- reference of supplier price when line was added (may be used to update buy_price_ht current price when future invoice will be created)
......@@ -58,19 +59,19 @@ create table llx_facturedet
special_code integer DEFAULT 0, -- code pour les lignes speciales
rang integer DEFAULT 0, -- position of line
fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines
fk_contract_line integer NULL, -- id of contract line when invoice comes from contract lines
import_key varchar(14),
situation_percent real, -- % progression of lines invoicing
fk_prev_id integer, -- id of the line in the previous situation,
fk_unit integer DEFAULT NULL, -- id of the unit code¡
situation_percent real, -- % progression of lines invoicing
fk_prev_id integer, -- id of the line in the previous situation,
fk_unit integer DEFAULT NULL, -- id of the unit code¡
fk_multicurrency integer,
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_subprice double(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0
multicurrency_total_tva double(24,8) DEFAULT 0,
multicurrency_total_ttc double(24,8) DEFAULT 0
)ENGINE=innodb;
--
......
......@@ -28,7 +28,8 @@ create table llx_propaldet
label varchar(255) DEFAULT NULL,
description text,
fk_remise_except integer NULL, -- Lien vers table des remises fixes
tva_tx double(6,3) DEFAULT 0, -- taux tva
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3) DEFAULT 0, -- Vat rate
localtax1_tx double(6,3) DEFAULT 0, -- localtax1 rate
localtax1_type varchar(10) NULL, -- localtax1 type
localtax2_tx double(6,3) DEFAULT 0, -- localtax2 rate
......
......@@ -23,7 +23,8 @@ CREATE TABLE llx_supplier_proposaldet (
label varchar(255) DEFAULT NULL,
description text,
fk_remise_except integer DEFAULT NULL,
tva_tx double(6,3) DEFAULT 0,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
tva_tx double(6,3) DEFAULT 0, -- Vat rate
localtax1_tx double(6,3) DEFAULT 0,
localtax1_type varchar(10) DEFAULT NULL,
localtax2_tx double(6,3) DEFAULT 0,
......@@ -45,7 +46,6 @@ CREATE TABLE llx_supplier_proposaldet (
special_code integer DEFAULT 0,
rang integer DEFAULT 0,
ref_fourn varchar(30) DEFAULT NULL,
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_subprice double(24,8) DEFAULT 0,
......
......@@ -24,7 +24,7 @@ AccountancyAreaDescActionFreq=The following actions are usually executed every m
AccountancyAreaDescChartModel=STEP %s: Create a model of chart of account from menu %s
AccountancyAreaDescChart=STEP %s: Create or check content of your chart of account from menu %s
AccountancyAreaDescBank=STEP %s: Check the binding between bank accounts and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on your payment lines.<br>For this, go on the card of each financial account. You can start from page %s.
AccountancyAreaDescVat=STEP %s: Check the binding between vat payment and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to VAT payments.<br>You can set accounting accounts to use for each VAT from page %s.
AccountancyAreaDescVat=STEP %s: Check the binding between vat rates and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to VAT lines.<br>You can set accounting accounts to use for each VAT from page %s.
AccountancyAreaDescSal=STEP %s: Check the binding between salaries payment and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payment of salaries.<br>For this you can use the menu entry %s.
AccountancyAreaDescContrib=STEP %s: Check the binding between special expences (miscellaneous taxes) and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payments of taxes.<br>For this you can use the menu entry %s.
AccountancyAreaDescDonation=STEP %s: Check the binding between donation and accounting account is done. Complete missing bindings. This will save you time in future for the next steps by suggesting you the correct default accounting account on record related to payments of donation.<br>You can set the account dedicated for that from the menu entry %s.
......@@ -46,6 +46,7 @@ AccountAccounting=Accounting account
AccountAccountingShort=Account
AccountAccountingSuggest=Accounting account suggest
MenuDefaultAccounts=Default accounts
MenuVatAccounts=Vat accounts
MenuProductsAccounts=Product accounts
ProductsBinding=Products accounts
Ventilation=Binding to accounts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment