prix de reliure

This commit is contained in:
Rodolphe Quiedeville 2007-03-19 15:22:59 +00:00
parent d772522e09
commit 82e54d1989
5 changed files with 49 additions and 33 deletions

View File

@ -84,7 +84,12 @@
</tr>
<tr>
<td>Prix de revient</td>
<td colspan="3">{$prod_pxrevient}</td>
<td>{$prod_pxrevient}</td>
<td>Prix reliure</td>
<td>
<input name="px_reliure" type="text" size="7" maxlength="6" value="{$prod_pxreliure}"
class="normal" onfocus="this.className='focus';" onblur="this.className='normal';">
</td>
</tr>
</table>

View File

@ -44,12 +44,15 @@
<td width="15%">Prix au feuillet</td>
<td width="35%">{$prod_pxfeuil} HT</td>
<td width="15%">Prix couverture</td>
<td width="15%"><a href="fiche.php?id={$livre_couverture_id}">Prix couverture</a></td>
<td width="35%">{$prod_pxcouv} HT</td>
</tr>
<tr>
<td width="15%">Prix de revient</td>
<td colspan="3">{$prod_pxrevient} HT</td>
<td width="35%">{$prod_pxrevient} HT</td>
<td width="15%">Prix reliure</td>
<td width="35%">{$prod_pxreliure} HT</td>
</tr>
<tr>
<td>Prix de vente</td>

View File

@ -2,15 +2,15 @@
<table class="border" width="100%">
<tr>
<td width="15%">Référence</td>
<td width="35%" style="font-weight: bold;">{$prod_ref}</td>
<td width="35%" style="font-weight: bold;">{$livre_ref}</td>
<td width="50%" align="right">
{$fiche_cursor_prev}{$fiche_cursor_next}
&nbsp;
</td>
</tr>
<tr>
<td width="15%">Titre du livre</td>
<td width="85%" colspan="2">{$prod_label}</td>
<td width="15%">Couverture du livre</td>
<td width="85%" colspan="2"><a href="fiche.php?id={$livre_id}">{$livre_label}</a></td>
</tr>
</table>
@ -36,26 +36,4 @@
<br />
<table class="border" width="100%">
<tr>
<td width="50%" valign="top">Description</td>
<td width="50%" valign="top">Photo</td>
</tr>
<tr>
<td width="50%" valign="top">{$prod_description|nl2br}</td>
<td rowspan="3" valign="top"></td>
</tr>
<tr>
<td width="50%" valign="top">Note (non visible sur les factures, propals...)
</tr>
<tr>
<td width="50%" valign="top">{$prod_note|nl2br}</td>
</tr>
</table>
</table>
<!-- END SMARTY TEMPLATE -->

View File

@ -54,6 +54,8 @@ class ProductLivre extends Product
$this->menu_new = 'NewBook';
$this->menu_add = 1;
$this->menu_clear = 1;
$this->no_button_copy = 1;
$this->menus[0][0] = DOL_URL_ROOT."/product/fiche.php?action=create&amp;type=0&amp;canvas=livre";
$this->menus[0][1] = 'NewBook';
@ -399,10 +401,12 @@ class ProductLivre extends Product
$smarty->assign('prod_pxfeuil', $this->px_feuillet);
$smarty->assign('prod_pxcouv', $this->px_couverture);
$smarty->assign('livre_couverture_id', $this->couverture_id);
$smarty->assign('prod_weight', $this->weight);
$smarty->assign('prod_weight_units', $this->weight_units);
$smarty->assign('prod_pxreliure', $this->px_reliure);
$smarty->assign('prod_pxrevient', price($this->px_revient));
$smarty->assign('prod_pxvente', price($this->price_ttc));

View File

@ -51,6 +51,11 @@ class ProductLivreCouverture extends Product
$this->menu_new = '';
$this->menu_add = 0;
$this->menu_clear = 1;
$this->no_button_copy = 1;
$this->no_button_edit = 1;
$this->no_button_delete = 1;
}
/**
* \brief Creation
@ -79,6 +84,25 @@ class ProductLivreCouverture extends Product
function FetchCanvas($id='', $ref='')
{
$result = $this->fetch($id,$ref);
if ($result >= 0)
{
$sql = "SELECT p.rowid,p.ref,p.label";
$sql.= " FROM ".MAIN_DB_PREFIX."product_cnv_livre as pl,".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE pl.rowid=p.rowid AND pl.fk_couverture = '".$id."'";
$result = $this->db->query($sql) ;
if ( $result )
{
$result = $this->db->fetch_array();
$this->livre_id = $result["rowid"];
$this->livre_ref = $result["ref"];
$this->livre_label = stripslashes($result["label"]);
$this->db->free();
}
}
return $result;
}
@ -96,11 +120,13 @@ class ProductLivreCouverture extends Product
* \brief Assigne les valeurs pour les templates Smarty
* \param smarty Instance de smarty
*/
function assign_values(&$smarty)
function assign_smarty_values(&$smarty)
{
$smarty->assign('prod_id', $this->id);
$smarty->assign('prod_ref', $this->ref);
$smarty->assign('prod_label', $this->livre->libelle);
$smarty->assign('livre_id', $this->livre_id);
$smarty->assign('livre_ref', $this->livre_ref);
$smarty->assign('livre_label', $this->livre_label);
$smarty->assign('prod_note', $this->note);
$smarty->assign('prod_description', $this->description);
$smarty->assign('prod_canvas', $this->canvas);