-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug : Expense reports #7839
Comments
I don't understand the goal of /**
* periode_existe
*
* @param User $fuser User
* @param Date $date_debut Start date
* @param Date $date_fin End date
* @return int <0 if KO, >0 if OK
*/
function periode_existe($fuser, $date_debut, $date_fin)
{
$sql = "SELECT rowid, date_debut, date_fin";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE fk_user_author = '{$fuser->id}'";
dol_syslog(get_class($this)."::periode_existe sql=".$sql);
$result = $this->db->query($sql);
if($result)
{
$num_lignes = $this->db->num_rows($result); $i = 0;
if ($num_lignes>0)
{
$date_d_form = $date_debut;
$date_f_form = $date_fin;
$existe = false;
while ($i < $num_lignes)
{
$objp = $this->db->fetch_object($result);
$date_d_req = $this->db->jdate($objp->date_debut); // 3
$date_f_req = $this->db->jdate($objp->date_fin); // 4
if (!($date_f_form < $date_d_req || $date_d_form > $date_f_req)) $existe = true;
$i++;
}
if($existe) return 1;
else return 0;
}
else
{
return 0;
}
}
else
{
$this->error=$this->db->lasterror();
dol_syslog(get_class($this)."::periode_existe Error ".$this->error, LOG_ERR);
return -1;
}
} Is it illegal to declare several expense report at the same day ? @aspangaro help ! |
GREAT !!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Bug
...or misunderstanding from me.
Impossible to create several expense reports for the same date.
Expected and actual behavior
The 10 September a user create a expense reports for the 5 to 8 September 2017. These one is approved.
One month later the same user receive the bill of his telephone subscription. He want's to be refunded because he called from USA to France with his personal phone.
So he create an other expense reports for the 5 to 8 September 2017 but a message displays "You can't create a expense report in this date because you have already create on in this date".
The quick solution is to create at the date of the day (20 November 2017). But at this date he have an other expense for an other project....
Why an user can't create several expense reports at the same date ?
Other case
The user visit several customers at the same day. We want to create several expense reports to dispatch them to several projects (intervention, after sales service, prospecting....).
A user forgot an expense in a old expense reports and wants to be refunded.
Feature request
Can create expense report without regards of the date.
Tks for reading
The text was updated successfully, but these errors were encountered: