Correction lien

This commit is contained in:
Michael RICOIS 2013-06-27 14:05:39 +00:00
parent 80757437fa
commit b4458b38b9

View File

@ -1567,7 +1567,7 @@ class Saisie extends WsScore
$lienM = new Application_Model_JoLiens(); $lienM = new Application_Model_JoLiens();
//Test si PDetention > 100 //Test si PDetention >= 100
if ($dataLien['actif']!=0) { if ($dataLien['actif']!=0) {
$sql = $lienM->select()->from($lienM, array( $sql = $lienM->select()->from($lienM, array(
'idPar', new Zend_Db_Expr('SUM( PDetention ) AS sumDet') 'idPar', new Zend_Db_Expr('SUM( PDetention ) AS sumDet')
@ -1579,7 +1579,7 @@ class Saisie extends WsScore
$sql->where('actif=?',1); $sql->where('actif=?',1);
$result = $lienM->fetchRow($sql); $result = $lienM->fetchRow($sql);
if ( null !== $result ) { if ( null !== $result ) {
if ( $result->sumDet + $dataLien['PDetention'] > 100 ) { if ( (float) ($result->sumDet + $dataLien['PDetention']) > 100.1 ) {
throw new SoapFault('ERR', "Erreur Detention sup 100%"); throw new SoapFault('ERR', "Erreur Detention sup 100%");
} }
} }
@ -2142,7 +2142,9 @@ class Saisie extends WsScore
* LienRef Fusion or Move LienRef * LienRef Fusion or Move LienRef
* @param string $action fusion|moveact|movepar * @param string $action fusion|moveact|movepar
* @param int $idLien * @param int $idLien
* Identifiant du lien entre idPar et idAct
* @param int $id * @param int $id
* Identifiant à affecter (idPar ou idAct)
* @throws SoapFault * @throws SoapFault
* @return boolean * @return boolean
*/ */
@ -2182,7 +2184,7 @@ class Saisie extends WsScore
{ {
try { try {
$result = $lienM->update(array('idPar'=>$id, 'idUpdate'=>$this->tabInfoUser['id']), $result = $lienM->update(array('idPar'=>$id, 'idUpdate'=>$this->tabInfoUser['id']),
'idAct='.$idLien); 'id='.$idLien);
} catch (Zend_Db_Exception $e) { } catch (Zend_Db_Exception $e) {
if ($this->tabInfoUser['idClient']==1) { if ($this->tabInfoUser['idClient']==1) {
throw new SoapFault('ERR', $e->getMessage()); throw new SoapFault('ERR', $e->getMessage());
@ -2198,7 +2200,7 @@ class Saisie extends WsScore
{ {
try { try {
$result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->tabInfoUser['id']), $result = $lienM->update(array('idAct'=>$id, 'idUpdate'=>$this->tabInfoUser['id']),
'idPar='.$idLien); 'id='.$idLien);
} catch (Zend_Db_Exception $e) { } catch (Zend_Db_Exception $e) {
if ($this->tabInfoUser['idClient']==1) { if ($this->tabInfoUser['idClient']==1) {
throw new SoapFault('ERR', $e->getMessage()); throw new SoapFault('ERR', $e->getMessage());