Ne pas rendre la saisie du SIRET obligatoire pour les cas où il ne
serait pas disponible
This commit is contained in:
parent
b5dc9d0efa
commit
b2e63c0383
@ -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 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
|
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
|
||||||
|
@ -40,7 +40,7 @@ class Client
|
|||||||
{
|
{
|
||||||
$data[$key] = trim($data[$key]);
|
$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é.');
|
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',
|
||||||
|
@ -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" 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="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>
|
||||||
|
@ -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" required=true}
|
{input type="text" name="siret" label="SIREN/SIRET"}
|
||||||
{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>
|
||||||
|
@ -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 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_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,7 +233,6 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user