This commit is contained in:
Rodolphe Quiedeville 2006-12-15 21:57:19 +00:00
parent efe7375759
commit 6377771ce7
2 changed files with 9 additions and 4 deletions

View File

@ -435,8 +435,12 @@ class ProductLivre extends Product
$sql.= ' p.duration, p.envente as statut, p.stock_loc'; $sql.= ' p.duration, p.envente as statut, p.stock_loc';
$sql.= ',pl.pages'; $sql.= ',pl.pages';
$sql.= ',SUM(fd.qty) as ventes'; $sql.= ',SUM(fd.qty) as ventes';
$sql.= ' FROM '.MAIN_DB_PREFIX.'product_cnv_livre as pl,'.MAIN_DB_PREFIX.'product as p'; $sql.= ",sc.reel as casier, se.reel as entrepot";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_product = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'facturedet as fd ON fd.fk_product = p.rowid';
$sql.= ','.MAIN_DB_PREFIX.'product_cnv_livre as pl';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as sc ON sc.fk_product = pl.rowid AND sc.fk_entrepot = 1';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as se ON se.fk_product = pl.rowid AND se.fk_entrepot = 2';
$sql .= " WHERE p.rowid=pl.rowid "; $sql .= " WHERE p.rowid=pl.rowid ";
if ($sall) if ($sall)
@ -479,8 +483,8 @@ class ProductLivre extends Product
$datas["id"] = $obj->rowid; $datas["id"] = $obj->rowid;
$datas["ref"] = $obj->ref; $datas["ref"] = $obj->ref;
$datas["titre"] = $obj->label; $datas["titre"] = $obj->label;
$datas["casier"] = 0; $datas["casier"] = $obj->casier;
$datas["entrepot"] = 0; $datas["entrepot"] = $obj->entrepot;
$datas["ventes"] = $obj->ventes; $datas["ventes"] = $obj->ventes;
$datas["stock"] = 0; $datas["stock"] = 0;
$datas["stock_loc"] = stripslashes($obj->stock_loc); $datas["stock_loc"] = stripslashes($obj->stock_loc);

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006 Auguria SARL <info@auguria.org>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -154,7 +155,7 @@ class ProductLivreContrat extends Product
{ {
dolibarr_syslog("ProductLivreContrat::UpdateCanvas"); dolibarr_syslog("ProductLivreContrat::UpdateCanvas");
$taux = str_replace(',','.',abs(trim($datas["contrat_taux"]))); $taux = ereg_replace(',','.',abs(trim($datas["contrat_taux"])));
$quant = trim($datas["contrat_quant"]); $quant = trim($datas["contrat_quant"]);
$duree = trim($datas["contrat_duree"]); $duree = trim($datas["contrat_duree"]);