New: Add hourly and daily amount on user card. Add weekly working hours
and salary on user card.
This commit is contained in:
parent
2cfe088ee4
commit
23eee1b83a
@ -49,6 +49,7 @@ For users:
|
||||
- New: [ task #1204 ] add a External reference to contract
|
||||
- New: [ task #1218 ] Can drag and drop an event from calendar to change its day.
|
||||
- New: Optimize size of image static resources.
|
||||
- New: Add hourly and daily amount on user card. Add weekly working hours and salary on user card.
|
||||
- Upgrade phpexcel lib to 1.7.8
|
||||
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
|
||||
- Fix: [ bug #1470, #1472, #1473] User trigger problem
|
||||
|
||||
@ -84,6 +84,10 @@ ALTER TABLE llx_product MODIFY COLUMN accountancy_code_buy varchar(32);
|
||||
ALTER TABLE llx_user MODIFY COLUMN accountancy_code varchar(32);
|
||||
|
||||
|
||||
ALTER TABLE llx_user ADD COLUMN thm double(24,8);
|
||||
ALTER TABLE llx_user ADD COLUMN tjm double(24,8);
|
||||
ALTER TABLE llx_user ADD COLUMN salary double(24,8);
|
||||
ALTER TABLE llx_user ADD COLUMN salaryextra double(24,8);
|
||||
ALTER TABLE llx_user ADD COLUMN weeklyhours double(16,8);
|
||||
|
||||
|
||||
|
||||
@ -71,6 +71,9 @@ create table llx_user
|
||||
fk_barcode_type integer DEFAULT 0,
|
||||
accountancy_code varchar(32) NULL,
|
||||
nb_holiday integer DEFAULT 0,
|
||||
thm double(24,8),
|
||||
tjm double(24,8),
|
||||
salary double(24,8),
|
||||
salaryextra double(24,8),
|
||||
weeklyhours double(16,8)
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -8,3 +8,5 @@ NewSalaryPayment=New salary payment
|
||||
SalaryPayment=Salary payment
|
||||
SalariesPayments=Salaries payments
|
||||
ShowSalaryPayment=Show salary payment
|
||||
THM=Average hourly price
|
||||
TJM=Average daily price
|
||||
|
||||
@ -119,3 +119,4 @@ HierarchicView=Hierarchical view
|
||||
UseTypeFieldToChange=Use field Type to change
|
||||
OpenIDURL=OpenID URL
|
||||
LoginUsingOpenID=Use OpenID to login
|
||||
WeeklyHours=Weekly hours
|
||||
@ -101,6 +101,10 @@ class User extends CommonObject
|
||||
|
||||
var $accountancy_code; // Accountancy code in prevision of the complete accountancy module
|
||||
var $thm; // Average cost of employee
|
||||
var $tjm; // Average cost of employee
|
||||
var $salary; // Monthly salary
|
||||
var $salaryextra; // Monthly salary extra
|
||||
var $weeklyhours; // Weekly hours
|
||||
|
||||
|
||||
/**
|
||||
@ -156,6 +160,10 @@ class User extends CommonObject
|
||||
$sql.= " u.openid as openid,";
|
||||
$sql.= " u.accountancy_code,";
|
||||
$sql.= " u.thm,";
|
||||
$sql.= " u.tjm,";
|
||||
$sql.= " u.salary,";
|
||||
$sql.= " u.salaryextra,";
|
||||
$sql.= " u.weeklyhours,";
|
||||
$sql.= " u.ref_int, u.ref_ext";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
@ -219,6 +227,10 @@ class User extends CommonObject
|
||||
$this->entity = $obj->entity;
|
||||
$this->accountancy_code = $obj->accountancy_code;
|
||||
$this->thm = $obj->thm;
|
||||
$this->tjm = $obj->tjm;
|
||||
$this->salary = $obj->salary;
|
||||
$this->salaryextra = $obj->salaryextra;
|
||||
$this->weeklyhours = $obj->weeklyhours;
|
||||
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
@ -1156,11 +1168,15 @@ class User extends CommonObject
|
||||
$sql.= ", job = '".$this->db->escape($this->job)."'";
|
||||
$sql.= ", signature = '".$this->db->escape($this->signature)."'";
|
||||
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
|
||||
$sql.= ", thm = ".(isset($this->thm)?$this->thm:"null"); // If not set, we use null
|
||||
$sql.= ", note = '".$this->db->escape($this->note)."'";
|
||||
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
|
||||
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");
|
||||
$sql.= ", fk_user = ".($this->fk_user > 0?"'".$this->db->escape($this->fk_user)."'":"null");
|
||||
if (isset($this->thm) || $this->thm != '') $sql.= ", thm= ".($this->thm != ''?"'".$this->db->escape($this->thm)."'":"null");
|
||||
if (isset($this->tjm) || $this->tjm != '') $sql.= ", tjm= ".($this->tjm != ''?"'".$this->db->escape($this->tjm)."'":"null");
|
||||
if (isset($this->salary) || $this->salary != '') $sql.= ", salary= ".($this->salary != ''?"'".$this->db->escape($this->salary)."'":"null");
|
||||
if (isset($this->salaryextra) || $this->salaryextra != '') $sql.= ", salaryextra= ".($this->salaryextra != ''?"'".$this->db->escape($this->salaryextra)."'":"null");
|
||||
$sql.= ", weeklyhours= ".($this->weeklyhours != ''?"'".$this->db->escape($this->weeklyhours)."'":"null");
|
||||
$sql.= ", entity = '".$this->entity."'";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
@ -2217,7 +2233,7 @@ class User extends CommonObject
|
||||
|
||||
// Init this->parentof that is array(id_son=>id_parent, ...)
|
||||
$this->load_parentof();
|
||||
|
||||
|
||||
// Init $this->users array
|
||||
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
|
||||
@ -200,6 +200,12 @@ if ($action == 'add' && $canadduser)
|
||||
$object->ldap_sid = GETPOST("ldap_sid");
|
||||
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
|
||||
|
||||
$object->thm = GETPOST("thm")!=''?GETPOST("thm"):'';
|
||||
$object->tjm = GETPOST("tjm")!=''?GETPOST("tjm"):'';
|
||||
$object->salary = GETPOST("salary")!=''?GETPOST("salary"):'';
|
||||
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
||||
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
|
||||
@ -339,6 +345,12 @@ if ($action == 'update' && ! $_POST["cancel"])
|
||||
$object->openid = GETPOST("openid");
|
||||
$object->fk_user = GETPOST("fk_user")>0?GETPOST("fk_user"):0;
|
||||
|
||||
$object->thm = GETPOST("thm")!=''?GETPOST("thm"):'';
|
||||
$object->tjm = GETPOST("tjm")!=''?GETPOST("tjm"):'';
|
||||
$object->salary = GETPOST("salary")!=''?GETPOST("salary"):'';
|
||||
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
|
||||
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
|
||||
@ -614,7 +626,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
$conf->global->LDAP_FIELD_LOGIN_SAMBA,
|
||||
$conf->global->LDAP_FIELD_PASSWORD,
|
||||
$conf->global->LDAP_FIELD_PASSWORD_CRYPTED,
|
||||
$conf->global->LDAP_FIELD_PHONE,
|
||||
$conf->global->LDAP_FIELD_PHONE,
|
||||
$conf->global->LDAP_FIELD_FAX,
|
||||
$conf->global->LDAP_FIELD_MOBILE,
|
||||
$conf->global->LDAP_FIELD_SKYPE,
|
||||
@ -928,6 +940,39 @@ if (($action == 'create') || ($action == 'adduserldap'))
|
||||
print '<td>';
|
||||
print $form->select_dolusers($object->fk_user,'fk_user',1,array($object->id),0,'',0,$conf->entity);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($conf->salaries->enabled)
|
||||
{
|
||||
$langs->load("salaries");
|
||||
|
||||
// THM
|
||||
print '<tr><td valign="top">'.$langs->trans("THM").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="thm" value="'.GETPOST('thm').'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// TJM
|
||||
print '<tr><td valign="top">'.$langs->trans("TJM").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="tjm" value="'.GETPOST('tjm').'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Salary
|
||||
print '<tr><td valign="top">'.$langs->trans("Salary").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="salary" value="'.GETPOST('salary').'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Weeklyhours
|
||||
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="weeklyhours" value="'.GETPOST('weeklyhours').'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Note
|
||||
@ -1223,6 +1268,39 @@ else
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
if ($conf->salaries->enabled)
|
||||
{
|
||||
$langs->load("salaries");
|
||||
|
||||
// THM
|
||||
print '<tr><td valign="top">'.$langs->trans("THM").'</td>';
|
||||
print '<td>';
|
||||
print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):'');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// TJM
|
||||
print '<tr><td valign="top">'.$langs->trans("TJM").'</td>';
|
||||
print '<td>';
|
||||
print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):'');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Salary
|
||||
print '<tr><td valign="top">'.$langs->trans("Salary").'</td>';
|
||||
print '<td>';
|
||||
print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):'');
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Weeklyhours
|
||||
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
|
||||
print '<td>';
|
||||
print price2num($object->weeklyhours);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Accountancy code
|
||||
if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared.
|
||||
{
|
||||
@ -1879,7 +1957,40 @@ else
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Accountancy code
|
||||
$langs->load("salaries");
|
||||
|
||||
if ($conf->salaries->enabled)
|
||||
{
|
||||
// THM
|
||||
print '<tr><td valign="top">'.$langs->trans("THM").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="thm" value="'.price2num(GETPOST('thm')?GETPOST('thm'):$object->thm).'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// TJM
|
||||
print '<tr><td valign="top">'.$langs->trans("TJM").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="tjm" value="'.price2num(GETPOST('tjm')?GETPOST('tjm'):$object->tjm).'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Salary
|
||||
print '<tr><td valign="top">'.$langs->trans("Salary").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="salary" value="'.price2num(GETPOST('salary')?GETPOST('salary'):$object->salary).'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
// Weeklyhours
|
||||
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
|
||||
print '<td>';
|
||||
print '<input size="8" type="text" name="weeklyhours" value="'.price2num(GETPOST('weeklyhours')?GETPOST('weeklyhours'):$object->weeklyhours).'">';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Accountancy code
|
||||
if (! empty($conf->global->USER_ENABLE_ACCOUNTANCY_CODE)) // For the moment field is not used so must not appeared.
|
||||
{
|
||||
print "<tr>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user