dolibarr  19.0.0-dev
commonorder.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <https://www.gnu.org/licenses/>.
16  */
17 
24 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
25 require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
26 require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php';
27 
31 abstract class CommonOrder extends CommonObject
32 {
33  use CommonIncoterm;
34 
35 
43  public function getKanbanView($option = '', $arraydata = null)
44  {
45  global $langs, $conf;
46 
47  $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
48 
49  $return = '<div class="box-flex-item box-flex-grow-zero">';
50  $return .= '<div class="info-box info-box-sm">';
51  $return .= '<div class="info-box-icon bg-infobox-action">';
52  $return .= img_picto('', 'order');
53  $return .= '</div>';
54  $return .= '<div class="info-box-content">';
55  $return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
56  $return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
57 
58  if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) {
59  $return .= '<br><div class="info-box-ref tdoverflowmax150">'.$this->thirdparty->getNomUrl(1).'</div>';
60  }
61  if (property_exists($this, 'total_ht')) {
62  $return .= '<div class="info-box-ref amount">'.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency).' '.$langs->trans('HT').'</div>';
63  }
64  if (method_exists($this, 'getLibStatut')) {
65  $return .= '<div class="info-box-status margintoponly">'.$this->getLibStatut(5).'</div>';
66  }
67  $return .= '</div>';
68  $return .= '</div>';
69  $return .= '</div>';
70  return $return;
71  }
72 
76  public $code = "";
77 }
78 
82 abstract class CommonOrderLine extends CommonObjectLine
83 {
88  public $label;
89 
96  public $ref;
97 
104  public $libelle;
105 
110  public $product_ref;
111 
116  public $product_label;
117 
122  public $product_tosell=0;
123 
128  public $product_tobuy=0;
129 
134  public $product_desc;
135 
140  public $product_tobatch;
141 
146  public $product_barcode;
147 
152  public $qty;
153 
159  public $price;
160 
165  public $subprice;
166 
171  public $product_type = 0;
172 
177  public $fk_product;
178 
183  public $remise_percent;
184 
189  public $vat_src_code;
190 
195  public $tva_tx;
196 
201  public $localtax1_tx;
202 
207  public $localtax2_tx;
208 
209  public $localtax1_type;
210  public $localtax2_type;
211 
218  public $info_bits = 0;
219 
220  public $special_code = 0;
221 
222  public $fk_multicurrency;
223  public $multicurrency_code;
224  public $multicurrency_subprice;
225  public $multicurrency_total_ht;
226  public $multicurrency_total_tva;
227  public $multicurrency_total_ttc;
228 }
CommonOrder\getKanbanView
getKanbanView($option='', $arraydata=null)
Return clicable link of object (with eventually picto)
Definition: commonorder.class.php:43
CommonOrder
Superclass for orders classes.
Definition: commonorder.class.php:31
CommonIncoterm
trait CommonIncoterm
Superclass for incoterm classes.
Definition: commonincoterm.class.php:29
CommonObjectLine
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Definition: commonobjectline.class.php:32
CommonObject
Parent class of all other business classes (invoices, contracts, proposals, orders,...
Definition: commonobject.class.php:45
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4135
CommonOrderLine\$label
$label
Custom label of line.
Definition: commonorder.class.php:88
CommonOrderLine\$price
$price
Unit price.
Definition: commonorder.class.php:159
CommonOrderLine
Superclass for orders classes.
Definition: commonorder.class.php:82