Commande de statuts association

This commit is contained in:
Michael RICOIS 2015-06-03 08:06:18 +00:00
parent 13bf40727c
commit e75ba037c1
3 changed files with 86 additions and 2 deletions

View File

@ -3,4 +3,5 @@ return array(
'BilanInput' => 'BilanInput',
'PieceKbis' => 'PieceKbis',
'Bilan' => 'Bilan',
'AssoStatut' => 'AssoStatut',
);

View File

@ -450,4 +450,54 @@ class Order extends Scores_Ws_Server
}
/**
* Commandes de statuts association
* @param string $month
* @throws SoapFault
* @return AssoStatut[]
*/
public function getAssoStatut($month = null)
{
$this->authenticate();
if ($month === null) {
$month = date('Y-m');
}
$dateStart = $month.'-01 00:00:00';
$dateEnd = $month.'-31 23:59:59';
$list = array();
try {
$commandeM = new Application_Model_Sdv1GreffeCommandesKb();
$sql = $commandeM->select()
->where('login=?', $this->User->login)
->where('dateInsert BETWEEN "'.$dateStart.'" AND "'.$dateEnd.'"')
->order('dateInsert DESC');
$result = $commandeM->fetchAll($sql);
if (count($result) > 0) {
foreach($result as $item) {
$cmd = new AssoStatut();
$cmd->Reference = strtoupper($item->refCommande);
$cmd->Mode = $item->mode;
$cmd->Error = $item->cmdError;
$cmd->CompanyName = $item->companyName;
$cmd->CompanyId = $item->companyId;
$cmd->CompanyIdType = $item->typeId;
$cmd->DateInsert = $item->dateInsert;
$cmd->DateEnvoi = $item->dateDone;
$list[] = $cmd;
}
}
} catch (Zend_Db_Exception $e) {
if ($this->User->idClient == 1) {
throw new SoapFault('ERR', $e->getMessage());
} else {
throw new SoapFault('ERR', "Application error");
}
}
return $list;
}
}

View File

@ -49,7 +49,6 @@ class BilanInput
class PieceKbis
{
/**
* @var string
*/
@ -307,5 +306,39 @@ class Acte
* @var string
*/
public $DateEnvoi;
}
class AssoStatut
{
/**
* @var string
*/
public $Reference;
/**
* @var string
*/
public $CompanyName;
/**
* @var string
*/
public $CompanyId;
/**
* @var string
*/
public $CompanyIdType;
/**
* @var string
*/
public $DateInsert;
/**
* @var string
*/
public $DateEnvoi;
}