diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9338f36ea57..bf32ae1b930 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -97,7 +97,7 @@ $tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk $tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; -$tabsql[7] = "SELECT a.id as rowid, a.id as code, a.libelle AS libelle, a.deductible, a.actioncompta, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a"; +$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; $tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent"; $tabsql[9] = "SELECT code, code_iso, label as libelle, active FROM ".MAIN_DB_PREFIX."c_currencies"; $tabsql[10]= "SELECT t.rowid, t.taux, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; @@ -111,20 +111,20 @@ $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[18]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."expedition_methode"; // Critere de tri du dictionnaire -$tabsqlsort[1] ="pays, code ASC"; -$tabsqlsort[2] ="pays, code ASC"; -$tabsqlsort[3] ="pays, code ASC"; +$tabsqlsort[1] ="pays ASC, code ASC"; +$tabsqlsort[2] ="pays ASC, code ASC"; +$tabsqlsort[3] ="pays ASC, code ASC"; $tabsqlsort[4] ="code ASC"; $tabsqlsort[5] ="libelle ASC"; $tabsqlsort[6] ="a.type ASC, a.code ASC"; -$tabsqlsort[7] ="a.libelle ASC"; +$tabsqlsort[7] ="pays ASC, code ASC, a.libelle ASC"; $tabsqlsort[8] ="libelle ASC"; $tabsqlsort[9] ="code ASC"; $tabsqlsort[10]="pays ASC, taux ASC, recuperableonly ASC"; $tabsqlsort[11]="element ASC, source ASC, code ASC"; $tabsqlsort[12]="sortorder ASC, code ASC"; $tabsqlsort[13]="code ASC"; -$tabsqlsort[14]="pays, e.organization ASC, code ASC"; +$tabsqlsort[14]="pays ASC, e.organization ASC, code ASC"; $tabsqlsort[15]="rowid ASC"; $tabsqlsort[16]="sortorder ASC"; $tabsqlsort[17]="code ASC"; @@ -137,7 +137,7 @@ $tabfield[3] = "code,libelle,pays_id,pays"; $tabfield[4] = "code,libelle"; $tabfield[5] = "code,libelle"; $tabfield[6] = "code,libelle,type"; -$tabfield[7] = "libelle,deductible,actioncompta"; +$tabfield[7] = "code,libelle,pays_id,pays,deductible"; $tabfield[8] = "code,libelle"; $tabfield[9] = "code,code_iso,libelle"; $tabfield[10]= "pays_id,pays,taux,recuperableonly,note"; @@ -157,7 +157,7 @@ $tabfieldvalue[3] = "code,libelle,pays"; $tabfieldvalue[4] = "code,libelle"; $tabfieldvalue[5] = "code,libelle"; $tabfieldvalue[6] = "code,libelle,type"; -$tabfieldvalue[7] = "libelle,deductible,actioncompta"; +$tabfieldvalue[7] = "code,libelle,pays,deductible"; $tabfieldvalue[8] = "code,libelle"; $tabfieldvalue[9] = "code,code_iso,libelle"; $tabfieldvalue[10]= "pays,taux,recuperableonly,note"; @@ -177,7 +177,7 @@ $tabfieldinsert[3] = "code_region,nom,fk_pays"; $tabfieldinsert[4] = "code,libelle"; $tabfieldinsert[5] = "code,civilite"; $tabfieldinsert[6] = "code,libelle,type"; -$tabfieldinsert[7] = "libelle,deductible,actioncompta"; +$tabfieldinsert[7] = "code,libelle,fk_pays,deductible"; $tabfieldinsert[8] = "code,libelle"; $tabfieldinsert[9] = "code,code_iso,label"; $tabfieldinsert[10]= "fk_pays,taux,recuperableonly,note"; diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 82d4077d384..cbebe87fbb2 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -18,11 +18,11 @@ */ /** - \file htdocs/compta/sociales/charges.php - \ingroup tax - \brief Fiche d'une charge sociale - \version $Id$ -*/ + * \file htdocs/compta/sociales/charges.php + * \ingroup tax + * \brief Social contribution car page + * \version $Id$ + */ require("./pre.inc.php"); require(DOL_DOCUMENT_ROOT."/chargesociales.class.php"); @@ -94,6 +94,11 @@ if ($_POST["action"] == 'add' && $user->rights->tax->charges->creer) $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Period")).'
'; $_GET["action"] = 'create'; } + elseif (! $_POST["actioncode"] > 0) + { + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Type")).'
'; + $_GET["action"] = 'create'; + } elseif (! $_POST["amount"]) { $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")).'
'; @@ -302,7 +307,7 @@ if ($chid > 0) } // Type - print "".$langs->trans("Type")."$cha->type_libelle".$langs->trans("Payments").""; + print "".$langs->trans("Type")."".$cha->type_libelle."".$langs->trans("Payments").""; // Period en date print "".$langs->trans("PeriodEndDate").""; @@ -338,7 +343,7 @@ if ($chid > 0) { $num = $db->num_rows($resql); $i = 0; $total = 0; - echo ''; + echo '
'; print ''; print ''; print ''; diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index a9aead32ce6..c9db47b74c8 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -350,33 +350,40 @@ class Form */ function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1) { - global $db,$langs,$user; + global $db,$langs,$user,$mysoc; $sql = "SELECT c.id, c.libelle as type"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " WHERE active = 1"; + $sql.= " AND fk_pays = ".$mysoc->pays_id; $sql.= " ORDER BY c.libelle ASC"; dol_syslog("Form::select_type_socialcontrib sql=".$sql, LOG_DEBUG); $resql=$db->query($sql); if ($resql) { - print ''; + $i = 0; + + if ($useempty) print ''; + while ($i < $num) + { + $obj = $db->fetch_object($resql); + print '
'.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans("Amount").' 
'; + print '
'; if (empty($conf->browser->phone) && $picto && $titre) print ''; print '
'.img_picto('',$picto, 'id="pictotitle"', $pictoisfullpath).''; print '
'.$titre.'
';