26 require_once DOL_DOCUMENT_ROOT.
'/core/modules/fichinter/modules_fichinter.php';
37 public $version =
'dolibarr';
39 public $prefix =
'FI';
51 public $nom =
'pacific';
56 public $name =
'pacific';
67 return $langs->trans(
"SimpleNumRefModelDesc", $this->prefix);
77 return $this->prefix.
"0501-0001";
88 global $langs, $conf, $db;
90 $langs->load(
"bills");
92 $fayymm =
''; $max =
'';
94 $posindice = strlen($this->prefix) + 6;
95 $sql =
"SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.
") AS SIGNED)) as max";
96 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter";
97 $sql .=
" WHERE ref LIKE '".$db->escape($this->prefix).
"____-%'";
98 $sql .=
" WHERE entity = ".$conf->entity;
100 $resql = $db->query($sql);
103 $row = $db->fetch_row(
$resql);
104 if ($row) { $fayymm = substr($row[0], 0, 6); $max = $row[0]; }
106 if (!$fayymm || preg_match(
'/'.$this->prefix.
'[0-9][0-9][0-9][0-9]/i', $fayymm))
110 $langs->load(
"errors");
111 $this->error = $langs->trans(
'ErrorNumRefModel', $max);
128 $posindice = strlen($this->prefix) + 6;
129 $sql =
"SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.
") AS SIGNED)) as max";
130 $sql .=
" FROM ".MAIN_DB_PREFIX.
"fichinter";
131 $sql .=
" WHERE ref LIKE '".$db->escape($this->prefix).
"____-%'";
132 $sql .=
" AND entity = ".$conf->entity;
134 $resql = $db->query($sql);
137 $obj = $db->fetch_object(
$resql);
138 if ($obj) $max = intval($obj->max);
143 $date = $object->datec;
144 $yymm = strftime(
"%y%m", $date);
146 if ($max >= (pow(10, 4) - 1)) $num = $max + 1;
147 else $num = sprintf(
"%04s", $max + 1);
149 return $this->prefix.$yymm.
"-".$num;
getExample()
Return an example of numbering.
getNextValue()
Return the next assigned value.
getNumRef($objsoc, $objforref)
Return next free value.
canBeActivated()
Checks if the numbers already in the database do not cause conflicts that would prevent this numberin...
info()
Return description of numbering module.
Parent class numbering models of intervention sheet references.
getNextValue($objsoc=0, $object= '')
Return next free value.
Class to manage numbering of intervention cards with rule Pacific.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.