diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 79edc9775f0..36984d82a69 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -156,7 +156,7 @@ if ($facid > 0) { if ($obj->statut == 0) { print "[Supprimer]"; } else { - print "[socidp&facid=$facid&action=add\">Emettre une vente]"; + print "-"; } if ($obj->statut == 1 && $resteapayer > 0) { print "[Emettre un paiement]"; @@ -195,7 +195,7 @@ if ($facid > 0) { } print "(facnumber/\">liste...)"; - print "\n"; + print "\n"; /* * Generation de la facture @@ -223,7 +223,8 @@ if ($facid > 0) { if ($result) { $num = $db->num_rows(); $i = 0; $total = 0; - print "

Proposition commerciale associée"; + print "

Proposition(s) commerciale(s) associée(s)"; + print '

'; print ""; print ""; print ""; @@ -277,7 +278,7 @@ if ($facid > 0) { $num = $db->num_rows(); if ($num > 0) { $i = 0; - print "

NumDate
"; + print '

'; print ""; print ""; print ""; diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index ae81937b8df..ec4b09bd316 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -44,13 +44,125 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -print "

"; +print "

Brouillons

"; $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 "

[Tous]Societe
"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + $var=True; + while ($i < $num) { + $objp = $db->fetch_object( $i); + $var=!$var; + + if ($objp->paye && !$sep) { + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + $sep = 1 ; $j = 0; + $subtotal = 0; + } + + print ""; + print "\n"; + print "\n"; + print "\n"; + + if ($objp->df > 0 ) { + print "\n"; + } else { + print "\n"; + } + + print "\n"; + + $yn[1] = "oui"; + $yn[0] = "non"; + + $total = $total + $objp->amount; + $subtotal = $subtotal + $objp->amount; + print "\n"; + print "\n"; + print "\n"; + $i++; + $j++; + + } + } + if ($i == 0) { $i=1; } if ($j == 0) { $j=1; } + print ""; + print ""; + print ""; + + print ""; + print ""; + print ""; + + print "
[Tous]NuméroSocieteDateMontantPayéMoyenne
$i factures"; + print "Total : ".francs($total)." FFSous Total : ".price($total)."euros HTMoyenne : ".price($total / ($i+1))."
[Tous]NuméroSocieteDateMontantPayéMoyenne
[idp\">Filtre]facid\">$objp->facnumberidp\">$objp->nom"; + $y = strftime("%Y",$objp->df); + $m = strftime("%m",$objp->df); + + print strftime("%d",$objp->df)."\n"; + print " "; + print strftime("%B",$objp->df)."\n"; + print " "; + print strftime("%Y",$objp->df)."!!!".price($objp->amount)."".$yn[$objp->paye]."".price($subtotal / ($j + 1))."
$j factures"; + print "Total : ".francs($subtotal)." FFSous Total : ".price($subtotal)."euros HTMoyenne : ".price($subtotal/ $j)."
$i factures"; + print "Total : ".francs($total)." FFTotal : ".price($total)."euros HTMoyenne : ".price($total/ $i)."
"; + $db->free(); +} else { + print $db->error(); +} + +/* + * + * + * + */ +print "

Validées
"; + +$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("Dernière modification $Date$ révision $Revision$"); ?> diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index 4db432de50d..45d1a3e4988 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -48,9 +48,9 @@ function llxHeader($head = "") { print "Accueil"; print ""; - print ""; - print "

Factures

\n"; + print ''; + print '

Factures

'; print "Paiements
\n"; print "admin fac
\n"; diff --git a/htdocs/conf/conf.class.php3.sample b/htdocs/conf/conf.class.php3.sample index fae56cef45f..c649efe31ea 100644 --- a/htdocs/conf/conf.class.php3.sample +++ b/htdocs/conf/conf.class.php3.sample @@ -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"; /* diff --git a/mysql/tables/llx_facture.sql b/mysql/tables/llx_facture.sql index ae874440b6e..82cd5d30ac0 100644 --- a/mysql/tables/llx_facture.sql +++ b/mysql/tables/llx_facture.sql @@ -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)