53 $this->family =
"financial";
55 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
60 $this->version =
'dolibarr';
62 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
63 $this->picto =
'salary';
66 $this->dirs = array(
"/salaries/temp");
69 $this->module_parts = array(
76 $this->config_page_url = array(
'salaries.php@salaries');
79 $this->hidden =
false;
80 $this->depends = array();
81 $this->requiredby = array();
82 $this->conflictwith = array();
83 $this->phpmin = array(7, 0);
84 $this->langfiles = array(
"salaries",
"bills");
89 "SALARIES_ACCOUNTING_ACCOUNT_PAYMENT",
96 "SALARIES_ACCOUNTING_ACCOUNT_CHARGE",
105 $this->boxes = array();
108 $this->rights = array();
109 $this->rights_class =
'salaries';
113 $this->rights[$r][0] = 511;
114 $this->rights[$r][1] =
'Read employee salaries and payments (yours only)';
115 $this->rights[$r][2] =
'r';
116 $this->rights[$r][3] = 0;
117 $this->rights[$r][4] =
'read';
118 $this->rights[$r][5] =
'';
121 $this->rights[$r][0] = 512;
122 $this->rights[$r][1] =
'Read employee salaries and payments (yours and of your subordinates)';
123 $this->rights[$r][2] =
'r';
124 $this->rights[$r][3] = 0;
125 $this->rights[$r][4] =
'readchild';
126 $this->rights[$r][5] =
'';
129 $this->rights[$r][0] = 513;
130 $this->rights[$r][1] =
'Create/modify payments of empoyee salaries';
131 $this->rights[$r][2] =
'w';
132 $this->rights[$r][3] = 0;
133 $this->rights[$r][4] =
'write';
134 $this->rights[$r][5] =
'';
137 $this->rights[$r][0] = 514;
138 $this->rights[$r][1] =
'Delete payments of employee salary';
139 $this->rights[$r][2] =
'd';
140 $this->rights[$r][3] = 0;
141 $this->rights[$r][4] =
'delete';
142 $this->rights[$r][5] =
'';
145 $this->rights[$r][0] = 517;
146 $this->rights[$r][1] =
'Read salaries and payments (of all employees)';
147 $this->rights[$r][2] =
'r';
148 $this->rights[$r][3] = 0;
149 $this->rights[$r][4] =
'readall';
152 $this->rights[$r][0] = 519;
153 $this->rights[$r][1] =
'Export payments of employee salaries';
154 $this->rights[$r][2] =
'r';
155 $this->rights[$r][3] = 0;
156 $this->rights[$r][4] =
'export';
157 $this->rights[$r][5] =
'';
171 $this->export_code[$r] = $this->rights_class.
'_'.$r;
172 $this->export_label[$r] =
'SalariesAndPayments';
173 $this->export_icon[$r] =
'salary';
174 $this->export_permission[$r] = array(array(
"salaries",
"export"));
175 $this->export_fields_array[$r] = array(
's.rowid' =>
'SalaryID',
's.label'=>
'Label',
's.datesp'=>
'DateStartPeriod',
's.dateep'=>
'DateEndPeriod',
's.amount' =>
'SalaryAmount',
's.paye' =>
'Status',
'u.firstname'=>
"Firstname",
'u.lastname'=>
"Lastname",
'u.login'=>
"Login",
'u.salary'=>
'CurrentSalary',
'p.datep'=>
'DatePayment',
'p.amount'=>
'AmountPayment',
'p.num_payment'=>
'Numero',
'p.note'=>
'Note');
176 $this->export_TypeFields_array[$r] = array(
's.rowid' =>
'Numeric',
's.label'=>
'Text',
's.amount' =>
'Numeric',
's.paye' =>
'Numeric',
'u.firstname'=>
"Text",
'u.lastname'=>
"Text",
'u.login'=>
'Text',
'u.salary'=>
"Numeric",
'p.datep'=>
'Date',
's.datesp'=>
'Date',
's.dateep'=>
'Date',
'p.amount'=>
'Numeric',
'p.num_payment'=>
'Numeric');
177 $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');
179 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
180 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'salary as s';
181 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON s.fk_user = u.rowid';
182 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'payment_salary as p ON p.fk_salary = s.rowid';
183 $this->export_sql_end[$r] .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'c_paiement as cp ON p.fk_typepayment = cp.id';
184 $this->export_sql_end[$r] .=
' AND s.entity IN ('.getEntity(
'salary').
')';