Fix: Formulaire ajout charges n'tait plus visible
This commit is contained in:
parent
e33b47a3c6
commit
f5f1c44ab2
@ -20,7 +20,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
/**
|
||||
\file htdocs/compta/sociales/charges.php
|
||||
\ingroup compta
|
||||
\brief Fiche d'une charge sociale
|
||||
@ -53,10 +53,10 @@ $chid=isset($_GET["id"])?$_GET["id"]:$_POST["id"];
|
||||
/* *************************************************************************** */
|
||||
if ($_GET["action"] == 'payed')
|
||||
{
|
||||
$cha = new ChargeSociales($db);
|
||||
$result = $cha->set_payed($chid);
|
||||
$cha = new ChargeSociales($db);
|
||||
$result = $cha->set_payed($chid);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
@ -65,153 +65,154 @@ if ($_GET["action"] == 'payed')
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
if ($chid > 0)
|
||||
{
|
||||
$html = new Form($db);
|
||||
{
|
||||
$html = new Form($db);
|
||||
|
||||
$cha = new ChargeSociales($db);
|
||||
$cha = new ChargeSociales($db);
|
||||
|
||||
if ( $cha->fetch($chid) > 0)
|
||||
{
|
||||
/*
|
||||
* Charge
|
||||
*/
|
||||
if ($cha->fetch($chid) > 0)
|
||||
{
|
||||
/*
|
||||
* Charge
|
||||
*/
|
||||
|
||||
//$head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id;
|
||||
$head[0][1] = $langs->trans("SocialContribution").": $cha->id";
|
||||
$h = 1;
|
||||
$a = 0;
|
||||
//$head[0][0] = DOL_URL_ROOT.'/comm/propal.php?propalid='.$propal->id;
|
||||
$head[0][1] = $langs->trans("SocialContribution").": $cha->id";
|
||||
$h = 1;
|
||||
$a = 0;
|
||||
|
||||
dolibarr_fiche_head($head, $a);
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression de la charge
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
$html->form_confirm("index.php?id=$cha->id&action=del","Supprimer la charge sociale","Etes-vous sûr de vouloir supprimer cette charge sociale ?","confirm_delete");
|
||||
}
|
||||
dolibarr_fiche_head($head, $a);
|
||||
|
||||
print "<form action=\"charges.php?id=$cha->id&action=update\" method=\"post\">";
|
||||
/*
|
||||
* Confirmation de la suppression de la charge
|
||||
*
|
||||
*/
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
$html->form_confirm("index.php?id=$cha->id&action=del","Supprimer la charge sociale","Etes-vous sûr de vouloir supprimer cette charge sociale ?","confirm_delete");
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print "<form action=\"charges.php?id=$cha->id&action=update\" method=\"post\">";
|
||||
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td>$cha->type_libelle</td><td>".$langs->trans("Payments")."</td></tr>";
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print "<tr><td>".$langs->trans("Period")."</td><td>".dolibarr_print_date($cha->periode,"%Y")."</td>";
|
||||
print '<td rowspan="5" valign="top">';
|
||||
|
||||
/*
|
||||
* Paiements
|
||||
*/
|
||||
$sql = "SELECT ".$db->pdate("datep")." as dp, p.amount,";
|
||||
$sql .= "c.libelle as paiement_type, p.num_paiement, p.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p, ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql .= " WHERE p.fk_charge = ".$chid." AND p.fk_typepaiement = c.id";
|
||||
$sql .= " ORDER BY dp DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0; $total = 0;
|
||||
echo '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td><td> </td></tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print img_object($langs->trans("Payment"),"payment").' ';
|
||||
print dolibarr_print_date($objp->dp)."</td>\n";
|
||||
print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td>".$langs->trans("Currency".$conf->monnaie)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($fac->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Total payé:</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td>".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Réclamé :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($cha->amount)."</td><td bgcolor=\"#d0d0d0\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
|
||||
$resteapayer = $cha->amount - $totalpaye;
|
||||
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
} else {
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print "</td>";
|
||||
print "<tr><td>".$langs->trans("Type")."</td><td>$cha->type_libelle</td><td>".$langs->trans("Payments")."</td></tr>";
|
||||
|
||||
print "</tr>";
|
||||
print "<tr><td>".$langs->trans("Period")."</td><td>".dolibarr_print_date($cha->periode,"%Y")."</td>";
|
||||
print '<td rowspan="5" valign="top">';
|
||||
|
||||
if ($cha->paye==0) {
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="desc" size="40" value="'.stripslashes($cha->lib).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td><input type=\"text\" name=\"amount\" value=\"".strftime("%Y%m%d",$cha->date_ech)."\"></td></tr>";
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td><b><input type=\"text\" name=\"amount\" value=\"$cha->amount\"></b></td></tr>";
|
||||
}
|
||||
else {
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$cha->lib.'</td></tr>';
|
||||
print "<tr><td>".$langs->trans("DateDue")."</td><td>".dolibarr_print_date($cha->date_ech)."</td></tr>";
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td><b>'.price($cha->amount).'</b></td></tr>';
|
||||
}
|
||||
/*
|
||||
* Paiements
|
||||
*/
|
||||
$sql = "SELECT ".$db->pdate("datep")." as dp, p.amount,";
|
||||
$sql .= "c.libelle as paiement_type, p.num_paiement, p.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."paiementcharge as p, ".MAIN_DB_PREFIX."c_paiement as c ";
|
||||
$sql .= " WHERE p.fk_charge = ".$chid." AND p.fk_typepaiement = c.id";
|
||||
$sql .= " ORDER BY dp DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
$i = 0; $total = 0;
|
||||
echo '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Type").'</td>';
|
||||
print '<td align="right">'.$langs->trans("Amount").'</td><td> </td></tr>';
|
||||
|
||||
$var=True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]><td>";
|
||||
print img_object($langs->trans("Payment"),"payment").' ';
|
||||
print dolibarr_print_date($objp->dp)."</td>\n";
|
||||
print "<td>$objp->paiement_type $objp->num_paiement</td>\n";
|
||||
print '<td align="right">'.price($objp->amount)."</td><td>".$langs->trans("Currency".$conf->monnaie)."</td>\n";
|
||||
print "</tr>";
|
||||
$totalpaye += $objp->amount;
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($fac->paye == 0)
|
||||
{
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Total payé:</td><td align=\"right\"><b>".price($totalpaye)."</b></td><td>".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Réclamé :</td><td align=\"right\" bgcolor=\"#d0d0d0\">".price($cha->amount)."</td><td bgcolor=\"#d0d0d0\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
|
||||
$resteapayer = $cha->amount - $totalpaye;
|
||||
|
||||
print "<tr><td colspan=\"2\" align=\"right\">".$langs->trans("RemainderToPay")." :</td>";
|
||||
print "<td align=\"right\" bgcolor=\"#f0f0f0\"><b>".price($resteapayer)."</b></td><td bgcolor=\"#f0f0f0\">".$langs->trans("Currency".$conf->monnaie)."</td></tr>\n";
|
||||
}
|
||||
print "</table>";
|
||||
$db->free();
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "</tr>";
|
||||
|
||||
if ($cha->paye==0) {
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="desc" size="40" value="'.stripslashes($cha->lib).'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("DateDue")."</td><td><input type=\"text\" name=\"amount\" value=\"".strftime("%Y%m%d",$cha->date_ech)."\"></td></tr>";
|
||||
print '<tr><td>'.$langs->trans("AmountTTC")."</td><td><b><input type=\"text\" name=\"amount\" value=\"$cha->amount\"></b></td></tr>";
|
||||
}
|
||||
else {
|
||||
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$cha->lib.'</td></tr>';
|
||||
print "<tr><td>".$langs->trans("DateDue")."</td><td>".dolibarr_print_date($cha->date_ech)."</td></tr>";
|
||||
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td><b>'.price($cha->amount).'</b></td></tr>';
|
||||
}
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$cha->getLibStatut().'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
|
||||
print "</form>\n";
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$cha->getLibStatut().'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
if (! $_GET["action"]) {
|
||||
print "</form>\n";
|
||||
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
print '</div>';
|
||||
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
if (! $_GET["action"])
|
||||
{
|
||||
/*
|
||||
* Boutons actions
|
||||
*/
|
||||
|
||||
// Supprimer
|
||||
if ($cha->paye == 0 && $totalpaye <=0 && $user->rights->compta->charges)
|
||||
{
|
||||
print "<a class=\"butDelete\" href=\"charges.php?id=$cha->id&action=delete\">".$langs->trans("Delete")."</a>";
|
||||
}
|
||||
print "<div class=\"tabsAction\">\n";
|
||||
|
||||
// Emettre paiement
|
||||
if ($cha->paye == 0 && round($resteapayer) > 0 && $user->rights->compta->charges)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"../paiement_charge.php?id=$cha->id&action=create\">".$langs->trans("DoPaiement")."</a>";
|
||||
}
|
||||
|
||||
// Classer 'payé'
|
||||
if ($cha->paye == 0 && round($resteapayer) <=0 && $user->rights->compta->charges)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"charges.php?id=$cha->id&action=payed\">".$langs->trans("ClassifyPayed")."</a>";
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
// Supprimer
|
||||
if ($cha->paye == 0 && $totalpaye <=0 && $user->rights->tax->charges->supprimer)
|
||||
{
|
||||
print "<a class=\"butDelete\" href=\"charges.php?id=$cha->id&action=delete\">".$langs->trans("Delete")."</a>";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Charge non trouvée */
|
||||
print "Charge inexistante ou accés refusé";
|
||||
}
|
||||
// Emettre paiement
|
||||
if ($cha->paye == 0 && round($resteapayer) > 0 && $user->rights->tax->charges->creer)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"../paiement_charge.php?id=$cha->id&action=create\">".$langs->trans("DoPaiement")."</a>";
|
||||
}
|
||||
|
||||
// Classer 'payé'
|
||||
if ($cha->paye == 0 && round($resteapayer) <=0 && $user->rights->tax->charges->creer)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"charges.php?id=$cha->id&action=payed\">".$langs->trans("ClassifyPayed")."</a>";
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Charge non trouvée */
|
||||
print "Charge inexistante ou accés refusé";
|
||||
}
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
|
||||
@ -533,7 +533,7 @@ LDAPFieldMobileExample=Default attribute : mobile
|
||||
ProductSetup=Products module setup
|
||||
NumberOfProductShowInSelect=Max number of products in combos select lists (0=no limit)
|
||||
ConfirmDeleteProductLineAbility=Confirmation of removal of a line produces in the forms
|
||||
ModifyProductDescAbility=Personalization of descriptions produced in the forms
|
||||
ModifyProductDescAbility=Personalization of descriptions produced in the forms
|
||||
ViewProductDescInFormAbility=Visualization of descriptions produced in the forms
|
||||
##### Syslog #####
|
||||
SyslogSetup=Syslog module setup
|
||||
|
||||
Loading…
Reference in New Issue
Block a user