Merge branch '2188-holiday_view' of verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
c0a806f751
|
@ -23,12 +23,12 @@ module.exports = Self => {
|
|||
beginningYear.setHours(0, 0, 0, 0);
|
||||
|
||||
let holidays = await Self.rawSql(
|
||||
`SELECT lh.dated, chn.name, cht.name, w.id
|
||||
FROM vn.holiday lh
|
||||
JOIN vn.workCenter w ON w.id = lh.workcenterFk
|
||||
LEFT JOIN vn.calendarHolidaysName chn ON chn.id = lh.holidayDetailFk
|
||||
LEFT JOIN vn.calendarHolidaysType cht ON cht.id = lh.holidayTypeFk
|
||||
WHERE w.warehouseFk = ? AND lh.dated >= ?`, [warehouseFk, beginningYear]);
|
||||
`SELECT clh.dated, chn.name, cht.name, w.id
|
||||
FROM vn.calendarHolidays clh
|
||||
JOIN vn.workCenter w ON w.id = clh.workcenterFk
|
||||
LEFT JOIN vn.calendarHolidaysName chn ON chn.id = clh.calendarHolidaysNameFk
|
||||
LEFT JOIN vn.calendarHolidaysType cht ON cht.id = clh.calendarHolidaysTypeFk
|
||||
WHERE w.warehouseFk = ? AND clh.dated >= ?`, [warehouseFk, beginningYear]);
|
||||
|
||||
return holidays.map(holiday => {
|
||||
holiday.dated = new Date(holiday.dated);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"Department": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Holiday": {
|
||||
"CalendarHoliday": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"CalendarHolidaysName": {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
{
|
||||
"name": "Holiday",
|
||||
"name": "CalendarHoliday",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "holiday"
|
||||
"table": "calendarHolidays"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"holidayDetailFk": {
|
||||
"calendarHolidaysNameFk": {
|
||||
"id": true,
|
||||
"type": "Number"
|
||||
},
|
||||
"holidayTypeFk": {
|
||||
"calendarHolidaysTypeFk": {
|
||||
"id": true,
|
||||
"type": "Number"
|
||||
},
|
|
@ -23,7 +23,7 @@
|
|||
},
|
||||
"holidays": {
|
||||
"type": "hasMany",
|
||||
"model": "Holiday",
|
||||
"model": "CalendarHoliday",
|
||||
"foreignKey": "workCenterFk"
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue