84 $sql =
"SELECT pl.rowid, pl.amount, p.ref, p.rowid as bon_rowid";
85 $sql .=
", pl.statut, pl.fk_soc";
86 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
87 $sql .=
", ".MAIN_DB_PREFIX.
"prelevement_bons as p";
88 $sql .=
" WHERE pl.rowid=".((int) $rowid);
89 $sql .=
" AND p.rowid = pl.fk_prelevement_bons";
90 $sql .=
" AND p.entity = ".$conf->entity;
92 $resql = $this->db->query($sql);
94 if ($this->db->num_rows($resql)) {
95 $obj = $this->db->fetch_object($resql);
97 $this->
id = $obj->rowid;
98 $this->amount = $obj->amount;
99 $this->socid = $obj->fk_soc;
100 $this->
statut = $obj->statut;
101 $this->bon_ref = $obj->ref;
102 $this->bon_rowid = $obj->bon_rowid;
105 dol_syslog(
"LignePrelevement::Fetch rowid=$rowid numrows=0");
108 $this->db->free($resql);
111 dol_syslog(
"LignePrelevement::Fetch rowid=$rowid");
143 return $langs->trans($this->statuts[$status]);
144 } elseif ($mode == 1) {
146 return img_picto($langs->trans($this->statuts[$status]),
'statut1',
'class="valignmiddle"').
' '.$langs->transnoentitiesnoconv($this->statuts[$status]);
147 } elseif ($status == 2) {
148 return img_picto($langs->trans($this->statuts[$status]),
'statut6',
'class="valignmiddle"').
' '.$langs->transnoentitiesnoconv($this->statuts[$status]);
149 } elseif ($status == 3) {
150 return img_picto($langs->trans($this->statuts[$status]),
'statut8',
'class="valignmiddle"').
' '.$langs->transnoentitiesnoconv($this->statuts[$status]);
152 } elseif ($mode == 2) {
154 return img_picto($langs->trans($this->statuts[$status]),
'statut1',
'class="valignmiddle"');
155 } elseif ($status == 2) {
156 return img_picto($langs->trans($this->statuts[$status]),
'statut6',
'class="valignmiddle"');
157 } elseif ($status == 3) {
158 return img_picto($langs->trans($this->statuts[$status]),
'statut8',
'class="valignmiddle"');
160 } elseif ($mode == 3) {
162 return $langs->trans($this->statuts[$status]).
' '.
img_picto($langs->transnoentitiesnoconv($this->statuts[$status]),
'statut1',
'class="valignmiddle"');
163 } elseif ($status == 2) {
164 return $langs->trans($this->statuts[$status]).
' '.
img_picto($langs->transnoentitiesnoconv($this->statuts[$status]),
'statut6',
'class="valignmiddle"');
165 } elseif ($status == 3) {
166 return $langs->trans($this->statuts[$status]).
' '.
img_picto($langs->transnoentitiesnoconv($this->statuts[$status]),
'statut8',
'class="valignmiddle"');