Compare commits
14 Commits
dev
...
fix_ticket
Author | SHA1 | Date |
---|---|---|
|
0be1f7bf49 | |
|
87f0712eb0 | |
|
2719a9dea6 | |
|
62cb5d0d57 | |
|
1d9a6b5336 | |
|
d57d57b8f4 | |
|
f95da6d5de | |
|
44a3059e91 | |
|
f7d953d392 | |
|
2bed2d63bc | |
|
5f123d45f2 | |
|
7dd2cf80c0 | |
|
d6499175ad | |
|
81e941db4e |
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -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 ;
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
UPDATE vn.zone
|
||||
SET priceOptimum = price
|
||||
WHERE priceOptimum = 0;
|
|
@ -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();
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue