Look: Modif esthétiques mineures

This commit is contained in:
Laurent Destailleur 2005-08-11 20:31:07 +00:00
parent 569d3f6a45
commit b30780a2da
5 changed files with 133 additions and 120 deletions

View File

@ -921,7 +921,7 @@ else
{ {
$langs->load("projects"); $langs->load("projects");
print '<td height="10">'; print '<td height="10">';
print '<table width="100%" class="nobordernopadding"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("Project"); print $langs->trans("Project");
print '</td>'; print '</td>';
if ($_GET["action"] != "classer") print '<td align="right"><a href="facture.php?action=classer&amp;facid='.$fac->id.'">'.img_edit($langs->trans("SetProject")).'</a></td>'; if ($_GET["action"] != "classer") print '<td align="right"><a href="facture.php?action=classer&amp;facid='.$fac->id.'">'.img_edit($langs->trans("SetProject")).'</a></td>';
@ -929,11 +929,11 @@ else
print '</td><td colspan="3">'; print '</td><td colspan="3">';
if ($_GET["action"] == "classer") if ($_GET["action"] == "classer")
{ {
$html->form_project("facture.php?facid=$fac->id",$fac->fk_soc,$fac->projetid,"projetid"); $html->form_project($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->fk_soc,$fac->projetid,"projetid");
} }
else else
{ {
$html->form_project("facture.php?facid=$fac->id",$fac->fk_soc,$fac->projetid,"none"); $html->form_project($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->fk_soc,$fac->projetid,"none");
} }
print "</td>"; print "</td>";
} else { } else {

View File

@ -22,10 +22,10 @@
*/ */
/** /**
\file htdocs/compta/facture.php \file htdocs/compta/facture.php
\ingroup facture \ingroup facture
\brief Page de création d'une facture \brief Page de création d'une facture
\version $Revision$ \version $Revision$
*/ */
require("./pre.inc.php"); require("./pre.inc.php");
@ -41,7 +41,6 @@ if (!$user->rights->facture->lire)
$langs->load("main"); // BUG De chargement de traduction ne pas modifier cette ligne $langs->load("main"); // BUG De chargement de traduction ne pas modifier cette ligne
$langs->load("bills"); $langs->load("bills");
$warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiement facture > delai)
if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; } if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; }
@ -117,19 +116,18 @@ if ($user->rights->facture->lire)
{ {
$sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'"; $sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'";
} }
$sql.= " GROUP BY f.facnumber";
$sql .= " GROUP BY f.facnumber";
$sql.= " ORDER BY ";
$sql .= " ORDER BY "; $listfield=split(',',$sortfield);
$listfield=split(',',$sortfield); foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.",";
foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.","; $sql.= " f.fk_soc ASC";
$sql .= " f.fk_soc ASC";
//$sql .= $db->plimit($limit+1,$offset);
//$sql .= $db->plimit($limit+1,$offset);
$result = $db->query($sql);
$result = $db->query($sql);
if ($result)
if ($result)
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
@ -190,13 +188,13 @@ if ($user->rights->facture->lire)
print '<td nowrap><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill")."</a> "; print '<td nowrap><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.img_object($langs->trans("ShowBill"),"bill")."</a> ";
print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a>'.$objp->increment; print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a>'.$objp->increment;
if ($objp->datelimite < (time() - $warning_delay) && ! $objp->paye && $objp->fk_statut == 1 && ! $objp->am) print img_warning($langs->trans("Late")); if ($objp->datelimite < (time() - $conf->facture->client->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late"));
print "</td>\n"; print "</td>\n";
print "<td nowrap align=\"center\">".dolibarr_print_date($objp->df)."</td>\n"; print "<td nowrap align=\"center\">".dolibarr_print_date($objp->df)."</td>\n";
print "<td nowrap align=\"center\">".dolibarr_print_date($objp->datelimite)."</td>\n"; print "<td nowrap align=\"center\">".dolibarr_print_date($objp->datelimite)."</td>\n";
print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).'</a></td>'; print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$objp->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).'</a></td>';
print "<td align=\"right\">".price($objp->total)."</td>"; print "<td align=\"right\">".price($objp->total)."</td>";
print "<td align=\"right\">".price($objp->total_ttc)."</td>"; print "<td align=\"right\">".price($objp->total_ttc)."</td>";

View File

@ -322,7 +322,7 @@ if ($socid > 0)
*/ */
if ($conf->projet->enabled) if ($conf->projet->enabled)
{ {
print '<table class="border" width="100%">'; print '<table class="noborder" width="100%">';
$sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do"; $sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p"; $sql .= " FROM ".MAIN_DB_PREFIX."projet as p";

View File

@ -37,13 +37,12 @@ $langs->load("bills");
$warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiement facture > delai) $warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiement facture > delai)
/* // Sécurité accés client
* Sécurité accés client $socidp='';
*/
if ($user->societe_id > 0) if ($user->societe_id > 0)
{ {
$action = ''; $action = '';
$socidp = $user->societe_id; $socidp = $user->societe_id;
} }
@ -54,24 +53,24 @@ llxHeader("",$langs->trans("AccountancyTreasuryArea"));
* Actions * Actions
*/ */
if ($_GET["action"] == 'add_bookmark') if (isset($_GET["action"]) && $_GET["action"] == 'add_bookmark')
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socidp." AND fk_user=".$user->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socidp." AND fk_user=".$user->id;
if (! $db->query($sql) ) if (! $db->query($sql) )
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");";
if (! $db->query($sql) ) if (! $db->query($sql) )
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
} }
if ($_GET["action"] == 'del_bookmark') if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark')
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"]; $sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"];
$result = $db->query($sql); $result = $db->query($sql);
} }
@ -80,11 +79,11 @@ if ($_GET["action"] == 'del_bookmark')
* Affichage page * Affichage page
* *
*/ */
print_titre($langs->trans("AccountancyTreasuryArea")); print_fiche_titre($langs->trans("AccountancyTreasuryArea"));
print '<table border="0" width="100%">'; print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%">'; print '<tr><td valign="top" width="30%" class="notopnoleft">';
/* /*
* Zone recherche facture * Zone recherche facture
@ -100,101 +99,114 @@ if ($conf->facture->enabled) {
} }
/* /**
* Factures brouillons * Factures brouillons
*/ */
if ($conf->facture->enabled && $user->rights->facture->lire) if ($conf->facture->enabled && $user->rights->facture->lire)
{ {
$sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp"; $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom, s.idp";
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; $sql .= " WHERE s.idp = f.fk_soc AND f.fk_statut = 0";
if ($socidp) if ($socidp)
{ {
$sql .= " AND f.fk_soc = $socidp"; $sql .= " AND f.fk_soc = $socidp";
} }
$resql = $db->query($sql); $resql = $db->query($sql);
if ( $resql ) if ( $resql )
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; if ($num)
{
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">'.$langs->trans("DraftBills").' ('.$num.')</td></tr>';
$i = 0;
$tot_ttc = 0;
$var = True;
while ($i < $num && $i < 20)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'><td nowrap><a href="facture.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.'</a></td>';
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'</a></td>';
print '<td align="right">'.price($obj->total_ttc).'</td>';
print '</tr>';
$tot_ttc+=$obj->total_ttc;
$i++;
}
if ($num) print '<tr class="liste_total"><td colspan="2" align="left">'.$langs->trans("Total").'</td>';
{ print '<td align="right">'.price($tot_ttc).'</td>';
print '<table class="noborder" width="100%">'; print '</tr>';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("DraftBills").' ('.$num.')</td></tr>';
$var = True;
while ($i < $num && $i < 20)
{
$obj = $db->fetch_object($resql);
$var=!$var;
print '<tr '.$bc[$var].'><td nowrap><a href="facture.php?facid='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->facnumber.'</a></td>';
print '<td><a href="fiche.php?socid='.$obj->idp.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($obj->nom,24).'</a></td></tr>';
$i++;
}
print "</table><br>"; print "</table><br>";
} }
$db->free($resql); $db->free($resql);
} }
else else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
} }
if ($conf->compta->enabled) { /**
/*
* Charges a payer * Charges a payer
*/ */
if ($user->societe_id == 0) if ($conf->compta->enabled)
{ {
if ($user->societe_id == 0)
$sql = "SELECT c.amount, cc.libelle";
$sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as c, ".MAIN_DB_PREFIX."c_chargesociales as cc";
$sql .= " WHERE c.fk_type = cc.id AND c.paye=0";
$resql = $db->query($sql);
if ( $resql )
{ {
$num = $db->num_rows($resql);
if ($num) $sql = "SELECT c.rowid, c.amount, cc.libelle";
{ $sql .= " FROM ".MAIN_DB_PREFIX."chargesociales as c, ".MAIN_DB_PREFIX."c_chargesociales as cc";
print '<table class="noborder" width="100%">'; $sql .= " WHERE c.fk_type = cc.id AND c.paye=0";
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("ContributionsToPay").' ('.$num.')</td></tr>'; $resql = $db->query($sql);
$i = 0;
$var = True; if ( $resql )
while ($i < $num) {
{ $num = $db->num_rows($resql);
$obj = $db->fetch_object($resql); if ($num)
$var = !$var; {
print "<tr $bc[$var]>"; print '<table class="noborder" width="100%">';
print '<td>'.$obj->libelle.'</td>'; print '<tr class="liste_titre">';
print '<td align="right">'.price($obj->amount).'</td>'; print '<td colspan="2">'.$langs->trans("ContributionsToPay").' ('.$num.')</td></tr>';
print '</tr>'; $i = 0;
$i++; $tot_ttc=0;
} $var = True;
print '</table><br>'; while ($i < $num)
} {
$db->free($resql); $obj = $db->fetch_object($resql);
} $var = !$var;
else print "<tr $bc[$var]>";
{ print '<td><a href="'.DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowBill"),"bill").' '.$obj->libelle.'</td>';
dolibarr_print_error($db); print '<td align="right">'.price($obj->amount).'</td>';
print '</tr>';
$tot_ttc+=$obj->amount;
$i++;
}
print '<tr class="liste_total"><td align="left">'.$langs->trans("Total").'</td>';
print '<td align="right">'.price($tot_ttc).'</td>';
print '</tr>';
print '</table><br>';
}
$db->free($resql);
}
else
{
dolibarr_print_error($db);
}
} }
} }
}
/**
/*
* Bookmark * Bookmark
*/ */
$sql = "SELECT s.idp, s.nom,b.rowid as bid"; $sql = "SELECT s.idp, s.nom,b.rowid as bid";
@ -231,7 +243,9 @@ else
{ {
dolibarr_print_error($db); dolibarr_print_error($db);
} }
print '</td><td valign="top" width="70%">';
print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
/* /*
@ -270,8 +284,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
print '<td align="right">'.$langs->trans("ToBill").'</td>'; print '<td align="right">'.$langs->trans("ToBill").'</td>';
print '</tr>'; print '</tr>';
$var = True; $var = True;
$tot_ht=0; $tot_ht=$tot_ttc=$tot_tobill=0;
$tot_ttc=0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);

View File

@ -272,7 +272,7 @@ if ($_GET["propalid"])
} }
else else
{ {
print '<td colspan="3">'.$propal->remise_percent.' %</td>'; print '<td colspan="3">'.$propal->remise_percent.'%</td>';
} }
print '</tr>'; print '</tr>';
@ -319,7 +319,7 @@ if ($_GET["propalid"])
print '<td>&nbsp;</td><td>&nbsp;</td>'; print '<td>&nbsp;</td><td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
$var=True; $var=true;
while ($i < $num_lignes) while ($i < $num_lignes)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
@ -620,6 +620,8 @@ if ($_GET["propalid"])
print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num); print_barre_liste($langs->trans("Proposals"), $page, "propal.php","&socidp=$socidp",$sortfield,$sortorder,'',$num);
$i = 0; $i = 0;
$var=true;
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'',$sortfield); print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'',$sortfield);