Merge branch 'dev' into 6321_negative_tickets
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2025-02-07 16:19:58 +01:00
commit fce6b13d2d
9 changed files with 2133 additions and 2096 deletions

View File

@ -214,15 +214,15 @@ INSERT INTO `vn`.`worker`(`id`, `code`, `firstName`, `lastName`,`bossFk`, `phone
(1109, 'HLK', 'Bruce' , 'Banner', 19, 432978109),
(1110, 'JJJ', 'Jessica' , 'Jones' , 19, 432978110);
INSERT INTO `vn`.`parking` (`id`, `column`, `row`, `sectorFk`, `code`, `pickingOrder`)
INSERT INTO `vn`.`parking` (`id`, `sectorFk`, `code`, `pickingOrder`)
VALUES
('1', 700, '01', 1, '700-01', 70001),
('2', 700, '02', 2, '700-02', 70002),
('3', 100, '01', 1, '100-01', 1),
(32397, 100, '02', 1, 'A-47-1', 1165),
(34831, 200, '01', 1, 'K-26-2', 20220),
(34965, 200, '02', 2, 'L-08-4', 21800),
(39096, 200, '03', 2, 'LR-02-3', 99999);
('1', 1, '700-01', 70001),
('2', 2, '700-02', 70002),
('3', 1, '100-01', 1),
(32397, 1, 'A-47-1', 1165),
(34831, 1, 'K-26-2', 20220),
(34965, 2, 'L-08-4', 21800),
(39096, 2, 'LR-02-3', 99999);
INSERT INTO `vn`.`shelving` (`code`, `parkingFk`, `isPrinted`, `priority`, `userFk`, `isRecyclable`)
VALUES

View File

@ -30,11 +30,16 @@ BEGIN
st.code stateCode,
sub2.code futureStateCode,
st.classColor,
sub2.classColor futureClassColor
sub2.classColor futureClassColor,
am.id agencyFk,
am.name agency,
sub2.agencyModeFk futureAgencyFk,
sub2.agencyMode futureAgency
FROM vn.saleVolume sv
JOIN vn.sale s ON s.id = sv.saleFk
JOIN vn.item i ON i.id = s.itemFk
JOIN vn.ticket t ON t.id = sv.ticketFk
JOIN vn.agencyMode am ON am.id = t.agencyModeFk
JOIN vn.address a ON a.id = t.addressFk
JOIN vn.province p ON p.id = a.provinceFk
JOIN vn.country c ON c.id = p.countryFk
@ -54,8 +59,11 @@ BEGIN
st.name state,
st.code,
st.classColor,
am.id agencyModeFk,
am.name agencyMode,
GROUP_CONCAT(DISTINCT i.itemPackingTypeFk ORDER BY i.itemPackingTypeFk) iptd
FROM vn.ticket t
JOIN vn.agencyMode am ON am.id = t.agencyModeFk
JOIN vn.ticketState ts ON ts.ticketFk = t.id
JOIN vn.state st ON st.id = ts.stateFk
JOIN vn.sale s ON s.ticketFk = t.id

View File

@ -10,7 +10,6 @@ BEGIN
IF NEW.isBooked = OLD.isBooked AND (
NOT (NEW.supplierFk <=> OLD.supplierFk) OR
NOT (NEW.dated <=> OLD.dated) OR
NOT (NEW.travelFk <=> OLD.travelFk) OR
NOT (NEW.companyFk <=> OLD.companyFk) OR
NOT (NEW.invoiceInFk <=> OLD.invoiceInFk) OR

View File

@ -0,0 +1,23 @@
CREATE TABLE vn.parkingCoordinates (
parkingFk int(11) NOT NULL,
x varchar(5) NOT NULL,
y varchar(5) NOT NULL,
z varchar(5) NOT NULL,
CONSTRAINT parkingCoordinates_pk PRIMARY KEY (parkingFk),
CONSTRAINT parkingCoordinates_parking_FK FOREIGN KEY (parkingFk) REFERENCES vn.parking(id) ON DELETE CASCADE ON UPDATE CASCADE
)
ENGINE=InnoDB
DEFAULT CHARSET=utf8mb3
COLLATE=utf8mb3_unicode_ci;
INSERT INTO vn.parkingCoordinates (parkingFk, x, y, z)
SELECT id, `column`, `row`, `floor`
FROM vn.parking
WHERE `column` IS NOT NULL
OR `row` IS NOT NULL
OR `floor` IS NOT NULL;
ALTER TABLE vn.parking
DROP COLUMN `column`,
DROP COLUMN `row`,
DROP COLUMN `floor`;

View File

@ -248,9 +248,10 @@ module.exports = Self => {
const models = Self.app.models;
const loopBackContext = LoopBackContext.getCurrentContext();
const accessToken = {req: loopBackContext.active.accessToken};
const editVerifiedDataWithoutTaxDataChecked = models.ACL.checkAccessAcl(
const accessToken = {req: {accessToken: loopBackContext.active.accessToken}};
const editVerifiedDataWithoutTaxDataChecked = await models.ACL.checkAccessAcl(
accessToken,
'Client',
'editVerifiedDataWithoutTaxDataCheck',

View File

@ -29,9 +29,9 @@ describe('entry_isEditable trigger', () => {
});
async function prepareEntry(isBooked, typeFk) {
let newCreated = Date.vnNew();
const companyFk = 69;
await entry.updateAttributes({isBooked, typeFk}, options);
await entry.updateAttributes({dated: newCreated}, options);
await entry.updateAttributes({companyFk}, options);
}
it('should throw an error when entry is booked and typeFk is null', async() => {

View File

@ -32,6 +32,12 @@ module.exports = Self => {
description: 'The client id',
http: {source: 'query'}
},
{
arg: 'companyFk',
type: 'integer',
description: 'The company id',
http: {source: 'query'}
},
{
arg: 'fi',
type: 'string',
@ -148,6 +154,7 @@ module.exports = Self => {
i.hasPdf,
i.customsAgentFk,
c.socialName AS clientSocialName,
i.companyFk,
co.code AS companyCode,
ca.fiscalName AS customsAgentName
FROM invoiceOut i

View File

@ -22,6 +22,11 @@ module.exports = Self => {
type: 'integer',
description: 'The item id',
},
{
arg: 'name',
type: 'string',
description: 'The item name',
},
{
arg: 'typeFk',
type: 'integer',
@ -112,6 +117,8 @@ module.exports = Self => {
: {'it.code': {like: `%${value}%`}};
case 'categoryFk':
return {'it.categoryFk': value};
case 'name':
return {'i.name': {like: `%${value}%`}};
case 'buyerFk':
return {'it.workerFk': value};
case 'warehouseFk':

View File

@ -12,14 +12,6 @@
"id": true,
"description": "Identifier"
},
"column": {
"type": "string",
"required": true
},
"row": {
"type": "string",
"required": true
},
"code": {
"type": "string"
},