diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index f4ef22d1fd5..f5a60dc1380 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -200,11 +200,11 @@ if (!empty($conf->projet->enabled)) { llxHeader('', $langs->trans("SocialContributions")); $sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,"; -$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode,"; +$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,"; if (!empty($conf->projet->enabled)) { $sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,"; } -$sql .= " c.libelle as type_label, cs.fk_account,"; +$sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,"; $sql .= " ba.label as blabel, ba.ref as bref, ba.number as bnumber, ba.account_number, ba.iban_prefix as iban, ba.bic, ba.currency_code, ba.clos,"; $sql .= " SUM(pc.amount) as alreadypayed, pay.code as payment_code"; $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; @@ -260,7 +260,7 @@ if ($search_date_limit_end) { if ($search_typeid > 0) { $sql .= " AND cs.fk_type = ".((int) $search_typeid); } -$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, c.libelle, cs.fk_account, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname"; +$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname"; if (!empty($conf->projet->enabled)) { $sql .= ", p.rowid, p.ref, p.title"; } @@ -561,6 +561,7 @@ while ($i < min($num, $limit)) { $chargesociale_static->ref = $obj->rowid; $chargesociale_static->label = $obj->label; $chargesociale_static->type_label = $obj->type_label; + if (!empty($conf->projet->enabled)) { $projectstatic->id = $obj->project_id; $projectstatic->ref = $obj->project_ref; @@ -595,7 +596,12 @@ while ($i < min($num, $limit)) { // Type if (!empty($arrayfields['cs.fk_type']['checked'])) { - print '