$chargesociales->lib = $_POST["label"]; $chargesociales->date_ech = $dateech; $chargesociales->periode = $dateperiod; $result = $chargesociales->update($user); if ($result > 0) { //$mesg='<div class="ok">'.$langs->trans("SocialContributionAdded").'</div>'; } else { $mesg = '<div class="error">' . $chargesociales->error . '</div>'; } } } /* * View */ $form = new Form($db); $formsocialcontrib = new FormSocialContrib($db); $help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module Taxes et dividendes|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)'; llxHeader("", $langs->trans("SocialContribution"), $help_url); // Mode creation if ($action == 'create') { print_fiche_titre($langs->trans("NewSocialContribution")); print "<br>\n"; dol_htmloutput_mesg($mesg); $var = false; print '<form name="charge" method="post" action="' . $_SERVER["PHP_SELF"] . '">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="action" value="add">'; print "<table class=\"noborder\" width=\"100%\">"; print "<tr class=\"liste_titre\">"; print '<td>'; print ' ';
$newfiltre = str_replace('filtre=', '', $filtre); $filterarray = explode('-', $newfiltre); foreach ($filterarray as $val) { $part = explode(':', $val); if ($part[0] == 'cs.fk_type') { $typeid = $part[1]; } } } else { $typeid = $_REQUEST['typeid']; } /* * View */ $form = new Form($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static = new ChargeSociales($db); llxHeader(); $sql = "SELECT cs.rowid as id, cs.fk_type as type, "; $sql .= " cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode,"; $sql .= " c.libelle as type_lib,"; $sql .= " SUM(pc.amount) as alreadypayed"; $sql .= " FROM " . MAIN_DB_PREFIX . "c_chargesociales as c,"; $sql .= " " . MAIN_DB_PREFIX . "chargesociales as cs"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql .= " WHERE cs.fk_type = c.id"; $sql .= " AND cs.entity = " . $conf->entity; if (GETPOST("search_label")) { $sql .= " AND cs.libelle LIKE '%" . $db->escape(GETPOST("search_label")) . "%'"; } if ($year > 0) {