C'est crade mais : on peut modifier un doc en reçu et il s'affiche

This commit is contained in:
Noizette 2020-10-24 05:40:42 +02:00
parent 0ab5fa5ad0
commit 2014dff1a1
8 changed files with 146 additions and 110 deletions

View file

@ -26,7 +26,7 @@ $tpl->assign('moyen_paiement', f('moyen_paiement') ?: $f->moyen_paiement);
if(f('save'))
{
$form->check('modifier_facture', [
'type' => 'required|in:facture,devis',
'type' => 'required|in:facture,devis,cerfa,cotis',
'numero_facture' => 'required|string',
'date_emission' => 'required|date',
'date_echeance' => 'required|date',
@ -60,13 +60,17 @@ if(f('save'))
'toto' => 0
];
if (f('type') == 'facture')
if (f('type') == 'devis')
{
$truc['type_facture'] = 0;
}
elseif (f('type') == 'facture')
{
$truc['type_facture'] = 1;
}
elseif (f('type') == 'devis')
elseif (f('type') == 'cerfa')
{
$truc['type_facture'] = 0;
$truc['type_facture'] = 2;
}
foreach(f('designation') as $k=>$value)
@ -101,8 +105,7 @@ if(f('save'))
}
}
$tpl->assign('type', f('type') ?: ($f->type_facture ?'facture':'devis'));
$tpl->assign('type', $facture->type[$f->type_facture]);
$tpl->assign('numero_facture', f('numero_facture') ?: $f->numero);
$tpl->assign('date_emission', strtotime(f('date_emission')) ?: $f->date_emission);
$tpl->assign('date_echeance', strtotime(f('date_echeance')) ?: $f->date_echeance);
@ -111,6 +114,7 @@ $tpl->assign('base_receveur', f('base_receveur') ?: ($f->receveur_membre?'membre
$tpl->assign('client_id', f('client') ?: $f->receveur_id);
$tpl->assign('membre_id', f('membre') ?: $f->receveur_id);
if (($d = f('designation')) && ($p = f('prix')))
{
foreach($d as $k=>$v)
@ -123,7 +127,7 @@ if (($d = f('designation')) && ($p = f('prix')))
$prix[] = $p[$k];
}
}
else
else/*if ($f->contenu)*/
{
foreach($f->contenu as $k=>$v)
{
@ -136,7 +140,9 @@ else
}
}
$tpl->assign('designations', $designations);
// $tpl->assign('designations', [0=>'',1=>'']);
$tpl->assign('prix', $prix);
// $tpl->assign('prix', ['','']);
$tpl->assign('membres', (array)DB::getInstance()->get('SELECT id, nom FROM membres WHERE id_categorie != -2 NOT IN (SELECT id FROM membres_categories WHERE cacher = 1);'));
$tpl->assign('clients', $client->listAll());