#1335 worker/filter renamed columns acordantly
This commit is contained in:
parent
97f3761e0c
commit
c2b3ff8d81
|
@ -1260,7 +1260,7 @@ INSERT INTO `pbx`.`sip`(`user_id`, `extension`, `secret`, `caller_id`)
|
|||
(9, 1201, '123456', 'developer');
|
||||
|
||||
INSERT INTO `postgresql`.`person`(`person_id`, `name`, `nickname`, `nif`, `firstname`, `id_trabajador`)
|
||||
SELECT w.id, w.name, u.nickname,CONCAT(RPAD(CONCAT(w.id,9),8,w.id),'A'),w.firstName,w.id
|
||||
SELECT w.id, w.lastName, u.nickname,CONCAT(RPAD(CONCAT(w.id,9),8,w.id),'A'),w.firstName,w.id
|
||||
FROM `vn`.`worker` `w`
|
||||
JOIN `account`.`user` `u` ON `u`.`id` = `w`.`userFk`;
|
||||
|
||||
|
|
|
@ -16,14 +16,14 @@ module.exports = function(Self) {
|
|||
Self.listWorkers = function() {
|
||||
let query =
|
||||
`SELECT w.id,
|
||||
CONCAT(w.firstName, IFNULL(CONCAT(" ", w.name), "")) \`name\`
|
||||
CONCAT(w.firstName, IFNULL(CONCAT(" ", w.lastName), "")) \`name\`
|
||||
FROM worker w
|
||||
JOIN account.user u ON w.userFk = u.id
|
||||
JOIN account.roleRole rr ON rr.role = u.role
|
||||
JOIN account.role r ON r.id = rr.inheritsFrom
|
||||
WHERE u.active
|
||||
AND r.\`name\` = 'employee'
|
||||
ORDER BY w.name ASC`;
|
||||
ORDER BY w.lastName ASC`;
|
||||
|
||||
return Self.rawSql(query);
|
||||
};
|
||||
|
|
|
@ -106,7 +106,7 @@ module.exports = Self => {
|
|||
i.value8,
|
||||
tci.price,
|
||||
tci.available,
|
||||
w.name AS lastName,
|
||||
w.lastName AS lastName,
|
||||
w.firstName
|
||||
FROM tmp.ticketCalculateItem tci
|
||||
JOIN vn.item i ON i.id = tci.itemFk
|
||||
|
|
|
@ -187,7 +187,7 @@ module.exports = Self => {
|
|||
w.name AS warehouse,
|
||||
am.name AS agencyMode,
|
||||
st.name AS state,
|
||||
wk.name AS salesPerson,
|
||||
wk.lastName AS salesPerson,
|
||||
ts.stateFk as stateFk,
|
||||
ts.alertLevel as alertLevel,
|
||||
ts.code as alertLevelCode,
|
||||
|
|
|
@ -61,7 +61,7 @@ module.exports = Self => {
|
|||
}, {
|
||||
arg: 'nickname',
|
||||
type: 'String',
|
||||
description: 'The worker name',
|
||||
description: 'The worker nickname',
|
||||
http: {source: 'query'}
|
||||
}
|
||||
],
|
||||
|
@ -85,15 +85,16 @@ module.exports = Self => {
|
|||
? {'w.id': value}
|
||||
: {or: [
|
||||
{'w.firstName': {like: `%${value}%`}},
|
||||
{'w.name': {like: `%${value}%`}},
|
||||
{'u.name': {like: `%${value}%`}}
|
||||
{'w.lastName': {like: `%${value}%`}},
|
||||
{'u.name': {like: `%${value}%`}},
|
||||
{'u.nickname': {like: `%${value}%`}}
|
||||
]};
|
||||
case 'id':
|
||||
return {'w.id': value};
|
||||
case 'userFk':
|
||||
return {'w.userFk': value};
|
||||
case 'name':
|
||||
return {'w.name': {like: `%${value}%`}};
|
||||
return {'w.lastName': {like: `%${value}%`}};
|
||||
case 'firstName':
|
||||
return {'w.firstName': {like: `%${value}%`}};
|
||||
case 'extension':
|
||||
|
@ -114,7 +115,7 @@ module.exports = Self => {
|
|||
|
||||
stmt = new ParameterizedSQL(
|
||||
`SELECT w.id, u.email, p.extension, u.name as userName,
|
||||
d.name AS department, w.name, u.nickname, mu.email
|
||||
d.name AS department, w.lastName, u.nickname, mu.email
|
||||
FROM worker w
|
||||
LEFT JOIN workerDepartment wd ON wd.workerFk = w.id
|
||||
LEFT JOIN department d ON d.id = wd.departmentFk
|
||||
|
|
|
@ -30,7 +30,7 @@ module.exports = {
|
|||
u.lang locale,
|
||||
u.name AS userName,
|
||||
c.email recipient,
|
||||
CONCAT(w.name, ' ', w.firstName) salesPersonName,
|
||||
CONCAT(w.lastName, ' ', w.firstName) salesPersonName,
|
||||
w.phone AS salesPersonPhone,
|
||||
CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail
|
||||
FROM client c
|
||||
|
|
|
@ -38,7 +38,7 @@ module.exports = {
|
|||
u.lang locale,
|
||||
u.name AS userName,
|
||||
c.email recipient,
|
||||
CONCAT(w.name, ' ', w.firstName) salesPersonName,
|
||||
CONCAT(w.lastName, ' ', w.firstName) salesPersonName,
|
||||
w.phone AS salesPersonPhone,
|
||||
CONCAT(wu.name, '@verdnatura.es') AS salesPersonEmail
|
||||
FROM client c
|
||||
|
|
Loading…
Reference in New Issue