diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index b67a7b8b99a..409b6a1e33f 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -921,7 +921,7 @@ else
{
$langs->load("projects");
print '
';
- print '';
+ print '| ';
print $langs->trans("Project");
print ' | ';
if ($_GET["action"] != "classer") print ''.img_edit($langs->trans("SetProject")).' | ';
@@ -929,11 +929,11 @@ else
print '';
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 " | ";
} else {
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index 78b692e3a78..8d80ef6f93b 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -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 ''.img_object($langs->trans("ShowBill"),"bill")." ";
print ''.$objp->facnumber.''.$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 " | \n";
print "".dolibarr_print_date($objp->df)." | \n";
print "".dolibarr_print_date($objp->datelimite)." | \n";
- print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,44).' | ';
+ print ''.img_object($langs->trans("ShowCompany"),"company").' '.dolibarr_trunc($objp->nom,32).' | ';
print "".price($objp->total)." | ";
print "".price($objp->total_ttc)." | ";
diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php
index 350e346b313..c655dad9746 100644
--- a/htdocs/compta/fiche.php
+++ b/htdocs/compta/fiche.php
@@ -322,7 +322,7 @@ if ($socid > 0)
*/
if ($conf->projet->enabled)
{
- print '';
+ print '';
$sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index c42597b1727..80e71b53c60 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -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 '';
+print '';
-print '| ';
+print ' | ';
/*
* 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 ' ";
+ }
+ $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 '';
- print '';
- print '| '.$langs->trans("ContributionsToPay").' ('.$num.') | ';
- $i = 0;
- $var = True;
- while ($i < $num)
- {
- $obj = $db->fetch_object($resql);
- $var = !$var;
- print "";
- print '| '.$obj->libelle.' | ';
- print ''.price($obj->amount).' | ';
- print ' ';
- $i++;
- }
- print ' ';
- }
- $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 '';
+ print '';
+ print '| '.$langs->trans("ContributionsToPay").' ('.$num.') | ';
+ $i = 0;
+ $tot_ttc=0;
+ $var = True;
+ while ($i < $num)
+ {
+ $obj = $db->fetch_object($resql);
+ $var = !$var;
+ print "";
+ print '| '.img_object($langs->trans("ShowBill"),"bill").' '.$obj->libelle.' | ';
+ print ''.price($obj->amount).' | ';
+ print ' ';
+ $tot_ttc+=$obj->amount;
+ $i++;
+ }
+
+ print '| '.$langs->trans("Total").' | ';
+ print ''.price($tot_ttc).' | ';
+ print ' ';
+
+ print ' ';
+ }
+ $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 ' | ';
+
+
+print ' | ';
/*
@@ -270,8 +284,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
print ' | '.$langs->trans("ToBill").' | ';
print ' ';
$var = True;
- $tot_ht=0;
- $tot_ttc=0;
+ $tot_ht=$tot_ttc=$tot_tobill=0;
while ($i < $num)
{
$obj = $db->fetch_object($resql);
diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php
index a5110363b71..6f81cdcec0e 100644
--- a/htdocs/compta/propal.php
+++ b/htdocs/compta/propal.php
@@ -272,7 +272,7 @@ if ($_GET["propalid"])
}
else
{
- print ''.$propal->remise_percent.' % | ';
+ print ''.$propal->remise_percent.'% | ';
}
print '';
@@ -319,7 +319,7 @@ if ($_GET["propalid"])
print ' | | ';
print "\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 "";
print '';
print_liste_field_titre($langs->trans("Ref"),"propal.php","p.ref","","&year=$year&viewstatut=$viewstatut",'',$sortfield);
|
|