Ajout des options de configuration pour reçus
This commit is contained in:
parent
64dc0d541d
commit
b18cd91aa4
10 changed files with 514 additions and 14 deletions
|
|
@ -8,7 +8,7 @@ use Garradin\UserException;
|
|||
class Facture
|
||||
{
|
||||
private $keys = [
|
||||
'type_facture',
|
||||
'type_facture', // 0 : devis, 1 : facture, 2 : reçu cerfa, 3 : reçu cotis
|
||||
'numero',
|
||||
'receveur_membre',
|
||||
'receveur_id',
|
||||
|
|
|
|||
56
lib/GenDon.php
Normal file
56
lib/GenDon.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
namespace Garradin\Plugin\RecuDon;
|
||||
|
||||
use Garradin\DB;
|
||||
use Garradin\UserException;
|
||||
|
||||
class GenDon
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function add($data)
|
||||
{
|
||||
//$this->_checkData($data);
|
||||
|
||||
/*if (!isset($data['numero']) == !trim($data['numero'])) {
|
||||
throw new UserException('Le numéro d ordre existe déjà sur un autre reçu.');
|
||||
}*/
|
||||
|
||||
$db = DB::getInstance();
|
||||
$db->insert('plugin_recudon', $data);
|
||||
|
||||
return $db->lastInsertRowID();
|
||||
}
|
||||
|
||||
public function edit($id, $data)
|
||||
{
|
||||
//$this->_checkData($data);
|
||||
|
||||
$db = DB::getInstance();
|
||||
return $db->simpleUpdate('plugin_recudon', $data, 'id = ' . (int) $id);
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
$db = DB::getInstance();
|
||||
|
||||
return $db->first('SELECT * FROM plugin_recudon WHERE id = ?;', (int) $id);
|
||||
}
|
||||
|
||||
public function remove($id)
|
||||
{
|
||||
$db = DB::getInstance();
|
||||
|
||||
return $db->simpleExec('DELETE FROM plugin_recudon WHERE id = ?;', (int) $id);
|
||||
}
|
||||
|
||||
public function listSimple()
|
||||
{
|
||||
$db = DB::getInstance();
|
||||
return $db->get('SELECT id, nom, prenom, ville, "date", gen_ordre, montant FROM plugin_recudon ORDER BY id;');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue