Merge branch 'dev' into 5334-editDepartment
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-06-05 07:00:27 +00:00
commit 2545a40087
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
- (Tickets -> Crear Factura) Al facturar se envia automáticamente el pdf al cliente
- (Artículos -> Histórico) Filtro para mostrar lo anterior al inventario
- (Trabajadores -> Nuevo trabajador) Permite elegir el método de pago
### Changed
- (Trabajadores -> Nuevo trabajador) Los clientes se crean sin 'TR' pero se añade tipo de negocio 'Trabajador'
### Fixed
- (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 ?
INTO TABLE `edi`.`item`
CHARACTER SET ascii
FIELDS TERMINATED BY ';'
LINES TERMINATED BY '\n' (@col1, @col2, @col3, @col4, @col5, @col6, @col7, @col8, @col9, @col10, @col11, @col12)
SET
id = @col2,
SET id = @col2,
product_name = @col4,
name = @col5,
plant_id = @col7,
@ -11,3 +11,4 @@ LOAD DATA LOCAL INFILE ?
entry_date = STR_TO_DATE(@col10, '%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')

View File

@ -121,7 +121,8 @@ module.exports = Self => {
host: ftpConfig.host,
username: ftpConfig.user,
password: ftpConfig.password,
procotol: 'ftp'
procotol: 'ftp',
additionalLftpCommands: 'set ssl:verify-certificate no'
});
}
@ -132,7 +133,7 @@ module.exports = Self => {
const ftpClient = await getFtpClient();
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) => {
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 `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`)
VALUES
('WagonType', '*', '*', 'ALLOW', 'ROLE', 'productionAssi'),
@ -70,3 +68,4 @@ INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `pri
('WagonType', 'createWagonType', '*', 'ALLOW', 'ROLE', 'productionAssi'),
('WagonType', 'deleteWagonType', '*', '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 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;
-- Cuando se apruebe el PR quitar y poner en redmine para hacerse manualmente
UPDATE `vn`.`workerConfig`
SET payMethodFk = 4
WHERE id=1;

View File

@ -61950,7 +61950,6 @@ BEGIN
* @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.
*/
DECLARE vDateInventory DATETIME;
DECLARE vInvCalculated INT;

View File

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

View File

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

View File

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

View File

@ -15,3 +15,7 @@ columns:
image: imagen
hasGrant: puede delegar
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']
}
},
{
relation: 'businessType',
scope: {
fields: ['description']
}
},
{
relation: 'account',
scope: {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ columns:
packingOut: empaquetar
hasMinPrice: tiene precio mínimo
isFragile: frágil
isFloramondo: es floramondo
isFloramondo: floramondo
packingShelve: estantería embalaje
isLaid: puesto
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
isBox: box
itemPackingTypeFk: packing type
externalId: external id
stateTypeFk: status

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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