54 $this->family =
"financial";
56 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
61 $this->version =
'dolibarr';
63 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
64 $this->picto =
'payment';
67 $this->dirs = array(
"/salaries/temp");
70 $this->config_page_url = array(
'salaries.php@salaries');
73 $this->hidden =
false;
74 $this->depends = array();
75 $this->requiredby = array();
76 $this->conflictwith = array();
77 $this->phpmin = array(7, 0);
78 $this->langfiles = array(
"salaries",
"bills");
81 $this->
const = array();
82 $this->
const[0] = array(
83 "SALARIES_ACCOUNTING_ACCOUNT_PAYMENT",
87 $this->
const[1] = array(
88 "SALARIES_ACCOUNTING_ACCOUNT_CHARGE",
94 $this->boxes = array();
97 $this->rights = array();
98 $this->rights_class =
'salaries';
102 $this->rights[$r][0] = 511;
103 $this->rights[$r][1] =
'Read employee salaries and payments (yours and your subordinates)';
104 $this->rights[$r][2] =
'r';
105 $this->rights[$r][3] = 0;
106 $this->rights[$r][4] =
'read';
107 $this->rights[$r][5] =
'';
110 $this->rights[$r][0] = 512;
111 $this->rights[$r][1] =
'Create/modify payments of empoyee salaries';
112 $this->rights[$r][2] =
'w';
113 $this->rights[$r][3] = 0;
114 $this->rights[$r][4] =
'write';
115 $this->rights[$r][5] =
'';
118 $this->rights[$r][0] = 514;
119 $this->rights[$r][1] =
'Delete payments of employee salary';
120 $this->rights[$r][2] =
'd';
121 $this->rights[$r][3] = 0;
122 $this->rights[$r][4] =
'delete';
123 $this->rights[$r][5] =
'';
126 $this->rights[$r][0] = 517;
127 $this->rights[$r][1] =
'Read salaries and payments of all employees';
128 $this->rights[$r][2] =
'r';
129 $this->rights[$r][3] = 0;
130 $this->rights[$r][4] =
'readall';
133 $this->rights[$r][0] = 519;
134 $this->rights[$r][1] =
'Export payments of employee salaries';
135 $this->rights[$r][2] =
'r';
136 $this->rights[$r][3] = 0;
137 $this->rights[$r][4] =
'export';
138 $this->rights[$r][5] =
'';
152 $this->export_code[$r] = $this->rights_class.
'_'.$r;
153 $this->export_label[$r] =
'SalariesAndPayments';
154 $this->export_permission[$r] = array(array(
"salaries",
"export"));
155 $this->export_fields_array[$r] = array(
'u.firstname'=>
"Firstname",
'u.lastname'=>
"Lastname",
'u.login'=>
"Login",
'u.salary'=>
'CurrentSalary',
'p.datep'=>
'DatePayment',
'p.datesp'=>
'DateStartPeriod',
'p.dateep'=>
'DateEndPeriod',
'p.amount'=>
'AmountPayment',
'p.num_payment'=>
'Numero',
'p.label'=>
'Label',
'p.note'=>
'Note');
156 $this->export_TypeFields_array[$r] = array(
'u.firstname'=>
"Text",
'u.lastname'=>
"Text",
'u.login'=>
'Text',
'u.salary'=>
"Numeric",
'p.datep'=>
'Date',
'p.datesp'=>
'Date',
'p.dateep'=>
'Date',
'p.amount'=>
'Numeric',
'p.num_payment'=>
'Numeric',
'p.label'=>
'Text');
157 $this->export_entities_array[$r] = array(
'u.firstname'=>
'user',
'u.lastname'=>
'user',
'u.login'=>
'user',
'u.salary'=>
'user',
'p.datep'=>
'payment',
'p.datesp'=>
'payment',
'p.dateep'=>
'payment',
'p.amount'=>
'payment',
'p.label'=>
'payment',
'p.note'=>
'payment',
'p.num_payment'=>
'payment');
159 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
160 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'user as u';
161 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'payment_salary as p ON p.fk_user = u.rowid';
162 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as cp ON p.fk_typepayment = cp.id';
163 $this->export_sql_end[$r] .=
' AND u.entity IN ('.getEntity(
'user').
')';