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

File diff suppressed because it is too large Load Diff

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,16 +59,19 @@ 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.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
JOIN vn.item i ON i.id = s.itemFk
WHERE t.shipped BETWEEN vFutureDated
AND util.dayend(vFutureDated)
AND t.warehouseFk = vWarehouseFk
GROUP BY t.id
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
JOIN vn.item i ON i.id = s.itemFk
WHERE t.shipped BETWEEN vFutureDated
AND util.dayend(vFutureDated)
AND t.warehouseFk = vWarehouseFk
GROUP BY t.id
) sub
GROUP BY sub.addressFk
) sub2 ON sub2.addressFk = t.addressFk AND t.id != sub2.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"
},