Compare commits

...

21 Commits

Author SHA1 Message Date
Pako Natek a6cc7cd2a5 Merge branch 'dev' into 8069-Overstocking
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-04 06:35:18 +00:00
Pablo Natek c01e5aee27 Merge pull request 'fix: refs #7404 add rounding to volume detail' (!3035) from 7404-roundDetailVolume into dev
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3035
Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
2024-10-04 05:31:32 +00:00
Pablo Natek f019214002 Merge branch 'dev' into 7404-roundDetailVolume
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-04 05:22:07 +00:00
Pablo Natek 229d5369a1 fix: refs #7404 spec for new entry fixture
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-04 07:20:10 +02:00
Pablo Natek 46e2ffd6c2 fix: refs #7404 add fixtures
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-03 14:39:58 +02:00
Guillermo Bonet 9499819eec Merge branch 'test' into dev
gitea/salix/pipeline/head This commit looks good Details
2024-10-03 12:43:21 +02:00
Guillermo Bonet f1bc959a49 fix: refs #7956 item_getSimilar block db
gitea/salix/pipeline/head This commit looks good Details
2024-10-03 12:40:52 +02:00
Pablo Natek 02f74e4215 Merge branch 'dev' into 7404-roundDetailVolume
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-03 10:08:43 +00:00
Pablo Natek 3f325d865f fix: refs #7404 test for lasEntriesFilter
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-10-03 12:08:23 +02:00
Javi Gallego 977ab4264d Merge pull request 'fix: refs #6861 collectionGetTickets' (!3065) from 6861-reserves into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3065
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
2024-10-03 09:57:53 +00:00
Sergio De la torre 32415d3616 fix: refs #6861 collectionGetTickets
gitea/salix/pipeline/pr-master Build started... Details
2024-10-03 11:56:36 +02:00
Sergio De la torre 82f8e84288 fix: refs #6861 collectionGetTickets
gitea/salix/pipeline/pr-master This commit looks good Details
2024-10-03 11:42:21 +02:00
Robert Ferrús 8f7fe4dc12 Merge pull request 'feat: refs #8064 itemTagState' (!3043) from 8064-itemTagState into master
gitea/salix/pipeline/head This commit looks good Details
Reviewed-on: #3043
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
2024-10-03 08:49:37 +00:00
Robert Ferrús 7a6f1eae94 Merge branch 'master' into 8064-itemTagState
gitea/salix/pipeline/pr-master This commit looks good Details
2024-10-03 07:58:14 +00:00
Pablo Natek 616c328681 Merge branch 'dev' into 7404-roundDetailVolume
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-10-03 07:55:51 +00:00
Robert Ferrús d1c08e68d3 Merge branch 'master' into 8064-itemTagState
gitea/salix/pipeline/pr-master This commit looks good Details
2024-10-03 07:37:16 +00:00
Robert Ferrús 79adce30b6 Merge branch 'master' into 8064-itemTagState
gitea/salix/pipeline/pr-master This commit looks good Details
2024-10-02 09:12:08 +00:00
Robert Ferrús 0a0b2f9ba0 Merge branch 'master' into 8064-itemTagState
gitea/salix/pipeline/pr-master This commit looks good Details
2024-10-02 05:03:02 +00:00
Robert Ferrús 982c1dd67b feat: refs #8064 itemTagState
gitea/salix/pipeline/pr-master Build queued... Details
2024-10-01 07:42:06 +02:00
Pablo Natek 751c0ee39e Merge branch 'dev' into 7404-roundDetailVolume
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2024-09-30 08:17:22 +00:00
Pablo Natek e7d07e496e fix: refs #7404 add rounding to volume detail
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-09-30 10:16:45 +02:00
7 changed files with 45 additions and 21 deletions

View File

@ -185,6 +185,7 @@ INSERT INTO `vn`.`warehouse`(`id`, `name`, `code`, `isComparative`, `isInventory
(3, 'Warehouse Three', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0),
(4, 'Warehouse Four', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1),
(5, 'Warehouse Five', NULL, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
(6, 'Warehouse six', 'vnh', 1, 1, 1, 1, 0, 0, 1, 1, 0, 0),
(13, 'Inventory', 'inv', 1, 1, 1, 0, 0, 0, 1, 0, 0, 0),
(60, 'Algemesi', NULL, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0);
@ -3941,6 +3942,11 @@ INSERT INTO vn.medicalReview
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL);
INSERT INTO vn.stockBought (workerFk, bought, reserve, dated)
VALUES(35, 1.00, 1.00, '2001-01-01');
INSERT INTO vn.auctionConfig (id,conversionCoefficient,warehouseFk)
VALUES (1,0.6,6);
INSERT INTO vn.payrollComponent
(id, name, isSalaryAgreed, isVariable, isException)
VALUES

View File

@ -21,9 +21,8 @@ BEGIN
SELECT tob.ticketFk, tob.description
FROM vn.ticketObservation tob
JOIN vn.ticketCollection tc ON tc.ticketFk = tob.ticketFk
LEFT JOIN vn.observationType ot ON ot.id = tob.observationTypeFk
WHERE ot.`code` = 'itemPicker'
AND tc.collectionFk = vParamFk OR tc.ticketFk = vParamFk
JOIN vn.observationType ot ON ot.id = tob.observationTypeFk AND ot.`code` = 'itemPicker'
WHERE tc.collectionFk = vParamFk OR tc.ticketFk = vParamFk
)
SELECT t.id ticketFk,
IF(!(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`,

View File

@ -18,9 +18,11 @@ BEGIN
* @param vDaysInForward Días de alcance para las ventas
*/
DECLARE vAvailableCalcFk INT;
DECLARE vVisibleCalcFk INT;
DECLARE vPriority INT DEFAULT 1;
CALL cache.available_refresh(vAvailableCalcFk, FALSE, vWarehouseFk, vDated);
CALL cache.visible_refresh(vVisibleCalcFk, FALSE, vWarehouseFk);
WITH itemTags AS (
SELECT i.id,
@ -41,12 +43,6 @@ BEGIN
LEFT JOIN vn.tag t ON t.id = it.tagFk
WHERE i.id = vSelf
),
stock AS (
SELECT itemFk, SUM(visible) stock
FROM vn.itemShelvingStock
WHERE warehouseFk = vWarehouseFk
GROUP BY itemFk
),
sold AS (
SELECT SUM(s.quantity) quantity, s.itemFk
FROM vn.sale s
@ -58,7 +54,7 @@ BEGIN
GROUP BY s.itemFk
)
SELECT i.id itemFk,
LEAST(CAST(sd.quantity AS INT), sk.stock) advanceable,
LEAST(CAST(sd.quantity AS INT), v.visible) advanceable,
i.longName,
i.subName,
i.tag5,
@ -80,13 +76,14 @@ BEGIN
WHEN b.groupingMode = 'packing' THEN b.packing
ELSE 1
END minQuantity,
sk.stock located,
v.visible located,
b.price2
FROM vn.item i
LEFT JOIN sold sd ON sd.itemFk = i.id
JOIN cache.available a ON a.item_id = i.id
AND a.calc_id = vAvailableCalcFk
LEFT JOIN stock sk ON sk.itemFk = i.id
LEFT JOIN cache.visible v ON v.item_id = i.id
AND v.calc_id = vVisibleCalcFk
LEFT JOIN cache.last_buy lb ON lb.item_id = i.id
AND lb.warehouse_id = vWarehouseFk
LEFT JOIN vn.itemProposal ip ON ip.mateFk = i.id
@ -96,7 +93,7 @@ BEGIN
LEFT JOIN vn.tag t ON t.id = it.tagFk
LEFT JOIN vn.buy b ON b.id = lb.buy_id
JOIN itemTags its
WHERE (a.available > 0 OR sd.quantity < sk.stock)
WHERE (a.available > 0 OR sd.quantity < v.visible)
AND (i.typeFk = its.typeFk OR NOT vShowType)
AND i.id <> vSelf
ORDER BY (a.available > 0) DESC,

View File

@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS `vn`.`itemStateTag` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT
CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Artificial');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Inactivo');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Preservado');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Seco');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Seco y preservado');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Estabilizada');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Natural y seco');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Preservado y artificial');
INSERT IGNORE INTO `vn`.`itemStateTag` (`name`) VALUES ('Usado');
UPDATE vn.tag
SET isFree=0,
sourceTable='itemStateTag'
WHERE name= 'Estado';

View File

@ -39,7 +39,7 @@ describe('Entry filter()', () => {
const result = await models.Entry.filter(ctx, options);
expect(result.length).toEqual(11);
expect(result.length).toEqual(12);
await tx.rollback();
} catch (e) {
@ -152,7 +152,7 @@ describe('Entry filter()', () => {
const result = await models.Entry.filter(ctx, options);
expect(result.length).toEqual(10);
expect(result.length).toEqual(11);
await tx.rollback();
} catch (e) {

View File

@ -45,8 +45,8 @@ module.exports = Self => {
i.id itemFk,
i.name itemName,
ti.quantity,
(ac.conversionCoefficient * (ti.quantity / b.packing) * buy_getVolume(b.id))
/ (vc.trolleyM3 * 1000000) volume,
ROUND((ac.conversionCoefficient * (ti.quantity / b.packing) * buy_getVolume(b.id))
/ (vc.trolleyM3 * 1000000),1) volume,
b.packagingFk packagingFk,
b.packing
FROM tmp.item ti

View File

@ -1,6 +1,6 @@
const {models} = require('vn-loopback/server/server');
describe('item lastEntriesFilter()', () => {
it('should return one entry for the given item', async() => {
it('should return two entry for the given item', async() => {
const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0);
const maxDate = Date.vnNew();
@ -13,7 +13,7 @@ describe('item lastEntriesFilter()', () => {
const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}};
const result = await models.Item.lastEntriesFilter(filter, options);
expect(result.length).toEqual(1);
expect(result.length).toEqual(2);
await tx.rollback();
} catch (e) {
@ -22,7 +22,7 @@ describe('item lastEntriesFilter()', () => {
}
});
it('should return five entries for the given item', async() => {
it('should return six entries for the given item', async() => {
const minDate = Date.vnNew();
minDate.setHours(0, 0, 0, 0);
minDate.setMonth(minDate.getMonth() - 2, 1);
@ -37,7 +37,7 @@ describe('item lastEntriesFilter()', () => {
const filter = {where: {itemFk: 1, landed: {between: [minDate, maxDate]}}};
const result = await models.Item.lastEntriesFilter(filter, options);
expect(result.length).toEqual(5);
expect(result.length).toEqual(6);
await tx.rollback();
} catch (e) {