43 public $picto =
'generic';
84 public $labelStatus = array();
86 const STATUS_DRAFT = 0;
87 const STATUS_NOT_USED = 1;
88 const STATUS_CREDITED = 2;
89 const STATUS_DEBITED = 2;
90 const STATUS_REJECTED = 3;
106 $langs->load(
"withdrawals");
107 $this->labelStatus[0] = $langs->trans(
"StatusWaiting");
108 $this->labelStatus[2] = $langs->trans(
"StatusPaid");
109 $this->labelStatus[3] = $langs->trans(
"StatusRefused");
124 $sql =
"SELECT pl.rowid, pl.amount, p.ref, p.rowid as bon_rowid";
125 $sql .=
", pl.statut as status, pl.fk_soc";
126 $sql .=
" FROM ".MAIN_DB_PREFIX.
"prelevement_lignes as pl";
127 $sql .=
", ".MAIN_DB_PREFIX.
"prelevement_bons as p";
128 $sql .=
" WHERE pl.rowid=".((int) $rowid);
129 $sql .=
" AND p.rowid = pl.fk_prelevement_bons";
130 $sql .=
" AND p.entity = ".((int)
$conf->entity);
132 $resql = $this->db->query($sql);
134 if ($this->db->num_rows($resql)) {
135 $obj = $this->db->fetch_object($resql);
137 $this->
id = $obj->rowid;
138 $this->
amount = $obj->amount;
139 $this->socid = $obj->fk_soc;
140 $this->statut = $obj->status;
141 $this->
status = $obj->status;
142 $this->bon_ref = $obj->ref;
143 $this->bon_rowid = $obj->bon_rowid;
146 dol_syslog(
"LignePrelevement::Fetch rowid=$rowid numrows=0");
149 $this->db->free($resql);
152 dol_syslog(
"LignePrelevement::Fetch rowid=$rowid");
167 return $this->
LibStatut(isset($this->statut) ? $this->statut : $this->status, $mode);
184 return $langs->trans($this->labelStatus[$status]);
185 } elseif ($mode == 1) {
187 return img_picto($langs->trans($this->labelStatus[$status]),
'statut1',
'class="valignmiddle"').
' '.$langs->transnoentitiesnoconv($this->labelStatus[$status]);
188 } elseif ($status == 2) {
189 return img_picto($langs->trans($this->labelStatus[$status]),
'statut6',
'class="valignmiddle"').
' '.$langs->transnoentitiesnoconv($this->labelStatus[$status]);
190 } elseif ($status == 3) {
191 return img_picto($langs->trans($this->labelStatus[$status]),
'statut8',
'class="valignmiddle"').
' '.$langs->transnoentitiesnoconv($this->labelStatus[$status]);
193 } elseif ($mode == 2) {
195 return img_picto($langs->trans($this->labelStatus[$status]),
'statut1',
'class="valignmiddle"');
196 } elseif ($status == 2) {
197 return img_picto($langs->trans($this->labelStatus[$status]),
'statut6',
'class="valignmiddle"');
198 } elseif ($status == 3) {
199 return img_picto($langs->trans($this->labelStatus[$status]),
'statut8',
'class="valignmiddle"');
201 } elseif ($mode == 3) {
203 return $langs->trans($this->labelStatus[$status]).
' '.
img_picto($langs->transnoentitiesnoconv($this->labelStatus[$status]),
'statut1',
'class="valignmiddle"');
204 } elseif ($status == 2) {
205 return $langs->trans($this->labelStatus[$status]).
' '.
img_picto($langs->transnoentitiesnoconv($this->labelStatus[$status]),
'statut6',
'class="valignmiddle"');
206 } elseif ($status == 3) {
207 return $langs->trans($this->labelStatus[$status]).
' '.
img_picto($langs->transnoentitiesnoconv($this->labelStatus[$status]),
'statut8',
'class="valignmiddle"');
225 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
227 $return =
'<div class="box-flex-item box-flex-grow-zero">';
228 $return .=
'<div class="info-box info-box-sm">';
229 $return .=
'<span class="info-box-icon bg-infobox-action">';
231 $return .=
'</span>';
232 $return .=
'<div class="info-box-content">';
233 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . $this->
id .
'</span>';
234 if ($selected >= 0) {
235 $return .=
'<input id="cb' . $this->
id .
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->
id .
'"' . ($selected ?
' checked="checked"' :
'') .
'>';
248 if (isset($this->
amount)) {
249 $return .=
'<br><span class="opacitymedium">' . $langs->trans(
"Amount") .
'</span> : <span class="amount">' .
price($this->
amount) .
'</span>';
251 $return .=
'<br><div class="info-box-status">' . $this->
getLibStatut(3) .
'</div>';
static commonReplaceThirdparty(DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
Function used to replace a thirdparty id with another one.
Class to manage Dolibarr database access.
Class to manage withdrawals.
static replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id)
Function used to replace a thirdparty id with another one.
fetch($rowid)
Recupere l'objet prelevement.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
LibStatut($status, $mode=0)
Return status label for a status.
getLibStatut($mode=0)
Return status label of object.
__construct($db)
Constructor.
print $langs trans("Ref").' m titre as m m statut as status
Or an array listing all the potential status of the object: array: int of the status => translated la...
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as p p num_paiement as f pf amount as amount