Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 5334-editDepartment

This commit is contained in:
Carlos Satorres 2023-06-05 08:30:12 +02:00
commit d8f5978284
35 changed files with 334 additions and 241 deletions

View File

@ -24,13 +24,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- (Tickets -> Crear Factura) Al facturar se envia automáticamente el pdf al cliente - (Tickets -> Crear Factura) Al facturar se envia automáticamente el pdf al cliente
- (Artículos -> Histórico) Filtro para mostrar lo anterior al inventario - (Artículos -> Histórico) Filtro para mostrar lo anterior al inventario
- (Trabajadores -> Nuevo trabajador) Permite elegir el método de pago
### Changed ### Changed
- (Trabajadores -> Nuevo trabajador) Los clientes se crean sin 'TR' pero se añade tipo de negocio 'Trabajador' - (Trabajadores -> Nuevo trabajador) Los clientes se crean sin 'TR' pero se añade tipo de negocio 'Trabajador'
### Fixed ### Fixed
- (Tickets -> Líneas) Se permite hacer split de líneas al mismo ticket - (Tickets -> Líneas) Se permite hacer split de líneas al mismo ticket
- (Tickets -> Cambiar estado) Ahora muestra la lista completa de todos los estados

View File

@ -1,9 +1,9 @@
LOAD DATA LOCAL INFILE ? LOAD DATA LOCAL INFILE ?
INTO TABLE `edi`.`item` INTO TABLE `edi`.`item`
CHARACTER SET ascii
FIELDS TERMINATED BY ';' FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n' (@col1, @col2, @col3, @col4, @col5, @col6, @col7, @col8, @col9, @col10, @col11, @col12) LINES TERMINATED BY '\n' (@col1, @col2, @col3, @col4, @col5, @col6, @col7, @col8, @col9, @col10, @col11, @col12)
SET SET id = @col2,
id = @col2,
product_name = @col4, product_name = @col4,
name = @col5, name = @col5,
plant_id = @col7, plant_id = @col7,
@ -11,3 +11,4 @@ LOAD DATA LOCAL INFILE ?
entry_date = STR_TO_DATE(@col10, '%Y%m%d'), entry_date = STR_TO_DATE(@col10, '%Y%m%d'),
expiry_date = IFNULL(NULL,STR_TO_DATE(@col11, '%Y%m%d')), expiry_date = IFNULL(NULL,STR_TO_DATE(@col11, '%Y%m%d')),
change_date_time = STR_TO_DATE(@col12, '%Y%m%d%H%i') change_date_time = STR_TO_DATE(@col12, '%Y%m%d%H%i')

View File

@ -121,7 +121,8 @@ module.exports = Self => {
host: ftpConfig.host, host: ftpConfig.host,
username: ftpConfig.user, username: ftpConfig.user,
password: ftpConfig.password, password: ftpConfig.password,
procotol: 'ftp' procotol: 'ftp',
additionalLftpCommands: 'set ssl:verify-certificate no'
}); });
} }
@ -132,7 +133,7 @@ module.exports = Self => {
const ftpClient = await getFtpClient(); const ftpClient = await getFtpClient();
console.debug(`Checking checksum for file ${file.name}...`); console.debug(`Checking checksum for file ${file.name}...`);
ftpClient.cat(`codes/${file.name}.txt`); ftpClient.cat(`codes/${file.name}.TXT`);
const response = await new Promise((resolve, reject) => { const response = await new Promise((resolve, reject) => {
ftpClient.exec((err, response) => { ftpClient.exec((err, response) => {

View File

@ -56,8 +56,6 @@ CREATE TABLE `vn`.`collectionWagonTicket` (
ALTER TABLE `vn`.`wagon` ADD `typeFk` int(11) unsigned NOT NULL; ALTER TABLE `vn`.`wagon` ADD `typeFk` int(11) unsigned NOT NULL;
ALTER TABLE `vn`.`wagon` ADD `label` int(11) unsigned NOT NULL; ALTER TABLE `vn`.`wagon` ADD `label` int(11) unsigned NOT NULL;
ALTER TABLE `vn`.`wagon` ADD CONSTRAINT `wagon_type` FOREIGN KEY (`typeFk`) REFERENCES `wagonType` (`id`) ON UPDATE CASCADE;
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES VALUES
('WagonType', '*', '*', 'ALLOW', 'ROLE', 'productionAssi'), ('WagonType', '*', '*', 'ALLOW', 'ROLE', 'productionAssi'),
@ -70,3 +68,4 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `pri
('WagonType', 'createWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'), ('WagonType', 'createWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'),
('WagonType', 'deleteWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'), ('WagonType', 'deleteWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'),
('WagonType', 'editWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'); ('WagonType', 'editWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi');

View File

@ -0,0 +1 @@
ALTER TABLE `vn`.`wagon` ADD CONSTRAINT `wagon_type` FOREIGN KEY (`typeFk`) REFERENCES `wagonType` (`id`) ON UPDATE CASCADE;

View File

@ -1,7 +1,7 @@
ALTER TABLE `vn`.`workerConfig` ADD payMethodFk tinyint(3) unsigned NULL; ALTER TABLE `vn`.`workerConfig` ADD payMethodFk tinyint(3) unsigned NULL;
ALTER TABLE `vn`.`workerConfig` ADD CONSTRAINT workerConfig_FK FOREIGN KEY (roleFk) REFERENCES account.`role`(id) ON DELETE RESTRICT ON UPDATE CASCADE; ALTER TABLE `vn`.`workerConfig` ADD CONSTRAINT workerConfig_FK FOREIGN KEY (roleFk) REFERENCES account.`role`(id) ON DELETE RESTRICT ON UPDATE CASCADE;
ALTER TABLE `vn`.`workerConfig` ADD CONSTRAINT workerConfig_FK_1 FOREIGN KEY (payMethodFk) REFERENCES `vn`.`payMethod`(id) ON DELETE SET NULL ON UPDATE CASCADE; ALTER TABLE `vn`.`workerConfig` ADD CONSTRAINT workerConfig_FK_1 FOREIGN KEY (payMethodFk) REFERENCES `vn`.`payMethod`(id) ON DELETE SET NULL ON UPDATE CASCADE;
-- Cuando se apruebe el PR quitar y poner en redmine para hacerse manualmente
UPDATE `vn`.`workerConfig` UPDATE `vn`.`workerConfig`
SET payMethodFk = 4 SET payMethodFk = 4
WHERE id=1; WHERE id=1;

View File

@ -61950,7 +61950,6 @@ BEGIN
* @vWarehouseFk almacen donde buscar * @vWarehouseFk almacen donde buscar
* @vDate Si la fecha es null, muestra el histórico desde el inventario. Si la fecha no es null, muestra histórico desde la fecha pasada. * @vDate Si la fecha es null, muestra el histórico desde el inventario. Si la fecha no es null, muestra histórico desde la fecha pasada.
*/ */
DECLARE vDateInventory DATETIME; DECLARE vDateInventory DATETIME;
DECLARE vInvCalculated INT; DECLARE vInvCalculated INT;

View File

@ -43,7 +43,7 @@ services:
- node.role == worker - node.role == worker
resources: resources:
limits: limits:
memory: 4G memory: 8G
configs: configs:
datasources: datasources:
external: true external: true

View File

@ -150,10 +150,10 @@ export default class Controller extends Section {
if (value == null || value == '') return null; if (value == null || value == '') return null;
switch (prop) { switch (prop) {
case 'search': case 'search':
const or = [{changedModelId: value}]; if (/^[0-9]+$/.test(value))
if (!/^[0-9]+$/.test(value)) return {changedModelId: value};
or.push({changedModelValue: {like: `%${value}%`}}); else
return {or}; return {changedModelValue: {like: `%${value}%`}};
case 'changes': case 'changes':
return {or: [ return {or: [
{oldInstance: {like: `%${value}%`}}, {oldInstance: {like: `%${value}%`}},

View File

@ -15,3 +15,7 @@ columns:
image: image image: image
hasGrant: has grant hasGrant: has grant
userFk: user userFk: user
recoverPass: recover password
role: role
sync: pending sync
lastPassChange: password changed

View File

@ -15,3 +15,7 @@ columns:
image: imagen image: imagen
hasGrant: puede delegar hasGrant: puede delegar
userFk: usuario userFk: usuario
recoverPass: recuperar contraseña
role: rol
sync: Pendiente de sincronizar
lastPassChange: contraseña modificada

View File

@ -59,6 +59,12 @@ module.exports = function(Self) {
fields: ['id', 'name'] fields: ['id', 'name']
} }
}, },
{
relation: 'businessType',
scope: {
fields: ['description']
}
},
{ {
relation: 'account', relation: 'account',
scope: { scope: {

View File

@ -43,6 +43,10 @@
{{$ctrl.client.salesPersonUser.name}} {{$ctrl.client.salesPersonUser.name}}
</span> </span>
</vn-label-value> </vn-label-value>
<vn-label-value
label="Business type"
value="{{$ctrl.client.businessType.description}}">
</vn-label-value>
</div> </div>
<div class="icons"> <div class="icons">
<vn-icon <vn-icon

View File

@ -8,3 +8,4 @@ Client invoices list: Listado de facturas del cliente
Pay method: Forma de pago Pay method: Forma de pago
Unpaid Dated: "Fecha: {{dated | date:'dd/MM/yyyy'}}" Unpaid Dated: "Fecha: {{dated | date:'dd/MM/yyyy'}}"
Unpaid Amount: "Importe: {{amount | currency: 'EUR':2}}" Unpaid Amount: "Importe: {{amount | currency: 'EUR':2}}"
Business type: Tipo de negocio

View File

@ -1,4 +1,4 @@
name: botanical name: botanical data
columns: columns:
itemFk: item itemFk: item
genusFk: genus genusFk: genus

View File

@ -1,4 +1,4 @@
name: botánico name: datos botánicos
columns: columns:
itemFk: artículo itemFk: artículo
genusFk: género genusFk: género

View File

@ -35,7 +35,7 @@ columns:
packingOut: packing out packingOut: packing out
hasMinPrice: has min price hasMinPrice: has min price
isFragile: fragile isFragile: fragile
isFloramondo: is floramondo isFloramondo: floramondo
packingShelve: packing shelve packingShelve: packing shelve
isLaid: laid isLaid: laid
inkFk: ink inkFk: ink

View File

@ -35,7 +35,7 @@ columns:
packingOut: empaquetar packingOut: empaquetar
hasMinPrice: tiene precio mínimo hasMinPrice: tiene precio mínimo
isFragile: frágil isFragile: frágil
isFloramondo: es floramondo isFloramondo: floramondo
packingShelve: estantería embalaje packingShelve: estantería embalaje
isLaid: puesto isLaid: puesto
inkFk: tinta inkFk: tinta

View File

@ -0,0 +1,11 @@
name: shelving
columns:
id: id
code: code
parkingFk: parking
isPrinted: printed
priority: priority
parked: parked
userFk: user
isSpam: SPAM
isRecyclable: recyclable

View File

@ -0,0 +1,11 @@
name: estantería
columns:
id: id
code: código
parkingFk: parking
isPrinted: impreso
priority: prioridad
parked: aparcado
userFk: usuario
isSpam: SPAM
isRecyclable: reciclable

View File

@ -12,3 +12,5 @@ columns:
hostFk: PC hostFk: PC
isBox: box isBox: box
itemPackingTypeFk: packing type itemPackingTypeFk: packing type
externalId: external id
stateTypeFk: status

View File

@ -12,3 +12,5 @@ columns:
hostFk: PC hostFk: PC
isBox: caja isBox: caja
itemPackingTypeFk: tipo empaquetado itemPackingTypeFk: tipo empaquetado
externalId: id externo
stateTypeFk: estado

View File

@ -4,9 +4,20 @@ columns:
companyCodeFk: company companyCodeFk: company
started: started started: started
ended: ended ended: ended
workerBusiness: business
reasonEndFk: ending reason
payedHolidays: payed holidays payedHolidays: payed holidays
occupationCodeFk: occupation
workerFk: worker workerFk: worker
notes: notes
departmentFk: department
workerBusinessProfessionalCategoryFk: professional category
calendarTypeFk: calendar type calendarTypeFk: calendar type
isHourlyLabor: hourly labor isHourlyLabor: hourly labor
workcenterFk: workcenter workcenterFk: workcenter
rate: rate
workerBusinessCategoryFk: category
workerBusinessTypeFk: type
amount: amount amount: amount
workerBusinessAgreementFk: agreement
basicSalary: salary

View File

@ -4,9 +4,20 @@ columns:
companyCodeFk: empresa companyCodeFk: empresa
started: iniciado started: iniciado
ended: finalizado ended: finalizado
workerBusiness: negocio
reasonEndFk: motivo finalización
payedHolidays: vacaciones pagadas payedHolidays: vacaciones pagadas
occupationCodeFk: ocupación
workerFk: trabajador workerFk: trabajador
notes: notas
departmentFk: departamento
workerBusinessProfessionalCategoryFk: categoría profesional
calendarTypeFk: tipo calendario calendarTypeFk: tipo calendario
isHourlyLabor: horario laboral isHourlyLabor: horario laboral
workcenterFk: centro de trabajo workcenterFk: centro de trabajo
rate: tarifa
workerBusinessCategoryFk: categoría
workerBusinessTypeFk: tipo
amount: salario amount: salario
workerBusinessAgreementFk: acuerdo
basicSalary: salario base

View File

@ -1,6 +1,6 @@
name: document name: document
columns: columns:
id: id id: id
dmsFk: dms worker: worker
workerFk: worker document: document
isReadableByWorker: readable by worker isReadableByWorker: readable by worker

View File

@ -1,6 +1,6 @@
name: documento name: documento
columns: columns:
id: id id: id
dmsFk: dms worker: trabajador
workerFk: trabajador document: documento
isReadableByWorker: legible por trabajador isReadableByWorker: accesible por trabajador

View File

@ -1,20 +1,32 @@
name: worker name: worker
columns: columns:
id: id id: id
code: code
firstName: first name firstName: first name
lastName: last name lastName: last name
sub: buyer number
photo: photo
phone: phone phone: phone
mobileExtension: mobile extension
userFk: user userFk: user
bossFk: boss bossFk: boss
fiDueDate: FI due date
hasMachineryAuthorized: machinery authorized
seniority: seniority
isTodayRelative: today relative
isF11Allowed: F11 allowed
sectorFk: sector
maritalStatus: marital status maritalStatus: marital status
labelerFk: labeler
originCountryFk: origin country originCountryFk: origin country
educationLevelFk: education level educationLevelFk: education level
SSN: SSN SSN: SSN
labelerFk: labeler fi: fiscal identifier
mobileExtension: mobile extension birth: birth date
code: code isDisable: disabled
isFreelance: freelance
isSsDiscounted: SS discounted
sex: sex
businessFk: current contract
balance: balance
locker: locker locker: locker
workerFk: worker
sectorFk: sector

View File

@ -1,20 +1,32 @@
name: trabajador name: trabajador
columns: columns:
id: id id: id
code: código
firstName: nombre firstName: nombre
lastName: apellido lastName: apellido
sub: número comprador
photo: foto
phone: teléfono phone: teléfono
mobileExtension: extensión móvil
userFk: usuario userFk: usuario
bossFk: jefe bossFk: jefe
fiDueDate: caducidad DNI
hasMachineryAuthorized: maquinaria autorizada
seniority: antigüedad
isTodayRelative: relativo hoy
isF11Allowed: F11 autorizado
sectorFk: sector
maritalStatus: estado civil maritalStatus: estado civil
labelerFk: etiquetadora
originCountryFk: país origen originCountryFk: país origen
educationLevelFk: nivel educativo educationLevelFk: nivel educativo
SSN: SSN SSN: SSN
labelerFk: etiquetadora fi: identificador fiscal
mobileExtension: extensión móvil birth: nacimiento
code: código isDisable: deshabilitado
locker: casillero isFreelance: autónomo
workerFk: trabajador isSsDiscounted: descuento SS
sectorFk: sector sex: sexo
businessFk: contrato actual
balance: saldo
locker: taquilla

View File

@ -230,21 +230,21 @@ module.exports = Self => {
}, myOptions); }, myOptions);
} else { } else {
const weekDay = day.dated.getDay(); const weekDay = day.dated.getDay();
const journeys = await models.Journey.find({ const journeys = await models.BusinessSchedule.find({
where: { where: {
business_id: day.businessFk, businessFk: day.businessFk,
day_id: weekDay weekday: weekDay
} }
}, myOptions); }, myOptions);
let timeTableDecimalInSeconds = 0; let timeTableDecimalInSeconds = 0;
for (let journey of journeys) { for (let journey of journeys) {
const start = Date.vnNew(); const start = Date.vnNew();
const [startHours, startMinutes, startSeconds] = getTime(journey.start); const [startHours, startMinutes, startSeconds] = getTime(journey.started);
start.setHours(startHours, startMinutes, startSeconds, 0); start.setHours(startHours, startMinutes, startSeconds, 0);
const end = Date.vnNew(); const end = Date.vnNew();
const [endHours, endMinutes, endSeconds] = getTime(journey.end); const [endHours, endMinutes, endSeconds] = getTime(journey.ended);
end.setHours(endHours, endMinutes, endSeconds, 0); end.setHours(endHours, endMinutes, endSeconds, 0);
const result = (end - start) / 1000; const result = (end - start) / 1000;
@ -255,7 +255,7 @@ module.exports = Self => {
const timeTableDecimal = timeTableDecimalInSeconds / 3600; const timeTableDecimal = timeTableDecimalInSeconds / 3600;
if (day.timeWorkDecimal == timeTableDecimal) { if (day.timeWorkDecimal == timeTableDecimal) {
const timed = new Date(day.dated); const timed = new Date(day.dated);
const [startHours, startMinutes, startSeconds] = getTime(journey.start); const [startHours, startMinutes, startSeconds] = getTime(journey.started);
await models.WorkerTimeControl.create({ await models.WorkerTimeControl.create({
userFk: day.workerFk, userFk: day.workerFk,
timed: timed.setHours(startHours, startMinutes, startSeconds), timed: timed.setHours(startHours, startMinutes, startSeconds),
@ -263,7 +263,7 @@ module.exports = Self => {
isSendMail: true isSendMail: true
}, myOptions); }, myOptions);
const [endHours, endMinutes, endSeconds] = getTime(journey.end); const [endHours, endMinutes, endSeconds] = getTime(journey.ended);
await models.WorkerTimeControl.create({ await models.WorkerTimeControl.create({
userFk: day.workerFk, userFk: day.workerFk,
timed: timed.setHours(endHours, endMinutes, endSeconds), timed: timed.setHours(endHours, endMinutes, endSeconds),
@ -276,7 +276,7 @@ module.exports = Self => {
}); });
if (journey == minStart) { if (journey == minStart) {
const timed = new Date(day.dated); const timed = new Date(day.dated);
const [startHours, startMinutes, startSeconds] = getTime(journey.start); const [startHours, startMinutes, startSeconds] = getTime(journey.started);
await models.WorkerTimeControl.create({ await models.WorkerTimeControl.create({
userFk: day.workerFk, userFk: day.workerFk,
timed: timed.setHours(startHours, startMinutes, startSeconds), timed: timed.setHours(startHours, startMinutes, startSeconds),
@ -304,7 +304,7 @@ module.exports = Self => {
}); });
if (journey == minStart) { if (journey == minStart) {
const timed = new Date(day.dated); const timed = new Date(day.dated);
const [startHours, startMinutes, startSeconds] = getTime(journey.start); const [startHours, startMinutes, startSeconds] = getTime(journey.started);
await models.WorkerTimeControl.create({ await models.WorkerTimeControl.create({
userFk: day.workerFk, userFk: day.workerFk,
timed: timed.setHours(startHours + 1, startMinutes, startSeconds), timed: timed.setHours(startHours + 1, startMinutes, startSeconds),

View File

@ -2,6 +2,9 @@
"AbsenceType": { "AbsenceType": {
"dataSource": "vn" "dataSource": "vn"
}, },
"BusinessSchedule": {
"dataSource": "vn"
},
"Calendar": { "Calendar": {
"dataSource": "vn" "dataSource": "vn"
}, },
@ -38,9 +41,6 @@
"EducationLevel": { "EducationLevel": {
"dataSource": "vn" "dataSource": "vn"
}, },
"Journey": {
"dataSource": "vn"
},
"ProfileType":{ "ProfileType":{
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -1,26 +1,26 @@
{ {
"name": "Journey", "name": "BusinessSchedule",
"base": "VnModel", "base": "VnModel",
"options": { "options": {
"mysql": { "mysql": {
"table": "postgresql.journey" "table": "businessSchedule"
} }
}, },
"properties": { "properties": {
"journey_id": { "id": {
"id": true, "id": true,
"type": "number" "type": "number"
}, },
"day_id": { "weekday": {
"type": "number" "type": "number"
}, },
"start": { "started": {
"type": "date" "type": "date"
}, },
"end": { "ended": {
"type": "date" "type": "date"
}, },
"business_id": { "businessFk": {
"type": "number" "type": "number"
} }
} }

View File

@ -75,7 +75,7 @@
"state": "worker.card.workerLog", "state": "worker.card.workerLog",
"component": "vn-worker-log", "component": "vn-worker-log",
"description": "Log", "description": "Log",
"acl": ["salesAssistant"] "acl": ["hr"]
}, { }, {
"url": "/note", "url": "/note",
"state": "worker.card.note", "state": "worker.card.note",