Compare commits

...

72 Commits

Author SHA1 Message Date
Carlos Satorres 38958ca5fb Merge branch 'dev' into 6389-changesMonitor
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-21 09:10:27 +00:00
Jon Elias 9cd16981e6 Merge pull request '#6924 Notify absences only to department boss' (!3175) from 6924-NotifyOnlyToBoss into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3175
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-21 07:06:27 +00:00
Alex Moreno 0ac46882be Merge branch 'dev' into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-21 06:54:00 +00:00
Alex Moreno f5b16ca36d Merge pull request 'fix: refs #7529 fix acls' (!3228) from 7529-worerPitFix into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3228
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-21 06:03:19 +00:00
Carlos Satorres 2098ea7163 Merge branch 'dev' into 7529-worerPitFix
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-21 04:48:26 +00:00
Carlos Satorres 82f4815282 fix: refs #7529 fix acls
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-20 14:16:26 +01:00
Guillermo Bonet 69bdf8efb2 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-20 14:08:42 +01:00
Sergio De la torre a8dea64bc1 Merge pull request 'fix: refs #7920 refs#7920 itemShelvingLog' (!3227) from 7920-itemShelvingLog into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
Reviewed-on: #3227
Reviewed-by: Guillermo Bonet <guillermo@verdnatura.es>
2024-11-20 13:07:51 +00:00
Sergio De la torre 9fbffe8a6b fix: refs #7920 refs#7920 itemShelvingLog
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-20 14:03:23 +01:00
Carlos Satorres d46683cd31 Merge pull request 'refs #7529 back models acls' (!2563) from 7529-workerPIT into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #2563
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-20 12:21:30 +00:00
Carlos Satorres 7ab1b7d171 Merge branch 'dev' of https: refs #7529//gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-20 13:14:26 +01:00
Carlos Satorres df249b05d3 fix: refs #7529 fix acl
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-20 13:10:43 +01:00
Pablo Natek cde3c8c50a Merge pull request 'feat: refs #8138 reduce credit on risk' (!3215) from 8138-feat-reduce-credit-on-risk into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3215
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
2024-11-20 11:21:09 +00:00
Guillermo Bonet 42a27f3407 Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-20 12:17:53 +01:00
Guillermo Bonet d302a9c3ba Merge branch 'master' into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-20 12:17:30 +01:00
Guillermo Bonet 917e3128a9 Merge pull request 'fix: refs #8191 Deleted msg send rocket in getSales.js' (!3225) from 8191-getSales into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3225
Reviewed-by: Sergio De la torre <sergiodt@verdnatura.es>
2024-11-20 11:13:28 +00:00
Guillermo Bonet 22ce7a4dd4 fix: refs #8191 Deleted unused traductions
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-20 12:07:10 +01:00
Guillermo Bonet a4b568e9b8 fix: refs #8191 Deleted msg send rocket in getSales.js
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-20 12:03:30 +01:00
Carlos Satorres 91164624bc Merge pull request 'fix: fix deleteZone' (!3224) from hotfix-deleteZoneShipped into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3224
Reviewed-by: Pablo Natek <pablone@verdnatura.es>
2024-11-20 10:19:06 +00:00
Carlos Satorres be311c0557 fix: fix deleteZone
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-20 11:09:15 +01:00
Jorge Penadés e4317a385c Merge pull request 'fix: refs #6818 add config' (!3223) from 6818-warmfixxInsertConfig into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
Reviewed-on: #3223
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-20 09:00:39 +00:00
Jorge Penadés 3cce342d9d fix: refs #6818 add config
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-20 09:52:42 +01:00
Pablo Natek 5e52b3b596 Merge branch 'dev' into 8138-feat-reduce-credit-on-risk
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-20 06:46:46 +00:00
Carlos Andrés ad345a0b91 Merge pull request 'feat: refs#8087 Redadas en travel' (!3177) from 8087-nuevosCamposTravel into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3177
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-11-19 16:57:15 +00:00
Alex Moreno 46148d7ba3 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 14:09:58 +01:00
Alex Moreno 033e269a5d Merge branch 'master' of https://gitea.verdnatura.es/verdnatura/salix into test
gitea/salix/pipeline/pr-dev This commit looks good Details
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 14:09:46 +01:00
Carlos Andrés 63c0747304 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8087-nuevosCamposTravel
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-19 13:52:12 +01:00
Carlos Andrés 953bc84a58 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-19 13:49:02 +01:00
Jon Elias 492c79de46 Merge branch 'dev' into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-19 12:42:53 +00:00
Jon Elias 149524f4fd Merge branch '6924-NotifyOnlyToBoss' of https://gitea.verdnatura.es/verdnatura/salix into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-19 13:40:32 +01:00
Jon Elias f145649fc7 fix: refs #6924 requested change 2024-11-19 13:40:31 +01:00
Carlos Andrés 6a43d3c752 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-19 13:40:12 +01:00
Jorge Penadés 2335b57e05 Merge pull request '#7323 add remaining fields' (!3220) from 7323-warfix-addRemainingFields into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
Reviewed-on: #3220
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-19 12:37:24 +00:00
Jorge Penadés c31fa7e9cf Merge branch 'test' into 7323-warfix-addRemainingFields
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 12:33:01 +00:00
Alex Moreno 60734136c3 Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good Details
2024-11-19 13:28:53 +01:00
Sergio De la torre f192b92c6a Merge pull request 'feat: refs #8099 refs#8099 addComplmentSalary' (!3219) from 8099-addComplementSalary into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
Reviewed-on: #3219
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-11-19 12:25:47 +00:00
Robert Ferrús b29053e850 Merge pull request 'feat: refs #8211 route_afterUpdate' (!3218) from 8211-hotFixRoute_afterUpdate into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3218
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
2024-11-19 11:05:30 +00:00
Jorge Penadés f89080d373 fix: refs #7323 add remaining fields
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 11:53:12 +01:00
Sergio De la torre feb11c123e feat: refs #8099 refs#8099 addComplmentSalary
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 11:45:40 +01:00
Sergio De la torre d21b42a567 feat: refs #8099 refs#8099 addComplmentSalary
gitea/salix/pipeline/pr-test This commit looks good Details
2024-11-19 11:24:00 +01:00
Robert Ferrús 7b5e474d24 feat: refs #8211 route_afterUpdate
gitea/salix/pipeline/pr-master This commit looks good Details
2024-11-19 11:15:57 +01:00
Pablo Natek a3f92a284f Merge branch 'dev' into 8138-feat-reduce-credit-on-risk
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-19 07:02:11 +00:00
Pablo Natek 2f93da199a feat: refs #8138 reduce credit on risk
gitea/salix/pipeline/pr-dev Build queued... Details
2024-11-19 08:01:41 +01:00
Carlos Satorres 6b0d7762b4 Merge branch '7529-workerPIT' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-18 13:57:42 +01:00
Carlos Satorres 2790e92741 fix: refs #7529 fix acl 2024-11-18 13:57:40 +01:00
Jon Elias 66149a69a7 Merge branch 'dev' into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-14 07:37:42 +00:00
Jon Elias 7be1bc385f perf: refs #6924 deleted useless relation
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-14 08:35:28 +01:00
Jon Elias dcae6dfbb4 Merge branch '6924-NotifyOnlyToBoss' of https://gitea.verdnatura.es/verdnatura/salix into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-13 08:45:45 +01:00
Jon Elias ea4adbea85 refactor: refs #6924 deleted department check 2024-11-13 08:45:44 +01:00
Jon Elias 0f913d8975 Merge branch 'dev' into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-13 06:51:32 +00:00
Carlos Andrés b8f2e0b906 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-12 16:50:46 +01:00
Carlos Andrés 358ed2513d feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-12 16:26:30 +01:00
Carlos Andrés 69d6e4a104 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 8087-nuevosCamposTravel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-12 16:24:05 +01:00
Carlos Andrés cf102699d5 feat: refs#8087 Redadas en travel
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-11 14:19:11 +01:00
Jon Elias bb7cecdcff Merge branch 'dev' into 6924-NotifyOnlyToBoss
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-11 10:01:09 +00:00
Jon Elias 1e8a7eff60 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6924-NotifyOnlyToBoss 2024-11-11 10:52:46 +01:00
Jon Elias 25891e0bad feat: refs #6924 notify absences only to department boss
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-11-11 10:42:06 +01:00
Carlos Satorres 73efb8f1a8 Merge branch 'dev' into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-08 11:17:48 +00:00
Carlos Satorres fa108e2af0 fix: refs #7529 fix sql
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-08 11:56:17 +01:00
Carlos Satorres c5afde3334 Merge branch 'dev' of https: refs #7529//gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-11-07 12:48:05 +01:00
Carlos Satorres e0e487859f fix: refs #7529 fix models
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-29 13:59:47 +01:00
Carlos Satorres ca6d8a67cb Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT 2024-10-29 08:32:44 +01:00
Carlos Satorres 6b10f60933 fix: refs #7529 mod model
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-29 08:03:18 +01:00
Carlos Satorres 55a409c680 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT 2024-10-29 06:13:12 +01:00
Carlos Satorres 248ae64872 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-28 13:31:37 +01:00
Carlos Satorres 903d85a243 fix: refs #7529 fix back
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-18 14:06:39 +02:00
Carlos Satorres 0a726a8fe7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-18 11:16:06 +02:00
Carlos Satorres 60375d153f Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-03 13:02:07 +02:00
Carlos Satorres 355ce46393 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-09-19 08:54:53 +02:00
Carlos Satorres 5da6c09f68 fix: refs #7529 workerPit
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-18 12:08:49 +02:00
Carlos Satorres c0ee82fd4f Merge branch 'dev' of https: refs #7529//gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-09-18 07:56:03 +02:00
Carlos Satorres 1a01b3e587 refs #7529 back models acls
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-06-10 10:42:52 +02:00
57 changed files with 440 additions and 143 deletions

View File

@ -29,10 +29,8 @@ module.exports = Self => {
});
Self.getSales = async(ctx, collectionOrTicketFk, print, source, options) => {
const models = Self.app.models;
const userId = ctx.req.accessToken.userId;
const myOptions = {userId};
const $t = ctx.req.__;
if (typeof options == 'object')
Object.assign(myOptions, options);
@ -59,22 +57,6 @@ module.exports = Self => {
if (print) await Self.rawSql('CALL vn.collection_printSticker(?,NULL)', [id], myOptions);
for (let ticket of tickets) {
if (ticket.observaciones) {
let observations = ticket.observaciones.split(' ');
for (let observation of observations) {
const salesPerson = ticket.salesPersonFk;
if (observation.startsWith('#') || observation.startsWith('@')) {
await models.Chat.send(ctx,
observation,
$t('ticketCommercial', {ticket: ticket.ticketFk, salesPerson})
);
}
}
}
}
return getCollection(id, tickets, sales, placements, myOptions);
};

View File

@ -1505,18 +1505,18 @@ INSERT INTO `vn`.`awb` (id, code, package, weight, created, amount, transitoryFk
(9, '99610289193', 302, 2972, util.VN_CURDATE(), 3871, 442, 1),
(10, '07546500856', 185, 2364, util.VN_CURDATE(), 5321, 442, 1);
INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyModeFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`, `awbFK`, `daysInForward`)
VALUES (1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1, 1, NULL),
(2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150.00, 2000, 'second travel', 2, 2, 2, NULL),
(3, util.VN_CURDATE(), util.VN_CURDATE(), 1, 2, 1, 0.00, 0.00, 'third travel', 1, 1, 3, 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, 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, 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, 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, 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, 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, 2),
(11, util.VN_CURDATE() - INTERVAL 1 DAY , util.VN_CURDATE(), 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, NULL),
(12, util.VN_CURDATE() , util.VN_CURDATE() + INTERVAL 1 DAY, 6, 3, 0, 50.00, 500, 'eleventh travel', 1, 2, 4, NULL);
INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseOutFk`, `agencyModeFk`, `m3`, `kg`,`ref`, `totalEntries`, `cargoSupplierFk`, `awbFK`, `isRaid`, `daysInForward`)
VALUES (1, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH), 1, 2, 1, 100.00, 1000, 'first travel', 1, 1, 1, FALSE, NULL),
(2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 2, 1, 150.00, 2000, 'second travel', 2, 2, 2, FALSE, NULL),
(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),
(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`)
VALUES
@ -4008,10 +4008,17 @@ 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 srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk)
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);
INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, code, stratus, hasWorkerWaiting, reserve, routeFk, dayMinute, lastUnloaded, hasStrapper, typeDefaultFk, motors, editorFk)
VALUES (0, 0, 0, 0, NULL, 3, 1, 0, 'ENT', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(1, 0, 9900, 0, NULL, 1, 0, 0, 'NOK', 0, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(2, 0, 0, 450, 13000, 1, 0, 1, '01A', 1, 1, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(2, 0, 0, 450, 13000, 1, 0, 1, '01A', 1, 1, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(3, 1400, 0, 450, 13000, 1, 0, 1, '01B', 1, 0, NULL, NULL, NULL, NULL, 0, 1, 1, NULL),
(4, 0, 500, 500, 13000, 1, 4, 1, '02A', 2, 1, NULL, NULL, NULL, NULL, 1, 4, 13, NULL),
(5, 1400, 500, 500, 13000, 1, 4, 1, '02B', 2, 1, NULL, NULL, NULL, NULL, 1, 4, 13, NULL),
@ -4022,9 +4029,11 @@ INSERT INTO srt.buffer (id, x, y, `size`, `length`, stateFk, typeFk, isActive, c
(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)
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 IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
VALUES ('saysimle-url-mock', 1320);INSERT INTO vn.workerIrpf (workerFk,spouseNif,geographicMobilityDate)
VALUES
(1106,'26493101E','2019-09-20');

View File

@ -53,7 +53,7 @@ proc: BEGIN
WHERE t.landed BETWEEN vInventoryDate AND vStartDate
AND t.warehouseInFk = vWarehouse
AND s.name != 'INVENTARIO'
AND NOT t.daysInForward
AND NOT t.isRaid
GROUP BY b.itemFk
) c
JOIN vn.item i ON i.id = c.itemFk

View File

@ -14,7 +14,7 @@ BEGIN
b.stickers = NEW.NumberOfUnits
WHERE i.supplyResponseFk = NEW.ID
AND am.name = 'LOGIFLORA'
AND tr.daysInForward
AND tr.isRaid
AND tr.landed >= util.VN_CURDATE();
END$$

View File

@ -59,7 +59,7 @@ BEGIN
JOIN vn.travel t ON t.id = e.travelFk
WHERE t.landed BETWEEN vDateInv AND vDate
AND t.warehouseInFk = vWarehouse
AND NOT t.daysInForward
AND NOT t.isRaid
UNION ALL
SELECT b.itemFk, -b.quantity
FROM vn.buy b
@ -67,7 +67,7 @@ BEGIN
JOIN vn.travel t ON t.id = e.travelFk
WHERE t.shipped BETWEEN vDateInv AND util.VN_CURDATE()
AND t.warehouseOutFk = vWarehouse
AND NOT t.daysInForward
AND NOT t.isRaid
AND t.isDelivered
UNION ALL
SELECT m.itemFk, -m.quantity

View File

@ -6,12 +6,11 @@ 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,
t.daysInForward,
t.isRaid,
ADDTIME(t.shipped,
IFNULL(t.shipmentHour, '00:00:00')) shipped,
t.warehouseOutFk,
@ -50,7 +49,7 @@ BEGIN
itemFk,
TIMESTAMPADD(DAY, life, @dated),
quantity,
IF(isIn, isReceived, isDelivered) AND NOT daysInForward
IF(isIn, isReceived, isDelivered) AND NOT isRaid
FROM tValues
WHERE isIn OR !lessThanInventory;
@ -65,7 +64,7 @@ BEGIN
itemFk,
created,
quantity,
IF(isIn, isDelivered, isReceived) AND NOT daysInForward
IF(isIn, isDelivered, isReceived) AND NOT isRaid
FROM tValues
WHERE !isIn OR !lessThanInventory;

View File

@ -39,7 +39,7 @@ BEGIN
AND vWarehouseFk IN (tr.warehouseInFk, 0)
AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable
AND NOT tr.daysInForward
AND NOT tr.isRaid
UNION ALL
SELECT tr.shipped,
NULL,
@ -58,7 +58,7 @@ BEGIN
AND s.id <> (SELECT supplierFk FROM inventoryConfig)
AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable
AND NOT tr.daysInForward
AND NOT tr.isRaid
UNION ALL
SELECT t.shipped,
NULL,

View File

@ -42,7 +42,7 @@ proc: BEGIN
WHERE t.landed BETWEEN vDatedInventory AND vDatedFrom
AND t.warehouseInFk = vWarehouseLanding
AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward
AND NOT t.isRaid
GROUP BY c.itemFk;
-- Tabla con el ultimo dia de last_buy para cada producto
@ -57,7 +57,7 @@ proc: BEGIN
JOIN travel tr ON tr.id = e.travelFk
LEFT JOIN tItemRange i ON t.itemFk = i.itemFk
WHERE t.warehouseFk = vWarehouseShipment
AND NOT tr.daysInForward
AND NOT tr.isRaid
ON DUPLICATE KEY UPDATE tItemRange.dated = GREATEST(tItemRange.dated,
tr.landed);
@ -94,7 +94,7 @@ proc: BEGIN
JOIN tItemRangeLive ir ON ir.itemFk = b.itemFk
WHERE NOT e.isExcludedFromAvailable
AND b.quantity <> 0
AND NOT t.daysInForward
AND NOT t.isRaid
AND t.warehouseInFk = vWarehouseLanding
AND t.landed >= vDatedFrom
AND (ir.dated IS NULL OR t.landed <= ir.dated)

View File

@ -166,7 +166,7 @@ BEGIN
LEFT JOIN tmp.buyUltimateFromInterval bufi ON bufi.itemFk = i.id
LEFT JOIN buy b3 ON b3.id = bufi.buyFk
WHERE ic.display
AND NOT tr.daysInForward
AND NOT tr.isRaid
AND (ti.visible OR ti.available)
ORDER BY i.typeFk, i.name, i.id, i.size, i.category, o.name;

View File

@ -137,7 +137,7 @@ BEGIN
JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseInFk = vWarehouseFk
AND tr.landed BETWEEN vDateLastInventory AND vDateYesterday
AND NOT tr.daysInForward
AND NOT tr.isRaid
GROUP BY b.itemFk;
-- Transfers
@ -150,7 +150,7 @@ BEGIN
JOIN travel tr ON tr.id = e.travelFk
WHERE tr.warehouseOutFk = vWarehouseFk
AND tr.shipped BETWEEN vDateLastInventory AND vDateYesterday
AND NOT tr.daysInForward
AND NOT tr.isRaid
GROUP BY b.itemFk
) sub
ON DUPLICATE KEY UPDATE quantity = IFNULL(quantity, 0) + sub.quantityOut;

View File

@ -48,7 +48,7 @@ BEGIN
iss.itemShelvingFk,
SUM(IFNULL(iss.quantity,0)),
IF(sgd.id, 'PREVIOUS_PREPARATION', 'PREPARED'),
ish.shelvingFk
sh.code
INTO vItemFk,
vSaleFk,
vItemShelvingFk,
@ -58,7 +58,8 @@ BEGIN
FROM itemShelvingSale iss
JOIN sale s ON s.id = iss.saleFk
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = iss.saleFk
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = iss.saleFk
LEFT JOIN shelving sh ON sh.id = ish.shelvingFk
WHERE iss.id = vItemShelvingSaleFk
AND NOT iss.isPicked;

View File

@ -21,7 +21,8 @@ BEGIN
ish.isChecked,
ic.url,
ish.available,
ish.buyFk
ish.buyFk,
sh.shelvingFk
FROM itemShelving ish
JOIN item i ON i.id = ish.itemFk
JOIN shelving s ON s.id = ish.shelvingFk

View File

@ -59,7 +59,7 @@ BEGIN
AND (s.id <> vSupplierInventoryFk OR vDated IS NULL)
AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable
AND NOT tr.daysInForward
AND NOT tr.isRaid
),
entriesOut AS (
SELECT 'entry',
@ -95,7 +95,7 @@ BEGIN
AND b.itemFk = vItemFk
AND NOT e.isExcludedFromAvailable
AND NOT w.isFeedStock
AND NOT tr.daysInForward
AND NOT tr.isRaid
),
sales AS (
WITH itemSales AS (

View File

@ -63,7 +63,7 @@ BEGIN
AND NOT e.isExcludedFromAvailable
AND b.quantity <> 0
AND (vItemFk IS NULL OR b.itemFk = vItemFk)
AND NOT t.daysInForward
AND NOT t.isRaid
UNION ALL
SELECT r.itemFk,
r.shipment,

View File

@ -30,7 +30,7 @@ BEGIN
AND NOT s.name = 'INVENTARIO'
AND (vWarehouseFk IS NULL OR t.warehouseInFk = vWarehouseFk)
AND w.isComparative
AND NOT t.daysInForward
AND NOT t.isRaid
GROUP BY i.id;
UPDATE tmp.itemInventory y

View File

@ -109,7 +109,7 @@ BEGIN
JOIN warehouse w ON w.id = tr.warehouseInFk
WHERE tr.landed BETWEEN vInventoried AND vDateDayEnd
AND IF(tr.landed = util.VN_CURDATE(), tr.isReceived, TRUE)
AND NOT tr.daysInForward
AND NOT tr.isRaid
AND w.valuatedInventory
AND t.isInventory
AND e.supplierFk <> vInventorySupplierFk
@ -131,7 +131,7 @@ BEGIN
JOIN itemCategory ic ON ic.id = t.categoryFk
JOIN warehouse w ON w.id = tr.warehouseOutFk
WHERE tr.shipped BETWEEN vInventoried AND vDateDayEnd
AND NOT tr.daysInForward
AND NOT tr.isRaid
AND w.valuatedInventory
AND t.isInventory
AND (t.id = vItemTypeFk OR vItemTypeFk IS NULL)
@ -196,7 +196,7 @@ BEGIN
JOIN warehouse wIn ON wIn.id = tr.warehouseInFk
JOIN warehouse wOut ON wOut.id = tr.warehouseOutFk
WHERE vDated >= tr.shipped AND vDated < tr.landed
AND NOT tr.daysInForward
AND NOT tr.isRaid
AND wIn.valuatedInventory
AND t.isInventory
AND e.isConfirmed

View File

@ -60,7 +60,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
AND w.isComparative
AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward
AND NOT t.isRaid
UNION ALL
SELECT b.itemFk, - b.quantity
FROM buy b
@ -71,7 +71,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
AND w.isComparative
AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward
AND NOT t.isRaid
) sub
GROUP BY itemFk;
@ -121,7 +121,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseInFk) = t.warehouseInFk
AND w.isComparative
AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward
AND NOT t.isRaid
UNION ALL
SELECT b.itemFk, t.shipped, - b.quantity
FROM buy b
@ -132,7 +132,7 @@ proc: BEGIN
AND IFNULL(vWarehouseFk, t.warehouseOutFk) = t.warehouseOutFk
AND w.isComparative
AND NOT e.isExcludedFromAvailable
AND NOT t.daysInForward
AND NOT t.isRaid
) sub
GROUP BY sub.itemFk, sub.dated;

View File

@ -10,7 +10,7 @@ BEGIN
JOIN vn.entry e ON e.travelFk = tr.id
JOIN vn.buy b ON b.entryFk = e.id
WHERE tr.landed BETWEEN vFromDated AND vToDated
AND NOT tr.daysInForward
AND NOT tr.isRaid
AND tr.warehouseInFk = vWarehouseFk
GROUP BY tr.landed , a.name ;
END$$

View File

@ -0,0 +1,17 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_checkRaid`(
vIsRaid BOOL,
vDaysInForward INT
)
BEGIN
/**
* Check if the values of isRaid and daysInforward are correct
*
* @param vIsRaid idRaid value
* @param vDaysInForward daysInForward value
*/
IF (NOT vIsRaid AND vDaysInForward IS NOT NULL) OR (vIsRaid AND vDaysInForward IS NULL) THEN
CALL util.throw('The raid information is not correct');
END IF;
END$$
DELIMITER ;

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`travel_moveRaids`()
BEGIN
/**
* Desplaza los travels en el futuro y avisa a los compradores
*
*
*/
DECLARE vDone BOOL DEFAULT FALSE;
DECLARE vBuyerEmail VARCHAR(40);
@ -11,21 +11,21 @@ BEGIN
DECLARE vMailBody TEXT DEFAULT '';
DECLARE vCur CURSOR FOR
SELECT GROUP_CONCAT(DISTINCT
CONCAT('https://salix.verdnatura.es/#!/travel/',
ttm.travelFk,
SELECT GROUP_CONCAT(DISTINCT
CONCAT('https://salix.verdnatura.es/#!/travel/',
ttm.travelFk,
'/summary ')
ORDER BY ttm.travelFk SEPARATOR '\n\r') travelLink,
CONCAT(u.name, '@verdnatura.es') buyerEmail
FROM tTravelToMove ttm
JOIN entry e ON e.travelFk = ttm.travelFk
JOIN entry e ON e.travelFk = ttm.travelFk
JOIN buy b ON b.entryFk = e.id
JOIN item i ON i.id = b.itemFk
JOIN itemType it ON it.id = i.typeFk
JOIN account.user u ON u.id = it.workerFk
GROUP BY u.name;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
@ -34,10 +34,11 @@ BEGIN
END;
CREATE OR REPLACE TEMPORARY TABLE tTravelToMove
SELECT id travelFk,
SELECT id travelFk,
util.VN_CURDATE() + INTERVAL daysInForward DAY newLanded
FROM travel
WHERE daysInForward;
WHERE isRaid
AND daysInForward;
START TRANSACTION;

View File

@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`entry_beforeUpdate`
BEFORE UPDATE ON `entry`
FOR EACH ROW
BEGIN
DECLARE vDaysInForward INT;
DECLARE vIsRaid BOOL;
DECLARE vPrintedCount INT;
DECLARE vHasDistinctWarehouses BOOL;
DECLARE vTotalBuy INT;
@ -38,7 +38,7 @@ BEGIN
CALL travel_throwAwb(NEW.travelFk);
END IF;
SELECT daysInForward INTO vDaysInForward
SELECT isRaid INTO vIsRaid
FROM travel t
JOIN entry e ON e.travelFk = t.id
WHERE entryFk = NEW.id;
@ -50,7 +50,7 @@ BEGIN
WHERE o.id = OLD.travelFk
AND n.id = NEW.travelFk;
IF vDaysInForward AND vHasDistinctWarehouses THEN
IF vIsRaid AND vHasDistinctWarehouses THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'A cloned entry cannot be moved to a travel with different warehouses';
END IF;

View File

@ -2,18 +2,18 @@ DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` 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;
@ -21,7 +21,8 @@ BEGIN
OR !(NEW.kmEnd <=> OLD.kmEnd)
OR !(NEW.workerFk <=> OLD.workerFk)
OR !(NEW.m3 <=> OLD.m3)
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)THEN
OR !(NEW.agencyModeFk <=> OLD.agencyModeFk)
OR !(NEW.vehicleFk <=> OLD.vehicleFk)THEN
CALL route_calcCommission(NEW.id);
END IF;

View File

@ -1,10 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` 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 ;

View File

@ -8,7 +8,11 @@ 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;

View File

@ -7,7 +7,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;
@ -20,19 +20,23 @@ 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;

View File

@ -6,7 +6,7 @@ AS SELECT `t`.`warehouseInFk` AS `warehouseInFk`,
`b`.`itemFk` AS `itemFk`,
`b`.`quantity` AS `quantity`,
`t`.`isReceived` AS `isReceived`,
`t`.`daysInForward` AS `isVirtualStock`,
`t`.`isRaid` AS `isVirtualStock`,
`e`.`id` AS `entryFk`
FROM (
(

View File

@ -15,5 +15,5 @@ FROM (
JOIN `vn`.`travel` `t` ON(`e`.`travelFk` = `t`.`id`)
)
WHERE `e`.`isExcludedFromAvailable` = 0
AND NOT `t`.`daysInForward`
AND NOT `t`.`isRaid`
AND `b`.`quantity` <> 0

View File

@ -31,5 +31,5 @@ FROM (
LEFT JOIN `edi`.`ekt` `ek` ON(`ek`.`id` = `b`.`ektFk`)
)
WHERE `tr`.`landed` BETWEEN `util`.`yesterday`() AND `util`.`tomorrow`()
AND NOT `tr`.`daysInForward`
AND NOT `tr`.`isRaid`
AND `b`.`stickers` > 0

View File

@ -8,6 +8,7 @@ AS SELECT `e`.`gestDocFk` AS `gestdoc_id`,
`e`.`isExcludedFromAvailable` AS `Inventario`,
`e`.`isConfirmed` AS `Confirmada`,
`e`.`isOrdered` AS `Pedida`,
`tr`.`isRaid` AS `isRaid`,
`tr`.`daysInForward` AS `daysInForward`,
`e`.`evaNotes` AS `notas`,
`e`.`supplierFk` AS `Id_Proveedor`,

View File

@ -18,5 +18,6 @@ AS SELECT `t`.`id` AS `id`,
`t`.`totalEntries` AS `totalEntries`,
`t`.`appointment` AS `appointment`,
`t`.`awbFk` AS `awbFk`,
`t`.`isRaid` AS `isRaid`,
`t`.`daysInForward` AS `daysInForward`
FROM `vn`.`travel` `t`

View File

@ -86,4 +86,4 @@ FROM (
)
WHERE NOT `W_IN`.`isFeedStock`
AND NOT `E`.`Inventario`
AND NOT `TR`.`daysInForward`
AND NOT `TR`.`isRaid`

View File

@ -0,0 +1,23 @@
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');

View File

@ -0,0 +1,4 @@
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';

View File

@ -0,0 +1,5 @@
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';

View File

@ -0,0 +1,15 @@
USE vn;
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteAction', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery');
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteComplement', 'find', 'READ', 'ALLOW', 'ROLE', 'delivery');
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteComplement', 'create', 'WRITE', 'ALLOW', 'ROLE', 'delivery');
INSERT INTO salix.ACL (model, property, accessType, permission, principalType, principalId)
VALUES('RouteComplement', 'deleteById', 'WRITE', 'ALLOW', 'ROLE', 'delivery');

View File

@ -0,0 +1,3 @@
-- Place your SQL code here
INSERT IGNORE INTO vn.saySimpleConfig (url, defaultChannel)
VALUES ('https://verdnatura.saysimple.io/start-conversation', 1320);

View File

@ -223,7 +223,6 @@
"Shelving not valid": "Shelving not valid",
"printerNotExists": "The printer does not exist",
"There are not picking tickets": "There are not picking tickets",
"ticketCommercial": "The ticket {{ ticket }} for the salesperson {{ salesMan }} is in preparation. (automatically generated message)",
"This password can only be changed by the user themselves": "This password can only be changed by the user themselves",
"They're not your subordinate": "They're not your subordinate",
"InvoiceIn is already booked": "InvoiceIn is already booked",
@ -245,6 +244,7 @@
"There are tickets for this area, delete them first": "There are tickets for this area, delete them first",
"ticketLostExpedition": "The ticket [{{ticketId}}]({{{ticketUrl}}}) has the following lost expedition:{{ expeditionId }}",
"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"
}

View File

@ -359,7 +359,6 @@
"This workCenter is already assigned to this agency": "Este centro de trabajo ya está asignado a esta agencia",
"Select ticket or client": "Elija un ticket o un client",
"It was not able to create the invoice": "No se pudo crear la factura",
"ticketCommercial": "El ticket {{ ticket }} para el vendedor {{ salesMan }} está en preparación. (mensaje generado automáticamente)",
"Incoterms and Customs agent are required for a non UEE member": "Se requieren Incoterms y agente de aduanas para un no miembro de la UEE",
"You can not use the same password": "No puedes usar la misma contraseña",
"This PDA is already assigned to another user": "Este PDA ya está asignado a otro usuario",
@ -388,5 +387,7 @@
"There is no company associated with that warehouse": "No hay ninguna empresa asociada a ese almacén",
"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"
"Sales already moved": "Ya han sido transferidas",
"The raid information is not correct": "La información de la redada no es correcta"
}

View File

@ -9,6 +9,7 @@ columns:
notes: notes
isConfirmed: confirmed
isVirtual: virtual
isRaid: raid
commission: commission
isOrdered: price3
created: created

View File

@ -9,6 +9,7 @@ columns:
notes: notas
isConfirmed: confirmado
isVirtual: virtual
isRaid: redada
commission: comisión
isOrdered: pedida
created: creado

View File

@ -194,6 +194,7 @@ module.exports = Self => {
e.evaNotes observation,
e.isConfirmed,
e.isOrdered,
t.isRaid,
t.daysInForward,
e.commission,
e.created,

View File

@ -49,8 +49,8 @@ module.exports = Self => {
'isReceived',
'isDelivered',
'ref',
'daysInForward',
],
'isRaid',
'daysInForward'],
include: [
{
relation: 'agency',

View File

@ -30,7 +30,7 @@
<vn-icon
vn-tooltip="Is virtual entry"
icon="icon-net"
ng-if="$ctrl.entryData.travel.daysInForward">
ng-if="$ctrl.entryData.travel.isRaid">
</vn-icon>
</div>
<div class="quicklinks">

View File

@ -86,7 +86,7 @@ auto-load="true">
</vn-check>
<vn-check
label="Raid"
ng-model="$ctrl.entryData.travel.daysInForward"
ng-model="$ctrl.entryData.travel.isRaid"
disabled="true">
</vn-check>
<vn-check

View File

@ -23,6 +23,12 @@
"Route": {
"dataSource": "vn"
},
"RouteAction": {
"dataSource": "vn"
},
"RouteComplement": {
"dataSource": "vn"
},
"RouteLog": {
"dataSource": "vn"
},
@ -32,4 +38,4 @@
"RoutesMonitor": {
"dataSource": "vn"
}
}
}

View File

@ -0,0 +1,30 @@
{
"name": "RouteAction",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "routeAction"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": true
},
"price": {
"type": "number"
},
"isMainlineDelivered": {
"type": "boolean",
"required": true
}
}
}

View File

@ -0,0 +1,37 @@
{
"name": "RouteComplement",
"base": "VnModel",
"mixins": {
"Loggable": true
},
"options": {
"mysql": {
"table": "routeComplement"
}
},
"properties": {
"id": {
"type": "number",
"id": true,
"description": "Identifier"
},
"dated": {
"type": "date"
},
"price": {
"type": "number"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"routeAction": {
"type": "belongsTo",
"model": "RouteAction",
"foreignKey": "routeActionFk"
}
}
}

View File

@ -265,7 +265,8 @@ module.exports = Self => {
FROM sale s2
JOIN item i2 ON i2.id = s2.itemFk
WHERE s2.ticketFk = t.id
) AS packing
) AS packing,
c.credit
FROM ticket t
LEFT JOIN invoiceOut io ON t.refFk = io.ref
LEFT JOIN zone z ON z.id = t.zoneFk

View File

@ -154,6 +154,7 @@ module.exports = Self => {
t.landingHour,
t.cargoSupplierFk,
t.totalEntries,
t.isRaid,
t.daysInForward,
am.name agencyModeName,
win.name warehouseInName,

View File

@ -51,6 +51,9 @@
"landingHour": {
"type": "string"
},
"isRaid": {
"type": "boolean"
},
"daysInForward": {
"type": "number"
}

View File

@ -58,9 +58,8 @@ 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, {
include: {relation: 'department'}
}, myOptions);
const labour = await models.WorkerLabour.findById(args.businessFk,
{fields: ['started', 'ended', 'businessFk']}, 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`);
@ -87,7 +86,8 @@ module.exports = Self => {
`SELECT COUNT(*) halfHolidayCounter
FROM vn.calendar c
JOIN vn.business b ON b.id = c.businessFk
WHERE c.dayOffTypeFk = 6
JOIN vn.absenceType at ON at.id = c.dayOffTypeFk
WHERE at.code = 'halfHoliday'
AND b.workerFk = ?
AND c.dated BETWEEN util.firstDayOfYear(?)
AND LAST_DAY(DATE_ADD(?, INTERVAL 12 - MONTH(?) MONTH))`, [id, date, now, now]);
@ -119,25 +119,23 @@ module.exports = Self => {
dated: args.dated
}, 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);
}
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);
if (tx) await tx.commit();

View File

@ -125,6 +125,15 @@
"Locker": {
"dataSource": "vn"
},
"WorkerIrpf": {
"dataSource": "vn"
},
"DisabilityGrade": {
"dataSource": "vn"
},
"WorkerRelative": {
"dataSource": "vn"
},
"MedicalReview": {
"dataSource": "vn"
},

View File

@ -0,0 +1,18 @@
{
"name": "DisabilityGrade",
"base": "VnModel",
"options": {
"mysql": {
"table": "disabilityGrade"
}
},
"properties": {
"id": {
"id": true,
"type": "number"
},
"description": {
"type": "string"
}
}
}

View File

@ -0,0 +1,55 @@
{
"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"
}
}
}

View File

@ -0,0 +1,53 @@
{
"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"
}
}
}

View File

@ -132,6 +132,16 @@
"type": "hasMany",
"model": "WorkerTimeControlMail",
"foreignKey": "workerFk"
},
"irpf": {
"type": "hasMany",
"model": "WorkerIrpf",
"foreignKey": "workerFk"
},
"workerRelative": {
"type": "hasMany",
"model": "WorkerRelative",
"foreignKey": "workerFK"
}
},
"acls": [
@ -301,8 +311,20 @@
"birth",
"educationLevelFk",
"originCountryFk",
"maritalStatus"
"maritalStatus",
"SSN"
],
"include": [
{
"relation": "client",
"scope": {
"fields": [
"id",
"phone"
]
}
}
]
}
}
}
}

View File

@ -40,8 +40,7 @@ module.exports = Self => {
try {
const filter = {
where: {
zoneFk: id,
shipped: {gte: today}
zoneFk: id
},
include: {
relation: 'ticketState',