Compare commits
1 Commits
dev
...
8213-itemS
Author | SHA1 | Date |
---|---|---|
Sergio De la torre | f4f5ab2651 |
|
@ -36,7 +36,3 @@ rules:
|
|||
jasmine/no-focused-tests: 0
|
||||
jasmine/prefer-toHaveBeenCalledWith: 0
|
||||
arrow-spacing: ["error", { "before": true, "after": true }]
|
||||
no-restricted-syntax:
|
||||
- "error"
|
||||
- selector: "NewExpression[callee.name='Date']"
|
||||
message: "Use Date.vnNew() instead of new Date()."
|
||||
|
|
|
@ -28,10 +28,9 @@ describe('ticket assign()', () => {
|
|||
await tx.rollback();
|
||||
});
|
||||
|
||||
it('should throw an error when there are no picking tickets', async() => {
|
||||
it('should throw an error when there is not picking tickets', async() => {
|
||||
try {
|
||||
await models.Collection.assign(ctx, options);
|
||||
fail('Expected an error to be thrown, but none was thrown.');
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual('There are not picking tickets');
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ module.exports = Self => {
|
|||
const url = await Self.app.models.Url.findOne({
|
||||
where: {
|
||||
appName,
|
||||
environment: process.env.NODE_ENV || 'development'
|
||||
environment: process.env.NODE_ENV || 'dev'
|
||||
}
|
||||
});
|
||||
return url?.url;
|
||||
|
|
|
@ -31,7 +31,7 @@ module.exports = Self => {
|
|||
return await Self.rawSql(`
|
||||
INSERT INTO workerActivity (workerFk, workerActivityTypeFk, model)
|
||||
SELECT ?, ?, ?
|
||||
FROM workerTimeControlConfig wtcc
|
||||
FROM workerTimeControlParams wtcp
|
||||
LEFT JOIN (
|
||||
SELECT wa.workerFk,
|
||||
wa.created,
|
||||
|
@ -44,7 +44,7 @@ module.exports = Self => {
|
|||
) sub ON TRUE
|
||||
WHERE sub.workerFk IS NULL
|
||||
OR sub.code <> ?
|
||||
OR TIMESTAMPDIFF(SECOND, sub.created, util.VN_NOW()) > wtcc.dayBreak;`
|
||||
OR TIMESTAMPDIFF(SECOND, sub.created, util.VN_NOW()) > wtcp.dayBreak;`
|
||||
, [userId, code, model, userId, code], myOptions);
|
||||
};
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@ USE `util`;
|
|||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
|
||||
INSERT INTO `version` VALUES ('vn-database','11358','45f7b60f1b43b24505a3e9abc6738dc484ad4fd5','2024-11-26 12:27:58','11365');
|
||||
INSERT INTO `version` VALUES ('vn-database','11311','315864403260623fede9f0471ef3d9036faf23b1','2024-11-12 08:00:59','11336');
|
||||
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10107','00-firstScript.sql','jenkins@10.0.2.69','2022-04-23 10:53:53',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','10112','00-firstScript.sql','jenkins@10.0.2.69','2022-05-09 09:14:53',NULL,NULL);
|
||||
|
@ -1065,50 +1065,11 @@ INSERT INTO `versionLog` VALUES ('vn-database','11290','00-firstScript.sql','jen
|
|||
INSERT INTO `versionLog` VALUES ('vn-database','11291','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-17 09:10:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11294','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11295','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-10 08:45:13',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11297','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:29',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11297','01-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11298','00-closure.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:37',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11300','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-18 08:27:05',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11302','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11308','00-firstScript.sql','jenkins@db-proxy1.servers.dc.verdnatura.es','2024-10-23 12:41:55',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11311','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 08:00:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11314','00-restrictedAsterisk.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11315','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11316','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11317','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11319','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11321','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11324','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-13 10:49:47',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11325','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11326','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11330','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11331','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11336','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11337','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11338','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-12 09:14:12',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11339','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:05:30',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','00-itemShelving.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:06:34',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','01-itemShelving.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:06:35',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','02-itemShelving.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:06:37',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','03-itemShelving.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:11:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','04-itemShelvingLog.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:11:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','05-itemShelvingLog.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:11:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11342','06-itemShelvingLog.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:11:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11343','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:11:07',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11344','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-13 17:36:45',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11344','01-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-13 17:46:26',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11345','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:11:08',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11346','00-address.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:15:02',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11346','01-client.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:16:29',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11346','02-supplier.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:27:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11347','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:27:57',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11348','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11349','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11350','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11353','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11355','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:14',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11357','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:16',NULL,NULL);
|
||||
INSERT INTO `versionLog` VALUES ('vn-database','11358','00-firstScript.sql','jenkins@db-proxy2.servers.dc.verdnatura.es','2024-11-26 07:28:21',NULL,NULL);
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
|
@ -2012,11 +1973,13 @@ INSERT INTO `ACL` VALUES (605,'Ticket','sendSms','WRITE','ALLOW','ROLE','employe
|
|||
INSERT INTO `ACL` VALUES (606,'Ticket','isLocked','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (607,'Ticket','freightCost','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (608,'Ticket','getComponentsSum','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','deliveryAssistant',10578);
|
||||
INSERT INTO `ACL` VALUES (609,'Ticket','updateAttributes','WRITE','ALLOW','ROLE','delivery',NULL);
|
||||
INSERT INTO `ACL` VALUES (610,'Ticket','deliveryNoteCsv','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (611,'State','find','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (612,'State','findById','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (613,'State','findOne','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (614,'Worker','find','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (616,'Worker','findOne','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (617,'Worker','filter','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (618,'Worker','getWorkedHours','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (619,'Worker','active','READ','ALLOW','ROLE','employee',NULL);
|
||||
|
@ -2082,6 +2045,7 @@ INSERT INTO `ACL` VALUES (716,'ExpeditionMistake','*','WRITE','ALLOW','ROLE','em
|
|||
INSERT INTO `ACL` VALUES (717,'WorkerMistake','*','WRITE','ALLOW','ROLE','coolerAssist',NULL);
|
||||
INSERT INTO `ACL` VALUES (718,'MistakesTypes','*','WRITE','ALLOW','ROLE','coolerAssist',NULL);
|
||||
INSERT INTO `ACL` VALUES (719,'MistakeType','*','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (720,'MachineWorker','*','READ','ALLOW','ROLE','coolerAssist',NULL);
|
||||
INSERT INTO `ACL` VALUES (721,'Printer','*','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (722,'SaleMistake','*','WRITE','ALLOW','ROLE','production',NULL);
|
||||
INSERT INTO `ACL` VALUES (723,'Item','setVisibleDiscard','WRITE','ALLOW','ROLE','employee',NULL);
|
||||
|
@ -2119,10 +2083,13 @@ INSERT INTO `ACL` VALUES (755,'Route','findById','READ','ALLOW','ROLE','employee
|
|||
INSERT INTO `ACL` VALUES (756,'Route','findOne','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (757,'Route','getRoutesByWorker','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (758,'Route','canViewAllRoute','READ','ALLOW','ROLE','deliveryAssistant',NULL);
|
||||
INSERT INTO `ACL` VALUES (759,'Route','cmr','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (760,'Cmr','downloadZip','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (761,'Route','downloadZip','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (762,'Route','filter','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (763,'Route','getByWorker','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (764,'Route','getDeliveryPoint','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (765,'Route','cmrs','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (766,'Route','getSuggestedTickets','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (767,'Route','getTickets','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (768,'Route','guessPriority','WRITE','ALLOW','ROLE','employee',NULL);
|
||||
|
@ -2163,6 +2130,7 @@ INSERT INTO `ACL` VALUES (802,'MailAliasAccount','deleteById','WRITE','ALLOW','R
|
|||
INSERT INTO `ACL` VALUES (804,'DeviceProduction','*','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (805,'Collection','assign','WRITE','ALLOW','ROLE','production',NULL);
|
||||
INSERT INTO `ACL` VALUES (806,'ExpeditionPallet','getPallet','READ','ALLOW','ROLE','production',NULL);
|
||||
INSERT INTO `ACL` VALUES (807,'MachineWorker','updateInTime','WRITE','ALLOW','ROLE','production',NULL);
|
||||
INSERT INTO `ACL` VALUES (808,'MobileAppVersionControl','getVersion','READ','ALLOW','ROLE','employee',NULL);
|
||||
INSERT INTO `ACL` VALUES (809,'SaleTracking','delete','WRITE','ALLOW','ROLE','production',NULL);
|
||||
INSERT INTO `ACL` VALUES (810,'SaleTracking','updateTracking','WRITE','ALLOW','ROLE','production',NULL);
|
||||
|
@ -2248,7 +2216,7 @@ INSERT INTO `ACL` VALUES (895,'ItemShelvingLog','*','READ','ALLOW','ROLE','produ
|
|||
INSERT INTO `ACL` VALUES (901,'WorkerTimeControl','sendMail','WRITE','ALLOW','ROLE','system',NULL);
|
||||
INSERT INTO `ACL` VALUES (902,'Entry','filter','READ','ALLOW','ROLE','supplier',NULL);
|
||||
INSERT INTO `ACL` VALUES (903,'Entry','getBuys','READ','ALLOW','ROLE','supplier',NULL);
|
||||
INSERT INTO `ACL` VALUES (904,'Entry','buyLabelSupplier','READ','ALLOW','ROLE','supplier',10578);
|
||||
INSERT INTO `ACL` VALUES (904,'Entry','buyLabel','READ','ALLOW','ROLE','supplier',NULL);
|
||||
INSERT INTO `ACL` VALUES (905,'AddressWaste','*','READ','ALLOW','ROLE','production',NULL);
|
||||
INSERT INTO `ACL` VALUES (906,'Entry','print','READ','ALLOW','ROLE','supplier',NULL);
|
||||
INSERT INTO `ACL` VALUES (907,'Expedition_PrintOut','*','*','ALLOW','ROLE','production',NULL);
|
||||
|
@ -2262,6 +2230,7 @@ INSERT INTO `ACL` VALUES (914,'VnToken','killSession','*','ALLOW','ROLE','develo
|
|||
INSERT INTO `ACL` VALUES (915,'ACL','*','WRITE','ALLOW','ROLE','developerBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (917,'InvoiceOut','refundAndInvoice','WRITE','ALLOW','ROLE','administrative',10578);
|
||||
INSERT INTO `ACL` VALUES (918,'Worker','__get__descriptor','READ','ALLOW','ROLE','employee',10578);
|
||||
INSERT INTO `ACL` VALUES (919,'Worker','findById','READ','ALLOW','ROLE','employee',10578);
|
||||
INSERT INTO `ACL` VALUES (920,'QuadmindsApiConfig','*','*','ALLOW','ROLE','delivery',19295);
|
||||
INSERT INTO `ACL` VALUES (922,'SaleGroup','*','WRITE','ALLOW','ROLE','production',19294);
|
||||
INSERT INTO `ACL` VALUES (923,'Worker','__get__advancedSummary','READ','ALLOW','ROLE','hr',10578);
|
||||
|
@ -2281,23 +2250,6 @@ INSERT INTO `ACL` VALUES (936,'Device','handleUser','*','ALLOW','ROLE','employee
|
|||
INSERT INTO `ACL` VALUES (937,'WorkerTimeControlMail','count','READ','ALLOW','ROLE','employee',10578);
|
||||
INSERT INTO `ACL` VALUES (938,'Worker','__get__mail','READ','ALLOW','ROLE','hr',10578);
|
||||
INSERT INTO `ACL` VALUES (939,'Machine','*','*','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (940,'ItemTypeLog','find','READ','ALLOW','ROLE','employee',10578);
|
||||
INSERT INTO `ACL` VALUES (941,'Entry','buyLabel','READ','ALLOW','ROLE','employee',10578);
|
||||
INSERT INTO `ACL` VALUES (942,'Cmr','filter','READ','ALLOW','ROLE','production',10578);
|
||||
INSERT INTO `ACL` VALUES (943,'Cmr','downloadZip','READ','ALLOW','ROLE','production',10578);
|
||||
INSERT INTO `ACL` VALUES (944,'Cmr','print','READ','ALLOW','ROLE','production',10578);
|
||||
INSERT INTO `ACL` VALUES (945,'Collection','create','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (946,'Collection','upsert','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (947,'Collection','replaceById','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (948,'Collection','updateAll','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (949,'Collection','updateAttributes','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (950,'Collection','deleteById','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (951,'Collection','destroyAll','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (952,'Collection','destroyById','WRITE','ALLOW','ROLE','productionBoss',10578);
|
||||
INSERT INTO `ACL` VALUES (953,'RouteAction','find','READ','ALLOW','ROLE','delivery',10578);
|
||||
INSERT INTO `ACL` VALUES (954,'RouteComplement','find','READ','ALLOW','ROLE','delivery',10578);
|
||||
INSERT INTO `ACL` VALUES (955,'RouteComplement','create','WRITE','ALLOW','ROLE','delivery',10578);
|
||||
INSERT INTO `ACL` VALUES (956,'RouteComplement','deleteById','WRITE','ALLOW','ROLE','delivery',10578);
|
||||
|
||||
INSERT INTO `fieldAcl` VALUES (1,'Client','name','update','employee');
|
||||
INSERT INTO `fieldAcl` VALUES (2,'Client','contact','update','employee');
|
||||
|
@ -2629,13 +2581,13 @@ INSERT INTO `department` VALUES (1,'VN','VERDNATURA',1,116,763,0,0,0,0,26,NULL,'
|
|||
INSERT INTO `department` VALUES (22,'shopping','COMPRAS',2,5,NULL,72,0,0,1,1,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (23,'CMA','CAMARA',15,16,NULL,72,1,1,2,0,37,'/1/37/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL,'PREVIOUS');
|
||||
INSERT INTO `department` VALUES (31,'it','INFORMATICA',6,7,NULL,72,0,0,1,0,1,'/1/','informatica-cau',1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (34,'accounting','CONTABILIDAD',8,9,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (35,'finance','FINANZAS',10,11,NULL,0,0,0,1,0,1,'/1/',NULL,1,'begonya@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (36,'labor','LABORAL',12,13,NULL,0,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (37,'PROD','PRODUCCION',14,37,NULL,72,1,1,1,11,1,'/1/',NULL,0,NULL,0,1,1,1,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (38,'picking','SACADO',17,18,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,1,0,1,NULL,NULL,NULL,'ON_PREPARATION');
|
||||
INSERT INTO `department` VALUES (39,'packing','ENCAJADO',19,20,NULL,72,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'PACKING');
|
||||
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',38,39,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,1,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (41,'administration','ADMINISTRACION',38,39,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (43,'VT','VENTAS',40,75,NULL,0,0,0,1,17,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (44,'management','GERENCIA',76,77,NULL,72,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (45,'logistic','LOGISTICA',78,79,NULL,72,0,0,1,0,1,'/1/',NULL,1,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
|
@ -2678,7 +2630,7 @@ INSERT INTO `department` VALUES (135,'routers','ENRUTADORES',110,111,NULL,0,0,0,
|
|||
INSERT INTO `department` VALUES (136,'heavyVehicles','VEHICULOS PESADOS',112,113,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (137,'sorter','SORTER',114,115,NULL,0,0,0,1,0,1,'/1/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (139,'spainTeam4','EQUIPO ESPAÑA 4',67,68,3803,0,0,0,2,0,43,'/1/43/','es4_equipo',1,'es4@verdnatura.es',0,0,0,0,NULL,NULL,'5400',NULL);
|
||||
INSERT INTO `department` VALUES (140,'internationalTeam','EQUIPO INTERNACIONAL',69,70,24065,0,0,0,2,0,43,'/1/43/','int_equipo',1,'international@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (140,'internationalTeam','EQUIPO INTERNACIONAL',69,70,33320,0,0,0,2,0,43,'/1/43/','int_equipo',1,'international@verdnatura.es',0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (141,NULL,'PREVIA',35,36,NULL,0,1,0,2,0,37,'/1/37/',NULL,0,NULL,0,0,0,1,NULL,NULL,NULL,'PREVIOUS');
|
||||
INSERT INTO `department` VALUES (146,NULL,'VERDNACOLOMBIA',3,4,NULL,72,0,0,2,0,22,'/1/22/',NULL,0,NULL,0,0,0,0,NULL,NULL,NULL,NULL);
|
||||
INSERT INTO `department` VALUES (147,'spainTeamAsia','EQUIPO ESPAÑA ASIA',71,72,40214,0,0,0,2,0,43,'/1/43/','esA_equipo',0,'esA@verdnatura.es',0,0,0,0,NULL,NULL,'5500',NULL);
|
||||
|
|
|
@ -49,7 +49,6 @@ INSERT IGNORE INTO `db` VALUES ('','geo','developerBoss','Y','Y','Y','Y','N','N'
|
|||
INSERT IGNORE INTO `db` VALUES ('','floranet','developer','Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N');
|
||||
INSERT IGNORE INTO `db` VALUES ('','tmp','guest','Y','Y','Y','Y','N','Y','N','N','N','N','Y','N','N','N','N','N','N','N','N','N');
|
||||
INSERT IGNORE INTO `db` VALUES ('','util','salix','Y','Y','Y','Y','N','N','N','N','N','N','Y','N','N','N','N','N','Y','N','N','N');
|
||||
INSERT IGNORE INTO `db` VALUES ('','srt','maintenanceBoss','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N');
|
||||
INSERT IGNORE INTO `db` VALUES ('','dipole','developerBoss','Y','Y','Y','Y','N','N','Y','N','N','N','N','N','N','N','N','N','Y','N','N','N');
|
||||
INSERT IGNORE INTO `db` VALUES ('','bi','developerBoss','Y','Y','Y','Y','N','N','Y','N','N','N','N','N','N','N','N','N','Y','N','N','N');
|
||||
INSERT IGNORE INTO `db` VALUES ('','sage','developerBoss','Y','Y','Y','Y','N','N','Y','N','N','N','N','N','N','N','N','N','Y','N','N','N');
|
||||
|
@ -942,6 +941,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','volumeConfig','alex
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerBoss','ticketTrackingState','alexm@%','0000-00-00 00:00:00','Select,Insert,Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','warehouse','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','role','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','workCenter','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','clientCredit','juan@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','worker','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','coolerAssist','workerAppTester','alexm@%','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1246,6 +1246,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','bs','deliveryAssistant','m3','alexm
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','ticketDms','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','time','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','deliveryAssistant','v_Articles_botanical','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','workCenter','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','workerDepartment','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryAssistant','zoneEvent','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bi','deliveryAssistant','rotacion','alexm@db-proxy2.static.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1387,7 +1388,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','entry','jenki
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','Cubos_Retorno','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','claimDestination','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','entryConfig','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','farmingDeliveryNote','carlosap@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','administrative','farmingDeliveryNote','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','sage','grafana','TiposIva','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','bs','buyer','waste','alexm@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','clientObservation','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1418,9 +1419,13 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financialBoss','accountDetail'
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','adminOfficer','accountDetail','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','project','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','maintenanceBoss','machineDetail','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyerSalesAssistant','route','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','employee','workCenter','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyerSalesAssistant','Rutas','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Update','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','antenna','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','bufferPool','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','enteringLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','expeditionLoading','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','failureLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','movingLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','sorterLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','buyer','genericAllocation','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','hr','businessReasonEnd','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn2008','buyer','buy_edi','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1458,7 +1463,7 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','vehicleDms','gu
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','vehicleInvoiceIn','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','deliveryBoss','vehicleNotes','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','production','saleGroup','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','shelvingLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','srt','maintenanceBoss','bufferLog','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','financialBoss','supplierAccount','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','productionAssi','tillSerial','alexm@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','stockBuyed','guillermo@db-proxy1.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
|
@ -1489,7 +1494,6 @@ INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemStemTag',
|
|||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBaseTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemBreederTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','grafana','itemShelvingLog','guillermo@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select','');
|
||||
INSERT IGNORE INTO `tables_priv` VALUES ('','vn','logisticAssist','itemTextureTag','jenkins@db-proxy2.servers.dc.verdnatura.es','0000-00-00 00:00:00','Select,Insert,Update,Delete','');
|
||||
/*!40000 ALTER TABLE `tables_priv` ENABLE KEYS */;
|
||||
|
||||
/*!40000 ALTER TABLE `columns_priv` DISABLE KEYS */;
|
||||
|
@ -1869,7 +1873,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','claimManager','buy_getVolumeByE
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_getVolumeByEntry','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','entry_moveNotPrinted','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_getVolume','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','stockBuyedByWorker','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','buy_getsplit','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','salesAssistant','subordinategetlist','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','buy_afterUpsert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -1922,7 +1925,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','util','grafana','firstdayofyear','FU
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','claimManager','dayend','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','util','employee','log_add','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','employee','moving_between','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','bi','financial','defaultersfromdate','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','bi','financial','defaultersfromdate','PROCEDURE','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','getuser','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','hasanynegativebase','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','marketingBoss','hasanynegativebase','FUNCTION','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2017,7 +2020,6 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','hr','logshow','PROCEDURE','alex
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyerBoss','supplierpackaging_reportsource','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','financialBoss','supplierexpenses','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','grafana','firstdayofweek','FUNCTION','juan@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','buyer','stockBuyed_add','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','mail_insert','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','administrative','duaParcialMake','PROCEDURE','alexm@%','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','palletizerBoss','packingsite_startcollection','PROCEDURE','alexm@db-proxy2.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2097,6 +2099,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','collection_printst
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','deviceproductionuser_getworker','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','ticket_printlabelprevious','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','ticket_isoutclosurezone','FUNCTION','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','workermachinery_isregistered','FUNCTION','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','ticketstatetoday_setstate','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','device_checklogin','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','worker_getfromhasmistake','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2104,7 +2107,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','sectorcollection_n
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','sectorcollection_get','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','setparking','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','shelvingparking_get','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','employee','report_print','PROCEDURE','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','machine_getworkerplate','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','saletracking_addprevok','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','sectorcollectionsalegroup_add','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','saletracking_updateischecked','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2113,7 +2116,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','travel_updatepacki
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','freelance_getinfo','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','company_getfiscaldata','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expedition_getfromroute','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','buy_getUltimate','FUNCTION','guillermo@db-proxy2.servers.dc.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','machineworker_gethistorical','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','itemplacementsupplyaiming','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','production','expeditionstate_addbypallet','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','production','expeditionloading_add','PROCEDURE','alexm@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2147,6 +2150,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','collection_printstic
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','deviceproductionuser_getworker','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','ticket_printlabelprevious','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','ticket_isoutclosurezone','FUNCTION','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','workermachinery_isregistered','FUNCTION','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','ticketstatetoday_setstate','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','device_checklogin','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','worker_getfromhasmistake','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2154,6 +2158,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','sectorcollection_new
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','sectorcollection_get','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','setparking','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','shelvingparking_get','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','machine_getworkerplate','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','saletracking_addprevok','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','sectorcollectionsalegroup_add','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','saletracking_updateischecked','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2162,6 +2167,7 @@ INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','travel_updatepacking
|
|||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','freelance_getinfo','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','company_getfiscaldata','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','expedition_getfromroute','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','machineworker_gethistorical','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','itemplacementsupplyaiming','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','vn','delivery','expeditionstate_addbypallet','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
INSERT IGNORE INTO `procs_priv` VALUES ('','srt','delivery','expeditionloading_add','PROCEDURE','guillermo@db-proxy1.static.verdnatura.es','Execute','0000-00-00 00:00:00');
|
||||
|
@ -2251,7 +2257,6 @@ INSERT IGNORE INTO `global_priv` VALUES ('','assetManager','{\"access\":0,\"vers
|
|||
INSERT IGNORE INTO `global_priv` VALUES ('','buyer','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','buyerAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','buyerBoss','{\"access\": 0, \"version_id\": 101106, \"is_role\": true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','buyerSalesAssistant','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','claimManager','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','cooler','{\"access\":0,\"version_id\":101106,\"is_role\":true}');
|
||||
INSERT IGNORE INTO `global_priv` VALUES ('','coolerAssist','{\"access\":0,\"version_id\":100707,\"is_role\":true}');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -867,17 +867,17 @@ BEGIN
|
|||
|
||||
UPDATE vn.buy b
|
||||
JOIN vn.entry e ON e.id = b.entryFk
|
||||
JOIN vn.travel tr ON tr.id = e.travelFk
|
||||
JOIN vn.agencyMode am ON am.id = tr.agencyModeFk
|
||||
JOIN vn.travel tr ON tr.id = e.travelFk
|
||||
JOIN vn.agencyMode am ON am.id = tr.agencyModeFk
|
||||
JOIN vn.item i ON i.id = b.itemFk
|
||||
JOIN edi.supplyResponse sr ON i.supplyResponseFk = sr.ID
|
||||
SET b.quantity = NEW.NumberOfItemsPerCask * NEW.NumberOfUnits,
|
||||
b.stickers = NEW.NumberOfUnits
|
||||
WHERE i.supplyResponseFk = NEW.ID
|
||||
AND am.name = 'LOGIFLORA'
|
||||
AND tr.isRaid
|
||||
AND e.isRaid
|
||||
AND tr.landed >= util.VN_CURDATE();
|
||||
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -1460,9 +1460,6 @@ DELIMITER ;;
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
IF NEW.`property` = '*' THEN
|
||||
CALL util.throw('The property field cannot be *');
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -2003,7 +2000,6 @@ BEGIN
|
|||
DECLARE vIsEqualizated BOOL;
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
SET NEW.geoFk = address_getGeo(NEW.id);
|
||||
|
||||
IF (NEW.phone <> '') THEN
|
||||
CALL pbx.phone_isValid(NEW.phone);
|
||||
|
@ -2040,6 +2036,7 @@ DELIMITER ;;
|
|||
BEFORE UPDATE ON `address`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF !(NEW.phone <=> OLD.phone) AND (NEW.phone <> '') THEN
|
||||
|
@ -2050,11 +2047,6 @@ BEGIN
|
|||
CALL pbx.phone_isValid(NEW.mobile);
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.provinceFk <=> OLD.provinceFk)
|
||||
OR (NEW.postalCode <=> OLD.postalCode) THEN
|
||||
|
||||
SET NEW.geoFk = address_getGeo(NEW.id);
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -3431,10 +3423,8 @@ DELIMITER ;;
|
|||
BEFORE INSERT ON `client`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
SET NEW.accountingAccount = 4300000000 + NEW.id;
|
||||
SET NEW.lastSalesPersonFk = NEW.salesPersonFk;
|
||||
SET NEW.geoFk = client_getGeo(NEW.id);
|
||||
|
||||
IF (NEW.phone <> '') THEN
|
||||
CALL pbx.phone_isValid(NEW.phone);
|
||||
|
@ -3443,6 +3433,10 @@ BEGIN
|
|||
IF (NEW.mobile <> '') THEN
|
||||
CALL pbx.phone_isValid(NEW.mobile);
|
||||
END IF;
|
||||
|
||||
SET NEW.accountingAccount = 4300000000 + NEW.id;
|
||||
|
||||
SET NEW.lastSalesPersonFk = NEW.salesPersonFk;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -3556,12 +3550,6 @@ BEGIN
|
|||
IF NOT (NEW.businessTypeFk <=> OLD.businessTypeFk) AND (NEW.businessTypeFk = 'individual' OR OLD.businessTypeFk = 'individual') THEN
|
||||
SET NEW.isTaxDataChecked = 0;
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.provinceFk <=> OLD.provinceFk)
|
||||
OR (NEW.postcode <=> OLD.postcode) THEN
|
||||
|
||||
SET NEW.geoFk = client_getGeo(NEW.id);
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -4972,7 +4960,7 @@ DELIMITER ;;
|
|||
BEFORE UPDATE ON `entry`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE vIsRaid BOOL;
|
||||
DECLARE vIsVirtual BOOL;
|
||||
DECLARE vPrintedCount INT;
|
||||
DECLARE vHasDistinctWarehouses BOOL;
|
||||
DECLARE vTotalBuy INT;
|
||||
|
@ -5006,20 +4994,18 @@ BEGIN
|
|||
IF NEW.travelFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.travelFk);
|
||||
END IF;
|
||||
|
||||
SELECT t.isRaid INTO vIsRaid
|
||||
FROM travel t
|
||||
JOIN entry e ON e.travelFk = t.id
|
||||
WHERE e.id = NEW.id;
|
||||
|
||||
SELECT COUNT(*) > 0 INTO vIsVirtual
|
||||
FROM entryVirtual WHERE entryFk = NEW.id;
|
||||
|
||||
SELECT NOT (o.warehouseInFk <=> n.warehouseInFk)
|
||||
OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)
|
||||
OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)
|
||||
INTO vHasDistinctWarehouses
|
||||
FROM travel o, travel n
|
||||
WHERE o.id = OLD.travelFk
|
||||
AND n.id = NEW.travelFk;
|
||||
|
||||
IF vIsRaid AND vHasDistinctWarehouses THEN
|
||||
IF vIsVirtual AND vHasDistinctWarehouses THEN
|
||||
SIGNAL SQLSTATE '45000'
|
||||
SET MESSAGE_TEXT = 'A cloned entry cannot be moved to a travel with different warehouses';
|
||||
END IF;
|
||||
|
@ -5042,7 +5028,7 @@ BEGIN
|
|||
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk)
|
||||
IF NOT (NEW.travelFk <=> OLD.travelFk)
|
||||
OR NOT (NEW.currencyFk <=> OLD.currencyFk)
|
||||
OR NOT (NEW.supplierFk <=> OLD.supplierFk) THEN
|
||||
|
||||
|
@ -5339,8 +5325,7 @@ BEGIN
|
|||
SET packages = (SELECT COUNT(counter)-1
|
||||
FROM expedition e WHERE e.ticketFk = OLD.ticketFk and e.freightItemFk)
|
||||
WHERE t.id = OLD.ticketFk;
|
||||
|
||||
CALL expedition_selfConsumptionPackaging(OLD.id, 'remove');
|
||||
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -6924,31 +6909,10 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemType_beforeInsert`
|
||||
BEFORE INSERT ON `itemType`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemType_beforeUpdate`
|
||||
BEFORE UPDATE ON `itemType`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
IF NEW.itemPackingTypeFk = '' THEN
|
||||
|
||||
SET NEW.itemPackingTypeFk = NULL;
|
||||
|
@ -6975,30 +6939,6 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`itemType_afterDelete`
|
||||
AFTER DELETE ON `itemType`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO itemTypeLog
|
||||
SET `action` = 'delete',
|
||||
`changedModel` = 'ItemType',
|
||||
`changedModelId` = OLD.id,
|
||||
`userFk` = account.myUser_getId();
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`machine_beforeInsert`
|
||||
BEFORE INSERT ON `machine`
|
||||
FOR EACH ROW
|
||||
|
@ -7644,7 +7584,7 @@ DELIMITER ;;
|
|||
AFTER DELETE ON `productionConfig`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO productionConfigLog
|
||||
INSERT INTO productionConfig
|
||||
SET `action` = 'delete',
|
||||
`changedModel` = 'ProductionConfig',
|
||||
`changedModelId` = OLD.id,
|
||||
|
@ -8228,18 +8168,18 @@ DELIMITER ;;
|
|||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`route_afterUpdate`
|
||||
AFTER UPDATE ON `route`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
BEGIN
|
||||
IF IFNULL(NEW.gestdocFk,0) <> IFNULL(OLD.gestdocFk,0) AND NEW.gestdocFk > 0 THEN
|
||||
-- JGF 09/09/14 cuando se añade un gestdoc a una ruta, se le asigna automagicamente a todos sus Tickets
|
||||
|
||||
|
||||
-- Inserta el gestdoc en todos los tickets de la ruta
|
||||
INSERT INTO ticketDms(ticketFk,dmsFk)
|
||||
SELECT id, NEW.gestdocFk FROM ticket WHERE routeFk = NEW.id
|
||||
ON DUPLICATE KEY UPDATE dmsFk = NEW.gestdocFk;
|
||||
|
||||
-- Update del firmado
|
||||
UPDATE ticket t
|
||||
JOIN ticketDms tg ON t.id = tg.ticketFk
|
||||
-- Update del firmado
|
||||
UPDATE ticket t
|
||||
JOIN ticketDms tg ON t.id = tg.ticketFk
|
||||
SET isSigned = 1 WHERE t.routeFk = NEW.id;
|
||||
END IF;
|
||||
|
||||
|
@ -8247,8 +8187,7 @@ BEGIN
|
|||
OR !(NEW.kmEnd <=> OLD.kmEnd)
|
||||
OR !(NEW.workerFk <=> OLD.workerFk)
|
||||
OR !(NEW.m3 <=> OLD.m3)
|
||||
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
|
||||
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
|
||||
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)THEN
|
||||
CALL route_calcCommission(NEW.id);
|
||||
END IF;
|
||||
|
||||
|
@ -9147,7 +9086,6 @@ DELIMITER ;;
|
|||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
SET NEW.geoFk = supplier_getGeo(NEW.id);
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -9242,11 +9180,6 @@ BEGIN
|
|||
SET NEW.isPayMethodChecked = FALSE;
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.provinceFk <=> OLD.provinceFk)
|
||||
OR (NEW.postCode <=> OLD.postCode) THEN
|
||||
|
||||
SET NEW.geoFk = supplier_getGeo(NEW.id);
|
||||
END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
|
@ -10568,6 +10501,28 @@ DELIMITER ;
|
|||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`town_beforeUpdate`
|
||||
BEFORE UPDATE ON `town`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
-- IF !(OLD.geoFk <=> NEW.geoFk) THEN
|
||||
-- CALL zoneGeo_throwNotEditable;
|
||||
-- END IF;
|
||||
END */;;
|
||||
DELIMITER ;
|
||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
||||
/*!50003 SET character_set_client = utf8mb4 */ ;
|
||||
/*!50003 SET character_set_results = utf8mb4 */ ;
|
||||
/*!50003 SET collation_connection = utf8mb4_unicode_ci */ ;
|
||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
||||
/*!50003 SET sql_mode = 'IGNORE_SPACE,NO_ENGINE_SUBSTITUTION' */ ;
|
||||
DELIMITER ;;
|
||||
/*!50003 CREATE*/ /*!50017 DEFINER=`vn`@`localhost`*/ /*!50003 TRIGGER `vn`.`town_afterUpdate`
|
||||
AFTER UPDATE ON `town`
|
||||
FOR EACH ROW
|
||||
|
@ -10625,11 +10580,7 @@ BEGIN
|
|||
CALL travel_checkDates(NEW.shipped, NEW.landed);
|
||||
|
||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||
|
||||
IF NEW.isRaid IS NOT NULL OR NEW.daysInForward IS NOT NULL THEN
|
||||
CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward);
|
||||
END IF;
|
||||
|
||||
|
||||
IF NEW.awbFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.id);
|
||||
END IF;
|
||||
|
@ -10656,7 +10607,7 @@ BEGIN
|
|||
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
|
||||
IF NOT (NEW.landed <=> OLD.landed)
|
||||
IF NOT (NEW.landed <=> OLD.landed)
|
||||
OR NOT (NEW.shipped <=> OLD.shipped) THEN
|
||||
CALL travel_checkDates(NEW.shipped, NEW.landed);
|
||||
END IF;
|
||||
|
@ -10669,23 +10620,19 @@ BEGIN
|
|||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.isRaid <=> OLD.isRaid) OR NOT (NEW.daysInForward <=> OLD.daysInForward) THEN
|
||||
CALL travel_checkRaid(NEW.isRaid, NEW.daysInForward);
|
||||
END IF;
|
||||
|
||||
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
||||
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
||||
SELECT COUNT(*) INTO vHasAnyInvoiceBooked
|
||||
FROM travel t
|
||||
JOIN entry e ON e.travelFk = t.id
|
||||
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
|
||||
JOIN entry e ON e.travelFk = t.id
|
||||
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
|
||||
WHERE t.id = NEW.id
|
||||
AND ii.isBooked;
|
||||
|
||||
AND ii.isBooked;
|
||||
|
||||
IF vHasAnyInvoiceBooked THEN
|
||||
CALL util.throw('The travel has entries with booked invoices');
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL THEN
|
||||
CALL travel_throwAwb(NEW.id);
|
||||
END IF;
|
||||
|
@ -11579,4 +11526,4 @@ USE `vn2008`;
|
|||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2024-11-26 12:09:13
|
||||
-- Dump completed on 2024-11-12 7:06:44
|
||||
|
|
|
@ -1511,26 +1511,26 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
|
|||
(3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1, 3, FALSE, NULL),
|
||||
(4, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 3, 1, 50.00, 500, 'fourth travel', 0, 2, 4, FALSE, NULL),
|
||||
(5, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 3, 1, 50.00, 500, 'fifth travel', 1, 1, 5, FALSE, NULL),
|
||||
(6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2, 6, FALSE,NULL),
|
||||
(6, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 4, 4, 1, 50.00, 500, 'sixth travel', 1, 2, 6, FALSE, NULL),
|
||||
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1, 7, TRUE, 2),
|
||||
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2, 10, FALSE, NULL),
|
||||
(10, DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), DATE_ADD(util.VN_CURDATE(), INTERVAL +5 DAY), 5, 1, 1, 50.00, 500, 'nineth travel', 1, 2, 10, TRUE, 2),
|
||||
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL),
|
||||
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, FALSE, NULL);
|
||||
|
||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `evaNotes`, `typeFk`)
|
||||
VALUES
|
||||
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, '', 'packaging'),
|
||||
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 'observation two', 'product'),
|
||||
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 'observation three', 'product'),
|
||||
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 'observation four', 'product'),
|
||||
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 'observation five', 'product'),
|
||||
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 'observation six', 'product'),
|
||||
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 'observation seven', 'product'),
|
||||
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, '', 'product'),
|
||||
(9, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, '', 'product'),
|
||||
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 10', 1, '', 'product'),
|
||||
(99, 69, util.VN_CURDATE() - INTERVAL 1 MONTH, 11, 0, 442, 'IN2009', 'Movement 99', 0, '', 'product');
|
||||
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `evaNotes`)
|
||||
VALUES
|
||||
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, ''),
|
||||
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 'observation two'),
|
||||
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 'observation three'),
|
||||
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 'observation four'),
|
||||
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 'observation five'),
|
||||
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 'observation six'),
|
||||
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 'observation seven'),
|
||||
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1,''),
|
||||
(9, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 9', 1, ''),
|
||||
(10, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL +2 DAY), 10, 0, 442, 'IN2009', 'Movement 10', 1, ''),
|
||||
(99, 69, '2000-12-01 00:00:00.000', 11, 0, 442, 'IN2009', 'Movement 99', 0, '');
|
||||
|
||||
INSERT INTO `vn`.`entryConfig` (`defaultEntry`, `inventorySupplierFk`, `defaultSupplierFk`)
|
||||
VALUES (2, 4, 1);
|
||||
|
@ -2521,6 +2521,10 @@ INSERT INTO `vn`.`queuePriority`(`id`, `priority`, `code`)
|
|||
(2, 'Normal', 'normal'),
|
||||
(3, 'Baja', 'low');
|
||||
|
||||
INSERT INTO `vn`.`workerTimeControlParams` (`id`, `dayBreak`, `weekBreak`, `weekScope`, `dayWorkMax`, `dayStayMax`, `weekMaxBreak`, `weekMaxScope`, `askInOut`)
|
||||
VALUES
|
||||
(1, 43200, 129600, 734400, 43200, 50400, 259200, 1296000, 36000);
|
||||
|
||||
INSERT IGNORE INTO `vn`.`greugeConfig` (`id`, `freightPickUpPrice`) VALUES ('1', '11');
|
||||
|
||||
INSERT INTO `vn`.`thermograph`(`id`, `model`)
|
||||
|
@ -4004,9 +4008,6 @@ INSERT IGNORE INTO pbx.queueMember
|
|||
UPDATE vn.department SET pbxQueue = '1000' WHERE name = "CAMARA";
|
||||
UPDATE vn.department SET pbxQueue = '2000' WHERE name = "VENTAS";
|
||||
|
||||
INSERT INTO vn.workerRelatives (workerFk, isDescendant, disabilityGradeFk, birthed, adoptionYear, isDependend, isJointCustody, updated)
|
||||
VALUES
|
||||
(1106, 1, NULL, 0, NULL, 0, 0, '2024-10-29 08:42:44.000');
|
||||
INSERT INTO vn.routeAction (id, name, price, isMainlineDelivered) VALUES(1, 'Pintar traje', 50.00, 0);
|
||||
INSERT INTO vn.routeComplement (id, dated, workerFk, price, routeActionFk) VALUES(1, util.VN_CURDATE(), 9, 50.00, 1);
|
||||
|
||||
|
@ -4024,12 +4025,10 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c
|
|||
(9, 1400, 1500, 500, 13000, 1, 1, 1, '04B', 4, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
|
||||
(10, 0, 2000, 500, 13000, 1, 1, 1, '05A', 5, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL);
|
||||
|
||||
|
||||
INSERT IGNORE INTO vn.saySimpleCountry (countryFk, channel)
|
||||
VALUES (19, '1169'),
|
||||
(8, '1183');
|
||||
|
||||
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
|
||||
VALUES ('saysimle-url-mock', 1320);
|
||||
|
||||
INSERT INTO vn.workerIrpf (workerFk,spouseNif, geographicMobilityDate)
|
||||
VALUES (1106,'26493101E','2019-09-20');
|
||||
|
|
|
@ -26,7 +26,7 @@ BEGIN
|
|||
|
||||
DECLARE vCursor CURSOR FOR
|
||||
SELECT it.taxableBase,
|
||||
CAST(SUM((( it.taxableBase / 100) * t.PorcentajeIva)) AS DECIMAL (10,2)),
|
||||
CAST((( it.taxableBase / 100) * t.PorcentajeIva) AS DECIMAL (10,2)),
|
||||
t.PorcentajeIva,
|
||||
it.transactionTypeSageFk,
|
||||
it.taxTypeSageFk,
|
||||
|
@ -39,8 +39,7 @@ BEGIN
|
|||
JOIN TiposTransacciones tt ON tt.CodigoTransaccion = it.transactionTypeSageFk
|
||||
LEFT JOIN vn.dua d ON d.id = vInvoiceInFk
|
||||
WHERE i.id = vInvoiceInFk
|
||||
AND d.id IS NULL
|
||||
GROUP BY it.taxTypeSageFk;
|
||||
AND d.id IS NULL;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ BEGIN
|
|||
DROP TEMPORARY TABLE IF EXISTS tValues;
|
||||
CREATE TEMPORARY TABLE tValues
|
||||
ENGINE = MEMORY
|
||||
SELECT b.id buyFk,
|
||||
SELECT
|
||||
b.id buyFk,
|
||||
e.id entryFk,
|
||||
t.id travelFk,
|
||||
b.itemFk,
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`timeWorkerControl_getDirection`(vUserFk INT, vTimed DATETIME)
|
||||
RETURNS varchar(6) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
|
||||
NOT DETERMINISTIC
|
||||
READS SQL DATA
|
||||
BEGIN
|
||||
/**
|
||||
* Verifica la dirección de la fichada
|
||||
* @param vUserFk Identificador del trabajador
|
||||
* @param vTimed Hora de la fichada
|
||||
* @return Retorna sentido de la fichada 'in, out, middle'
|
||||
*/
|
||||
|
||||
DECLARE vPrevious DATETIME ;
|
||||
DECLARE vNext DATETIME ;
|
||||
DECLARE vPreviousDirection VARCHAR(3) ;
|
||||
DECLARE vNextDirection VARCHAR(3) ;
|
||||
DECLARE vDayStayMax INT;
|
||||
DECLARE vTimedSeconds INT;
|
||||
DECLARE vLastTimeIn INT;
|
||||
|
||||
SELECT UNIX_TIMESTAMP(vTimed) INTO vTimedSeconds;
|
||||
|
||||
SELECT dayStayMax INTO vDayStayMax
|
||||
FROM vn.workerTimeControlParams;
|
||||
|
||||
SELECT timed, direction INTO vNext,vNextDirection
|
||||
FROM vn.workerTimeControl
|
||||
WHERE userFk = vUserFk
|
||||
AND direction IN ('in','out')
|
||||
AND timed > vTimed
|
||||
ORDER BY timed ASC
|
||||
LIMIT 1;
|
||||
|
||||
SELECT timed, direction INTO vPrevious, vPreviousDirection
|
||||
FROM vn.workerTimeControl
|
||||
WHERE userFk = vUserFk
|
||||
AND direction IN ('in','out')
|
||||
AND timed < vTimed
|
||||
ORDER BY timed DESC
|
||||
LIMIT 1;
|
||||
|
||||
IF (vTimedSeconds - UNIX_TIMESTAMP(vPrevious) + UNIX_TIMESTAMP(vNext) - vTimedSeconds)<= vDayStayMax AND vPreviousDirection = 'in' AND vNextDirection = 'out' THEN
|
||||
RETURN 'middle';
|
||||
END IF;
|
||||
|
||||
|
||||
IF (vTimedSeconds> UNIX_TIMESTAMP(vPrevious)) THEN
|
||||
IF vPreviousDirection = 'in' THEN
|
||||
RETURN 'out';
|
||||
ELSE
|
||||
SELECT UNIX_TIMESTAMP(MAX(timed)) INTO vLastTimeIn
|
||||
FROM vn.workerTimeControl
|
||||
WHERE userFk = vUserFk
|
||||
AND direction ='in'
|
||||
AND timed < vPrevious;
|
||||
IF vTimedSeconds - vLastTimeIn <= vDayStayMax THEN
|
||||
RETURN 'out';
|
||||
END IF;
|
||||
END IF;
|
||||
END IF;
|
||||
|
||||
RETURN 'in';
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -9,18 +9,16 @@ BEGIN
|
|||
*
|
||||
* @param vSelf Id de entrada
|
||||
*/
|
||||
DECLARE vIsNotEditable BOOL DEFAULT FALSE;
|
||||
DECLARE vIsEditable BOOL;
|
||||
|
||||
SELECT TRUE INTO vIsNotEditable
|
||||
SELECT e.isBooked INTO vIsEditable
|
||||
FROM `entry` e
|
||||
LEFT JOIN entryType et ON et.code = e.typeFk
|
||||
WHERE e.id = vSelf
|
||||
AND e.isBooked
|
||||
AND (e.typeFk IS NULL OR NOT et.isInformal);
|
||||
JOIN entryType et ON et.code = e.typeFk
|
||||
WHERE NOT et.isInformal
|
||||
AND e.id = vSelf;
|
||||
|
||||
IF vIsNotEditable AND NOT IFNULL(@isModeInventory, FALSE) THEN
|
||||
IF vIsEditable AND NOT IFNULL(@isModeInventory, FALSE) THEN
|
||||
CALL util.throw(CONCAT('Entry ', vSelf, ' is not editable'));
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -219,7 +219,7 @@ BEGIN
|
|||
) eWithheld ON TRUE
|
||||
WHERE tii.taxTypeSageFk IS NOT NULL
|
||||
AND (tii.taxCode IS NULL OR tii.taxCode NOT IN ('import10', 'import21'))
|
||||
GROUP BY tii.CuentaIvaRepercutido;
|
||||
GROUP BY tii.PorcentajeIva, tii.expenseFk;
|
||||
|
||||
-- Línea iva inversor sujeto pasivo
|
||||
INSERT INTO XDiario(
|
||||
|
@ -284,7 +284,7 @@ BEGIN
|
|||
AND NOT(tii.isVies
|
||||
AND c.nontaxableTransactionTypeFk = tii.transactionTypeSageFk
|
||||
AND tii.taxCode = 'nonTaxable')
|
||||
GROUP BY tii.CuentaIvaRepercutido;
|
||||
GROUP BY tii.PorcentajeIva, tii.expenseFk;
|
||||
|
||||
-- Actualización del registro original
|
||||
UPDATE invoiceIn ii
|
||||
|
|
|
@ -23,15 +23,14 @@ BEGIN
|
|||
DELETE FROM routeCommission
|
||||
WHERE routeFk = vSelf;
|
||||
|
||||
SELECT w.isFreelance, v.isKmTruckRate, p.countryFk INTO vIsFreelance, vIsKmTruckRate, vCountryFk
|
||||
SELECT w.isFreelance, v.isKmTruckRate, c.countryFk INTO vIsFreelance, vIsKmTruckRate, vCountryFk
|
||||
FROM route r
|
||||
JOIN worker w ON w.id = r.workerFk
|
||||
JOIN vehicle v ON v.id = r.vehicleFk
|
||||
LEFT JOIN ticket t ON t.routeFk = r.id
|
||||
LEFT JOIN address a ON a.id = t.addressFk
|
||||
LEFT JOIN province p ON p.id = a.provinceFk
|
||||
LEFT JOIN client c ON c.id = t.clientFk
|
||||
WHERE r.id = vSelf
|
||||
GROUP BY p.countryFk
|
||||
GROUP BY c.countryFk
|
||||
ORDER BY COUNT(*) DESC
|
||||
LIMIT 1;
|
||||
|
||||
|
@ -91,9 +90,7 @@ BEGIN
|
|||
(r.kmEnd - r.kmStart) *
|
||||
IF(v.isKmTruckRate, rc.kmHeavy, rc.kmLight),
|
||||
IFNULL(r.m3, 0) *
|
||||
IF(v.isKmTruckRate,
|
||||
IFNULL(wc.deliveryM3Cat5, rc.deliveryM3Cat5),
|
||||
IFNULL(wc.deliveryM3Cat4, rc.deliveryM3Cat4)),
|
||||
IF(v.isKmTruckRate, rc.deliveryM3Cat5, rc.deliveryM3Cat4),
|
||||
(r.kmEnd - r.kmStart) * rc.kmYearly,
|
||||
IFNULL(r.m3, 0) * rc.m3Yearly,
|
||||
IFNULL(wc.distributionCat4M3, rc.distributionCat4M3) * IFNULL(r.m3, 0),
|
||||
|
|
|
@ -5,122 +5,122 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`ticket_splitItemPacki
|
|||
)
|
||||
BEGIN
|
||||
/**
|
||||
* Separa en diferentes tickets según el tipo de empaquetado
|
||||
* El ticket original conserva las líneas del tipo de empaquetado especificado
|
||||
* Las líneas sin tipo de empaquetado se asignan al ticket del tipo por defecto.
|
||||
* Clona y reparte las ventas de un ticket en funcion del tipo de empaquetado.
|
||||
* Respeta el id inicial para el tipo propuesto.
|
||||
*
|
||||
* @param vSelf Id del ticket original
|
||||
* @param vOriginalItemPackingTypeFk Tipo de empaquetado a mantener en el ticket original
|
||||
* @param vSelf Id ticket
|
||||
* @param vOriginalItemPackingTypeFk Tipo para el que se reserva el número de ticket original
|
||||
* @return table tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
*/
|
||||
DECLARE vIsDone BOOLEAN DEFAULT FALSE;
|
||||
DECLARE vCurrentPackingType VARCHAR(1);
|
||||
DECLARE vDefaultPackingType VARCHAR(1);
|
||||
DECLARE vHasOriginalPackingType BOOLEAN;
|
||||
DECLARE vItemPackingTypeFk VARCHAR(1) DEFAULT 'H';
|
||||
DECLARE vNewTicketFk INT;
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vPackingTypesToSplit INT;
|
||||
DECLARE vDone INT DEFAULT FALSE;
|
||||
|
||||
DECLARE vItemPackingTypes CURSOR FOR
|
||||
SELECT DISTINCT itemPackingTypeFk FROM tSalesToMove;
|
||||
DECLARE vSaleGroup CURSOR FOR
|
||||
SELECT itemPackingTypeFk
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL
|
||||
ORDER BY (itemPackingTypeFk = vOriginalItemPackingTypeFk) DESC;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vIsDone = TRUE;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
ROLLBACK;
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSalesToMove (
|
||||
ticketFk INT,
|
||||
saleFk INT,
|
||||
itemPackingTypeFk VARCHAR(1)
|
||||
) ENGINE=MEMORY;
|
||||
|
||||
SELECT COALESCE(MAX(ic.defaultPackingTypeFk), MAX(i.itemPackingTypeFk)) INTO vDefaultPackingType
|
||||
FROM vn.sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
LEFT JOIN itemConfig ic ON ic.defaultPackingTypeFk = i.itemPackingTypeFk
|
||||
WHERE s.ticketFk = vSelf
|
||||
GROUP BY s.ticketFk;
|
||||
|
||||
SELECT EXISTS (
|
||||
SELECT TRUE
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
WHERE s.ticketFk = vSelf
|
||||
AND i.itemPackingTypeFk = vOriginalItemPackingTypeFk
|
||||
) INTO vHasOriginalPackingType;
|
||||
|
||||
IF vOriginalItemPackingTypeFk IS NULL OR NOT vHasOriginalPackingType THEN
|
||||
SET vOriginalItemPackingTypeFk = vDefaultPackingType;
|
||||
END IF;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SELECT t.id INTO vTicketFk
|
||||
FROM ticket t
|
||||
JOIN sale s ON s.id = t.id
|
||||
WHERE t.id = vSelf
|
||||
SELECT id
|
||||
FROM sale
|
||||
WHERE ticketFk = vSelf
|
||||
AND NOT quantity
|
||||
FOR UPDATE;
|
||||
|
||||
INSERT INTO tSalesToMove (saleFk, itemPackingTypeFk)
|
||||
SELECT s.id, i.itemPackingTypeFk
|
||||
DELETE FROM sale
|
||||
WHERE NOT quantity
|
||||
AND ticketFk = vSelf;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSale
|
||||
(PRIMARY KEY (id))
|
||||
ENGINE = MEMORY
|
||||
SELECT s.id, i.itemPackingTypeFk, IFNULL(sv.litros, 0) litros
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
WHERE s.ticketFk = vSelf
|
||||
AND i.itemPackingTypeFk <> vOriginalItemPackingTypeFk;
|
||||
LEFT JOIN saleVolume sv ON sv.saleFk = s.id
|
||||
WHERE s.ticketFk = vSelf;
|
||||
|
||||
OPEN vItemPackingTypes;
|
||||
l: LOOP
|
||||
SET vIsDone = FALSE;
|
||||
FETCH vItemPackingTypes INTO vCurrentPackingType;
|
||||
CREATE OR REPLACE TEMPORARY TABLE tSaleGroup
|
||||
ENGINE = MEMORY
|
||||
SELECT itemPackingTypeFk, SUM(litros) totalLitros
|
||||
FROM tSale
|
||||
GROUP BY itemPackingTypeFk;
|
||||
|
||||
IF vIsDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
SELECT COUNT(*) INTO vPackingTypesToSplit
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL;
|
||||
|
||||
CALL ticket_Clone(vSelf, vNewTicketFk);
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT(
|
||||
ticketFk INT,
|
||||
itemPackingTypeFk VARCHAR(1)
|
||||
) ENGINE = MEMORY;
|
||||
|
||||
SELECT id INTO vTicketFk
|
||||
FROM ticket t
|
||||
WHERE t.id = vNewTicketFk
|
||||
FOR UPDATE;
|
||||
CASE vPackingTypesToSplit
|
||||
WHEN 0 THEN
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
VALUES(vSelf, vItemPackingTypeFk);
|
||||
WHEN 1 THEN
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
SELECT vSelf, itemPackingTypeFk
|
||||
FROM tSaleGroup
|
||||
WHERE itemPackingTypeFk IS NOT NULL;
|
||||
ELSE
|
||||
OPEN vSaleGroup;
|
||||
FETCH vSaleGroup INTO vItemPackingTypeFk;
|
||||
|
||||
UPDATE tSalesToMove
|
||||
SET ticketFk = vNewTicketFk
|
||||
WHERE itemPackingTypeFk = vCurrentPackingType;
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
VALUES(vSelf, vItemPackingTypeFk);
|
||||
|
||||
IF vCurrentPackingType = vDefaultPackingType THEN
|
||||
INSERT INTO tSalesToMove (ticketFk, saleFk, itemPackingTypeFk)
|
||||
SELECT vNewTicketFk, s.id, i.itemPackingTypeFk
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
WHERE s.ticketFk = vSelf
|
||||
AND i.itemPackingTypeFk IS NULL;
|
||||
END IF;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vSaleGroup INTO vItemPackingTypeFk;
|
||||
|
||||
END LOOP;
|
||||
CLOSE vItemPackingTypes;
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
UPDATE sale s
|
||||
JOIN tSalesToMove t ON t.saleFk = s.id
|
||||
SET s.ticketFk = t.ticketFk;
|
||||
CALL ticket_Clone(vSelf, vNewTicketFk);
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.ticketIPT
|
||||
ENGINE=MEMORY
|
||||
SELECT s.ticketFk, MAX(i.itemPackingTypeFk) itemPackingTypeFk
|
||||
FROM sale s
|
||||
JOIN item i ON i.id = s.itemFk
|
||||
WHERE s.ticketFk = vSelf
|
||||
GROUP BY s.ticketFk
|
||||
UNION
|
||||
SELECT ticketFk, MAX(itemPackingTypeFk)
|
||||
FROM tSalesToMove
|
||||
GROUP BY ticketFk;
|
||||
INSERT INTO tmp.ticketIPT(ticketFk, itemPackingTypeFk)
|
||||
VALUES(vNewTicketFk, vItemPackingTypeFk);
|
||||
END LOOP;
|
||||
|
||||
CLOSE vSaleGroup;
|
||||
|
||||
SELECT s.id
|
||||
FROM sale s
|
||||
JOIN tSale ts ON ts.id = s.id
|
||||
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
|
||||
FOR UPDATE;
|
||||
|
||||
UPDATE sale s
|
||||
JOIN tSale ts ON ts.id = s.id
|
||||
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = ts.itemPackingTypeFk
|
||||
SET s.ticketFk = t.ticketFk;
|
||||
|
||||
SELECT itemPackingTypeFk INTO vItemPackingTypeFk
|
||||
FROM tSaleGroup sg
|
||||
WHERE sg.itemPackingTypeFk IS NOT NULL
|
||||
ORDER BY sg.itemPackingTypeFk
|
||||
LIMIT 1;
|
||||
|
||||
UPDATE sale s
|
||||
JOIN tSale ts ON ts.id = s.id
|
||||
JOIN tmp.ticketIPT t ON t.itemPackingTypeFk = vItemPackingTypeFk
|
||||
SET s.ticketFk = t.ticketFk
|
||||
WHERE ts.itemPackingTypeFk IS NULL;
|
||||
END CASE;
|
||||
|
||||
COMMIT;
|
||||
|
||||
DROP TEMPORARY TABLE tSalesToMove;
|
||||
DROP TEMPORARY TABLE
|
||||
tSale,
|
||||
tSaleGroup;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`workerTimeControl_check`(vUserFk INT, vDated DATE,vTabletFk VARCHAR(100))
|
||||
proc: BEGIN
|
||||
/**
|
||||
* Verifica si el empleado puede fichar en el momento actual, si puede fichar llama a workerTimeControlAdd
|
||||
*
|
||||
* @param vUserFk Identificador del trabajador
|
||||
* @return Retorna si encuentra un problema 'odd','maxTimeWork','breakDay','breakWeek' ;
|
||||
* En caso de tener algun problema retorna el primero que encuentra
|
||||
*/
|
||||
DECLARE vLastIn DATETIME ;
|
||||
DECLARE vLastOut DATETIME ;
|
||||
DECLARE vDayWorkMax INT;
|
||||
DECLARE vDayBreak INT;
|
||||
DECLARE vWeekBreak INT ;
|
||||
DECLARE vWeekScope INT;
|
||||
DECLARE vDayStayMax INT;
|
||||
DECLARE vProblem VARCHAR(20) DEFAULT NULL;
|
||||
DECLARE vTimedWorked INT;
|
||||
DECLARE vCalendarStateType VARCHAR(20) DEFAULT NULL;
|
||||
DECLARE vDepartmentFk INT;
|
||||
DECLARE vTo VARCHAR(50) DEFAULT NULL;
|
||||
DECLARE vUserName VARCHAR(50) DEFAULT NULL;
|
||||
DECLARE vBody VARCHAR(255) DEFAULT NULL;
|
||||
|
||||
SELECT dayBreak, weekBreak, weekScope, dayWorkMax, dayStayMax
|
||||
INTO vDayBreak, vWeekBreak, vWeekScope, vDayWorkMax, vDayStayMax
|
||||
FROM workerTimeControlParams;
|
||||
|
||||
SELECT MAX(timed) INTO vLastIn
|
||||
FROM workerTimeControl
|
||||
WHERE userFk = vUserFk
|
||||
AND direction = 'in';
|
||||
|
||||
SELECT MAX(timed) INTO vLastOut
|
||||
FROM workerTimeControl
|
||||
WHERE userFk = vUserFk
|
||||
AND direction = 'out';
|
||||
|
||||
SELECT CONCAT(u.name,'@verdnatura.es') INTO vTo
|
||||
FROM account.user u
|
||||
WHERE u.id = (SELECT bossFk FROM worker WHERE id = vUserFk);
|
||||
|
||||
SELECT CONCAT(firstName,' ',lastName) INTO vUserName
|
||||
FROM worker w
|
||||
WHERE w.id = vUserFk;
|
||||
|
||||
|
||||
IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastIn) > vDayStayMax THEN -- NUEVA JORNADA
|
||||
|
||||
-- VERIFICAR DESCANSO DIARIO
|
||||
IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vDayBreak THEN
|
||||
SELECT "Descansos 12 h" AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Descansos 12 h") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
-- VERIFICAR FICHADAS IMPARES DEL ÚLTIMO DÍA QUE SE FICHÓ
|
||||
IF (SELECT MOD(COUNT(*),2) -- <>0
|
||||
FROM workerTimeControl
|
||||
WHERE userFk = vUserFk
|
||||
AND timed >= vLastIn
|
||||
) THEN
|
||||
SELECT "Dias con fichadas impares" AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Dias con fichadas impares") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
-- VERIFICAR VACACIONES
|
||||
SELECT at2.name INTO vCalendarStateType
|
||||
FROM calendar c
|
||||
JOIN business b ON b.id = c.businessFk
|
||||
JOIN absenceType at2 ON at2.id = c.dayOffTypeFk
|
||||
WHERE c.dated = util.VN_CURDATE()
|
||||
AND at2.isAllowedToWork = FALSE
|
||||
AND b.workerFk = vUserFk
|
||||
LIMIT 1;
|
||||
|
||||
IF(LENGTH(vCalendarStateType)) THEN
|
||||
SELECT vCalendarStateType AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Vacaciones") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
|
||||
END IF;
|
||||
|
||||
-- VERIFICAR CONTRATO EN VIGOR
|
||||
IF (SELECT COUNT(*)
|
||||
FROM business b
|
||||
WHERE b.workerFk = vUserFk
|
||||
AND b.started <= vDated
|
||||
AND IFNULL(b.ended, vDated) >= vDated
|
||||
) = 0 THEN
|
||||
SELECT "No hay un contrato en vigor" AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"No hay un contrato en vigor") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
|
||||
END IF;
|
||||
|
||||
-- VERIFICAR DESCANSO SEMANAL
|
||||
SET @vHasBreakWeek:= FALSE;
|
||||
SET @vLastTimed:= UNIX_TIMESTAMP((util.VN_NOW() - INTERVAL vWeekScope SECOND));
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.trash;
|
||||
CREATE TEMPORARY TABLE tmp.trash
|
||||
SELECT IF(vWeekBreak-(UNIX_TIMESTAMP(timed)-@vLastTimed) <= 0, @vHasBreakWeek:=TRUE, TRUE) alias,
|
||||
@vLastTimed:= UNIX_TIMESTAMP(timed)
|
||||
FROM workerTimeControl
|
||||
WHERE timed>= (util.VN_NOW() - INTERVAL vWeekScope SECOND)
|
||||
AND userFk= vUserFk
|
||||
AND direction IN ('in','out')
|
||||
ORDER BY timed ASC;
|
||||
|
||||
IF UNIX_TIMESTAMP(util.VN_NOW()) - UNIX_TIMESTAMP(vLastOut) < vWeekBreak AND @vHasBreakWeek = FALSE THEN -- REVISA SI EL DESCANSO SE HA REALIZADO DESPUÉS DE LA ÚLTIMA FICHADA
|
||||
SELECT "Descansos 36 h" AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Descansos 36 h") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.trash;
|
||||
|
||||
ELSE -- DIA ACTUAL
|
||||
|
||||
-- VERIFICA QUE EL TIEMPO EFECTIVO NO SUPERE EL MÁXIMO
|
||||
SELECT IFNULL(SUM(if( mod(wtc.order,2)=1, -UNIX_TIMESTAMP(timed), UNIX_TIMESTAMP(timed))),0) - IF( MOD(COUNT(*),2), UNIX_TIMESTAMP(util.VN_NOW()), 0) INTO vTimedWorked
|
||||
FROM workerTimeControl wtc
|
||||
WHERE userFk = vUserFk
|
||||
AND timed >= vLastIn
|
||||
ORDER BY timed;
|
||||
|
||||
IF vTimedWorked > vDayWorkMax THEN
|
||||
SELECT "Jornadas" AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No ha podido fichar por el siguiente problema: ',"Jornadas") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
END IF;
|
||||
|
||||
-- VERIFICAR DEPARTAMENTO
|
||||
/* IF vTabletFk IS NOT NULL THEN
|
||||
SELECT wtcu.departmentFk INTO vDepartmentFk
|
||||
FROM workerTimeControlUserInfo wtcu
|
||||
WHERE wtcu.userFk = vUserFk;
|
||||
IF (SELECT COUNT(td.tabletFk)
|
||||
FROM tabletDepartment td
|
||||
WHERE td.tabletFk = vTabletFk AND td.departmentFk = vDepartmentFk
|
||||
) = 0 THEN
|
||||
SELECT "No perteneces a este departamento." AS problem;
|
||||
-- ENVIAMOS CORREO AL BOSSFK
|
||||
SELECT CONCAT(vUserName,' No a podido fichar por el siguiente problema: ',"No perteneces a este departamento.") INTO vBody;
|
||||
CALL mail_insert(vTo,vTo,'error al fichar',vBody);
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
END IF;*/
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,23 +0,0 @@
|
|||
ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk;
|
||||
ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk;
|
||||
|
||||
INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId)
|
||||
VALUES
|
||||
('WorkerRelative','updateAttributes','*','ALLOW','ROLE','hr'),
|
||||
('WorkerRelative','crud','WRITE','ALLOW','ROLE','hr'),
|
||||
('WorkerRelative','findById','*','ALLOW','ROLE','hr'),
|
||||
('WorkerRelative','find','*','ALLOW','ROLE','hr'),
|
||||
('WorkerRelative','upsert','*','ALLOW','ROLE','hr'),
|
||||
('WorkerRelative','filter','*','ALLOW','ROLE','hr'),
|
||||
('WorkerIrpf','updateAttributes','*','ALLOW','ROLE','hr'),
|
||||
('WorkerIrpf','crud','*','ALLOW','ROLE','hr'),
|
||||
('WorkerIrpf','findById','*','ALLOW','ROLE','hr'),
|
||||
('WorkerIrpf','find','*','ALLOW','ROLE','hr'),
|
||||
('WorkerIrpf','upsert','*','ALLOW','ROLE','hr'),
|
||||
('WorkerIrpf','filter','*','ALLOW','ROLE','hr'),
|
||||
('DisabilityGrade','updateAttributes','*','ALLOW','ROLE','hr'),
|
||||
('DisabilityGrade','crud','*','ALLOW','ROLE','hr'),
|
||||
('DisabilityGrade','findById','*','ALLOW','ROLE','hr'),
|
||||
('DisabilityGrade','find','*','ALLOW','ROLE','hr'),
|
||||
('DisabilityGrade','upsert','*','ALLOW','ROLE','hr');
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
-- Eliminar registros existentes donde property = '*'
|
||||
DELETE FROM `salix`.ACL WHERE model = 'entry' AND property = '*';
|
||||
|
||||
-- Insertar permisos para los métodos solicitados en el modelo Entry
|
||||
INSERT INTO `salix`.ACL (model, property, accessType, permission, principalType, principalId)
|
||||
VALUES
|
||||
-- Permisos para administrative
|
||||
('Entry', 'upsert', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'isBooked', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'findById', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'find', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'filter', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'count', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'getEntry', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'getBuys', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'findOne', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'deleteBuys', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'editLatestBuys', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'importBuys', 'WRITE', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'importBuysPreview', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'lastItemBuys', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
('Entry', 'latestBuysFilter', 'READ', 'ALLOW', 'ROLE', 'administrative'),
|
||||
|
||||
-- Permisos para buyer (excluyendo isBooked)
|
||||
('Entry', 'upsert', 'WRITE', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'updateAttributes', 'WRITE', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'findById', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'find', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'filter', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'count', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'getEntry', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'getBuys', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'findOne', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'deleteBuys', 'WRITE', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'editLatestBuys', 'WRITE', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'importBuys', 'WRITE', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'importBuysPreview', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'lastItemBuys', 'READ', 'ALLOW', 'ROLE', 'buyer'),
|
||||
('Entry', 'latestBuysFilter', 'READ', 'ALLOW', 'ROLE', 'buyer');
|
|
@ -1,4 +0,0 @@
|
|||
ALTER TABLE vn.travel ADD isRaid tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Redada';
|
||||
|
||||
ALTER TABLE vn.travel MODIFY COLUMN daysInForward int(10) unsigned DEFAULT NULL
|
||||
COMMENT 'Cuando es una redada, indica el número de días que se añadirán a la fecha de hoy para establecer el landed. NULL si no es una redada';
|
|
@ -1,5 +0,0 @@
|
|||
|
||||
ALTER TABLE vn.travel ADD IF NOT EXISTS isRaid tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Redada';
|
||||
|
||||
ALTER TABLE vn.travel MODIFY COLUMN daysInForward int(10) unsigned DEFAULT NULL
|
||||
COMMENT 'Cuando es una redada, indica el número de días que se añadirán a la fecha de hoy para establecer el landed. NULL si no es una redada';
|
|
@ -1,2 +0,0 @@
|
|||
|
||||
ALTER TABLE vn.itemConfig ADD defaultPackingTypeFk VARCHAR(1) DEFAULT 'H' NULL;
|
|
@ -1,2 +0,0 @@
|
|||
RENAME TABLE vn.workerTimeControlParams TO vn.workerTimeControlParams__;
|
||||
ALTER TABLE vn.workerTimeControlParams__ COMMENT='@deprecated 2024-11-19';
|
|
@ -1,8 +0,0 @@
|
|||
DELETE FROM vn.stateI18n
|
||||
WHERE `name` IN ('Billed', 'Facturado', 'Assisted preparation', 'Preparación asistida', 'Shipped', 'Embarcado', 'Stowaway OK', 'Polizón OK');
|
||||
|
||||
UPDATE vn.`state` SET nextStateFk = 43
|
||||
WHERE nextStateFk IN (11, 27, 30, 32, 41);
|
||||
|
||||
DELETE FROM vn.`state`
|
||||
WHERE code IN ('INVOICED', 'ASSISTED_PREPARATION', 'BOARD', 'OK STOWAWAY', 'PARTIAL_PREPARATION');
|
|
@ -1,7 +0,0 @@
|
|||
ALTER TABLE vn.workCenterCommission ADD IF NOT EXISTS deliveryM3Cat4 DECIMAL(5,2) DEFAULT NULL NULL;
|
||||
ALTER TABLE vn.workCenterCommission ADD IF NOT EXISTS deliveryM3Cat5 DECIMAL(5,2) DEFAULT NULL NULL;
|
||||
|
||||
INSERT IGNORE INTO vn.workCenterCommission (workCenterFk, deliveryM3Cat4, deliveryM3Cat5)
|
||||
VALUES (5,8.0,8.0);
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
ALTER TABLE `vn`.`creditInsurance` DROP COLUMN `creditClassification__`;
|
||||
ALTER TABLE `vn`.`worker` DROP COLUMN `isF11Allowed__`;
|
||||
ALTER TABLE `util`.`config` DROP COLUMN `dbVersion__`;
|
||||
ALTER TABLE `util`.`config` DROP COLUMN `hasTriggersDisabled__`;
|
||||
ALTER TABLE `vn`.`agencyMode` DROP COLUMN `showAgencyName__`;
|
||||
DROP TABLE `account`.`accountLog__`;
|
||||
DROP TABLE `vn`.`silexACL__`;
|
|
@ -241,10 +241,10 @@
|
|||
"The maximum height of the wagon is 200cm": "The maximum height of the wagon is 200cm",
|
||||
"The quantity claimed cannot be greater than the quantity of the line": "The quantity claimed cannot be greater than the quantity of the line",
|
||||
"There are tickets for this area, delete them first": "There are tickets for this area, delete them first",
|
||||
"You do not have permission to modify the booked field": "You do not have permission to modify the booked field",
|
||||
"Invalid or expired verification code": "Invalid or expired verification code",
|
||||
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
|
||||
"The raid information is not correct": "The raid information is not correct",
|
||||
"Invalid or expired verification code": "Invalid or expired verification code",
|
||||
"Payment method is required": "Payment method is required",
|
||||
"The raid information is not correct": "The raid information is not correct",
|
||||
"Sales already moved": "Sales already moved"
|
||||
|
||||
}
|
||||
|
|
|
@ -385,10 +385,8 @@
|
|||
"type cannot be blank": "Se debe rellenar el tipo",
|
||||
"There are tickets for this area, delete them first": "Hay tickets para esta sección, borralos primero",
|
||||
"There is no company associated with that warehouse": "No hay ninguna empresa asociada a ese almacén",
|
||||
"You do not have permission to modify the booked field": "No tienes permisos para modificar el campo contabilizada",
|
||||
"ticketLostExpedition": "El ticket [{{ticketId}}]({{{ticketUrl}}}) tiene la siguiente expedición perdida:{{ expeditionId }}",
|
||||
"The web user's email already exists": "El correo del usuario web ya existe",
|
||||
"Sales already moved": "Ya han sido transferidas",
|
||||
"The raid information is not correct": "La información de la redada no es correcta"
|
||||
}
|
||||
|
||||
|
|
|
@ -362,9 +362,8 @@
|
|||
"The invoices have been created but the PDFs could not be generated": "La facture a été émise mais le PDF n'a pas pu être généré",
|
||||
"It has been invoiced but the PDF of refund not be generated": "Il a été facturé mais le PDF de remboursement n'a pas été généré",
|
||||
"Cannot send mail": "Impossible d'envoyer le mail",
|
||||
"Original invoice not found": "Facture originale introuvable",
|
||||
"The quantity claimed cannot be greater than the quantity of the line": "Le montant réclamé ne peut pas être supérieur au montant de la ligne",
|
||||
"You do not have permission to modify the booked field": "Vous n'avez pas la permission de modifier le champ comptabilisé",
|
||||
"Original invoice not found": "Facture originale introuvable",
|
||||
"The quantity claimed cannot be greater than the quantity of the line": "Le montant réclamé ne peut pas être supérieur au montant de la ligne",
|
||||
"ticketLostExpedition": "Le ticket [{{ticketId}}]({{{ticketUrl}}}) a l'expédition perdue suivante : {{expeditionId}}",
|
||||
"The web user's email already exists": "L'email de l'internaute existe déjà"
|
||||
}
|
||||
}
|
|
@ -366,4 +366,4 @@
|
|||
"The quantity claimed cannot be greater than the quantity of the line": "O valor reclamado não pode ser superior ao valor da linha",
|
||||
"ticketLostExpedition": "O ticket [{{ticketId}}]({{{ticketUrl}}}) tem a seguinte expedição perdida: {{expeditionId}}",
|
||||
"The web user's email already exists": "O e-mail do utilizador da web já existe."
|
||||
}
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
const UserError = require('vn-loopback/util/user-error');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
module.exports = Self => {
|
||||
require('../methods/entry/filter')(Self);
|
||||
|
@ -19,20 +18,11 @@ module.exports = Self => {
|
|||
|
||||
const changes = ctx.data || ctx.instance;
|
||||
const orgData = ctx.currentInstance;
|
||||
const loopBackContext = LoopBackContext.getCurrentContext();
|
||||
const accessToken = {req: loopBackContext.active};
|
||||
const hasChanges = orgData && changes;
|
||||
|
||||
const isBookedChanged = changes.isBooked !== undefined && orgData.isBooked !== changes.isBooked;
|
||||
|
||||
if (isBookedChanged) {
|
||||
const canEditIsBooked = await Self.app.models.ACL.checkAccessAcl(accessToken, 'Entry', 'isBooked', 'READ');
|
||||
if (!canEditIsBooked)
|
||||
throw new UserError('You do not have permission to modify the booked field');
|
||||
}
|
||||
|
||||
const observation = changes.observation || orgData.observation;
|
||||
const observationChanged = hasChanges && orgData.observation != observation;
|
||||
const hasChanges = orgData && changes;
|
||||
const observationChanged = hasChanges
|
||||
&& orgData.observation != observation;
|
||||
|
||||
if (observationChanged) {
|
||||
let tx;
|
||||
|
@ -47,7 +37,8 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const userId = loopBackContext.active.accessToken.userId;
|
||||
const loopbackContext = LoopBackContext.getCurrentContext();
|
||||
const userId = loopbackContext.active.accessToken.userId;
|
||||
const id = changes.id || orgData.id;
|
||||
const entry = await Self.app.models.Entry.findById(id, null, myOptions);
|
||||
await entry.updateAttribute('observationEditorFk', userId, myOptions);
|
||||
|
|
|
@ -1,97 +0,0 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('entry_isEditable trigger', () => {
|
||||
const activeCtx = {
|
||||
accessToken: {userId: 5},
|
||||
http: {
|
||||
req: {
|
||||
headers: {origin: 'http://localhost'}
|
||||
}
|
||||
}
|
||||
};
|
||||
const ctx = {req: activeCtx};
|
||||
const entryId = 1;
|
||||
let tx;
|
||||
let options;
|
||||
let entry;
|
||||
|
||||
beforeEach(async() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({active: ctx.req});
|
||||
tx = await models.Entry.beginTransaction({});
|
||||
options = {transaction: tx};
|
||||
|
||||
entry = await models.Entry.findById(entryId, null, options);
|
||||
});
|
||||
|
||||
afterEach(async() => {
|
||||
await tx.rollback();
|
||||
});
|
||||
|
||||
async function prepareEntry(isBooked, typeFk) {
|
||||
let newCreated = Date.vnNew();
|
||||
await entry.updateAttributes({isBooked, typeFk}, options);
|
||||
await entry.updateAttributes({dated: newCreated}, options);
|
||||
}
|
||||
|
||||
it('should throw an error when entry is booked and typeFk is null', async() => {
|
||||
let error;
|
||||
try {
|
||||
await prepareEntry(true, null);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error.message).toContain(`Entry ${entryId} is not editable`);
|
||||
});
|
||||
|
||||
it('should throw an error when entry is booked and typeFk is not informal', async() => {
|
||||
let error;
|
||||
try {
|
||||
const type = await models.EntryType.findOne({where: {isInformal: false}}, options);
|
||||
await prepareEntry(true, type.code);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error.message).toContain(`Entry ${entryId} is not editable`);
|
||||
});
|
||||
|
||||
it('should not throw an error when entry is booked and typeFk is informal', async() => {
|
||||
let error;
|
||||
try {
|
||||
const type = await models.EntryType.findOne({where: {isInformal: true}}, options);
|
||||
await prepareEntry(true, type.code);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should not throw an error when entry is not booked', async() => {
|
||||
let error;
|
||||
try {
|
||||
const type = await models.EntryType.findOne({}, options);
|
||||
await prepareEntry(false, type.code);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
expect(error).toBeUndefined();
|
||||
});
|
||||
|
||||
it('should not throw an error when @isModeInventory is true', async() => {
|
||||
let error;
|
||||
try {
|
||||
await models.Application.rawSql('SET @isModeInventory = TRUE;', null, options);
|
||||
await prepareEntry(true, null);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
} finally {
|
||||
await models.Application.rawSql('SET @isModeInventory = FALSE;', null, options);
|
||||
}
|
||||
|
||||
expect(error).toBeUndefined();
|
||||
});
|
||||
});
|
|
@ -30,7 +30,7 @@
|
|||
<vn-icon
|
||||
vn-tooltip="Is virtual entry"
|
||||
icon="icon-net"
|
||||
ng-if="$ctrl.entryData.travel.isRaid">
|
||||
ng-if="$ctrl.entryData.travel.isRaid">
|
||||
</vn-icon>
|
||||
</div>
|
||||
<div class="quicklinks">
|
||||
|
|
|
@ -342,6 +342,7 @@ module.exports = Self => {
|
|||
'CHECKED',
|
||||
'PACKING',
|
||||
'PACKED',
|
||||
'INVOICED',
|
||||
'ON_DELIVERY',
|
||||
'PREPARED',
|
||||
'WAITING_FOR_PICKUP',
|
||||
|
@ -349,7 +350,10 @@ module.exports = Self => {
|
|||
'PRINTED_BACK',
|
||||
'LAST_CALL',
|
||||
'PREVIOUS_PREPARATION',
|
||||
'ASSISTED_PREPARATION',
|
||||
'BOARD',
|
||||
'PRINTED STOWAWAY',
|
||||
'OK STOWAWAY',
|
||||
'HALF_PACKED',
|
||||
'COOLER_PREPARATION'
|
||||
]}};
|
||||
|
|
|
@ -15,7 +15,7 @@ module.exports = Self => {
|
|||
Self.getWithPackaging = async options => {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
const oneYearAgo = Date.vnNew();
|
||||
const oneYearAgo = new Date();
|
||||
oneYearAgo.setFullYear(oneYearAgo.getFullYear() - 1);
|
||||
|
||||
if (typeof options == 'object')
|
||||
|
|
|
@ -1,12 +1,26 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
|
||||
describe('Supplier getWithPackaging()', () => {
|
||||
beforeAll.mockLoopBackContext();
|
||||
it('should return a list of suppliers with an entry of type packaging', async() => {
|
||||
const typeFk = 'packaging';
|
||||
|
||||
const tx = await models.Supplier.beginTransaction({});
|
||||
const myOptions = {transaction: tx};
|
||||
|
||||
try {
|
||||
const entry = await models.Entry.findOne(
|
||||
{
|
||||
where: {
|
||||
id: 1
|
||||
},
|
||||
myOptions
|
||||
});
|
||||
|
||||
await entry.updateAttributes({
|
||||
typeFk: typeFk,
|
||||
created: new Date()
|
||||
});
|
||||
|
||||
const result = await models.Supplier.getWithPackaging(myOptions);
|
||||
|
||||
expect(result.length).toEqual(1);
|
||||
|
|
|
@ -265,8 +265,7 @@ module.exports = Self => {
|
|||
FROM sale s2
|
||||
JOIN item i2 ON i2.id = s2.itemFk
|
||||
WHERE s2.ticketFk = t.id
|
||||
) AS packing,
|
||||
c.credit
|
||||
) AS packing
|
||||
FROM ticket t
|
||||
LEFT JOIN invoiceOut io ON t.refFk = io.ref
|
||||
LEFT JOIN zone z ON z.id = t.zoneFk
|
||||
|
|
|
@ -154,8 +154,8 @@ module.exports = Self => {
|
|||
t.landingHour,
|
||||
t.cargoSupplierFk,
|
||||
t.totalEntries,
|
||||
t.isRaid,
|
||||
t.daysInForward,
|
||||
t.isRaid,
|
||||
am.name agencyModeName,
|
||||
win.name warehouseInName,
|
||||
wout.name warehouseOutName,
|
||||
|
|
|
@ -86,30 +86,30 @@ module.exports = Self => {
|
|||
'Tipo Documento': 'description',
|
||||
'Stored on': 'created',
|
||||
'Document ID': 'id',
|
||||
'URL': 'url',
|
||||
'URL': 'download',
|
||||
'Stored by': 'name',
|
||||
'Estado': 'state'
|
||||
};
|
||||
|
||||
workerDocuware =
|
||||
await models.Docuware.getById('hr', worker?.lastName + ' ' + worker?.firstName, docuwareParse) ?? [];
|
||||
|
||||
await models.Docuware.getById('hr', worker.lastName + ' ' + worker.firstName, docuwareParse) ?? [];
|
||||
const url = (await Self.app.models.Url.getUrl('docuware')) + 'WebClient';
|
||||
for (document of workerDocuware) {
|
||||
const {id: documentId, dmsFk} = document;
|
||||
const docuwareId = document.id;
|
||||
const defaultData = {
|
||||
id: documentId,
|
||||
id: docuwareId,
|
||||
workerFk: id,
|
||||
dmsFk: dmsFk,
|
||||
dmsFk: docuwareId,
|
||||
dms: {
|
||||
id: documentId,
|
||||
file: dmsFk + '.pdf',
|
||||
id: docuwareId,
|
||||
file: docuwareId + '.pdf',
|
||||
isDocuware: true,
|
||||
hasFile: false,
|
||||
reference: worker?.fi,
|
||||
dmsFk: dmsFk,
|
||||
url: document.url,
|
||||
download: `WorkerDms/${document.dmsFk}/docuwareDownload`,
|
||||
reference: worker.fi,
|
||||
dmsFk: docuwareId,
|
||||
url,
|
||||
description: document.description + ' - ' + document.state,
|
||||
download: document.download,
|
||||
created: document.created,
|
||||
dmsType: {name: 'Docuware'},
|
||||
worker: {id: null, user: {name: document.name}},
|
||||
|
|
|
@ -16,7 +16,7 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.checkInbox = async() => {
|
||||
let imapConfig = await Self.app.models.WorkerTimeControlConfig.findOne();
|
||||
let imapConfig = await Self.app.models.WorkerTimeControlParams.findOne();
|
||||
let imap = new Imap({
|
||||
user: imapConfig.mailUser,
|
||||
password: imapConfig.mailPass,
|
||||
|
|
|
@ -58,8 +58,9 @@ module.exports = Self => {
|
|||
if (!isSubordinate || (isSubordinate && userId == id && !isTeamBoss))
|
||||
throw new UserError(`You don't have enough privileges`);
|
||||
|
||||
const labour = await models.WorkerLabour.findById(args.businessFk,
|
||||
{fields: ['started', 'ended', 'businessFk']}, myOptions);
|
||||
const labour = await models.WorkerLabour.findById(args.businessFk, {
|
||||
include: {relation: 'department'}
|
||||
}, myOptions);
|
||||
|
||||
if (args.dated < labour.started || (labour.ended != null && args.dated > labour.ended))
|
||||
throw new UserError(`The contract was not active during the selected date`);
|
||||
|
@ -86,8 +87,7 @@ module.exports = Self => {
|
|||
`SELECT COUNT(*) halfHolidayCounter
|
||||
FROM vn.calendar c
|
||||
JOIN vn.business b ON b.id = c.businessFk
|
||||
JOIN vn.absenceType at ON at.id = c.dayOffTypeFk
|
||||
WHERE at.code = 'halfHoliday'
|
||||
WHERE c.dayOffTypeFk = 6
|
||||
AND b.workerFk = ?
|
||||
AND c.dated BETWEEN util.firstDayOfYear(?)
|
||||
AND LAST_DAY(DATE_ADD(?, INTERVAL 12 - MONTH(?) MONTH))`, [id, date, now, now]);
|
||||
|
@ -119,23 +119,25 @@ module.exports = Self => {
|
|||
dated: args.dated
|
||||
}, myOptions);
|
||||
|
||||
const account = await models.VnUser.findById(userId, null, myOptions);
|
||||
const subordinated = await models.VnUser.findById(id, null, myOptions);
|
||||
const worker = await models.Worker.findById(subordinated.id, null, myOptions);
|
||||
const departmentBoss = await models.VnUser.findById(worker.bossFk, null, myOptions);
|
||||
const url = await Self.app.models.Url.getUrl();
|
||||
const body = $t('Created absence', {
|
||||
author: account.nickname,
|
||||
employee: subordinated.nickname,
|
||||
absenceType: absenceType.name,
|
||||
dated: formatDate(args.dated),
|
||||
workerUrl: `${url}worker/${id}/calendar`
|
||||
});
|
||||
await models.Mail.create({
|
||||
subject: $t('Absence change notification on the labour calendar'),
|
||||
body: body,
|
||||
receiver: departmentBoss.email
|
||||
}, myOptions);
|
||||
const department = labour.department();
|
||||
if (department && department.notificationEmail) {
|
||||
const absenceType = await models.AbsenceType.findById(args.absenceTypeId, null, myOptions);
|
||||
const account = await models.VnUser.findById(userId, null, myOptions);
|
||||
const subordinated = await models.VnUser.findById(id, null, myOptions);
|
||||
const url = await Self.app.models.Url.getUrl();
|
||||
const body = $t('Created absence', {
|
||||
author: account.nickname,
|
||||
employee: subordinated.nickname,
|
||||
absenceType: absenceType.name,
|
||||
dated: formatDate(args.dated),
|
||||
workerUrl: `${url}worker/${id}/calendar`
|
||||
});
|
||||
await models.Mail.create({
|
||||
subject: $t('Absence change notification on the labour calendar'),
|
||||
body: body,
|
||||
receiver: department.notificationEmail
|
||||
}, myOptions);
|
||||
}
|
||||
|
||||
if (tx) await tx.commit();
|
||||
|
||||
|
|
|
@ -113,6 +113,9 @@
|
|||
"WorkerTimeControlConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerTimeControlParams": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerTimeControlMail": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -122,15 +125,6 @@
|
|||
"Locker": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerIrpf": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"DisabilityGrade": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerRelative": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"MedicalReview": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
{
|
||||
"name": "DisabilityGrade",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "disabilityGrade"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
{
|
||||
"name": "WorkerIrpf",
|
||||
"description": "Model 145 IRPF",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerIrpf"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"workerFk": {
|
||||
"type": "number",
|
||||
"id": 1,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"spouseNif": {
|
||||
"type": "string"
|
||||
},
|
||||
"geographicMobilityDate": {
|
||||
"type": "date"
|
||||
},
|
||||
"disabilityGradeFk": {
|
||||
"type" : "number"
|
||||
},
|
||||
"isDependend": {
|
||||
"type" : "number"
|
||||
},
|
||||
"familySituation": {
|
||||
"type" : "number"
|
||||
},
|
||||
"spousePension": {
|
||||
"type" : "number"
|
||||
},
|
||||
"childPension": {
|
||||
"type" : "number"
|
||||
},
|
||||
"hasHousingPaymentBefore": {
|
||||
"type" : "number"
|
||||
},
|
||||
"hasHousingPaymentAfter": {
|
||||
"type" : "number"
|
||||
},
|
||||
"updated": {
|
||||
"type" : "date"
|
||||
}
|
||||
|
||||
},
|
||||
"relations": {
|
||||
"disabilityGrade": {
|
||||
"type": "belongsTo",
|
||||
"model": "disabilityGrade",
|
||||
"foreignKey": "disabilityGradeFk"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
{
|
||||
"name": "WorkerRelative",
|
||||
"description": "Model 145 IRPF",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerRelatives"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
},
|
||||
"workerFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"isDescendant": {
|
||||
"type": "number"
|
||||
},
|
||||
"disabilityGradeFk": {
|
||||
"type" : "number"
|
||||
},
|
||||
"birthed": {
|
||||
"type" : "number"
|
||||
},
|
||||
"adoptionYear": {
|
||||
"type" : "number"
|
||||
},
|
||||
"isDependend": {
|
||||
"type" : "boolean"
|
||||
},
|
||||
"isJointCustody": {
|
||||
"type" : "boolean"
|
||||
},
|
||||
"updated": {
|
||||
"type" : "date"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"disabilityGrade": {
|
||||
"type": "belongsTo",
|
||||
"model": "disabilityGrade",
|
||||
"foreignKey": "disabilityGradeFk"
|
||||
},
|
||||
"worker": {
|
||||
"type": "belongsTo",
|
||||
"model": "VnUser",
|
||||
"foreignKey": "workerFK"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -11,15 +11,6 @@
|
|||
"id": true,
|
||||
"type": "number"
|
||||
},
|
||||
"mailPass": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailHost": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailUser": {
|
||||
"type": "string"
|
||||
},
|
||||
"breakTime": {
|
||||
"type": "number"
|
||||
},
|
||||
|
@ -32,13 +23,5 @@
|
|||
"teleworkingStartBreakTime": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "WorkerTimeControlParams",
|
||||
"description": "imap config",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerTimeControlParams"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"mailHost": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailUser": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailPass": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailSuccessFolder": {
|
||||
"type": "string"
|
||||
},
|
||||
"mailErrorFolder": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "$everyone",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -132,16 +132,6 @@
|
|||
"type": "hasMany",
|
||||
"model": "WorkerTimeControlMail",
|
||||
"foreignKey": "workerFk"
|
||||
},
|
||||
"irpf": {
|
||||
"type": "hasMany",
|
||||
"model": "WorkerIrpf",
|
||||
"foreignKey": "workerFk"
|
||||
},
|
||||
"workerRelative": {
|
||||
"type": "hasMany",
|
||||
"model": "WorkerRelative",
|
||||
"foreignKey": "workerFK"
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
|
@ -327,4 +317,4 @@
|
|||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -385,6 +385,7 @@ localFixtures:
|
|||
- workerTimeControl
|
||||
- workerTimeControlConfig
|
||||
- workerTimeControlMail
|
||||
- workerTimeControlParams
|
||||
- zone
|
||||
- zoneAgencyMode
|
||||
- zoneClosure
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-back",
|
||||
"version": "24.50.0",
|
||||
"version": "24.48.0",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Salix backend",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue