28require_once DOL_DOCUMENT_ROOT .
'/compta/facture/class/facture.class.php';
38 public $module =
'webportal';
53 protected $invoice_static =
null;
98 public $fields = array(
99 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 1,),
100 'entity' => array(
'type' =>
'integer',
'label' =>
'Entity',
'default' =>
'1',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 20,
'index' => 1,),
101 'ref' => array(
'type' =>
'varchar(30)',
'label' =>
'Ref',
'enabled' => 1,
'visible' => 2,
'notnull' => 1,
'showoncombobox' => 1,
'position' => 5,),
102 'type' => array(
'type' =>
'smallint(6)',
'label' =>
'Type',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 15,),
103 'datef' => array(
'type' =>
'date',
'label' =>
'DateInvoice',
'enabled' => 1,
'visible' => 2,
'position' => 20,),
104 'date_lim_reglement' => array(
'type' =>
'date',
'label' =>
'DateDue',
'enabled' => 1,
'visible' => 2,
'position' => 25,),
105 'paye' => array(
'type' =>
'smallint(6)',
'label' =>
'InvoicePaidCompletely',
'enabled' => 1,
'visible' => 0,
'notnull' => 1,
'position' => 80,),
106 'total_ht' => array(
'type' =>
'price',
'label' =>
'AmountHT',
'enabled' => 1,
'visible' => 2,
'position' => 95,
'isameasure' => 1,),
107 'total_tva' => array(
'type' =>
'price',
'label' =>
'AmountVAT',
'enabled' => 1,
'visible' => 2,
'position' => 100,
'isameasure' => 1,),
108 'total_ttc' => array(
'type' =>
'price',
'label' =>
'AmountTTC',
'enabled' => 1,
'visible' => 2,
'position' => 130,
'isameasure' => 1,),
109 'multicurrency_total_ht' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountHT',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 290,
'isameasure' => 1,),
110 'multicurrency_total_tva' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountVAT',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 291,
'isameasure' => 1,),
111 'multicurrency_total_ttc' => array(
'type' =>
'price',
'label' =>
'MulticurrencyAmountTTC',
'enabled' =>
'isModEnabled("multicurrency")',
'visible' => -2,
'position' => 292,
'isameasure' => 1,),
112 'fk_statut' => array(
'type' =>
'smallint(6)',
'label' =>
'Status',
'enabled' => 1,
'visible' => 2,
'notnull' => 1,
'position' => 1000,
'arrayofkeyval' => self::ARRAY_STATUS_LABEL,),
142 if (!$this->invoice_static) {
143 $this->invoice_static =
new Facture($this->db);
146 return $this->invoice_static;
158 $this->isextrafieldmanaged = 0;
173 $langs->load(
'bills');
194 public function getNomUrl($withpicto = 0, $option =
'', $max = 0, $short = 0, $moretitle =
'', $notooltip = 0, $addlinktonotes = 0, $save_lastsearch_value = -1, $target =
'')
196 global $langs, $conf;
198 if (!empty($conf->dol_no_mouse_hover)) {
211 $picto = $this->picto;
212 if ($this->
type == self::TYPE_REPLACEMENT) {
215 if ($this->
type == self::TYPE_CREDIT_NOTE) {
218 if ($this->
type == self::TYPE_DEPOSIT) {
223 'objecttype' => $this->element,
224 'moretitle' => $moretitle,
227 $classfortooltip =
'classfortooltip';
230 $classfortooltip =
'classforajaxtooltip';
237 $linkclose = ($target ?
' target="' . $target .
'"' :
'');
239 $linkstart =
'<a href="' . $url .
'"';
240 $linkstart .= $linkclose .
'>';
243 if ($option ==
'nolink') {
248 $result .= $linkstart;
250 $result .=
img_object(($notooltip ?
'' : $label), $picto, ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') : $dataparams .
' class="' . (($withpicto != 2) ?
'paddingright ' :
'') . $classfortooltip .
'"'), 0, 0, $notooltip ? 0 : 1);
252 if ($withpicto != 2) {
253 $result .= ($max ?
dol_trunc($this->
ref, $max) : $this->ref);
257 global $action, $hookmanager;
258 $hookmanager->initHooks(array(
'invoicedao'));
259 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result,
'notooltip' => $notooltip,
'addlinktonotes' => $addlinktonotes,
'save_lastsearch_value' => $save_lastsearch_value,
'target' => $target);
260 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
262 $result = $hookmanager->resPrint;
264 $result .= $hookmanager->resPrint;
279 $selected = (empty($arraydata[
'selected']) ? 0 : $arraydata[
'selected']);
281 $return =
'<div class="box-flex-item box-flex-grow-zero">';
282 $return .=
'<div class="info-box info-box-sm">';
283 $return .=
'<span class="info-box-icon bg-infobox-action">';
286 $return .=
'</span>';
287 $return .=
'<div class="info-box-content">';
288 $return .=
'<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">' . (method_exists($this,
'getNomUrl') ? $this->
getNomUrl(1) : $this->ref) .
'</span>';
289 $return .=
'<input id="cb' . $this->
id .
'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="' . $this->
id .
'"' . ($selected ?
' checked="checked"' :
'') .
'>';
290 if (property_exists($this,
'socid')) {
291 $return .=
'<br><span class="info-box-label">' . $this->socid .
'</span>';
293 if (property_exists($this,
'fk_user_author')) {
294 $return .=
'<br><span class="info-box-label">' . $this->fk_user_author .
'</span>';
296 if (method_exists($this,
'getLibStatut')) {
297 $return .=
'<br><div class="info-box-status margintoponly">' . $this->
getLibStatut(3) .
'</div>';
314 return $this->
LibStatut($this->paye, $this->fk_statut, $mode, -1, $this->
type);
326 return $this->
LibStatut($this->paye, $this->fk_statut, $mode, $alreadypaid, $this->
type);
341 public function LibStatut($paye, $status, $mode = 0, $alreadypaid = -1, $type = -1)
344 return $this->
getInvoiceStatic()->LibStatut($paye, $status, $mode, $alreadypaid, $type);
Class to manage Dolibarr database access.
Class to manage invoices.
const STATUS_DRAFT
Draft status.
const STATUS_VALIDATED
Validated (need to be paid)
const STATUS_ABANDONED
Classified abandoned and no payment done.
const STATUS_CLOSED
Classified paid.
Class for WebPortalInvoice.
getKanbanView($option='', $arraydata=null)
Return clickable link of object (with eventually picto)
__construct(DoliDB $db)
Constructor.
getInvoiceStatic()
Get invoice for static methods.
LibStatut($paye, $status, $mode=0, $alreadypaid=-1, $type=-1)
Return label of a status.
getLibStatut($mode=0, $alreadypaid=-1)
Return label of object status.
const ARRAY_STATUS_LABEL
Status list (short label)
getLabelStatus($mode=0)
Return the label of the status.
getNomUrl($withpicto=0, $option='', $max=0, $short=0, $moretitle='', $notooltip=0, $addlinktonotes=0, $save_lastsearch_value=-1, $target='')
Return clickable link of object (with eventually picto)
getTooltipContentArray($params)
getTooltipContentArray
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)
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
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...
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type