Ne pas rendre la saisie du SIRET obligatoire pour les cas où il ne

serait pas disponible
This commit is contained in:
Jean-Christophe Engel 2024-01-12 12:05:38 +01:00
parent b5dc9d0efa
commit b2e63c0383
5 changed files with 6 additions and 7 deletions

View File

@ -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

View File

@ -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',

View File

@ -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>

View File

@ -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>

View File

@ -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