diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 806efaf4aa6..e8becbfd2ed 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -20,6 +20,14 @@ * $Source$ * */ + +/*! \file htdocs/compta/sociales/index.php + \ingroup compta + \brief Ecran des charges sociales + \version $Revision$ +*/ + + require("./pre.inc.php"); $user->getrights('facture'); @@ -36,7 +44,7 @@ llxHeader(); * Ajout d'une charge sociale */ -if ($action == 'add') +if ($_POST["action"] == 'add') { if (! $_POST["date"] || ! $_POST["periode"] || ! $_POST["amount"]) { $mesg="
Erreur: Tous les champs date et montant doivent etre renseignés avec une valeur non vide.
"; @@ -48,7 +56,7 @@ if ($action == 'add') if (! $db->query($sql) ) { - print $db->error(); + dolibarr_print_error($db); } else { $mesg="
La charge a été ajoutée.
"; @@ -66,7 +74,7 @@ if ($_GET["action"] == 'del') if (! $db->query($sql) ) { - print $db->error(); + dolibarr_print_error($db); } } @@ -80,20 +88,83 @@ $year=$_GET["year"]; $filtre=$_GET["filtre"]; //if (! $year) { $year=date("Y", time()); } -print_fiche_titre("Charges sociales",($year?"".img_previous()." Année $year ".img_next()."":"")); +print_fiche_titre("Charges sociales",($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); print "
\n"; if ($mesg) { print "$mesg
"; } -print ""; +print "
"; + +/* + * Forumalaire d'ajout d'une charge + * + */ +if ($user->rights->compta->charges->creer) { + $var = !$var; + + print ""; + print ''; + print "\n"; + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + + print ''; + print ''; + + print ''; + + print ''; + +} + print ""; print ''; -print ''; - print ''; - print ''; - print ''; - print ''; - - print ''; - print ''; - print ''; - - print ''; - print ''; -} - print '
'; + print ' '; + print ''; + print $langs->trans("DateDue"); + print ''; + print $langs->trans("Period"); + print ''; + print $langs->trans("Type"); + print ''; + print $langs->trans("Label"); + print ''; + print $langs->trans("Amount"); + print ''; + print ' '; + print '
 
YYYYMMDD

YYYYMMDD
'; + print '
 
'; print_liste_field_titre($langs->trans("Ref"),"index.php","id"); -print ''; -print_liste_field_titre("Echéance","index.php","de"); +print ''; +print_liste_field_titre($langs->trans("DateDue"),"index.php","de"); print ''; print_liste_field_titre($langs->trans("Period"),"index.php","periode"); print ''; @@ -180,43 +251,6 @@ else dolibarr_print_error($db); } -/* - * Forumalaire d'ajout d'une charge - * - */ -if ($user->rights->compta->charges->creer) { - print '
 
YYYYMMDD

YYYYMMDD
'; - print '
';