Compare commits

..

14 Commits

Author SHA1 Message Date
Javier Segarra 0be1f7bf49 Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-18 12:31:47 +01:00
Javier Segarra 87f0712eb0 feat: claimManager 2025-02-18 12:31:38 +01:00
Javier Segarra 2719a9dea6 perf: update state ticket 2025-02-18 12:31:23 +01:00
Javier Segarra 62cb5d0d57 Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-18 10:42:57 +00:00
Javier Segarra 1d9a6b5336 Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-18 08:26:55 +00:00
Jon Elias d57d57b8f4 Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-18 08:17:35 +00:00
Javier Segarra f95da6d5de Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-17 17:43:02 +00:00
Javier Segarra 44a3059e91 fix: replace colour by inkFk
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-17 13:36:46 +01:00
Javier Segarra f7d953d392 fix: item_getLack
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-17 11:33:07 +01:00
Javier Segarra 2bed2d63bc Merge branch 'dev' into fix_ticketNegative 2025-02-17 09:21:55 +01:00
Javier Segarra 5f123d45f2 test: fix itemLack
gitea/salix/pipeline/pr-dev This commit looks good Details
2025-02-16 03:20:20 +01:00
Javier Segarra 7dd2cf80c0 Merge branch 'dev' into fix_ticketNegative
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-16 03:17:43 +01:00
Javier Segarra d6499175ad fix: minor bugs 2025-02-16 03:17:31 +01:00
Javier Segarra 81e941db4e fix: replace arg id by itemFk
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2025-02-13 10:07:01 +01:00
15 changed files with 45 additions and 36 deletions

View File

@ -2140,6 +2140,9 @@ UPDATE `vn`.`business`
UPDATE `vn`.`business` b
SET b.`workerBusinessProfessionalCategoryFk` = 2
WHERE b.`workerFk` = 1110;
UPDATE `vn`.`business` b
SET b.`departmentFk` = 53
WHERE b.`workerFk` = 72;
UPDATE `vn`.`business` b
SET b.`departmentFk` = 43

View File

@ -9,7 +9,9 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getLack`(
vSize INT,
vOrigen INT,
vLack INT,
vWarehouseFk INT
vWarehouseFk INT,
vCategoryFk INT,
vTypeFk INT
)
BEGIN
/**
@ -26,10 +28,12 @@ BEGIN
SELECT i.id itemFk,
i.longName,
i.name,
w.id warehouseFk,
p.`name` producer,
i.`size`,
i.category,
it.categoryFk,
w.name warehouse,
SUM(IFNULL(sub.amount,0)) lack,
i.inkFk,
@ -59,13 +63,15 @@ BEGIN
AND ic.display
AND it.code != 'GEN'
AND (vSelf IS NULL OR i.id = vSelf)
AND (vLongname IS NULL OR i.name = vLongname)
AND (vLongname IS NULL OR i.longName LIKE CONCAT('%', vLongname, '%'))
AND (vProducerName IS NULL OR p.`name` LIKE CONCAT('%', vProducerName, '%'))
AND (vColor IS NULL OR vColor = i.inkFk)
AND (vSize IS NULL OR vSize = i.`size`)
AND (vOrigen IS NULL OR vOrigen = w.id)
AND (vLack IS NULL OR vLack = sub.amount)
AND (vWarehouseFk IS NULL OR vWarehouseFk = w.id)
AND (vCategoryFk IS NULL OR vCategoryFk = it.categoryFk)
AND (vTypeFk IS NULL OR vTypeFk = i.typeFk)
GROUP BY i.id, w.id
HAVING lack < 0;

View File

@ -4,9 +4,5 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`zone_beforeInsert`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.priceOptimum = 0 THEN
SET NEW.priceOptimum = NEW.price;
END IF;
END$$
DELIMITER ;

View File

@ -4,9 +4,5 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`zone_beforeUpdate`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
IF NEW.priceOptimum = 0 THEN
CALL util.throw('The priceOptimum cannot be 0');
END IF;
END$$
DELIMITER ;

View File

@ -1,3 +0,0 @@
UPDATE vn.zone
SET priceOptimum = price
WHERE priceOptimum = 0;

View File

@ -90,6 +90,7 @@ module.exports = Self => {
});
await models.Chat.sendCheckingPresence(ctx, salesPerson.id, message);
if (tx) await tx.commit();
return resultReplaceItem;
} catch (e) {
if (tx) await tx.rollback();

View File

@ -98,7 +98,6 @@ module.exports = Self => {
for (let sale of sales) {
const problems = saleProblems.get(sale.id);
sale.claim = claimedSales.get(sale.id);
if (problems) {
for (const problem in problems)
sale[problem] = problems[problem];

View File

@ -15,12 +15,12 @@ module.exports = Self => {
http: {source: 'query'}
},
{
arg: 'id',
arg: 'itemFk',
type: 'number',
description: 'The item id',
},
{
arg: 'longname',
arg: 'longName',
type: 'string',
description: 'Article name',
},
@ -30,9 +30,9 @@ module.exports = Self => {
description: 'Supplier id',
},
{
arg: 'colour',
arg: 'inkFk',
type: 'string',
description: 'Colour\'s item',
description: 'InkFk\'s item',
},
{
arg: 'size',
@ -49,6 +49,16 @@ module.exports = Self => {
type: 'number',
description: 'The warehouse id',
},
{
arg: 'typeFk',
type: 'number',
description: 'The type id',
},
{
arg: 'categoryFk',
type: 'number',
description: 'The category id',
},
{
arg: 'lack',
type: 'number',
@ -80,9 +90,9 @@ module.exports = Self => {
Object.assign(myOptions, options);
const filterKeyOrder = [
'id', 'force', 'days', 'longname', 'supplier',
'colour', 'size', 'originFk',
'lack', 'warehouseFk'
'itemFk', 'force', 'days', 'longName', 'supplier',
'inkFk', 'size', 'originFk',
'lack', 'warehouseFk', 'categoryFk', 'typeFk'
];
delete ctx?.args?.ctx;

View File

@ -46,7 +46,7 @@ module.exports = Self => {
const stmt = new ParameterizedSQL(`
SELECT s.id,
st.code,
t.id,
t.id ticketFk,
t.nickname,
c.id customerId,
t.shipped,

View File

@ -25,7 +25,7 @@ describe('Item Lack', () => {
it('should return data with filter.id', async() => {
const filter = {
id: 5
itemFk: 5
};
const result = await models.Ticket.itemLack(ctx, filter, options);
@ -34,7 +34,7 @@ describe('Item Lack', () => {
it('should return data with filter.longname', async() => {
const filter = {
longname: 'Ranged weapon pistol 9mm'
longName: 'Ranged weapon pistol 9mm'
};
const result = await models.Ticket.itemLack(ctx, filter, options);
@ -43,7 +43,7 @@ describe('Item Lack', () => {
it('should return data with filter.color', async() => {
const filter = {
colour: 'WHT'
inkFk: 'WHT'
};
const result = await models.Ticket.itemLack(ctx, filter, options);

View File

@ -43,8 +43,16 @@ module.exports = Self => {
const {code} = await models.State.findById(params.stateFk, {fields: ['code']}, myOptions);
params.code = code;
} else {
const {id} = await models.State.findOne({where: {code: params.code}}, myOptions);
const {id, code} = await models.State.findOne({
where: {
or: [
{code: params.code},
{id: params.code}
]
}
}, myOptions);
params.stateFk = id;
params.code = code;
}
if (!params.userFk) {

View File

@ -92,7 +92,7 @@
</td>
<td class="icon-field">
<vn-icon
ng-show="::ticket.isTaxDataChecked !== 0"
ng-show="::ticket.isTaxDataChecked === 0"
translate-attr="{title: 'No verified data'}"
class="bright"
icon="icon-no036">

View File

@ -40,7 +40,7 @@
</vn-td>
<vn-td class="icon-field">
<vn-icon
ng-show="::ticket.isTaxDataChecked !== 0"
ng-show="::ticket.isTaxDataChecked === 0"
translate-attr="{title: 'No verified data'}"
class="bright"
icon="icon-no036">

View File

@ -67,11 +67,6 @@ module.exports = Self => {
type: 'number',
description: 'The freighter supplier id'
},
{
arg: 'entrySupplierFk',
type: 'number',
description: 'The supplier of the entry(not freighter) id'
},
],
returns: {
type: ['Object'],
@ -99,8 +94,6 @@ module.exports = Self => {
return {'t.landed': {lte: value}};
case 'continent':
return {'cnt.code': value};
case 'entrySupplierFk':
return {'e.supplierFk': value};
case 'id':
case 'agencyModeFk':
case 'warehouseOutFk':

View File

@ -1,6 +1,6 @@
{
"name": "salix-back",
"version": "25.10.0",
"version": "25.08.0",
"author": "Verdnatura Levante SL",
"description": "Salix backend",
"license": "GPL-3.0",