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 ' 
';