CREATE TABLE IF NOT EXISTS flux_caisse( id_flux_caisse INTEGER PRIMARY KEY, type INTEGER NULL default 0, description TEXT NULL, created_by INTEGER NULL, session_code text NULL, amount INTEGER NULL, date_creation TEXT NULL, created_by_flux INTEGER null )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS flux_sessions( id_flux_session INTEGER PRIMARY KEY, flux_session_code text null, date_debut TEXT NULL, date_fin TEXT NULL, status INTEGER null, created_by_flux_session INTEGER null )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS stores ( id_store INTEGER PRIMARY KEY, name_store text NOT NULL, has_printer text null default 0, printing_ip text NULL )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS users ( user_id text PRIMARY KEY, full_name text NOT NULL, pin_code text NOT NULL, stores_allowed text null default 0, group_id integer not null default 0, perm_name text default '' ) WITHOUT ROWID; CREATE TABLE IF NOT EXISTS articles ( article_id INTEGER PRIMARY KEY, nature_article text default '0', design_article text NOT NULL, ref_categorie_article integer default 0, quantite_article INTEGER NOT NULL, prix_de_vente_article INTEGER not null, prix_vente_client_article INTEGER not null, prix_dachat_article integer default 0, codebar_article text not null, etat_tva text not null, store_id_article integer not null ) WITHOUT ROWID; CREATE TABLE IF NOT EXISTS categories( id_categorie INTEGER PRIMARY KEY, store_id integer not null, nom_categorie not null )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS modes( id_mode_paiement INTEGER PRIMARY KEY, designation_paiement_mode text not null )WITHOUT ROWID;CREATE TABLE IF NOT EXISTS types( id_type_facture INTEGER PRIMARY KEY, designation_type_facture text not null ) WITHOUT ROWID; CREATE TABLE IF NOT EXISTS commandes( id_pos_ibi_commandes INTEGER PRIMARY KEY, commande_status integer default 0, code text not null, code_facture integer default null, commission_status integer null, print_count integer default 0, print_count_souche integer default 0, print_count_bon integer default 0, client_id_commande integer default 1, table_id integer null, type_commande integer null default 0, montant_paye integer null, montant_du integer null, currency_type text not null, currency_rate integer null default 0, currency_total_converted integer null default 0, cancel_status integer null default 0, created_by_pos_ibi_commandes integer default 0, posted_by integer default null, date_paiement_commande text null, date_facturation_commande text null, deleted_status_pos_ibi_commandes integer default 0, sync_obr integer default 0, status_obr integer default 0, fa_number text default null, fa_motif integer default null, fa_generated integer default 0, is_fa integer default 0, caution_remain text default null, caution_rc text default null, caution_status integer default 0, date_creation_pos_ibi_commandes text null, from_cloud integer null default 0 )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS produits( id_pos_ibi_commandes_produits INTEGER PRIMARY KEY, pos_ibi_commandes_id integer null, ref_product_codebar text not null, ref_command_code text not null, price_unit_htva text not null, quantite real, tva real default 0, tc real default 0, rc real default 0, discount_percent real default 0, prix_normal integer default 0, prix_client integer default 0, prix_vendu integer default 0, prix_achat integer default 0, name_produit text not null, accompagnement text default null, deleted_status_pos_ibi_commandes_produits integer default 0, date_creation_pos_ibi_commandes_produits text not null, created_by_pos_ibi_commandes_produits integer not null, store_id_pos_ibi_commandes_produits integer not null )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS tables( id_commande_location INTEGER PRIMARY KEY, designation text not null, delete_status integer default 0 )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS profile( name text not null, nif text not null, rc text not null, centre_fiscal text not null, secteur text not null, juridique text not null, username text default null, password text default null, province text default null, avenue text default null, rue text default null, tl_taxpayer text default null, status_tva integer null, vat_taxpayer integer null, ct_taxpayer integer null, tp_type integer null, commune text default null, link_obr text default null, currency_rate text default null, bp text default null, telephone text default null, address text default null ); CREATE TABLE IF NOT EXISTS shifts( id_shift INTEGER PRIMARY KEY, shift_start text null default null, shift_end text null default null, shift_status integer null default 1, created_by_shift integer not null, inserted_at_shift text null default null, updated_at_shift text null default null, from_cloud integer not null default 1 )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS paiements( id_paiement integer PRIMARY key, commande_id integer not null, montant_paiement integer not null, mode_paiement integer not null, type_facture integer not null, avance integer null, rabais integer null, session_code integer not null, client_id_paiement integer not null, date_creation_paiement text not null, commande_code text null default null, created_by_paiement integer not null, date_creation_commande text null default null )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS clients( id_client integer primary key, nom_client text null default null, prenom_client text null default null, adresse_client text null default null, with_tva integer not null default 0, nif_client text null default null )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS last_bill_last_cmd( id_last_bill INTEGER PRIMARY KEY, last_bill integer default 0, last_cmd integer default 0, last_rc integer default 0, last_fa integer default 0, last_year integer default 0 )WITHOUT ROWID; CREATE TABLE IF NOT EXISTS notificationobr( id_notification integer primary key, invoice_number text null default null, invoice_registered_number text null default null, invoice_registered_date text null default null, electronic_signature text null default null, date_creation_contribuable text null default null, is_fa_notification text null default null )WITHOUT ROWID; INSERT INTO users(user_id, full_name, pin_code, group_id, perm_name) VALUES(2456,"initiator", "0000", 1, 'pos_mob_can_initiate');