*** empty log message ***

This commit is contained in:
Rodolphe Quiedeville 2002-05-03 11:34:33 +00:00
parent de4f44136d
commit a7a8ad94bc
5 changed files with 136 additions and 8 deletions

View File

@ -156,7 +156,7 @@ if ($facid > 0) {
if ($obj->statut == 0) {
print "<td align=\"center\" bgcolor=\"#e0e0e0\" width=\"25%\">[<a href=\"$PHP_SELF?facid=$facid&action=delete\">Supprimer</a>]</td>";
} else {
print "<td align=\"center\" width=\"25%\">[<a href=\"../comm/ventes.php3?socid=$obj->socidp&facid=$facid&action=add\">Emettre une vente</a>]</td>";
print "<td align=\"center\" width=\"25%\">-</td>";
}
if ($obj->statut == 1 && $resteapayer > 0) {
print "<td align=\"center\" bgcolor=\"#e0e0e0\" width=\"25%\">[<a href=\"paiement.php3?facid=$facid&action=create\">Emettre un paiement</a>]</td>";
@ -195,7 +195,7 @@ if ($facid > 0) {
}
print "<tr><td colspan=\"2\">(<a href=\"../../doc/facture/$obj->facnumber/\">liste...</a>)</td></tr>";
print "</table>\n";
print "</table>\n</table>";
/*
* Generation de la facture
@ -223,7 +223,8 @@ if ($facid > 0) {
if ($result) {
$num = $db->num_rows();
$i = 0; $total = 0;
print "<p><b>Proposition commerciale associée</b><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<p><b>Proposition(s) commerciale(s) associée(s)</b>";
print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"orange\">";
print "<td>Num</td>";
print "<td>Date</td>";
@ -277,7 +278,7 @@ if ($facid > 0) {
$num = $db->num_rows();
if ($num > 0) {
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<p><TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"orange\">";
print "<TD>[<a href=\"$PHP_SELF\">Tous</a>]</td>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";

View File

@ -44,13 +44,125 @@ $offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
print "<P>";
print "<P>Brouillons<p>";
$sep = 0;
$sept = 0;
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.fk_statut = 0";
if ($socidp) {
$sql .= " AND s.idp = $socidp";
}
if ($month > 0) {
$sql .= " AND date_part('month', date(f.datef)) = $month";
}
if ($year > 0) {
$sql .= " AND date_part('year', date(f.datef)) = $year";
}
$sql .= " ORDER BY f.fk_statut, f.paye, f.datef DESC ";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
if ($num > 0) {
$i = 0;
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TD>[<a href=\"$PHP_SELF\">Tous</a>]</td>";
print "<TD>Num&eacute;ro</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TD align=\"right\">Date</TD><TD align=\"right\">Montant</TD>";
print "<TD align=\"right\">Payé</TD><TD align=\"right\">Moyenne</TD>";
print "</TR>\n";
$var=True;
while ($i < $num) {
$objp = $db->fetch_object( $i);
$var=!$var;
if ($objp->paye && !$sep) {
print "<tr><td></td><td>$i factures</td><td colspan=\"2\" align=\"right\">";
print "<small>Total : ".francs($total)." FF</small></td>";
print "<td align=\"right\">Sous Total :<b> ".price($total)."</b></td><td>euros HT</td>";
print "<td align=\"right\">Moyenne :<b> ".price($total / ($i+1))."</b></td></tr>";
print "<TR bgcolor=\"orange\">";
print "<TD>[<a href=\"$PHP_SELF\">Tous</a>]</td>";
print "<TD>Num&eacute;ro</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TD align=\"right\">Date</TD><TD align=\"right\">Montant</TD>";
print "<TD align=\"right\">Payé</TD><TD align=\"right\">Moyenne</TD>";
print "</TR>\n";
$sep = 1 ; $j = 0;
$subtotal = 0;
}
print "<TR $bc[$var]>";
print "<TD>[<a href=\"$PHP_SELF?socidp=$objp->idp\">Filtre</a>]</TD>\n";
print "<td><a href=\"facture.php3?facid=$objp->facid\">$objp->facnumber</a></TD>\n";
print "<TD><a href=\"../comm/index.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
if ($objp->df > 0 ) {
print "<TD align=\"right\">";
$y = strftime("%Y",$objp->df);
$m = strftime("%m",$objp->df);
print strftime("%d",$objp->df)."\n";
print " <a href=\"facture.php3?year=$y&month=$m\">";
print strftime("%B",$objp->df)."</a>\n";
print " <a href=\"facture.php3?year=$y\">";
print strftime("%Y",$objp->df)."</a></TD>\n";
} else {
print "<TD align=\"right\"><b>!!!</b></TD>\n";
}
print "<TD align=\"right\">".price($objp->amount)."</TD>\n";
$yn[1] = "oui";
$yn[0] = "<b>non</b>";
$total = $total + $objp->amount;
$subtotal = $subtotal + $objp->amount;
print "<TD align=\"right\">".$yn[$objp->paye]."</TD>\n";
print "<TD align=\"right\">".price($subtotal / ($j + 1))."</TD>\n";
print "</TR>\n";
$i++;
$j++;
}
}
if ($i == 0) { $i=1; } if ($j == 0) { $j=1; }
print "<tr><td></td><td>$j factures</td><td colspan=\"2\" align=\"right\">";
print "<small>Total : ".francs($subtotal)." FF</small></td>";
print "<td align=\"right\">Sous Total :<b> ".price($subtotal)."</b></td><td>euros HT</td>";
print "<td align=\"right\">Moyenne :<b> ".price($subtotal/ $j)."</b></td></tr>";
print "<tr bgcolor=\"#d0d0d0\"><td></td><td>$i factures</td><td colspan=\"2\" align=\"right\">";
print "<small>Total : ".francs($total)." FF</small></td>";
print "<td align=\"right\"><b>Total : ".price($total)."</b></td><td>euros HT</td>";
print "<td align=\"right\"><b>Moyenne : ".price($total/ $i)."</b></td></tr>";
print "</TABLE>";
$db->free();
} else {
print $db->error();
}
/*
*
*
*
*/
print "<P>Validées<br>";
$sep = 0;
$sept = 0;
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.fk_statut > 0";
if ($socidp) {
$sql .= " AND s.idp = $socidp";
@ -151,6 +263,9 @@ if ($result) {
print $db->error();
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -48,9 +48,9 @@ function llxHeader($head = "") {
print "<A href=\"/\">Accueil</A>";
print "</td></tr>";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<CENTER><A href=\"/compta/index.php3\">Factures</A></CENTER><p>\n";
print '<TR><TD bgcolor="#e0e0e0" valign="top" align="right">';
print '<div align="center"><A href="/compta/index.php3">Factures</A></div><p>';
print "<A href=\"paiement.php3\">Paiements</A><BR>\n";
print "<A href=\"fac.php3\">admin fac</A><BR>\n";

View File

@ -42,6 +42,13 @@ class Conf {
class PropalConf {
Function PropalConf() {
$this->fromtoname = "Service Commercial";
$this->fromtomail = "commercial@propal.com";
$this->replytoname = "Service Commercial";
$this->replytomail = "commercial@propal.com";
$this->templatesdir = "/home/www/dolibarr/dolibarr/templates/propal/default";
$this->outputdir = "/home/www/dolibarr/dolibarr/htdocs/document/propal";
/*

View File

@ -35,6 +35,11 @@ create table llx_facture
fk_statut smallint default 0 NOT NULL,
author varchar(50),
fk_user integer, -- createur de la facture
fk_user_author integer, -- createur de la propale
fk_user_valid integer, -- valideur de la propale
note text,
UNIQUE INDEX (facnumber)