diff --git a/htdocs/comm/facture.php3 b/htdocs/comm/facture.php3 deleted file mode 100644 index e8e37631bea..00000000000 --- a/htdocs/comm/facture.php3 +++ /dev/null @@ -1,239 +0,0 @@ - - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ - * - */ - -require("./pre.inc.php3"); - -llxHeader(); - - -if ($action == 'add') { - $datefacture = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear)); - - $sql = "INSERT INTO llx_facture (facnumber, fk_soc, datec, datef, note, amount, remise, tva, total, author) "; - $sql .= " VALUES ('$facnumber', $socid, now(), $datefacture,'$note', $amount, $remise, $tva, $total, '$author');"; - $result = $db->query($sql); - - if ($result) { - $sql = "SELECT rowid, facnumber FROM llx_facture WHERE facnumber='$facnumber';"; - $result = $db->query($sql); - if ($result) { - $objfac = $db->fetch_object( 0); - $facid = $objfac->rowid; - $facnumber = $objfac->facnumber; - $action = ''; - - $sql = "INSERT INTO llx_fa_pr (fk_facture,fk_propal) VALUES ($facid, $propalid);"; - $result = $db->query($sql); - - - /* - * - * Génération du PDF - * - */ - - print "
Génération du PDF

"; - - $command = "export DBI_DSN=\"".$GLOBALS["DBI"]."\" "; - $command .= " ; ../../scripts/facture-tex.pl --facture=$facid --pdf --gljroot=" . $GLOBALS["GLJ_ROOT"] ; - - $output = system($command); - print "

command : $command
"; - - } - } else { - print "

Erreur : la facture n'a pas été créée, vérifier le numéro !"; - print "

Retour à la propal"; - } - -} elseif ($action == 'create') { - - $sql = "SELECT s.nom, s.prefix_comm, s.idp, p.price, p.remise, p.tva, p.total, p.ref, ".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst"; - $sql .= " FROM llx_societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id"; - - $sql .= " AND p.rowid = $propalid"; - - if ( $db->query($sql) ) { - $num = $db->num_rows(); - if ($num) { - $obj = $db->fetch_object( 0); - - $numfa = "F-" . $obj->prefix_comm . "-" . strftime("%y%m%d", time()); - - print "Emettre une facture

"; - print "

"; - print "price - $obj->remise)."\">"; - print "total\">"; - print ""; - print ""; - print ""; - - - print ""; - print ""; - print ""; - print ""; - - print "remise\">"; - print "tva\">"; - - print ""; - print ""; - print "idp\">"; - - $strmonth[1] = "Janvier"; $strmonth[2] = "Février"; $strmonth[3] = "Mars"; $strmonth[4] = "Avril"; - $strmonth[5] = "Mai"; $strmonth[6] = "Juin"; $strmonth[7] = "Juillet"; $strmonth[8] = "Août"; - $strmonth[9] = "Septembre"; $strmonth[10] = "Octobre"; - $strmonth[11] = "Novembre"; $strmonth[12] = "Décembre"; - - print ""; - $author = $GLOBALS["REMOTE_USER"]; - print ""; - - print ""; - print ""; - print ""; - print ""; - print "
Société :$obj->nomCommentaires :
"; - print "
Propal :$obj->ref
Montant HT :".price($obj->price - $obj->remise)."
TVA :".price($obj->tva)."
Total TTC :".price($obj->total)."
Date :"; - $cday = date("d", time()); - print ""; - $cmonth = date("n", time()); - print ""; - - print "
Auteur :$author
Numéro :
"; - - } - } else { - print $db->error(); - } - - - print "

"; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - - $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid "; - $sql .= " FROM llx_societe as s,llx_facture as f WHERE f.fk_soc = s.idp ORDER BY f.datec DESC "; - - if ( $db->query($sql) ) { - $num = $db->num_rows(); - if ($num > 0) { - $i = 0; $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - 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; - print "\n"; - print "\n"; - $i++; - } - print ""; - print ""; - } - $db->free(); - } else { - print ""; - } - print "
SocieteNumDateMontantPayé
idp\">$objp->nomfacid\">$objp->facnumber"; - print strftime("%d %B %Y",$objp->df)."!!!".price($objp->amount)."".$yn[$objp->paye]."
$i facturesTotal : ".francs($total)." FFTotal : ".price($total)."$_MONNAIES HT
".$db->error()."
"; -} - - - - - - - - - - - - -if ($facid) { - - $sql = "SELECT s.nom,s.idp, f.amount, f.facnumber, f.rowid"; - $sql .= " FROM llx_societe as s, llx_facture as f WHERE f.fk_soc = s.idp"; - $sql .= " AND f.rowid = $facid"; - - $result = $db->query($sql); - if ($result) { - $num = $db->num_rows(); - if ($num) { - $obj = $db->fetch_object( 0); - print "Facture

"; - print ""; - print ""; - print ""; - print ""; - print "
Numero :rowid\">$obj->facnumber
Société :$obj->nom
Montant :$obj->amount
"; - } - } -} - - -$db->close(); - -llxFooter(); -?> diff --git a/htdocs/compta/fac.php3 b/htdocs/compta/fac.php3 deleted file mode 100644 index bdc38cdbac9..00000000000 --- a/htdocs/compta/fac.php3 +++ /dev/null @@ -1,135 +0,0 @@ - - * $Id$ - * $Source$ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ -require("./pre.inc.php3"); -require("../lib/functions.inc.php3"); -llxHeader(); -print "Factures"; - -$bc[0]="bgcolor=\"#90c090\""; -$bc[1]="bgcolor=\"#b0e0b0\""; - - -if ($sortfield == "") { - $sortfield="lower(p.label)"; -} -if ($sortorder == "") { - $sortorder="ASC"; -} - -$yn["t"] = "oui"; -$yn["f"] = "non"; - -if ($page == -1) { $page = 0 ; } -$limit = 26; -$offset = $limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - -print "

"; - -$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, f.tva, f.remise, f.total "; -$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp"; - -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.datef DESC "; - -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows(); - if ($num > 0) { - $i = 0; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - - print ""; - - print "\n"; - print "\n"; - - if ($objp->df > 0 ) { - print ""; - } else { - print "\n"; - } - - print "\n"; - print "\n"; - print "\n"; - print "\n"; - - - $total = $total + $objp->amount; - $subtotal = $subtotal + $objp->amount; - - print "\n"; - print "\n"; - $i++; - $j++; - - } - } - if ($i == 0) { $i=1; } if ($j == 0) { $j=1; } - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - - print "
NuméroSocieteDateMontantRemiseTVA
facid\">$objp->facnumberidp\">$objp->nom"; - $y = strftime("%Y",$objp->df); - $m = strftime("%m",$objp->df); - - print strftime("%d/%b/%Y",$objp->df)."!!!".price($objp->amount)."".price($objp->remise)."".price($objp->tva)."".price($objp->total)."".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(); -} - -$db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); -?>