Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
19684f9a36
@ -936,6 +936,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
function commande($user, $date, $methode, $comment='')
|
function commande($user, $date, $methode, $comment='')
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
dol_syslog(get_class($this)."::commande");
|
dol_syslog(get_class($this)."::commande");
|
||||||
$result = 0;
|
$result = 0;
|
||||||
if ($user->rights->fournisseur->commande->commander)
|
if ($user->rights->fournisseur->commande->commander)
|
||||||
@ -946,16 +947,24 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
dol_syslog(get_class($this)."::commande", LOG_DEBUG);
|
dol_syslog(get_class($this)."::commande", LOG_DEBUG);
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
$this->statut = 3;
|
||||||
|
$this->methode_commande_id = $methode;
|
||||||
|
$this->date_commande = $this->db->idate($date);
|
||||||
$result = 1;
|
$result = 1;
|
||||||
$this->log($user, 3, $date, $comment);
|
$this->log($user, 3, $date, $comment);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$this->error = $this->db->lasterror();
|
||||||
|
$this->errors[] = $this->db->lasterror();
|
||||||
$result = -1;
|
$result = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$result = -1;
|
||||||
|
$this->error = $langs->trans('NotAuthorized');
|
||||||
|
$this->errors[] = $lanfs->trans('NotAuthorized');
|
||||||
dol_syslog(get_class($this)."::commande User not Authorized", LOG_ERR);
|
dol_syslog(get_class($this)."::commande User not Authorized", LOG_ERR);
|
||||||
}
|
}
|
||||||
return $result ;
|
return $result ;
|
||||||
@ -1762,7 +1771,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
*/
|
*/
|
||||||
function Livraison($user, $date, $type, $comment)
|
function Livraison($user, $date, $type, $comment)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf, $langs;
|
||||||
|
|
||||||
$result = 0;
|
$result = 0;
|
||||||
$error = 0;
|
$error = 0;
|
||||||
@ -1829,6 +1838,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$result = 0;
|
$result = 0;
|
||||||
|
$this->statut = $statut;
|
||||||
$result=$this->log($user, $statut, $date, $comment);
|
$result=$this->log($user, $statut, $date, $comment);
|
||||||
|
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
@ -1843,6 +1853,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$this->error = $langs->trans('NotAuthorized');
|
||||||
|
$this->errors[] = $langs->trans('NotAuthorized');
|
||||||
dol_syslog(get_class($this)."::Livraison Not Authorized");
|
dol_syslog(get_class($this)."::Livraison Not Authorized");
|
||||||
$result = -3;
|
$result = -3;
|
||||||
}
|
}
|
||||||
@ -1992,6 +2004,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
$this->statut = $status;
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -710,8 +710,7 @@ if (empty($reshook))
|
|||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
$object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
|
$action = '';
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -770,12 +769,12 @@ if (empty($reshook))
|
|||||||
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment"));
|
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment"));
|
||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
|
setEventMessages($langs->trans("DeliveryStateSaved"), null);
|
||||||
exit;
|
$action = '';
|
||||||
}
|
}
|
||||||
else if($result == -3)
|
else if($result == -3)
|
||||||
{
|
{
|
||||||
setEventMessage($langs->trans("NotAuthorized"), 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -59,6 +59,7 @@ ErrorCantLoadUserFromDolibarrDatabase=Failed to find user <b>%s</b> in Dolibarr
|
|||||||
ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'.
|
ErrorNoVATRateDefinedForSellerCountry=Error, no vat rates defined for country '%s'.
|
||||||
ErrorNoSocialContributionForSellerCountry=Error, no social/fiscal taxes type defined for country '%s'.
|
ErrorNoSocialContributionForSellerCountry=Error, no social/fiscal taxes type defined for country '%s'.
|
||||||
ErrorFailedToSaveFile=Error, failed to save file.
|
ErrorFailedToSaveFile=Error, failed to save file.
|
||||||
|
NotAuthorized=You are not authorized to do that.
|
||||||
SetDate=Set date
|
SetDate=Set date
|
||||||
SelectDate=Select a date
|
SelectDate=Select a date
|
||||||
SeeAlso=See also %s
|
SeeAlso=See also %s
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user