';
*/
if ($conf->facture->enabled)
{
- print ' ";
+ print ' ";
}
diff --git a/htdocs/compta/ventilation/fiche.php b/htdocs/compta/ventilation/fiche.php
index 1e5b4bb9bef..b855b7e83f6 100644
--- a/htdocs/compta/ventilation/fiche.php
+++ b/htdocs/compta/ventilation/fiche.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2005 Laurent Destailleur
+/* Copyright (C) 2004 Rodolphe Quiedeville
+ * Copyright (C) 2005-2006 Laurent Destailleur
*
* 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
@@ -28,14 +28,19 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
$langs->load("bills");
-
$mesg = '';
if (!$user->rights->compta->ventilation->creer) accessforbidden();
+
+/*
+ * Actions
+ */
+
if ($_POST["action"] == 'ventil' && $user->rights->compta->ventilation->creer)
{
$sql = " UPDATE ".MAIN_DB_PREFIX."facturedet";
@@ -79,6 +84,7 @@ if ($result)
*
*/
$form = new Form($db);
+$facture_static=new Facture($db);
if($_GET["id"])
{
@@ -110,14 +116,19 @@ if($_GET["id"])
}
- print_titre("Ventilation");
+ print_fiche_titre("Ventilation");
print '';
- print '| '.$langs->trans("Bill").' | ';
- print ''.$objp->facnumber.' | ';
+
+ // Ref facture
+ print '| '.$langs->trans("Invoice").' | ';
+ $facture_static->ref=$objp->facnumber;
+ $facture_static->id=$objp->facid;
+ print ''.$facture_static->getNomUrl(1).' | ';
+ print ' ';
print '| Ligne | ';
- print ''.stripslashes(nl2br($objp->description)).' | ';
+ print ''.nl2br($objp->description).' | ';
print '| Ventiler dans le compte : | ';
if($objp->fk_code_ventilation == 0)
diff --git a/htdocs/compta/ventilation/index.php b/htdocs/compta/ventilation/index.php
index ddf829c0086..ac77370249f 100644
--- a/htdocs/compta/ventilation/index.php
+++ b/htdocs/compta/ventilation/index.php
@@ -29,6 +29,8 @@
require("./pre.inc.php");
+$langs->load("compta");
+
llxHeader('','Compta - Ventilation');
@@ -66,18 +68,18 @@ if ($result)
$var=true;
print '';
-print '| Lignes a ventiler | ';
-print '| Type | Nb | ';
+print '| '.$langs->trans("Lines").' | ';
+print '| '.$langs->trans("Type").' | '.$langs->trans("Nb").' | ';
$var=!$var;
-print "".'| Factures | '.$nbfac.' | ';
+print "".'| '.$langs->trans("Invoices").' | '.$nbfac.' | ';
$var=!$var;
-print "".'| Paiements | '.$nbp.' | ';
+print "".'| '.$langs->trans("Payments").' | '.$nbp.' | ';
print " \n";
print ' | ';
print '';
-print '| Type | Nb de lignes | Numero | ID | ';
+print '| Type | '.$langs->trans("NbOfLines").' | '.$langs->trans("AccountNumber").' | '.$langs->trans("TransID").' | ';
$sql = "SELECT count(*), ccg.intitule, ccg.rowid,ccg.numero FROM ".MAIN_DB_PREFIX."facturedet as fd";
$sql.= " ,".MAIN_DB_PREFIX."compta_compte_generaux as ccg";
diff --git a/htdocs/compta/ventilation/lignes.php b/htdocs/compta/ventilation/lignes.php
index ff78392a98d..ff4e962f97c 100644
--- a/htdocs/compta/ventilation/lignes.php
+++ b/htdocs/compta/ventilation/lignes.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2006 Laurent Destailleur
*
* 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
@@ -20,48 +21,51 @@
*/
/**
- \file htdocs/compta/ventilation/lignes.php
- \ingroup facture
- \brief Page de detail des lignes de ventilation d'une facture
- \version $Revision$
+ \file htdocs/compta/ventilation/lignes.php
+ \ingroup facture
+ \brief Page de detail des lignes de ventilation d'une facture
+ \version $Revision$
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT."/facture.class.php");
+require_once(DOL_DOCUMENT_ROOT."/product.class.php");
+
+$langs->load("bills");
+$langs->load("compta");
$user->getrights('facture');
$user->getrights('banque');
-$langs->load("bills");
if (!$user->rights->facture->lire) accessforbidden();
if (!$user->rights->compta->ventilation->creer) accessforbidden();
-/*
- * Sécurité accés client
- */
+
+// Sécurité accés client
if ($user->societe_id > 0) accessforbidden();
+
llxHeader('');
/*
- * Lignes de factures
- *
- */
+* Lignes de factures
+*
+*/
$page = $_GET["page"];
if ($page < 0) $page = 0;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
-$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.fk_code_ventilation, c.intitule, c.numero";
-$sql .= ",p.rowid as product_id, p.ref as product_ref, p.label as product_label";
-$sql .= " FROM (".MAIN_DB_PREFIX."facturedet as l";
-$sql .= " , ".MAIN_DB_PREFIX."facture as f";
-$sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c)";
-$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product)";
-$sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
-$sql .= " AND c.rowid = l.fk_code_ventilation";
-
+$sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.fk_code_ventilation, c.intitule, c.numero,";
+$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type";
+$sql.= " FROM (".MAIN_DB_PREFIX."facturedet as l";
+$sql.= " , ".MAIN_DB_PREFIX."facture as f";
+$sql.= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c)";
+$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON (p.rowid = l.fk_product)";
+$sql.= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
+$sql.= " AND c.rowid = l.fk_code_ventilation";
if (strlen(trim($_GET["search_facture"])))
{
- $sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'";
+ $sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'";
}
$sql .= " ORDER BY l.rowid DESC";
@@ -71,54 +75,69 @@ $result = $db->query($sql);
if ($result)
{
- $num_lignes = $db->num_rows($result);
- $i = 0;
-
- print_barre_liste("Lignes de facture ventilées",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes);
+ $num_lignes = $db->num_rows($result);
+ $i = 0;
- print ' | |