FIX : Update pencil should be shoxn only when no payment has been entered
This commit is contained in:
parent
fbe5ec8bb2
commit
0bd4b132a4
@ -444,15 +444,28 @@ if ($id > 0) {
|
|||||||
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
|
||||||
|
|
||||||
// Employee
|
// Employee
|
||||||
if ($action != 'editfk_user') {
|
if($action != 'editfk_user') {
|
||||||
$morehtmlref .= '<br>' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
|
if ($object->getSommePaiement() > 0 && !empty($object->fk_user)){
|
||||||
|
|
||||||
if (!empty($object->fk_user)) {
|
|
||||||
$userstatic = new User($db);
|
$userstatic = new User($db);
|
||||||
$userstatic->fetch($object->fk_user);
|
$result = $userstatic->fetch($object->fk_user);
|
||||||
$morehtmlref .= $userstatic->getNomUrl(1);
|
if ($result > 0){
|
||||||
|
$morehtmlref .= '<br>' .$langs->trans('Employee').' : '.$userstatic->getNomUrl(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$morehtmlref .= '<br />' . $form->editfieldkey("Employee", 'fk_user', $object->label, $object, $user->rights->salaries->write, 'string', '', 0, 1);
|
||||||
|
if(!empty($object->fk_user)) {
|
||||||
|
$userstatic = new User($db);
|
||||||
|
$result = $userstatic->fetch($object->fk_user);
|
||||||
|
if ($result > 0){
|
||||||
|
$morehtmlref .= $userstatic->getNomUrl(1);
|
||||||
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$morehtmlref .= '<br>'.$langs->trans('Employee').' : ';
|
$morehtmlref .= '<br>'.$langs->trans('Employee').' : ';
|
||||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||||
$morehtmlref .= '<input type="hidden" name="action" value="setfk_user">';
|
$morehtmlref .= '<input type="hidden" name="action" value="setfk_user">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user