mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '9.0' of https://github.com/dolibarr/dolibarr into 10.0
Conflicts: htdocs/expensereport/class/expensereport.class.php htdocs/product/stock/replenishorders.php
This commit is contained in:
commit
9483e367ca
|
|
@ -1853,10 +1853,15 @@ function dol_convert_file($fileinput, $ext = 'png', $fileoutput = '', $page = ''
|
|||
if (empty($fileoutput)) $fileoutput=$fileinput.".".$ext;
|
||||
|
||||
$count = $image->getNumberImages();
|
||||
|
||||
if (! dol_is_file($fileoutput) || is_writeable($fileoutput))
|
||||
{
|
||||
$ret = $image->writeImages($fileoutput, true);
|
||||
try {
|
||||
$ret = $image->writeImages($fileoutput, true);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
dol_syslog($e->getMessage(), LOG_WARNING);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1234,10 +1234,10 @@ class ExpenseReport extends CommonObject
|
|||
|
||||
$this->date_debut = $this->db->jdate($objp->date_debut);
|
||||
|
||||
if ($this->fk_statut != 2)
|
||||
if ($this->fk_statut != self::STATUS_VALIDATED)
|
||||
{
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET fk_statut = 2";
|
||||
$sql.= " SET fk_statut = ".self::STATUS_VALIDATED;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::set_save_from_refuse sql=".$sql, LOG_DEBUG);
|
||||
|
|
@ -1272,11 +1272,12 @@ class ExpenseReport extends CommonObject
|
|||
|
||||
// date approval
|
||||
$this->date_approve = $now;
|
||||
if ($this->fk_statut != 5) {
|
||||
$this->db->begin();
|
||||
if ($this->fk_statut != self::STATUS_APPROVED)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = 5, fk_user_approve = ".$fuser->id.",";
|
||||
$sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_APPROVED.", fk_user_approve = ".$fuser->id.",";
|
||||
$sql.= " date_approve='".$this->db->idate($this->date_approve)."'";
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
if ($this->db->query($sql))
|
||||
|
|
@ -1333,10 +1334,10 @@ class ExpenseReport extends CommonObject
|
|||
$error = 0;
|
||||
|
||||
// date de refus
|
||||
if ($this->fk_statut != 99)
|
||||
if ($this->fk_statut != self::STATUS_REFUSED)
|
||||
{
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = 99, fk_user_refuse = ".$fuser->id.",";
|
||||
$sql.= " SET ref = '".$this->db->escape($this->ref)."', fk_statut = ".self::STATUS_REFUSED.", fk_user_refuse = ".$fuser->id.",";
|
||||
$sql.= " date_refuse='".$this->db->idate($now)."',";
|
||||
$sql.= " detail_refuse='".$this->db->escape($details)."',";
|
||||
$sql.= " fk_user_approve = NULL";
|
||||
|
|
@ -1402,7 +1403,7 @@ class ExpenseReport extends CommonObject
|
|||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET paid = 0";
|
||||
$sql.= " SET paid = 0, fk_statut = ".self::STATUS_APPROVED;
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::set_unpaid sql=".$sql, LOG_DEBUG);
|
||||
|
|
@ -1459,12 +1460,12 @@ class ExpenseReport extends CommonObject
|
|||
// phpcs:enable
|
||||
$error = 0;
|
||||
$this->date_cancel = $this->db->idate(gmmktime());
|
||||
if ($this->fk_statut != ExpenseReport::STATUS_CANCELED)
|
||||
if ($this->fk_statut != self::STATUS_CANCELED)
|
||||
{
|
||||
$this->db->begin();
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql.= " SET fk_statut = ".ExpenseReport::STATUS_CANCELED.", fk_user_cancel = ".$fuser->id;
|
||||
$sql.= " SET fk_statut = ".self::STATUS_CANCELED.", fk_user_cancel = ".$fuser->id;
|
||||
$sql.= ", date_cancel='".$this->db->idate($this->date_cancel)."'";
|
||||
$sql.= " ,detail_cancel='".$this->db->escape($detail)."'";
|
||||
$sql.= ' WHERE rowid = '.$this->id;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -153,7 +154,9 @@ if (GETPOST('statut', 'int')) {
|
|||
$sql .= ' GROUP BY cf.rowid, cf.ref, cf.date_creation, cf.fk_statut';
|
||||
$sql .= ', cf.total_ttc, cf.fk_user_author, u.login, s.rowid, s.nom';
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
$sql .= $db->plimit($limit+1, $offset);
|
||||
if (! $sproduct) {
|
||||
$sql .= $db->plimit($limit+1, $offset);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
|
|
@ -270,7 +273,7 @@ if ($resql)
|
|||
|
||||
$userstatic = new User($db);
|
||||
|
||||
while ($i < min($num, $conf->liste_limit))
|
||||
while ($i < min($num, $sproduct?$num:$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user