<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;
use Helpers\Trad\Trad;

class DaEntet extends QueryBuilder
{
    protected string $table = 'DA_ENTET with (nolock)';
    protected string $primaryKey = 'NO_DA';
    protected string $libelle = 'NO_DA';
    
    public function getTaxonomie() :int
    {
        return 1;
    }
    
    public function getArchitecture(\Helpers\Trad\ITrad $trad)
    {
        return  [
            'NO_DA'     => ['nomChamp' => $trad->t("Numéro demande d'achat")],
            'CHIF_EXEC' => ['nomChamp' => $trad->t("Chiffrage/Exécution")],
            'TYP_DOC'   => ['nomChamp' => $trad->t('Type de document')],
            'CODE_STE'  => ['nomChamp' => $trad->t("Société")],
            'DTE_EMISS' => ['nomChamp' => $trad->t("Date d'émission"), 'type' => 'DATE'],
            'DTE_VAL'   => ['nomChamp' => $trad->t("Date de validité"), 'type' => 'DATE'],

            'VALIDITE'  => ['nomChamp' => $trad->t("Validée ?"), 'type' => 'RADIO'],
            'TRAITEE'   => ['nomChamp' => $trad->t("Traitée ?"), 'type' => 'RADIO'],
            'SIGNEE'    => ['nomChamp' => $trad->t("Signée ?"), 'type' => 'RADIO'],
            'REFUSEE'   => ['nomChamp' => $trad->t("Refusée ?"), 'type' => 'RADIO'],
            
            'NO_DEM'    => ['nomChamp' => $trad->t('Demandeur')],
            'SECTIMP'   => ['nomChamp' => $trad->t('Section d\'imputation')],
            'CODGES'    => ['nomChamp' => $trad->t('Code gestion')],
            'LIBGES'    => ['nomChamp' => $trad->t("Libellé code gestion")],
            'CODECOMP'  => ['nomChamp' => $trad->t("Code complémentaire")],
            'SSCPTEANA' => ['nomChamp' => $trad->t('Sous-compte d\'analyse')],
            'DEVISE'    => ['nomChamp' => $trad->t('Devise')],
            'BUDGETDA'  => ['nomChamp' => $trad->t('Budget'), 'type' => 'MONTANT'],
            'ZONELIB'   => ['nomChamp' => $trad->t('Zone libre DA')],
            'COD_LNG'   => ['nomChamp' => $trad->t('Langue de la DA')],
            
            'ACD'       => ['nomChamp' => $trad->t('Accord-cadre')],
            'FOU'       => ['nomChamp' => $trad->t('Code fournisseur')],
            'NOCDISDA'  => ['nomChamp' => $trad->t("Notation commande ?"), 'type' => 'RADIO'],
            'ADRFOU'    => ['nomChamp' => $trad->t('Adresse fournisseur')],
            'CPFOU'     => ['nomChamp' => $trad->t('Code postal fournisseur')],
            'VILLEFOU'  => ['nomChamp' => $trad->t('Ville fournisseur')],
            'VILFOU'    => ['nomChamp' => $trad->t('CP et Ville fournisseur')],
            'PAYSFOU'   => ['nomChamp' => $trad->t('Pays fournisseur')],
            'CTCT_FOU'  => ['nomChamp' => $trad->t('Contact fournisseur')],
            'TEL_CTCT'  => ['nomChamp' => $trad->t("Tel. fournisseur")],
            'POR_CTCT'  => ['nomChamp' => $trad->t('Portable fournisseur')],
            'FAX_CTCT'  => ['nomChamp' => $trad->t('Fax fournisseur')],
            'EMA_CTCT'  => ['nomChamp' => $trad->t('Email fournisseur')],
            
            'CTR_LIV'   => ['nomChamp' => $trad->t('Centre de livraison')],
            'ADRLIV'    => ['nomChamp' => $trad->t('Adresse livraison')],
            'CPLIV'     => ['nomChamp' => $trad->t('Code postal livraison')],
            'VILLELIV'  => ['nomChamp' => $trad->t('Ville livraison')],
            'VILLIV'    => ['nomChamp' => $trad->t('CP et Ville livraison')],
            'PAYSLIV'   => ['nomChamp' => $trad->t('Pays livraison')],
            'NMCTC1L'   => ['nomChamp' => $trad->t('Contact livraison')],
            'FTCTC1L'   => ['nomChamp' => $trad->t('Contact livraison fonction')],
            'TLCTC1L'   => ['nomChamp' => $trad->t('Contact livraison tel')],
            'PRCTC1L'   => ['nomChamp' => $trad->t('Contact livraison portable')],
            'FXCTC1L'   => ['nomChamp' => $trad->t('Contact livraison faxe')],
            'MLCTC1L'   => ['nomChamp' => $trad->t('Contact livraison mail')],

            'DAENT_CENTRE_EMETTEUR' => ['nomChamp' =>$trad->t("Centre émetteur")],
            'COND_PAIE' => ['nomChamp' => $trad->t('Condition de paiement')],
            'MODE_PAIE' => ['nomChamp' => $trad->t('Mode de paiement')],
            'MODE_LIV'  => ['nomChamp' => $trad->t('Mode de livraison')],
            'MOD_TRS'   => ['nomChamp' => $trad->t('Mode de transport')],
            'DTE_LIV'   => ['nomChamp' => $trad->t('Date de livraison'), 'type' => 'DATE'],
            'CODE_MESS' => ['nomChamp' => $trad->t('Message')],
            'TYPNMP'    => ['nomChamp' => $trad->t('Type d\'achat nomenclature marchés publics')],
            
            'TOTAL_DA'      => ['nomChamp' => $trad->t('Total HT'), 'type' => 'MONTANT'],
            'TOTAL_DA_TTC'  => ['nomChamp' => $trad->t('Total TTC'), 'type' => 'MONTANT'],

            'FORMUL'    => ['nomChamp' => $trad->t('Formulaire')],
            'OBJET_DA'  => ['nomChamp' => $trad->t('Objet')],
            'NM_TITRE'  => ['nomChamp' => $trad->t('Titre'), 'type' => 'MEMO'],
            'NM_COMMEN' => ['nomChamp' => $trad->t('Commentaire'), 'type' => 'MEMO'],

            // TODO A TRAITER
            /*
            'NOCDEDIR'  => ['nomChamp' => $trad->t('')],
            'NUMPRORI'  => ['nomChamp' => $trad->t('')],
            'FM_CODE'   => ['nomChamp' => $trad->t('')],
            'DACDECHA'  => ['nomChamp' =>$trad->t(" ?"), 'type' => 'RADIO'],
            'ID_CG'     => ['nomChamp' => $trad->t('')],
            'EVE_SIG'   => ['nomChamp' => $trad->t('')],
            'EVE_VAL'   => ['nomChamp' => $trad->t('')],
            */
        ];
    }
}
