Fix can refuse expense report
This commit is contained in:
parent
66fcbeaf8d
commit
e571f681a0
@ -3217,11 +3217,11 @@ class Form
|
|||||||
{
|
{
|
||||||
foreach ($formquestion as $key => $input)
|
foreach ($formquestion as $key => $input)
|
||||||
{
|
{
|
||||||
if (isset($input['name'])) array_push($inputok,$input['name']);
|
//print "xx ".$key." rr ".is_array($input)."<br>\n";
|
||||||
|
if (is_array($input) && isset($input['name'])) array_push($inputok,$input['name']);
|
||||||
if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko,$input['name']);
|
if (isset($input['inputko']) && $input['inputko'] == 1) array_push($inputko,$input['name']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show JQuery confirm box. Note that global var $useglobalvars is used inside this template
|
// Show JQuery confirm box. Note that global var $useglobalvars is used inside this template
|
||||||
$formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
|
$formconfirm.= '<div id="'.$dialogconfirm.'" title="'.dol_escape_htmltag($title).'" style="display: none;">';
|
||||||
if (! empty($more)) {
|
if (! empty($more)) {
|
||||||
|
|||||||
@ -576,7 +576,7 @@ if ($action == "confirm_refuse" && GETPOST('confirm')=="yes" && $id > 0 && $user
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setEventMessage($object->error, $object->errors);
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1407,7 +1407,14 @@ else
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("AmountHT").'</td>';
|
print '<td>'.$langs->trans("AmountHT").'</td>';
|
||||||
print '<td>'.price($object->total_ht).'</td>';
|
print '<td>'.price($object->total_ht).'</td>';
|
||||||
print '<td rowspan="7" valign="top">';
|
$rowspan = 5;
|
||||||
|
if ($object->fk_statut < 3) $rowspan++;
|
||||||
|
elseif($object->fk_statut == 4) $rowspan+=2;
|
||||||
|
else $rowspan+=2;
|
||||||
|
if ($object->fk_statut==99 || !empty($object->detail_refuse)) $rowspan+=2;
|
||||||
|
if($object->fk_statut==6) $rowspan+=2;
|
||||||
|
|
||||||
|
print '<td rowspan="'.$rowspan.'" valign="top">';
|
||||||
/*
|
/*
|
||||||
* Payments
|
* Payments
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -986,8 +986,8 @@ class ExpenseReport extends CommonObject
|
|||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element;
|
||||||
$sql.= " SET ref = '".$this->ref."', fk_statut = 99, fk_user_refuse = ".$fuser->id.",";
|
$sql.= " SET ref = '".$this->ref."', fk_statut = 99, fk_user_refuse = ".$fuser->id.",";
|
||||||
$sql.= " date_refuse='".$this->db->idate($now)."',";
|
$sql.= " date_refuse='".$this->db->idate($now)."',";
|
||||||
$sql.= " detail_refuse='".$this->db->escape($details)."'";
|
$sql.= " detail_refuse='".$this->db->escape($details)."',";
|
||||||
$sql.= " fk_user_approve=NULL,";
|
$sql.= " fk_user_approve = NULL";
|
||||||
$sql.= ' WHERE rowid = '.$this->id;
|
$sql.= ' WHERE rowid = '.$this->id;
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user