28require_once DOL_DOCUMENT_ROOT .
'/commande/class/commande.class.php';
38 public $module =
'webportal';
54 protected $order_static =
null;
99 public $fields = array(
100 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 10,),
101 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => -2,
'notnull' => 1,
'position' => 20,
'index' => 1,),
102 'ref' => array(
'type' =>
'varchar(30)',
'label' =>
'Ref',
'enabled' => 1,
'visible' => 2,
'notnull' => 1,
'showoncombobox' => 1,
'position' => 25,),
103 'date_commande' => array(
'type' =>
'date',
'label' =>
'Date',
'enabled' => 1,
'visible' => 2,
'position' => 60,),
104 'date_livraison' => array(
'type' =>
'date',
'label' =>
'DateDeliveryPlanned',
'enabled' => 1,
'visible' => 2,
'position' => 70,),
105 'total_ht' => array(
'type' =>
'price',
'label' =>
'TotalHT',
'enabled' => 1,
'visible' => 2,
'position' => 125,
'isameasure' => 1,),
106 'total_tva' => array(
'type' =>
'price',
'label' =>
'VAT',
'enabled' => 1,
'visible' => 2,
'position' => 130,
'isameasure' => 1,),
107 'total_ttc' => array(
'type' =>
'price',
'label' =>
'TotalTTC',
'enabled' => 1,
'visible' => 2,
'position' => 145,
'isameasure' => 1,),
108 'multicurrency_total_ht' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountHT',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 255,
'isameasure' => 1,),
109 'multicurrency_total_tva' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountVAT',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 260,
'isameasure' => 1,),
110 'multicurrency_total_ttc' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountTTC',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 265,
'isameasure' => 1,),
111 'fk_statut' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 2,
'position' => 500,
'notnull' => -5,
'arrayofkeyval' => self::ARRAY_STATUS_LABEL,),
138 if (!$this->order_static) {
139 $this->order_static =
new Commande($this->db);
142 return $this->order_static;
156 $this->isextrafieldmanaged = 0;
169 global $conf, $langs;
174 return [
'optimize' => $langs->trans(
"WebPortalOrder")];
176 $datas[
'picto'] =
img_picto(
'', $this->picto) .
' <u>' . $langs->trans(
"WebPortalOrder") .
'</u>';
177 if (isset($this->
status)) {
180 $datas[
'ref'] .=
'<br><b>' . $langs->trans(
'Ref') .
':</b> ' . $this->ref;
198 public function getNomUrl($withpicto = 0, $option =
'', $max = 0, $short = 0, $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0, $target =
'')
200 global $conf, $langs, $hookmanager;
202 if (!empty($conf->dol_no_mouse_hover)) {
217 'objecttype' => $this->element,
221 $classfortooltip =
'classfortooltip';
224 $classfortooltip =
'classforajaxtooltip';
233 $linkstart =
'<a href="' . $url .
'"';
234 $linkstart .= $linkclose .
'>';
237 if ($option ===
'nolink') {
242 $result .= $linkstart;
244 $result .=
img_object(($notooltip ?
'' : $label), $this->picto, (($withpicto != 2) ?
'class="paddingright"' :
''), 0, 0, $notooltip ? 0 : 1);
246 if ($withpicto != 2) {
247 $result .= $this->ref;
252 $hookmanager->initHooks(array($this->element .
'dao'));
253 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
254 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
256 $result = $hookmanager->resPrint;
258 $result .= $hookmanager->resPrint;
272 global $langs, $conf;
274 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
276 $return =
'<div class="box-flex-item box-flex-grow-zero">';
277 $return .=
'<div class="info-box info-box-sm">';
278 $return .=
'<div class="info-box-icon bg-infobox-action">';
281 $return .=
'<div class="info-box-content">';
282 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . (method_exists($this,
'getNomUrl') ? $this->
getNomUrl() : $this->ref) .
'</span>';
283 $return .=
'<input id="cb' . $this->
id .
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->
id .
'"' . ($selected ?
' checked="checked"' :
'') .
'>';
285 if (property_exists($this,
'thirdparty') && is_object($this->thirdparty)) {
286 $return .=
'<br><div class="info-box-ref tdoverflowmax150">' . $this->thirdparty->getNomUrl(1) .
'</div>';
288 if (property_exists($this,
'total_ht')) {
289 $return .=
'<div class="info-box-ref amount">' .
price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency) .
' ' . $langs->trans(
'HT') .
'</div>';
291 if (method_exists($this,
'getLibStatut')) {
292 $return .=
'<div class="info-box-status margintoponly">' . $this->
getLibStatut(5) .
'</div>';
309 return $this->
LibStatut($this->fk_statut, $this->billed, $mode);
320 return $this->
LibStatut($this->fk_statut, $this->billed, $mode);
333 public function LibStatut($status, $billed, $mode, $donotshowbilled = 0)
336 return $this->
getOrderStatic()->LibStatut($status, $billed, $mode, $donotshowbilled);
Class to manage customers orders.
const STATUS_SHIPMENTONPROCESS
Shipment on process.
const STATUS_CLOSED
Closed (Sent, billed or not)
const STATUS_CANCELED
Canceled status.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated status.
Class to manage Dolibarr database access.
Class for WebPortalOrder.
getOrderStatic()
Get order for static method.
getTooltipContentArray($params)
getTooltipContentArray
getLabelStatus($mode=0)
Return the label of the status.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
getLibStatut($mode=0)
Return the label of the status.
LibStatut($status, $billed, $mode, $donotshowbilled=0)
Return label of status.
const ARRAY_STATUS_LABEL
Status list (short label)
getNomUrl($withpicto=0, $option='', $max=0, $short=0, $notooltip=0, $save_lastsearch_value=-1, $addlinktonotes=0, $target='')
Return clickable link of object (with eventually picto)
__construct(DoliDB $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...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...