Look: Modif esthtiques mineures
This commit is contained in:
parent
569d3f6a45
commit
b30780a2da
@ -921,7 +921,7 @@ else
|
||||
{
|
||||
$langs->load("projects");
|
||||
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 '</td>';
|
||||
if ($_GET["action"] != "classer") print '<td align="right"><a href="facture.php?action=classer&facid='.$fac->id.'">'.img_edit($langs->trans("SetProject")).'</a></td>';
|
||||
@ -929,11 +929,11 @@ else
|
||||
print '</td><td colspan="3">';
|
||||
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
|
||||
{
|
||||
$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>";
|
||||
} else {
|
||||
|
||||
@ -22,10 +22,10 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/compta/facture.php
|
||||
\ingroup facture
|
||||
\brief Page de création d'une facture
|
||||
\version $Revision$
|
||||
\file htdocs/compta/facture.php
|
||||
\ingroup facture
|
||||
\brief Page de création d'une facture
|
||||
\version $Revision$
|
||||
*/
|
||||
|
||||
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("bills");
|
||||
|
||||
$warning_delay=31*24*60*60; // Delai affichage warning retard (si retard paiement facture > delai)
|
||||
|
||||
|
||||
if ($_GET["socidp"]) { $socidp=$_GET["socidp"]; }
|
||||
@ -117,19 +116,18 @@ if ($user->rights->facture->lire)
|
||||
{
|
||||
$sql .= " AND f.facnumber like '%".$_POST["sf_ref"] . "%'";
|
||||
}
|
||||
|
||||
$sql .= " GROUP BY f.facnumber";
|
||||
|
||||
$sql .= " ORDER BY ";
|
||||
$listfield=split(',',$sortfield);
|
||||
foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.",";
|
||||
$sql .= " f.fk_soc ASC";
|
||||
|
||||
//$sql .= $db->plimit($limit+1,$offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result)
|
||||
$sql.= " GROUP BY f.facnumber";
|
||||
|
||||
$sql.= " ORDER BY ";
|
||||
$listfield=split(',',$sortfield);
|
||||
foreach ($listfield as $key => $value) $sql.=$listfield[$key]." ".$sortorder.",";
|
||||
$sql.= " f.fk_soc ASC";
|
||||
|
||||
//$sql .= $db->plimit($limit+1,$offset);
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($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 '<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 nowrap align=\"center\">".dolibarr_print_date($objp->df)."</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_ttc)."</td>";
|
||||
|
||||
@ -322,7 +322,7 @@ if ($socid > 0)
|
||||
*/
|
||||
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 .= " FROM ".MAIN_DB_PREFIX."projet as p";
|
||||
|
||||
@ -37,13 +37,12 @@ $langs->load("bills");
|
||||
|
||||
$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)
|
||||
{
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
$action = '';
|
||||
$socidp = $user->societe_id;
|
||||
}
|
||||
|
||||
|
||||
@ -54,24 +53,24 @@ llxHeader("",$langs->trans("AccountancyTreasuryArea"));
|
||||
* 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;
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");";
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE fk_soc = ".$socidp." AND fk_user=".$user->id;
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");";
|
||||
if (! $db->query($sql) )
|
||||
{
|
||||
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"];
|
||||
$result = $db->query($sql);
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bookmark WHERE rowid=".$_GET["bid"];
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
@ -80,11 +79,11 @@ if ($_GET["action"] == 'del_bookmark')
|
||||
* 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
|
||||
@ -100,101 +99,114 @@ if ($conf->facture->enabled) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
* Factures brouillons
|
||||
*/
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
{
|
||||
|
||||
$sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp";
|
||||
$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 = "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 .= " 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);
|
||||
$i = 0;
|
||||
$num = $db->num_rows($resql);
|
||||
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 '<table class="noborder" width="100%">';
|
||||
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 '<tr class="liste_total"><td colspan="2" align="left">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right">'.price($tot_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
print "</table><br>";
|
||||
}
|
||||
$db->free($resql);
|
||||
print "</table><br>";
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
dolibarr_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
if ($conf->compta->enabled) {
|
||||
|
||||
/*
|
||||
/**
|
||||
* Charges a payer
|
||||
*/
|
||||
if ($user->societe_id == 0)
|
||||
if ($conf->compta->enabled)
|
||||
{
|
||||
|
||||
$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 )
|
||||
if ($user->societe_id == 0)
|
||||
{
|
||||
$num = $db->num_rows($resql);
|
||||
if ($num)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("ContributionsToPay").' ('.$num.')</td></tr>';
|
||||
$i = 0;
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var = !$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>'.$obj->libelle.'</td>';
|
||||
print '<td align="right">'.price($obj->amount).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
}
|
||||
print '</table><br>';
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_print_error($db);
|
||||
|
||||
$sql = "SELECT c.rowid, 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)
|
||||
{
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("ContributionsToPay").' ('.$num.')</td></tr>';
|
||||
$i = 0;
|
||||
$tot_ttc=0;
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
$var = !$var;
|
||||
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>';
|
||||
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
|
||||
*/
|
||||
$sql = "SELECT s.idp, s.nom,b.rowid as bid";
|
||||
@ -231,7 +243,9 @@ else
|
||||
{
|
||||
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 '</tr>';
|
||||
$var = True;
|
||||
$tot_ht=0;
|
||||
$tot_ttc=0;
|
||||
$tot_ht=$tot_ttc=$tot_tobill=0;
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -272,7 +272,7 @@ if ($_GET["propalid"])
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td colspan="3">'.$propal->remise_percent.' %</td>';
|
||||
print '<td colspan="3">'.$propal->remise_percent.'%</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
@ -319,7 +319,7 @@ if ($_GET["propalid"])
|
||||
print '<td> </td><td> </td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
$var=True;
|
||||
$var=true;
|
||||
while ($i < $num_lignes)
|
||||
{
|
||||
$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);
|
||||
|
||||
$i = 0;
|
||||
$var=true;
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'',$sortfield);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user