Compare commits
4 Commits
b6bb4fd80d
...
39bde25d24
Author | SHA1 | Date | |
---|---|---|---|
39bde25d24 | |||
b2e63c0383 | |||
b5dc9d0efa | |||
c9300fe943 |
@ -121,7 +121,7 @@ $form->runIf(f('select_cotis') && !$form->hasErrors(),
|
||||
}, 'add_cotis_1');
|
||||
|
||||
$form->runIf(f('add_cotis') && !$form->hasErrors(),
|
||||
function () use ($radio, $fields, $facture)
|
||||
function () use ($radio, $fields, $facture, $form)
|
||||
{
|
||||
$radio['type'] = f('cotisation');
|
||||
try
|
||||
|
@ -17,7 +17,7 @@ if (!$c)
|
||||
}
|
||||
|
||||
$form->runIf(f('save') && !$form->hasErrors(),
|
||||
function () use ($client, $id)
|
||||
function () use ($client, $id, $form)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ require_once __DIR__ . '/_inc.php';
|
||||
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
$form->runIf(f('add') && !$form->hasErrors(),
|
||||
function () use ($client)
|
||||
function () use ($client, $form)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -18,7 +18,7 @@ if (!$client)
|
||||
}
|
||||
|
||||
$form->runIf(f('delete') && !$form->hasErrors(),
|
||||
function () use ($facture, $f)
|
||||
function () use ($facture, $f, $form)
|
||||
{
|
||||
try {
|
||||
$facture->delete($f->id);
|
||||
|
@ -12,6 +12,7 @@ $session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
|
||||
|
||||
$list = $facture->list();
|
||||
$list->loadFromQueryString();
|
||||
$list->setPageSize(50);
|
||||
|
||||
$tpl->assign(compact('list'));
|
||||
|
||||
|
@ -58,13 +58,19 @@ if ($f->type_facture != CERFA)
|
||||
switch ($f->type_facture)
|
||||
{
|
||||
case FACT:
|
||||
$doc = 'Facture n°'. $f->numero;
|
||||
$doc = 'Facture n° '. $f->numero;
|
||||
$txtemis = $doc . " - Émise le " . $emission;
|
||||
$txtdest = "Adressée à :";
|
||||
break;
|
||||
case DEVIS:
|
||||
$doc = 'Devis n°'. $f->numero;
|
||||
$doc = 'Devis n° '. $f->numero;
|
||||
$txtemis = $doc . " - Émis le " . $emission;
|
||||
$txtdest = "Adressé à :";
|
||||
break;
|
||||
case COTIS:
|
||||
$doc = 'Reçu de cotisation n°'. $f->numero;
|
||||
$doc = 'Reçu de cotisation n° '. $f->numero;
|
||||
$txtemis = $doc . " - Émis le " . $emission;
|
||||
$txtdest = "Adressé à :";
|
||||
break;
|
||||
}
|
||||
|
||||
@ -97,7 +103,7 @@ if ($f->type_facture != CERFA)
|
||||
(($t = $config->get('site_asso'))?"Site web : $t<br>":'');
|
||||
|
||||
$receveur =
|
||||
'Adressé à :<br><br>'.
|
||||
$txtdest.'<br>'.
|
||||
'<b>'.$c->nom.'</b><br>'.
|
||||
$c->adresse."<br>".
|
||||
$c->code_postal.' '.$c->ville."<br>".
|
||||
@ -307,7 +313,7 @@ EOF;
|
||||
</head>
|
||||
<body>
|
||||
<p class="titre">
|
||||
$doc - Émis le $emission
|
||||
$txtemis
|
||||
</p>
|
||||
|
||||
<table class="adressage">
|
||||
|
@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS plugin_facturation_clients (
|
||||
adresse TEXT NOT NULL,
|
||||
code_postal TEXT NOT NULL,
|
||||
ville TEXT NOT NULL,
|
||||
siret TEXT NOT NULL,
|
||||
siret TEXT,
|
||||
date_creation TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date_creation) IS NOT NULL AND date(date_creation) = date_creation), -- Date d\'inscription
|
||||
telephone TEXT,
|
||||
email TEXT
|
||||
|
@ -40,7 +40,7 @@ class Client
|
||||
{
|
||||
$data[$key] = trim($data[$key]);
|
||||
|
||||
if($data[$key] == '' && ($key != 'telephone' && $key != 'email'))
|
||||
if($data[$key] == '' && ($key != 'siret' && $key != 'telephone' && $key != 'email'))
|
||||
{
|
||||
throw new UserException('Le champs '.$key.' doit être renseigné.');
|
||||
}
|
||||
@ -128,7 +128,7 @@ class Client
|
||||
'label' => 'Ville',
|
||||
],
|
||||
'siret' => [
|
||||
'label' => 'Siret',
|
||||
'label' => 'SIRET',
|
||||
],
|
||||
'telephone' => [
|
||||
'label' => 'Téléphone',
|
||||
|
@ -352,11 +352,11 @@ class Facture
|
||||
'select' => sprintf('CASE WHEN receveur_membre THEN %s ELSE c.nom END', $id_field),
|
||||
],
|
||||
'receveur_adresse' => [
|
||||
'label' => 'Son adresse',
|
||||
'label' => 'Adresse',
|
||||
'select' => 'CASE WHEN receveur_membre THEN u.adresse ELSE c.adresse END',
|
||||
],
|
||||
'receveur_ville' => [
|
||||
'label' => 'Sa ville',
|
||||
'label' => 'Ville',
|
||||
'select' => 'CASE WHEN receveur_membre THEN u.ville ELSE c.ville END',
|
||||
],
|
||||
'date_emission' => [
|
||||
@ -391,6 +391,7 @@ class Facture
|
||||
|
||||
$list = new DynamicList($columns, $tables);
|
||||
$list->orderBy('date_emission', true);
|
||||
$list->setCount('COUNT(f.id)');
|
||||
|
||||
$currency = Config::getInstance()->monnaie;
|
||||
|
||||
@ -420,7 +421,6 @@ class Facture
|
||||
}
|
||||
});
|
||||
|
||||
$list->setPageSize(1000);
|
||||
return $list;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
{input type="text" name="adresse" label="Adresse" required=true source=$client}
|
||||
{input type="text" name="code_postal" label="Code postal" required=true source=$client}
|
||||
{input type="text" name="ville" label="Ville" required=true source=$client}
|
||||
{input type="text" name="siret" label="SIREN/SIRET" required=true source=$client}
|
||||
{input type="text" name="siret" label="SIREN/SIRET" source=$client}
|
||||
{input type="tel" name="telephone" label="Téléphone" source=$client}
|
||||
{input type="email" name="email" label="Adresse e-mail" source=$client}
|
||||
</dl>
|
||||
|
@ -55,7 +55,7 @@
|
||||
{input type="text" name="adresse" label="Adresse" required=true}
|
||||
{input type="text" name="code_postal" label="Code postal" required=true}
|
||||
{input type="text" name="ville" label="Ville" required=true}
|
||||
{input type="text" name="siret" label="SIREN/SIRET" required=true}
|
||||
{input type="text" name="siret" label="SIREN/SIRET"}
|
||||
{input type="tel" name="telephone" label="Téléphone"}
|
||||
{input type="email" name="email" label="Adresse e-mail"}
|
||||
</dl>
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{$list->getHTMLPagination()|raw}
|
||||
|
||||
<p class="help">
|
||||
Export de la liste :
|
||||
|
@ -222,7 +222,7 @@ if (version_compare($old_version, '0.8.5', '<'))
|
||||
adresse TEXT NOT NULL,
|
||||
code_postal TEXT NOT NULL,
|
||||
ville TEXT NOT NULL,
|
||||
siret TEXT NOT NULL,
|
||||
siret TEXT,
|
||||
date_creation TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date_creation) IS NOT NULL AND date(date_creation) = date_creation),
|
||||
telephone TEXT,
|
||||
email TEXT
|
||||
@ -233,7 +233,6 @@ if (version_compare($old_version, '0.8.5', '<'))
|
||||
$sql = 'SELECT * FROM plugin_facturation_clients';
|
||||
foreach ($db->iterate($sql) as $client)
|
||||
{
|
||||
$client->siret = "";
|
||||
$db->insert('plugin_facturation_clients_tmp', $client);
|
||||
}
|
||||
// remplacer l'ancienne table par la nouvelle
|
||||
|
Loading…
Reference in New Issue
Block a user