SD-1 mep des factures
This commit is contained in:
parent
8cb323a133
commit
9adeda59ae
@ -78,17 +78,20 @@ class Metier_Credit_Information extends Scores_Ws_Server
|
||||
|
||||
/**
|
||||
* Recuperation des informations necessaires a la facturation
|
||||
* @param string $idCmd
|
||||
* @param int $id
|
||||
*/
|
||||
public function getInfosFacture($idCmd){
|
||||
$sql='select c.*, u.idClient, u.siret
|
||||
public function getInfosFacture($id){
|
||||
$sql='select c.*, u.idClient, u.siret, u.email,u.nom,u.prenom
|
||||
from sdv1.credit__paid c inner join utilisateurs u on c.idUser=u.id
|
||||
where idCmd= :idCmd;';
|
||||
where c.id= :id;';
|
||||
$stmt = $this->conn->prepare($sql);
|
||||
$stmt->bindValue('idCmd', $idCmd);
|
||||
$stmt->bindValue('id', $id);
|
||||
$stmt->execute();
|
||||
if ($stmt->rowCount() == 1) {
|
||||
$infos['commande']=$stmt->fetch(PDO::FETCH_ASSOC);
|
||||
}else{
|
||||
$infos['commande']=null;
|
||||
return $infos;
|
||||
}
|
||||
$siren=substr($infos['commande']['siret'],0,9);
|
||||
$nic=substr($infos['commande']['siret'],9,5);
|
||||
|
@ -204,4 +204,20 @@ class Credit extends Scores_Ws_Server
|
||||
return $GetcontactsCreditResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recherche des donnees de facturation
|
||||
* @param integer id
|
||||
* @return GetfactinfosCredit
|
||||
*/
|
||||
public function getfactinfosCredit($id){
|
||||
$this->authenticate();
|
||||
$idUser = $this->User->id;
|
||||
$this->permission($this->libdroits);
|
||||
$GetfactinfosCreditResult=new GetfactinfosCredit();
|
||||
$GetfactinfosCreditResult->id=$id;
|
||||
$crdt=new Metier_Credit_Information();
|
||||
$GetfactinfosCreditResult->result=$crdt->getInfosFacture($id);
|
||||
return $GetfactinfosCreditResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -105,3 +105,16 @@ class GetcontactsCredit
|
||||
*/
|
||||
public $result;
|
||||
}
|
||||
class GetfactinfosCredit
|
||||
{
|
||||
/**
|
||||
* All informations for invoicing
|
||||
* @var array
|
||||
*/
|
||||
public $result;
|
||||
/**
|
||||
* Params sent
|
||||
* @var integer
|
||||
*/
|
||||
public $id;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user