<?php

namespace Modules\Commande\Repository;

class Solder
{
    
    private $pdo;
    
    public function __construct(\PDO $pdo)
    {
        $this->pdo = $pdo;
    }
    
    /**
     * retourne la liste des notations commande
     * @param array $post
     * @return array
     */
    public function listeLigneCde($numCde)
    {
        $arrayReq = [];
        $req = "select 
                    NO_PO, CODE_ART, DES_SOMM, QTE_COMM, RAL,UNITE, DTELIVPRE, SOLD_PHYS, MEMOS.CONTMEMO DES_COMP, DTELIVCON, ETAT_FIN
                from CA_LIGNE with (nolock) 
                left join MEMOS with (nolock) on MEMOS.NODEMEMO = CA_LIGNE. NM_DCOMP
                where NO_CDE = :numCde";

        $arrayReq=[
            ':numCde' => $numCde,
        ];

        $commande = $this->pdo->prepare($req);
        $commande->execute($arrayReq);
        
        return $commande->fetchAll($this->pdo::FETCH_ASSOC);
    }
}
