Fix: wrong variable

This commit is contained in:
Laurent Destailleur 2010-09-06 13:24:07 +00:00
parent 58ded3b529
commit 83437a678f

View File

@ -21,12 +21,12 @@
/** /**
* \file htdocs/compta/sociales/index.php * \file htdocs/compta/sociales/index.php
* \ingroup tax * \ingroup tax
* \brief Ecran des charges sociales * \brief Page to list all social contributions
* \version $Id$ * \version $Id$
*/ */
require('../../main.inc.php'); require('../../main.inc.php');
require(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); require(DOL_DOCUMENT_ROOT."/compta/sociales/class/chargesociales.class.php");
// Security check // Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = isset($_GET["socid"])?$_GET["socid"]:'';
@ -71,7 +71,6 @@ else
* View * View
*/ */
llxHeader(); llxHeader();
$html = new Form($db); $html = new Form($db);
@ -131,6 +130,18 @@ if ($resql)
print $mesg."<br>"; print $mesg."<br>";
} }
if (empty($mysoc->pays_id) && empty($mysoc->pays_code))
{
print '<div class="error">';
$langs->load("errors");
$countrynotdefined=$langs->trans("ErrorSetACountryFirst");
print $countrynotdefined;
print '</div>';
}
else
{
print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
@ -141,7 +152,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Type"),"index.php","type","",$param,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),"index.php","type","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PeriodEndDate"),"index.php","periode","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PeriodEndDate"),"index.php","periode","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),"index.php","s.amount","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),"index.php","s.amount","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),"index.php","de","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateDue"),"index.php","s.date_ech","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),"index.php","s.paye","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),"index.php","s.paye","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
@ -197,7 +208,7 @@ if ($resql)
print '<td align="right" width="100">'.price($obj->amount).'</td>'; print '<td align="right" width="100">'.price($obj->amount).'</td>';
// Due date // Due date
print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->de), 'day').'</td>'; print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->date_ech), 'day').'</td>';
print '<td align="right" nowrap="nowrap">'.$chargesociale_static->LibStatut($obj->paye,5).'</a></td>'; print '<td align="right" nowrap="nowrap">'.$chargesociale_static->LibStatut($obj->paye,5).'</a></td>';
@ -209,6 +220,7 @@ if ($resql)
print '</form>'; print '</form>';
} }
}
else else
{ {
dol_print_error($db); dol_print_error($db);