Compare commits

..

No commits in common. "39bde25d2422c31ad950c7302faa3507c5a699b5" and "b6bb4fd80da8c5b14b6bab8816b96d8a76ec21fe" have entirely different histories.

13 changed files with 19 additions and 26 deletions

View File

@ -121,7 +121,7 @@ $form->runIf(f('select_cotis') && !$form->hasErrors(),
}, 'add_cotis_1'); }, 'add_cotis_1');
$form->runIf(f('add_cotis') && !$form->hasErrors(), $form->runIf(f('add_cotis') && !$form->hasErrors(),
function () use ($radio, $fields, $facture, $form) function () use ($radio, $fields, $facture)
{ {
$radio['type'] = f('cotisation'); $radio['type'] = f('cotisation');
try try

View File

@ -17,7 +17,7 @@ if (!$c)
} }
$form->runIf(f('save') && !$form->hasErrors(), $form->runIf(f('save') && !$form->hasErrors(),
function () use ($client, $id, $form) function () use ($client, $id)
{ {
try try
{ {

View File

@ -7,7 +7,7 @@ require_once __DIR__ . '/_inc.php';
$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ); $session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
$form->runIf(f('add') && !$form->hasErrors(), $form->runIf(f('add') && !$form->hasErrors(),
function () use ($client, $form) function () use ($client)
{ {
try try
{ {

View File

@ -18,7 +18,7 @@ if (!$client)
} }
$form->runIf(f('delete') && !$form->hasErrors(), $form->runIf(f('delete') && !$form->hasErrors(),
function () use ($facture, $f, $form) function () use ($facture, $f)
{ {
try { try {
$facture->delete($f->id); $facture->delete($f->id);

View File

@ -12,7 +12,6 @@ $session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
$list = $facture->list(); $list = $facture->list();
$list->loadFromQueryString(); $list->loadFromQueryString();
$list->setPageSize(50);
$tpl->assign(compact('list')); $tpl->assign(compact('list'));

View File

@ -58,19 +58,13 @@ if ($f->type_facture != CERFA)
switch ($f->type_facture) switch ($f->type_facture)
{ {
case FACT: case FACT:
$doc = 'Facture n° '. $f->numero; $doc = 'Facture n°'. $f->numero;
$txtemis = $doc . " - Émise le " . $emission;
$txtdest = "Adressée à :";
break; break;
case DEVIS: case DEVIS:
$doc = 'Devis n° '. $f->numero; $doc = 'Devis n°'. $f->numero;
$txtemis = $doc . " - Émis le " . $emission;
$txtdest = "Adressé à :";
break; break;
case COTIS: 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; break;
} }
@ -103,7 +97,7 @@ if ($f->type_facture != CERFA)
(($t = $config->get('site_asso'))?"Site web : $t<br>":''); (($t = $config->get('site_asso'))?"Site web : $t<br>":'');
$receveur = $receveur =
$txtdest.'<br>'. 'Adressé à :<br><br>'.
'<b>'.$c->nom.'</b><br>'. '<b>'.$c->nom.'</b><br>'.
$c->adresse."<br>". $c->adresse."<br>".
$c->code_postal.' '.$c->ville."<br>". $c->code_postal.' '.$c->ville."<br>".
@ -313,7 +307,7 @@ EOF;
</head> </head>
<body> <body>
<p class="titre"> <p class="titre">
$txtemis $doc - Émis le $emission
</p> </p>
<table class="adressage"> <table class="adressage">

View File

@ -21,7 +21,7 @@ CREATE TABLE IF NOT EXISTS plugin_facturation_clients (
adresse TEXT NOT NULL, adresse TEXT NOT NULL,
code_postal TEXT NOT NULL, code_postal TEXT NOT NULL,
ville TEXT NOT NULL, ville TEXT NOT NULL,
siret TEXT, siret TEXT NOT NULL,
date_creation TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date_creation) IS NOT NULL AND date(date_creation) = date_creation), -- Date d\'inscription 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, telephone TEXT,
email TEXT email TEXT

View File

@ -40,7 +40,7 @@ class Client
{ {
$data[$key] = trim($data[$key]); $data[$key] = trim($data[$key]);
if($data[$key] == '' && ($key != 'siret' && $key != 'telephone' && $key != 'email')) if($data[$key] == '' && ($key != 'telephone' && $key != 'email'))
{ {
throw new UserException('Le champs '.$key.' doit être renseigné.'); throw new UserException('Le champs '.$key.' doit être renseigné.');
} }
@ -128,7 +128,7 @@ class Client
'label' => 'Ville', 'label' => 'Ville',
], ],
'siret' => [ 'siret' => [
'label' => 'SIRET', 'label' => 'Siret',
], ],
'telephone' => [ 'telephone' => [
'label' => 'Téléphone', 'label' => 'Téléphone',

View File

@ -352,11 +352,11 @@ class Facture
'select' => sprintf('CASE WHEN receveur_membre THEN %s ELSE c.nom END', $id_field), 'select' => sprintf('CASE WHEN receveur_membre THEN %s ELSE c.nom END', $id_field),
], ],
'receveur_adresse' => [ 'receveur_adresse' => [
'label' => 'Adresse', 'label' => 'Son adresse',
'select' => 'CASE WHEN receveur_membre THEN u.adresse ELSE c.adresse END', 'select' => 'CASE WHEN receveur_membre THEN u.adresse ELSE c.adresse END',
], ],
'receveur_ville' => [ 'receveur_ville' => [
'label' => 'Ville', 'label' => 'Sa ville',
'select' => 'CASE WHEN receveur_membre THEN u.ville ELSE c.ville END', 'select' => 'CASE WHEN receveur_membre THEN u.ville ELSE c.ville END',
], ],
'date_emission' => [ 'date_emission' => [
@ -391,7 +391,6 @@ class Facture
$list = new DynamicList($columns, $tables); $list = new DynamicList($columns, $tables);
$list->orderBy('date_emission', true); $list->orderBy('date_emission', true);
$list->setCount('COUNT(f.id)');
$currency = Config::getInstance()->monnaie; $currency = Config::getInstance()->monnaie;
@ -421,6 +420,7 @@ class Facture
} }
}); });
$list->setPageSize(1000);
return $list; return $list;
} }

View File

@ -11,7 +11,7 @@
{input type="text" name="adresse" label="Adresse" required=true source=$client} {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="code_postal" label="Code postal" required=true source=$client}
{input type="text" name="ville" label="Ville" required=true source=$client} {input type="text" name="ville" label="Ville" required=true source=$client}
{input type="text" name="siret" label="SIREN/SIRET" source=$client} {input type="text" name="siret" label="SIREN/SIRET" required=true source=$client}
{input type="tel" name="telephone" label="Téléphone" source=$client} {input type="tel" name="telephone" label="Téléphone" source=$client}
{input type="email" name="email" label="Adresse e-mail" source=$client} {input type="email" name="email" label="Adresse e-mail" source=$client}
</dl> </dl>

View File

@ -55,7 +55,7 @@
{input type="text" name="adresse" label="Adresse" required=true} {input type="text" name="adresse" label="Adresse" required=true}
{input type="text" name="code_postal" label="Code postal" 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="ville" label="Ville" required=true}
{input type="text" name="siret" label="SIREN/SIRET"} {input type="text" name="siret" label="SIREN/SIRET" required=true}
{input type="tel" name="telephone" label="Téléphone"} {input type="tel" name="telephone" label="Téléphone"}
{input type="email" name="email" label="Adresse e-mail"} {input type="email" name="email" label="Adresse e-mail"}
</dl> </dl>

View File

@ -33,7 +33,6 @@
</tbody> </tbody>
</table> </table>
{$list->getHTMLPagination()|raw}
<p class="help"> <p class="help">
Export de la liste&nbsp;: Export de la liste&nbsp;:

View File

@ -222,7 +222,7 @@ if (version_compare($old_version, '0.8.5', '<'))
adresse TEXT NOT NULL, adresse TEXT NOT NULL,
code_postal TEXT NOT NULL, code_postal TEXT NOT NULL,
ville TEXT NOT NULL, ville TEXT NOT NULL,
siret TEXT, siret TEXT NOT NULL,
date_creation TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date_creation) IS NOT NULL AND date(date_creation) = date_creation), date_creation TEXT NOT NULL DEFAULT CURRENT_DATE CHECK (date(date_creation) IS NOT NULL AND date(date_creation) = date_creation),
telephone TEXT, telephone TEXT,
email TEXT email TEXT
@ -233,6 +233,7 @@ if (version_compare($old_version, '0.8.5', '<'))
$sql = 'SELECT * FROM plugin_facturation_clients'; $sql = 'SELECT * FROM plugin_facturation_clients';
foreach ($db->iterate($sql) as $client) foreach ($db->iterate($sql) as $client)
{ {
$client->siret = "";
$db->insert('plugin_facturation_clients_tmp', $client); $db->insert('plugin_facturation_clients_tmp', $client);
} }
// remplacer l'ancienne table par la nouvelle // remplacer l'ancienne table par la nouvelle