Sage100-ws/utils/tiers/tiers_data_sql.py

82 lines
3.4 KiB
Python

def _build_tiers_select_query():
"""Construit la partie SELECT de la requête avec tous les champs tiers + collaborateur"""
return """
SELECT
-- IDENTIFICATION TIERS (9)
t.CT_Num, t.CT_Intitule, t.CT_Type, t.CT_Qualite,
t.CT_Classement, t.CT_Raccourci, t.CT_Siret, t.CT_Identifiant,
t.CT_Ape,
-- ADRESSE TIERS (7)
t.CT_Contact, t.CT_Adresse, t.CT_Complement,
t.CT_CodePostal, t.CT_Ville, t.CT_CodeRegion, t.CT_Pays,
-- TELECOM TIERS (6)
t.CT_Telephone, t.CT_Telecopie, t.CT_EMail, t.CT_Site,
t.CT_Facebook, t.CT_LinkedIn,
-- TAUX TIERS (4)
t.CT_Taux01, t.CT_Taux02, t.CT_Taux03, t.CT_Taux04,
-- STATISTIQUES TIERS (10)
t.CT_Statistique01, t.CT_Statistique02, t.CT_Statistique03,
t.CT_Statistique04, t.CT_Statistique05, t.CT_Statistique06,
t.CT_Statistique07, t.CT_Statistique08, t.CT_Statistique09,
t.CT_Statistique10,
-- COMMERCIAL TIERS (4)
t.CT_Encours, t.CT_Assurance, t.CT_Langue, t.CO_No,
-- FACTURATION TIERS (11)
t.CT_Lettrage, t.CT_Sommeil, t.CT_Facture, t.CT_Prospect,
t.CT_BLFact, t.CT_Saut, t.CT_ValidEch, t.CT_ControlEnc,
t.CT_NotRappel, t.CT_NotPenal, t.CT_BonAPayer,
-- LOGISTIQUE TIERS (4)
t.CT_PrioriteLivr, t.CT_LivrPartielle,
t.CT_DelaiTransport, t.CT_DelaiAppro,
-- COMMENTAIRE TIERS (1)
t.CT_Commentaire,
-- ANALYTIQUE TIERS (1)
t.CA_Num,
-- ORGANISATION / SURVEILLANCE TIERS (10)
t.MR_No, t.CT_Surveillance, t.CT_Coface,
t.CT_SvFormeJuri, t.CT_SvEffectif, t.CT_SvRegul,
t.CT_SvCotation, t.CT_SvObjetMaj, t.CT_SvCA, t.CT_SvResultat,
-- COMPTE GENERAL ET CATEGORIES TIERS (3)
t.CG_NumPrinc, t.N_CatTarif, t.N_CatCompta,
-- COLLABORATEUR (23 champs)
c.CO_No AS Collab_CO_No,
c.CO_Nom AS Collab_CO_Nom,
c.CO_Prenom AS Collab_CO_Prenom,
c.CO_Fonction AS Collab_CO_Fonction,
c.CO_Adresse AS Collab_CO_Adresse,
c.CO_Complement AS Collab_CO_Complement,
c.CO_CodePostal AS Collab_CO_CodePostal,
c.CO_Ville AS Collab_CO_Ville,
c.CO_CodeRegion AS Collab_CO_CodeRegion,
c.CO_Pays AS Collab_CO_Pays,
c.CO_Service AS Collab_CO_Service,
c.CO_Vendeur AS Collab_CO_Vendeur,
c.CO_Caissier AS Collab_CO_Caissier,
c.CO_Acheteur AS Collab_CO_Acheteur,
c.CO_Telephone AS Collab_CO_Telephone,
c.CO_Telecopie AS Collab_CO_Telecopie,
c.CO_EMail AS Collab_CO_EMail,
c.CO_TelPortable AS Collab_CO_TelPortable,
c.CO_Matricule AS Collab_CO_Matricule,
c.CO_Facebook AS Collab_CO_Facebook,
c.CO_LinkedIn AS Collab_CO_LinkedIn,
c.CO_Skype AS Collab_CO_Skype,
c.CO_Sommeil AS Collab_CO_Sommeil,
c.CO_ChefVentes AS Collab_CO_ChefVentes,
c.CO_NoChefVentes AS Collab_CO_NoChefVentes
"""
__all__ = ["_build_tiers_select_query"]