forked from Wavyzz/dolibarr
Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0
Conflicts: htdocs/core/actions_massactions.inc.php
This commit is contained in:
@@ -215,7 +215,7 @@ if (! $error && $massaction == 'confirm_presend')
|
|||||||
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
$resaction.='<div class="error">'.$langs->trans('ErrorOnlyProposalNotDraftCanBeSentInMassAction',$objectobj->ref).'</div><br>';
|
||||||
continue; // Payment done or started or canceled
|
continue; // Payment done or started or canceled
|
||||||
}
|
}
|
||||||
if ($objectclass == 'Commande' && $objectoj->statut == Commande::STATUS_DRAFT)
|
if ($objectclass == 'Commande' && $objectojb->statut == Commande::STATUS_DRAFT)
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
$nbignored++;
|
$nbignored++;
|
||||||
|
|||||||
@@ -717,8 +717,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
global $conf,$user;
|
global $conf,$user;
|
||||||
|
|
||||||
if (! is_object($objsoc)) $valueforccc=$objsoc;
|
if (! is_object($objsoc)) $valueforccc=$objsoc;
|
||||||
else if ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=$objsoc->code_fournisseur;
|
else if ($table == "commande_fournisseur" || $table == "facture_fourn" ) $valueforccc=dol_string_unaccent($objsoc->code_fournisseur);
|
||||||
else $valueforccc=$objsoc->code_client;
|
else $valueforccc=dol_string_unaccent($objsoc->code_client);
|
||||||
|
|
||||||
$sharetable = $table;
|
$sharetable = $table;
|
||||||
if ($table == 'facture' || $table == 'invoice') $sharetable = 'invoicenumber'; // for getEntity function
|
if ($table == 'facture' || $table == 'invoice') $sharetable = 'invoicenumber'; // for getEntity function
|
||||||
@@ -966,6 +966,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
// Define $maskLike
|
// Define $maskLike
|
||||||
$maskLike = dol_string_nospecial($mask);
|
$maskLike = dol_string_nospecial($mask);
|
||||||
$maskLike = str_replace("%","_",$maskLike);
|
$maskLike = str_replace("%","_",$maskLike);
|
||||||
|
|
||||||
// Replace protected special codes with matching number of _ as wild card caracter
|
// Replace protected special codes with matching number of _ as wild card caracter
|
||||||
$maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike);
|
$maskLike = preg_replace('/\{yyyy\}/i','____',$maskLike);
|
||||||
$maskLike = preg_replace('/\{yy\}/i','__',$maskLike);
|
$maskLike = preg_replace('/\{yy\}/i','__',$maskLike);
|
||||||
@@ -1141,7 +1142,7 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
|
|||||||
// Now we replace the refclient
|
// Now we replace the refclient
|
||||||
if ($maskrefclient)
|
if ($maskrefclient)
|
||||||
{
|
{
|
||||||
//print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode."\n<br>";
|
//print "maskrefclient=".$maskrefclient." maskwithonlyymcode=".$maskwithonlyymcode." maskwithnocode=".$maskwithnocode." maskrefclient_clientcode=".$maskrefclient_clientcode."\n<br>";exit;
|
||||||
$maskrefclient_maskbefore='{'.$maskrefclient.'}';
|
$maskrefclient_maskbefore='{'.$maskrefclient.'}';
|
||||||
$maskrefclient_maskafter=$maskrefclient_clientcode.str_pad($maskrefclient_counter,dol_strlen($maskrefclient_maskcounter),"0",STR_PAD_LEFT);
|
$maskrefclient_maskafter=$maskrefclient_clientcode.str_pad($maskrefclient_counter,dol_strlen($maskrefclient_maskcounter),"0",STR_PAD_LEFT);
|
||||||
$numFinal = str_replace($maskrefclient_maskbefore,$maskrefclient_maskafter,$numFinal);
|
$numFinal = str_replace($maskrefclient_maskbefore,$maskrefclient_maskafter,$numFinal);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2014-2016 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2015-2019 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
@@ -600,7 +600,7 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON t.fk_mode_reglement = p.id";
|
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON t.fk_mode_reglement = p.id";
|
||||||
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid';
|
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON t.fk_incoterms = i.rowid';
|
||||||
if ($id) $sql.= " WHERE t.rowid=".$id;
|
if ($id) $sql.= " WHERE t.rowid=".$id;
|
||||||
if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."'";
|
if ($ref) $sql.= " WHERE t.ref='".$this->db->escape($ref)."' AND t.entity IN (".getEntity('supplier_invoice').")";
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
@@ -1370,7 +1370,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
// We increase stock for product
|
// We increase stock for product
|
||||||
$up_ht_disc=$this->lines[$i]->pu_ht;
|
$up_ht_disc=$this->lines[$i]->pu_ht;
|
||||||
if (! empty($this->lines[$i]->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) $up_ht_disc=price2num($up_ht_disc * (100 - $this->lines[$i]->remise_percent) / 100, 'MU');
|
if (! empty($this->lines[$i]->remise_percent) && empty($conf->global->STOCK_EXCLUDE_DISCOUNT_FOR_PMP)) $up_ht_disc=price2num($up_ht_disc * (100 - $this->lines[$i]->remise_percent) / 100, 'MU');
|
||||||
$result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $up_ht_disc, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
if ($this->type == FactureFournisseur::TYPE_CREDIT_NOTE) $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $up_ht_disc, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||||
|
else $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $up_ht_disc, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
unset($this->line);
|
unset($this->line);
|
||||||
}
|
}
|
||||||
@@ -1495,7 +1496,8 @@ class FactureFournisseur extends CommonInvoice
|
|||||||
$mouvP = new MouvementStock($this->db);
|
$mouvP = new MouvementStock($this->db);
|
||||||
$mouvP->origin = &$this;
|
$mouvP->origin = &$this;
|
||||||
// We increase stock for product
|
// We increase stock for product
|
||||||
$result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr", $this->ref));
|
if ($this->type == FactureFournisseur::TYPE_CREDIT_NOTE) $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr", $this->ref));
|
||||||
|
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceBackToDraftInDolibarr", $this->ref));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user