323 |
|
|
324 |
// Selectionne les lignes contrats liées à un produit |
// Selectionne les lignes contrats liées à un produit |
325 |
$sql = "SELECT p.rowid, p.label, p.description as product_desc, p.ref,"; |
$sql = "SELECT p.rowid, p.label, p.description as product_desc, p.ref,"; |
326 |
$sql.= " d.description, d.price_ht, d.tva_tx, d.qty, d.remise_percent, d.subprice,"; |
$sql.= " d.description, d.statut, d.price_ht, d.tva_tx, d.qty, d.remise_percent, d.subprice,"; |
327 |
$sql.= " d.date_ouverture_prevue, d.date_ouverture,"; |
$sql.= " d.date_ouverture_prevue, d.date_ouverture,"; |
328 |
$sql.= " d.date_fin_validite, d.date_cloture"; |
$sql.= " d.date_fin_validite, d.date_cloture"; |
329 |
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d, ".MAIN_DB_PREFIX."product as p"; |
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d, ".MAIN_DB_PREFIX."product as p"; |
349 |
$ligne->ref = $objp->ref; |
$ligne->ref = $objp->ref; |
350 |
$ligne->tva_tx = $objp->tva_tx; |
$ligne->tva_tx = $objp->tva_tx; |
351 |
$ligne->subprice = $objp->subprice; |
$ligne->subprice = $objp->subprice; |
352 |
|
$ligne->statut = $objp->statut; |
353 |
$ligne->remise_percent = $objp->remise_percent; |
$ligne->remise_percent = $objp->remise_percent; |
354 |
$ligne->price = $objp->price; |
$ligne->price = $objp->price; |
355 |
$ligne->product_id = $objp->rowid; |
$ligne->product_id = $objp->rowid; |
373 |
} |
} |
374 |
|
|
375 |
// Selectionne les lignes contrat liées à aucun produit |
// Selectionne les lignes contrat liées à aucun produit |
376 |
$sql = "SELECT d.qty, d.description, d.price_ht, d.subprice, d.tva_tx, d.rowid, d.remise_percent,"; |
$sql = "SELECT d.rowid, d.statut, d.qty, d.description, d.price_ht, d.subprice, d.tva_tx, d.rowid, d.remise_percent,"; |
377 |
$sql.= " d.date_ouverture_prevue, d.date_ouverture,"; |
$sql.= " d.date_ouverture_prevue, d.date_ouverture,"; |
378 |
$sql.= " d.date_fin_validite, d.date_cloture"; |
$sql.= " d.date_fin_validite, d.date_cloture"; |
379 |
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d"; |
$sql.= " FROM ".MAIN_DB_PREFIX."contratdet as d"; |
390 |
{ |
{ |
391 |
$objp = $this->db->fetch_object($result); |
$objp = $this->db->fetch_object($result); |
392 |
$ligne = new ContratLigne(); |
$ligne = new ContratLigne(); |
393 |
|
$ligne->id = $objp->rowid; |
394 |
$ligne->libelle = stripslashes($objp->description); |
$ligne->libelle = stripslashes($objp->description); |
395 |
$ligne->desc = stripslashes($objp->description); |
$ligne->desc = stripslashes($objp->description); |
396 |
$ligne->qty = $objp->qty; |
$ligne->qty = $objp->qty; |
397 |
|
$ligne->statut = $objp->statut; |
398 |
$ligne->ref = $objp->ref; |
$ligne->ref = $objp->ref; |
399 |
$ligne->tva_tx = $objp->tva_tx; |
$ligne->tva_tx = $objp->tva_tx; |
400 |
$ligne->subprice = $objp->subprice; |
$ligne->subprice = $objp->subprice; |
1216 |
var $remise_percent; |
var $remise_percent; |
1217 |
var $price; |
var $price; |
1218 |
var $product_id; |
var $product_id; |
1219 |
|
|
1220 |
|
var $statut; |
1221 |
var $date_debut_prevue; |
var $date_debut_prevue; |
1222 |
var $date_debut_reel; |
var $date_debut_reel; |
1223 |
var $date_fin_prevue; |
var $date_fin_prevue; |
1226 |
function ContratLigne() |
function ContratLigne() |
1227 |
{ |
{ |
1228 |
} |
} |
1229 |
|
|
1230 |
|
function is_activated() |
1231 |
|
{ |
1232 |
|
return $this->statut == 4 ; |
1233 |
|
} |
1234 |
} |
} |
1235 |
|
|
1236 |
|
|