columns:
  code_cloture:
    type: character(1)
    default: "0"
  code_cp_demandee:
    type: character(1)
    default: "0"
  code_expedie_0:
    type: character(1)
    default: "''::bpchar"
  code_expedie_1:
    type: character(1)
    default: "''::bpchar"
  code_expedie_2:
    type: character(1)
    default: "''::bpchar"
  code_expedie_22:
    type: character(1)
    default: "''::bpchar"
  code_facture:
    type: character(1)
    default: "'0'::bpchar"
  code_vente:
    type: character(1)
    default: "0"
  date_debut:
    type: date
  date_encours:
    type: date
    default: "'2099-12-31'::date"
  date_expedition:
    type: date
    default: "'2099-12-31'::date"
  date_expedition_0:
    type: date
    default: "'2099-12-31'::date"
  date_expedition_1:
    type: date
    default: "'2099-12-31'::date"
  date_expedition_2:
    type: date
    default: "'2099-12-31'::date"
  date_expedition_22:
    type: date
    default: "'2099-12-31'::date"
  date_facture:
    type: date
    default: "'2099-12-31'::date"
  date_fin:
    type: date
  date_solde:
    type: date
    default: "'2099-12-31'::date"
  date_solde_0_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_0_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_1_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_1_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_22_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_22_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_2_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_2_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_0_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_0_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_1_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_1_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_22_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_22_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_2_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_2_h:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_c:
    type: date
    default: "'2099-12-31'::date"
  date_solde_reference_h:
    type: date
    default: "'2099-12-31'::date"
  date_vente:
    type: date
  delai_expedition:
    type: numeric(5,0)
    default: "0"
  delai_expedition_0:
    type: numeric(5,0)
    default: "0"
  delai_expedition_1:
    type: numeric(5,0)
    default: "0"
  delai_expedition_2:
    type: numeric(5,0)
    default: "0"
  delai_expedition_22:
    type: numeric(5,0)
    default: "0"
  delai_facture:
    type: numeric(5,0)
    default: "0"
  delai_solde:
    type: numeric(5,0)
    default: "0"
  delai_solde_0_c:
    type: numeric(5,0)
    default: "0"
  delai_solde_0_h:
    type: numeric(5,0)
    default: "0"
  delai_solde_1_c:
    type: numeric(5,0)
    default: "0"
  delai_solde_1_h:
    type: numeric(5,0)
    default: "0"
  delai_solde_22_c:
    type: numeric(5,0)
    default: "0"
  delai_solde_22_h:
    type: numeric(5,0)
    default: "0"
  delai_solde_2_c:
    type: numeric(5,0)
    default: "0"
  delai_solde_2_h:
    type: numeric(5,0)
    default: "0"
  facture_od_avoir_id:
    type: bigint
    default: "0"
  facture_reference_id:
    type: bigint
    default: "0"
  finess:
    type: character(9)
    not_null: NOT NULL
    default: "''::bpchar"
  ghm_id:
    type: bigint
    default: "0"
  ghs_bebe1_id:
    type: bigint
    default: "0"
  ghs_bebe2_id:
    type: bigint
    default: "0"
  ghs_bebe3_id:
    type: bigint
    default: "0"
  ghs_id:
    type: bigint
    default: "0"
  gmt_id:
    type: bigint
    default: "0"
  mois_vente:
    type: numeric(6,0)
    default: "0"
  montant_comptabilise_0_c:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_0_h:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_1_c:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_1_h:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_22_c:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_22_h:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_2_c:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_2_h:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_budget_global_c:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_c:
    type: numeric(13,2)
    default: "0"
  montant_comptabilise_h:
    type: numeric(13,2)
    default: "0"
  montant_encours_0_c:
    type: numeric(13,2)
    default: "0"
  montant_encours_0_h:
    type: numeric(13,2)
    default: "0"
  montant_encours_1_c:
    type: numeric(13,2)
    default: "0"
  montant_encours_1_h:
    type: numeric(13,2)
    default: "0"
  montant_encours_22_c:
    type: numeric(13,2)
    default: "0"
  montant_encours_22_h:
    type: numeric(13,2)
    default: "0"
  montant_encours_2_c:
    type: numeric(13,2)
    default: "0"
  montant_encours_2_h:
    type: numeric(13,2)
    default: "0"
  montant_encours_c:
    type: numeric(13,2)
    default: "0"
  montant_encours_h:
    type: numeric(13,2)
    default: "0"
  montant_facture_0_c:
    type: numeric(13,2)
    default: "0"
  montant_facture_0_h:
    type: numeric(13,2)
    default: "0"
  montant_facture_1_c:
    type: numeric(13,2)
    default: "0"
  montant_facture_1_h:
    type: numeric(13,2)
    default: "0"
  montant_facture_22_c:
    type: numeric(13,2)
    default: "0"
  montant_facture_22_h:
    type: numeric(13,2)
    default: "0"
  montant_facture_2_c:
    type: numeric(13,2)
    default: "0"
  montant_facture_2_h:
    type: numeric(13,2)
    default: "0"
  montant_facture_c:
    type: numeric(13,2)
    default: "0"
  montant_facture_c_actes_inclus_dans_sejour:
    type: numeric(13,2)
    default: "0"
  montant_facture_h:
    type: numeric(13,2)
    default: "0"
  montant_facture_h_actes_inclus_dans_sejour:
    type: numeric(13,2)
    default: "0"
  montant_regle_0_c:
    type: numeric(13,2)
    default: "0"
  montant_regle_0_h:
    type: numeric(13,2)
    default: "0"
  montant_regle_1_c:
    type: numeric(13,2)
    default: "0"
  montant_regle_1_h:
    type: numeric(13,2)
    default: "0"
  montant_regle_22_c:
    type: numeric(13,2)
    default: "0"
  montant_regle_22_h:
    type: numeric(13,2)
    default: "0"
  montant_regle_2_c:
    type: numeric(13,2)
    default: "0"
  montant_regle_2_h:
    type: numeric(13,2)
    default: "0"
  montant_regle_c:
    type: numeric(13,2)
    default: "0"
  montant_regle_h:
    type: numeric(13,2)
    default: "0"
  motif_non_facturation_comment:
    type: text
    default: "''::text"
  motif_non_facturation_id:
    type: bigint
    default: "0"
  nb_rejets:
    type: numeric
    default: "0"
  no_bordereau_0:
    type: text
    default: "''::text"
  no_bordereau_1:
    type: text
    default: "''::text"
  no_bordereau_2:
    type: text
    default: "''::text"
  no_bordereau_22:
    type: text
    default: "''::text"
  no_facture:
    type: text
    not_null: NOT NULL
  no_facture_od_avoir:
    type: text
    default: "''::text"
  no_facture_reference:
    type: text
    default: "''::text"
  no_sejour:
    type: text
    not_null: NOT NULL
  oid:
    type: bigint
    not_null: NOT NULL
    default: "nextval('s_factures'::regclass)"
  particularite_t2a:
    type: text
    default: "''::text"
    comment: |
      SE1 = Forfait SE1
      SE2 = Forfait SE2
      SE3 = Forfait SE3
  provider_id:
    type: bigint
    default: "0"
  sejour_id:
    type: bigint
    default: "0"
  tiers_payant_0_id:
    type: bigint
    default: "0"
  tiers_payant_1_id:
    type: bigint
    default: "0"
  tiers_payant_22_id:
    type: bigint
    default: "0"
  tiers_payant_2_id:
    type: bigint
    default: "0"
  type_facture:
    type: character(1)
    default: "0"
constraints:
  p_factures_pkey:
    type: PRIMARY KEY
    column: oid
indexes:
  i_factures_1:
    column: no_facture, no_sejour
    method: btree
  i_factures_10:
    column: date_vente
    method: btree
  i_factures_11:
    column: no_facture_reference
    method: btree
  i_factures_12:
    column: no_facture_od_avoir
    method: btree
  i_factures_13:
    column: sejour_id
    method: btree
  i_factures_14:
    column: facture_reference_id
    method: btree
  i_factures_15:
    column: date_fin
    method: btree
  i_factures_2:
    column: no_facture
    method: btree
  i_factures_3:
    column: tiers_payant_1_id
    method: btree
  i_factures_4:
    column: tiers_payant_2_id
    method: btree
  i_factures_5:
    column: no_sejour
    method: btree
  i_factures_6:
    column: tiers_payant_0_id
    method: btree
  i_factures_7:
    column: tiers_payant_22_id
    method: btree
  i_factures_8:
    column: ghs_id
    method: btree
  i_factures_9:
    column: date_facture
    method: btree