gestion des differents modeles pdf

This commit is contained in:
Rodolphe Quiedeville 2003-07-07 16:28:55 +00:00
parent 2fc8f8243e
commit f98db0fc50
3 changed files with 37 additions and 31 deletions

View File

@ -21,7 +21,7 @@
*/
require("./pre.inc.php3");
require("./propal.class.php3");
require("./propal_model_pdf.class.php3");
$db = new Db();
@ -75,14 +75,16 @@ if ($action == 'create')
print '<tr><td>Société</td><td><a href="fiche.php3?socid='.$socidp.'">'.$objsoc->nom.'</a></td>';
print '<td rowspan="6" valign="top">';
print "Commentaires :<br>";
print '<textarea name="note" wrap="soft" cols="30" rows="10"></textarea>';
print '<td valign="top" colspan="2">';
print "Commentaires</td></tr>";
print "<tr><td>Date</td><td>";
print_date_select();
print "</td></tr>";
print "</td>";
print '<td rowspan="4" colspan="2" valign="top">';
print '<textarea name="note" wrap="soft" cols="30" rows="10"></textarea>';
print '<tr><td>Auteur</td><td>'.$user->fullname.'</td></tr>';
print "<tr><td>Num</td><td><input name=\"ref\" value=\"$numpr\"></td></tr>\n";
/*
@ -154,9 +156,13 @@ if ($action == 'create')
print 'Cette societe n\'a pas de projet.<br>';
print '<a href=projet/fiche.php3?socidp='.$socidp.'&action=create>Créer un projet</a>';
}
print '</td></tr>';
print "</table>";
print '</td>';
print '<td>Modèle</td>';
print '<td>';
$html = new Form($db);
$modelpdf = new Propal_Model_pdf($db);
$html->select_array("modelpdf",$modelpdf->liste_array(),PROPALE_ADDON_PDF);
print "</td></tr></table>";
/*
*
@ -187,19 +193,13 @@ if ($action == 'create')
print_titre("Services/Produits");
print "<table border=1 cellspacing=0>";
print '<table border="1" cellspacing="0">';
print "<tr><td><select name=\"idprod1\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty1\" value=\"1\"></td></tr>\n";
print "<tr><td><select name=\"idprod2\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty2\" value=\"1\"></td></tr>\n";
print "<tr><td><select name=\"idprod3\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty3\" value=\"1\"></td></tr>\n";
print "<tr><td><select name=\"idprod4\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty4\" value=\"1\"></td></tr>\n";
for ($i = 1 ; $i < 5 ; $i++)
{
print '<tr><td><select name="idprod'.$i.'">'.$opt.'</select></td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td></tr>';
}
print "<tr><td align=\"right\" colspan=\"2\">Remise : <input size=\"6\" name=\"remise\" value=\"0\"></td></tr>\n";

View File

@ -54,14 +54,17 @@ if ($action == 'add')
{
$propal = new Propal($db, $socidp);
$propal->remise = $remise;
$propal->datep = $db->idate(mktime(12, 1 , 1, $remonth, $reday, $reyear));
$propal->contactid = $contactidp;
$propal->projetidp = $projetidp;
$propal->remise = $HTTP_POST_VARS["remise"];
$propal->datep = $db->idate(mktime(12, 1 , 1,
$HTTP_POST_VARS["remonth"],
$HTTP_POST_VARS["reday"],
$HTTP_POST_VARS["reyear"]));
$propal->contactid = $HTTP_POST_VARS["contactidp"];
$propal->projetidp = $HTTP_POST_VARS["projetidp"];
$propal->modelpdf = $HTTP_POST_VARS["modelpdf"];
$propal->author = $user->id;
$propal->note = $note;
$propal->note = $HTTP_POST_VARS["note"];
$propal->ref = $ref;
@ -88,7 +91,9 @@ if ($action == 'add')
if ($action == 'pdf')
{
propale_pdf_create($db, $propalid);
$propal = new Propal($db);
$propal->fetch($propalid);
propale_pdf_create($db, $propalid, $propal->modelpdf);
}
if ($action == 'setstatut')

View File

@ -132,8 +132,8 @@ class Propal
/*
* Insertion dans la base
*/
$sql = "INSERT INTO llx_propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note) ";
$sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0, $this->datep, now(), '$this->ref', $this->author, '$this->note')";
$sql = "INSERT INTO llx_propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note, model_pdf) ";
$sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0, $this->datep, now(), '$this->ref', $this->author, '$this->note','$this->modelpdf')";
$sqlok = 0;
if ( $this->db->query($sql) )
@ -256,7 +256,7 @@ class Propal
Function fetch($rowid)
{
$sql = "SELECT ref,total,price,remise,tva,fk_soc,".$this->db->pdate(datep)."as dp ";
$sql = "SELECT ref,total,price,remise,tva,fk_soc,".$this->db->pdate(datep)."as dp, model_pdf ";
$sql .= " FROM llx_propal WHERE rowid=$rowid;";
if ($this->db->query($sql) )
@ -275,7 +275,8 @@ class Propal
$this->total_ht = $obj->price;
$this->total_tva = $obj->tva;
$this->total_ttc = $obj->total;
$this->socidp = $obj->fk_soc;
$this->socidp = $obj->fk_soc;
$this->modelpdf = $obj->model_pdf;
$this->lignes = array();
$this->db->free();