This commit is contained in:
Rodolphe Quiedeville 2004-05-27 10:11:38 +00:00
parent a4be3ac19e
commit e082ccae4c
15 changed files with 97 additions and 72 deletions

View File

@ -139,8 +139,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
$sql .= " GROUP BY date_format(a.datea, '%m/%Y') ";
$sql .= " ORDER BY date_format(a.datea, '%Y %m') DESC";
if ( $db->query($sql) )
{
$num = $db->num_rows();
@ -153,6 +152,9 @@ if ( $db->query($sql) )
print '<td>Date</td>';
print '<td align="center">Nombre</td>';
print '<td>Action</td>';
print '<td align="center">PDF</td>';
print '<td align="center">Date</td>';
print '<td align="center">Taille</td>';
print "</tr>\n";
$var=True;
while ($i < min($num,$limit))

View File

@ -149,22 +149,34 @@ Class CommActionRapport {
{
$num = $this->db->num_rows();
$i = 0;
$y1 = 0;
$y2 = 0;
while ($i < $num)
{
$obj = $this->db->fetch_object($i);
$y = $pdf->GetY();
$pdf->SetFont('Arial','',11);
$pdf->SetXY(10, $y);
$pdf->MultiCell(40, 8, $obj->societe, 0, 'L', 0);
$pdf->SetXY(50,$y);
$pdf->MultiCell(40, 8, $obj->libelle, 0, 'L', 0);
$pdf->SetXY(90,$y);
$pdf->MultiCell(110, 8, $obj->note, 0, 'L', 0);
$y = max($pdf->GetY(), $y1, $y2) + 1;
$pdf->SetFont('Arial','',10);
$pdf->SetXY(5, $y);
$pdf->MultiCell(15, 4, strftime('%d/%b',$obj->da), 0, 'L', 0);
$pdf->SetXY(20, $y);
$pdf->MultiCell(40, 4, $obj->societe, 0, 'L', 0);
$y1 = max($y, $pdf->GetY());
$pdf->SetXY(60,$y);
$pdf->MultiCell(40, 4, $obj->libelle, 0, 'L', 0);
$pdf->SetXY(100,$y);
$pdf->MultiCell(110, 4, $obj->note, 0, 'L', 0);
$y2 = max($y, $pdf->GetY());
$i++;
}
}
$pdf->Rect(10, 10, 190, 277);
$pdf->Rect(5, 5, 200, 287);
return 1;
}

View File

@ -33,13 +33,10 @@ if ($HTTP_POST_VARS["action"] == 'add')
$contact->name = $HTTP_POST_VARS["name"];
$contact->firstname = $HTTP_POST_VARS["firstname"];
$contact->poste = $HTTP_POST_VARS["poste"];
$contact->address = $HTTP_POST_VARS["adresse"];
$contact->cp = $HTTP_POST_VARS["cp"];
$contact->ville = $HTTP_POST_VARS["ville"];
$contact->address = $HTTP_POST_VARS["adresse"];
$contact->cp = $HTTP_POST_VARS["cp"];
$contact->ville = $HTTP_POST_VARS["ville"];
$contact->fax = $HTTP_POST_VARS["fax"];
$contact->note = $HTTP_POST_VARS["note"];
$contact->email = $HTTP_POST_VARS["email"];
@ -189,7 +186,7 @@ elseif ($_GET["action"] == 'edit')
}
print '<tr><td>Nom</td><td><input name="name" type="text" size="20" maxlength="80" value="'.$contact->name.'"></td>';
print '<td>Prenom</td><td><input name="firstname" type="text" size="15" maxlength="80" value="'.$contact->firstname.'"></td>';
print '<td>Prénom</td><td><input name="firstname" type="text" size="15" maxlength="80" value="'.$contact->firstname.'"></td>';
print '<td>Tel Pro</td><td><input name="phone_pro" type="text" size="18" maxlength="80" value="'.$contact->phone_pro.'"></td></tr>';

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify

View File

@ -88,7 +88,18 @@ Class pdf_tourteau {
$curY = $nexY;
$pdf->SetXY (11, $curY );
$pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J');
// if ($fac->lignes[$i]->produit_id)
// {
// $prod = new Product($this->db, $fac->lignes[$i]->produit_id);
// $prod->fetch($fac->lignes[$i]->produit_id);
// $pdf->MultiCell(118, 5, $prod->description, 0, 'J');
// }
//else
// {
$pdf->MultiCell(118, 5, $fac->lignes[$i]->desc, 0, 'J');
// }
$nexY = $pdf->GetY();

View File

@ -21,7 +21,6 @@
* $Source$
*
*/
include("./inc.php");
pHeader("Fichier de configuration","etape1");
@ -181,8 +180,6 @@ $dolibarr_main_db_host = "localhost";
</td>
</tr>
<tr>
<td colspan="3" align="center"><h2>Base de données - Accés super utilisateur</h2></td></tr>

View File

@ -48,6 +48,9 @@ class Product
*/
Function check()
{
$this->ref = ereg_replace("'","",stripslashes($this->ref));
$this->ref = ereg_replace("\"","",stripslashes($this->ref));
$err = 0;
if (strlen(trim($this->ref)) == 0)
$err++;
@ -70,6 +73,8 @@ class Product
*/
Function create($user)
{
$this->ref = ereg_replace("'","",stripslashes($this->ref));
$this->ref = ereg_replace("\"","",stripslashes($this->ref));
$sql = "SELECT count(*)";
$sql .= " FROM ".MAIN_DB_PREFIX."product WHERE ref = '" .trim($this->ref)."'";
@ -123,34 +128,36 @@ class Product
*/
Function update($id, $user)
{
$this->ref = ereg_replace("\"","",stripslashes($this->ref));
$this->ref = ereg_replace("'","",stripslashes($this->ref));
if (strlen(trim($this->libelle)) == 0)
{
$this->libelle = 'LIBELLE MANQUANT';
}
$sql = "UPDATE ".MAIN_DB_PREFIX."product ";
$sql .= " SET label = '" . trim($this->libelle) ."'";
if (strlen(trim($this->ref)))
{
$sql .= ",ref = '" . trim($this->ref) ."'";
}
$sql .= ",tva_tx = " . $this->tva_tx ;
$sql .= ",envente = " . $this->envente ;
$sql .= ",seuil_stock_alerte = " . $this->seuil_stock_alerte ;
$sql .= ",description = '" . trim($this->description) ."'";
$sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'";
$sql .= " WHERE rowid = " . $id;
if ( $this->db->query($sql) )
{
return 1;
}
else
{
print $this->db->error() . ' in ' . $sql;
}
if (strlen(trim($this->libelle)) == 0)
{
$this->libelle = 'LIBELLE MANQUANT';
}
$sql = "UPDATE ".MAIN_DB_PREFIX."product ";
$sql .= " SET label = '" . trim($this->libelle) ."'";
if (strlen(trim($this->ref)))
{
$sql .= ",ref = '" . trim($this->ref) ."'";
}
$sql .= ",tva_tx = " . $this->tva_tx ;
$sql .= ",envente = " . $this->envente ;
$sql .= ",seuil_stock_alerte = " . $this->seuil_stock_alerte ;
$sql .= ",description = '" . trim($this->description) ."'";
$sql .= ",duration = '" . $this->duration_value . $this->duration_unit ."'";
$sql .= " WHERE rowid = " . $id;
if ( $this->db->query($sql) )
{
return 1;
}
else
{
print $this->db->error() . ' in ' . $sql;
}
}
/**
*

View File

@ -148,6 +148,5 @@ class Project {
}
}
}
?>

View File

@ -20,12 +20,10 @@
*
*/
require("./pre.inc.php");
require("./project.class.php");
require("../propal.class.php");
require("../facture.class.php");
require("../commande/commande.class.php");
llxHeader("","../");
$projet = new Project($db);

View File

@ -20,7 +20,6 @@
*
*/
require("./pre.inc.php");
require("./project.class.php");
require("../propal.class.php");
require("../facture.class.php");
require("../commande/commande.class.php");

View File

@ -20,7 +20,6 @@
*
*/
require("./pre.inc.php");
require("./project.class.php");
require("../propal.class.php");
require("../facture.class.php");
require("../commande/commande.class.php");
@ -101,8 +100,8 @@ if ($action == 'create')
$projet = new Project($db);
$projet->fetch($id);
$projet->societe->fetch($projet->societe->id);
$h=0;
$head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
$head[$h][1] = 'Fiche projet';
@ -118,10 +117,6 @@ if ($action == 'create')
dolibarr_fiche_head($head, 0);
$projet->societe->fetch($projet->societe->id);
if ($action == 'edit')
{
print '<form method="post" action="fiche.php?id='.$id.'">';
@ -129,16 +124,16 @@ if ($action == 'create')
print '<table class="border" border="1" cellpadding="4" cellspacing="0">';
print '<tr><td>Société</td><td>'.$projet->societe->nom.'</td></tr>';
print '<tr><td>Ref</td><td><input name="ref" value="'.$projet->ref.'"></td></tr>';
print '<tr><td>Titre</td><td><input name="title" value="'.$projet->title.'"></td></tr>';
print '</table><input type="submit" Value="Enregistrer"></form>';
}
else
{
print '<table class="border" border="1" cellpadding="4" cellspacing="0" width="100%">';
print '<tr><td>Société</td><td><a href="../comm/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>';
print '<tr><td width="20%">Réf</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td></tr>';
print '<tr><td width="20%">Titre</td><td>'.$projet->title.'</td>';
print '<td width="20%">Réf</td><td>'.$projet->ref.'</td></tr>';
print '<tr><td>Société</td><td colspan="3">'.$projet->societe->nom.$projet->societe->id.'</a></td></tr>';
print '</table>';
}

View File

@ -21,6 +21,8 @@
*/
require ("../main.inc.php");
require("./project.class.php");
function llxHeader($head = "", $urlp = "") {
/*

View File

@ -1,5 +1,5 @@
<?PHP
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* 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

View File

@ -20,7 +20,6 @@
*
*/
require("./pre.inc.php");
require("./project.class.php");
require("../propal.class.php");
require("../facture.class.php");
require("../commande/commande.class.php");

View File

@ -307,8 +307,11 @@ class Propal
Function fetch($rowid)
{
$sql = "SELECT ref,total,price,remise,tva,fk_soc,fk_soc_contact,".$this->db->pdate("datep")."as dp,".$this->db->pdate("fin_validite")."as dfv, model_pdf, note, fk_projet, fk_statut, remise_percent";
$sql .= " FROM ".MAIN_DB_PREFIX."propal WHERE rowid=$rowid;";
$sql = "SELECT ref,total,price,remise,tva,fk_soc,fk_soc_contact,".$this->db->pdate("datep")."as dp,".$this->db->pdate("fin_validite")."as dfv, model_pdf, note, fk_projet, fk_statut, remise_percent, fk_user_author";
$sql .= ", c.label as statut_label";
$sql .= " FROM ".MAIN_DB_PREFIX."propal";
$sql .= "," . MAIN_DB_PREFIX."c_propalst as c";
$sql .= " WHERE rowid=$rowid AND fk_statut = c.id";
if ($this->db->query($sql) )
{
@ -335,6 +338,10 @@ class Propal
$this->modelpdf = $obj->model_pdf;
$this->note = $obj->note;
$this->statut = $obj->fk_statut;
$this->statut_libelle = $obj->statut_label;
$this->user_author_id = $obj->fk_user_author;
if ($obj->fk_statut == 0)
{
$this->brouillon = 1;
@ -506,7 +513,7 @@ class Propal
}
}
/**
* Cloture de la propale
* Cloture de la proposition commerciale
*
*/
Function cloture($user, $statut, $note)
@ -540,7 +547,7 @@ class Propal
}
}
/**
*
* Créée une commande à partir de la proposition commerciale
*
*/
Function create_commande($user)