From b66e9acefa255591a36f660867523f54b3faa130 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Feb 2004 19:47:58 +0000 Subject: [PATCH] =?UTF-8?q?La=20page=20des=20charges=20=E9tait=20dans=20un?= =?UTF-8?q?=20=E9tat=20peu=20avanc=E9.=20J'ai=20avanc=E9=20le=20travail=20?= =?UTF-8?q?en=20am=E9liorant=20l'affichage,=20int=E9grant=20la=20suppressi?= =?UTF-8?q?on=20d'une=20ligne=20de=20charge=20saisie=20et=20ajout=E9=20un?= =?UTF-8?q?=20message=20pour=20le=20paiement=20signalant=20que=20ce=20n'?= =?UTF-8?q?=E9tait=20pas=20encore=20disponible=20afin=20de=20faire=20plus?= =?UTF-8?q?=20propre=20en=20release.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/sociales/index.php | 67 +++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index d0cd508be9b..4f8fca43f72 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -37,13 +37,15 @@ function valeur($sql) } return $valeur; } + + /* * */ if ($action == 'add') { - $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech,amount) "; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."chargesociales (fk_type, libelle, date_ech, amount) "; $sql .= " VALUES ($type,'$libelle','$date',$amount);"; if (! $db->query($sql) ) @@ -52,22 +54,38 @@ if ($action == 'add') } } -print_titre("Charges sociales $year"); +if ($_GET["action"] == 'del') +{ + $sql = "DELETE FROM ".MAIN_DB_PREFIX."chargesociales where rowid='".$_GET["id"]."'"; + + if (! $db->query($sql) ) + { + print $db->error(); + } +} + +if ($_GET["action"] == 'edit') +{ + print "La modification est le paiement des charges n'est pas encore disponible.\nSeule leur saisie est possible, sans interaction avec le compte pour l'instant.\n"; +} + + /* - * - * + * Affichage liste et formulaire des charges. */ -print ""; -print ""; -print ''; -print "\n"; +print_titre("Charges sociales $year"); + +print "
EcheancePériode'; -print_liste_field_titre("Charges",$PHP_SELF,"c.libelle"); -print 'Montant 
"; +print ""; +print ''; +print "\n"; -$sql = "SELECT c.libelle as nom, s.amount,".$db->pdate("s.date_ech")." as de, s.date_pai, s.libelle, s.paye,".$db->pdate("s.periode")." as periode,".$db->pdate("s.date_pai")." as dp"; +$sql = "SELECT s.rowid as id, c.libelle as nom, s.amount,".$db->pdate("s.date_ech")." as de, s.date_pai, s.libelle, s.paye,".$db->pdate("s.periode")." as periode,".$db->pdate("s.date_pai")." as dp"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."chargesociales as s"; $sql .= " WHERE s.fk_type = c.id"; if ($year > 0) @@ -87,16 +105,24 @@ if ( $db->query($sql) ) $var = !$var; print ""; print ''; - print ''; + print ''; print ''; print ''; if ($obj->paye) { - print ''; + print ''; + print ''; } else { - print ''; - print ''; + print ''; + print ''; } print ''; $i++; @@ -113,9 +139,10 @@ else */ print ''; print ''; -print ''; +print ''; +print ''; -print ''; +print ''; print ''; +print ''; -print ''; +print ''; +print ''; print '
Echeance/DatePériode'; +print_liste_field_titre("Libellé",$PHP_SELF,"c.libelle"); +print 'MontantPayé 
'.strftime("%d %b %y",$obj->de).'periode).'">'.strftime("%Y",$obj->periode).''; + if ($obj->periode) { + print 'periode).'">'.strftime("%Y",$obj->periode).''; + } else { + print ' '; + } + print ''.$obj->nom.''.$obj->libelle.''.price($obj->amount).''.strftime("%d/%m/%y",$obj->dp).''.strftime("%d/%m/%y",$obj->dp).' Non'.img_edit().''; + print '   '.img_delete().'
YYYYMMDD '; -print ' 
';