<?php

namespace Modules\Additional\Specifique\Client123\Modules\Facture\Repository;

//use Helpers\Filter\FilterTable;

class CsCreationFacture
{

    
    public static function initCsSI($codtab, $codeEnr, $pdo)
    {
        $req = "SELECT VALEUR FROM CS_DON with(nolock) WHERE COD_TAB=:value AND COD_ENR=:codeEnr AND NUM_FIX=(SELECT LIB01DICO FROM DILISPEC with(nolock) WHERE TYPEDICO='PARNCS0123' AND CODEDICO='NCS_FAC_ENT_SECTIMPU')";
        
        $arrayReq = [
            ':value' => $codtab,
            ':codeEnr' => $codeEnr,
        ];

        $champSupp = $pdo->prepare($req);
        $champSupp->execute($arrayReq);
        
        return $champSupp->fetch()['VALEUR'];
    }
}
