mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 09:02:59 +01:00
Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -812,10 +812,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
$y+=3;
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
if ($obj->type == 2) $text=$outputlangs->trans("CreditNote");
|
||||
elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit");
|
||||
elseif ($obj->type == 0) $text=$outputlangs->trans("ExcessReceived");
|
||||
else $text=$outputlangs->trans("UnknownType");
|
||||
if ($obj->type == 2) $text=$outputlangs->transnoentities("CreditNote");
|
||||
elseif ($obj->type == 3) $text=$outputlangs->transnoentities("Deposit");
|
||||
elseif ($obj->type == 0) $text=$outputlangs->transnoentities("ExcessReceived");
|
||||
else $text=$outputlangs->transnoentities("UnknownType");
|
||||
|
||||
$invoice->fetch($obj->fk_facture_source);
|
||||
|
||||
|
||||
@@ -108,12 +108,15 @@ class mod_propale_marbre extends ModeleNumRefPropales
|
||||
{
|
||||
global $db,$conf;
|
||||
|
||||
// Use object entity ID
|
||||
$entity = ((isset($propal->entity) && is_numeric($propal->entity)) ? $propal->entity : $conf->entity);
|
||||
|
||||
// D'abord on recupere la valeur max
|
||||
$posindice=8;
|
||||
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
|
||||
$sql.= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
|
||||
$sql.= " AND entity = ".$conf->entity;
|
||||
$sql.= " AND entity = ".$entity;
|
||||
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
|
||||
@@ -115,8 +115,14 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
|
||||
|
||||
$constant = 'PROPALE_SAPHIR_MASK_'.$propal->entity;
|
||||
|
||||
// On defini critere recherche compteur
|
||||
$mask=$conf->global->PROPALE_SAPHIR_MASK;
|
||||
if (! empty($conf->global->$constant)) {
|
||||
$mask = $conf->global->$constant; // for multicompany proposal sharing
|
||||
} else {
|
||||
$mask = $conf->global->PROPALE_SAPHIR_MASK;
|
||||
}
|
||||
|
||||
if (! $mask)
|
||||
{
|
||||
@@ -124,9 +130,12 @@ class mod_propale_saphir extends ModeleNumRefPropales
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Use object entity ID
|
||||
$entity = ((isset($propal->entity) && is_numeric($propal->entity)) ? $propal->entity : $conf->entity);
|
||||
|
||||
$date = $propal->date;
|
||||
|
||||
$numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc,$date);
|
||||
$numFinal=get_next_value($db,$mask,'propal','ref','',$objsoc,$date,'next',false,null,$entity);
|
||||
|
||||
return $numFinal;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user