Fix: Specimen
This commit is contained in:
parent
0dd736e74b
commit
a9d61ae84c
@ -758,57 +758,30 @@ class Fichinter extends CommonObject
|
|||||||
{
|
{
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
// Charge tableau des produits prodids
|
$now=dol_now();
|
||||||
$prodids = array();
|
|
||||||
$sql = "SELECT rowid";
|
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
|
||||||
$sql.= " WHERE entity = ".$conf->entity;
|
|
||||||
$sql.= " AND tosell = 1";
|
|
||||||
$resql = $this->db->query($sql);
|
|
||||||
if ($resql)
|
|
||||||
{
|
|
||||||
$num_prods = $this->db->num_rows($resql);
|
|
||||||
$i = 0;
|
|
||||||
while ($i < $num_prods)
|
|
||||||
{
|
|
||||||
$i++;
|
|
||||||
$row = $this->db->fetch_row($resql);
|
|
||||||
$prodids[$i] = $row[0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else dol_print_error($this->db);
|
|
||||||
|
|
||||||
// Initialise parametres
|
// Initialise parametres
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
$this->ref = 'SPECIMEN';
|
$this->ref = 'SPECIMEN';
|
||||||
$this->specimen=1;
|
$this->specimen=1;
|
||||||
$this->socid = 1;
|
$this->socid = 1;
|
||||||
$this->date = time();
|
$this->date = $now;
|
||||||
$this->date_lim_reglement=$this->date+3600*24*30;
|
|
||||||
$this->cond_reglement_code = 'RECEP';
|
|
||||||
$this->mode_reglement_code = 'CHQ';
|
|
||||||
$this->note_public='SPECIMEN';
|
$this->note_public='SPECIMEN';
|
||||||
|
$this->duree = 0;
|
||||||
$nbp = 5;
|
$nbp = 5;
|
||||||
$xnbp = 0;
|
$xnbp = 0;
|
||||||
while ($xnbp < $nbp)
|
while ($xnbp < $nbp)
|
||||||
{
|
{
|
||||||
$line=new FichinterLigne($this->db);
|
$line=new FichinterLigne($this->db);
|
||||||
$line->desc=$langs->trans("Description")." ".$xnbp;
|
$line->desc=$langs->trans("Description")." ".$xnbp;
|
||||||
$line->qty=1;
|
$line->datei=($now-3600*(1+$xnbp));
|
||||||
$line->subprice=100;
|
$line->duration=600;
|
||||||
$line->price=100;
|
$line->fk_fichinter=0;
|
||||||
$line->tva_tx=19.6;
|
|
||||||
$prodid = rand(1, $num_prods);
|
|
||||||
$line->fk_product=$prodids[$prodid];
|
|
||||||
|
|
||||||
$this->lines[$xnbp]=$line;
|
$this->lines[$xnbp]=$line;
|
||||||
$xnbp++;
|
$xnbp++;
|
||||||
}
|
|
||||||
|
|
||||||
$this->amount_ht = $xnbp*100;
|
$this->duree+=$line->duration;
|
||||||
$this->total_ht = $xnbp*100;
|
}
|
||||||
$this->total_tva = $xnbp*19.6;
|
|
||||||
$this->total_ttc = $xnbp*119.6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user