2019-11-02 17:53:27 +01:00
|
|
|
|
CREATE TABLE IF NOT EXISTS plugin_facturation_factures (
|
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
|
type_facture INTEGER NOT NULL DEFAULT 0,
|
|
|
|
|
numero TEXT NOT NULL UNIQUE,
|
|
|
|
|
receveur_membre INTEGER NOT NULL, -- bool
|
|
|
|
|
receveur_id INTEGER NOT NULL,
|
|
|
|
|
date_emission TEXT NOT NULL, -- CHECK (date(date_emission) IS NOT NULL AND date(date_emission) = date_emission),
|
|
|
|
|
date_echeance TEXT NOT NULL, -- CHECK (date(date_echeance) IS NOT NULL AND date(date_echeance) = date_echeance),
|
|
|
|
|
reglee INTEGER DEFAULT 0, -- bool
|
|
|
|
|
archivee INTEGER DEFAULT 0, -- bool
|
|
|
|
|
moyen_paiement TEXT NOT NULL,
|
|
|
|
|
contenu TEXT NOT NULL,
|
2021-11-05 23:47:36 +01:00
|
|
|
|
total INTEGER DEFAULT 0
|
2019-11-02 17:53:27 +01:00
|
|
|
|
|
2020-12-29 18:07:26 +01:00
|
|
|
|
-- FOREIGN KEY(moyen_paiement) REFERENCES compta_moyens_paiement(code)
|
2019-11-02 17:53:27 +01:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS plugin_facturation_clients (
|
|
|
|
|
id INTEGER PRIMARY KEY,
|
|
|
|
|
nom TEXT NOT NULL,
|
|
|
|
|
adresse TEXT NOT NULL,
|
|
|
|
|
code_postal TEXT NOT NULL,
|
|
|
|
|
ville TEXT NOT NULL,
|
|
|
|
|
-- date_creation INTEGER NOT NULL,
|
|
|
|
|
date_creation TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date_creation) IS NOT NULL AND date(date_creation) = date_creation), -- Date d\'inscription
|
|
|
|
|
telephone TEXT,
|
|
|
|
|
email TEXT
|
|
|
|
|
);
|
|
|
|
|
|
2020-12-29 18:07:26 +01:00
|
|
|
|
|
|
|
|
|
CREATE TABLE IF NOT EXISTS plugin_facturation_paiement
|
|
|
|
|
-- Moyens de paiement
|
|
|
|
|
(
|
|
|
|
|
code TEXT NOT NULL PRIMARY KEY,
|
|
|
|
|
nom TEXT NOT NULL
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
--INSERT INTO compta_moyens_paiement (code, nom) VALUES ('AU', 'Autre');
|
|
|
|
|
INSERT OR IGNORE INTO plugin_facturation_paiement (code, nom) VALUES ('CB', 'Carte bleue');
|
|
|
|
|
INSERT OR IGNORE INTO plugin_facturation_paiement (code, nom) VALUES ('CH', 'Chèque');
|
|
|
|
|
INSERT OR IGNORE INTO plugin_facturation_paiement (code, nom) VALUES ('ES', 'Espèces');
|
|
|
|
|
INSERT OR IGNORE INTO plugin_facturation_paiement (code, nom) VALUES ('PR', 'Prélèvement');
|
|
|
|
|
INSERT OR IGNORE INTO plugin_facturation_paiement (code, nom) VALUES ('TI', 'TIP');
|
|
|
|
|
INSERT OR IGNORE INTO plugin_facturation_paiement (code, nom) VALUES ('VI', 'Virement');
|
|
|
|
|
|
2019-11-02 17:53:27 +01:00
|
|
|
|
-- CREATE TABLE IF NOT EXISTS plugin_facturation_produits (
|
|
|
|
|
-- id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
|
|
|
|
|
-- designation TEXT,
|
|
|
|
|
-- valeur_prix REAL
|
|
|
|
|
-- );
|