8032-devToTest_2440 #3009

Merged
alexm merged 262 commits from 8032-devToTest_2440 into test 2024-09-24 09:34:49 +00:00
9 changed files with 42 additions and 15 deletions
Showing only changes of commit e7d3062208 - Show all commits

View File

@ -25,6 +25,9 @@
"isManaged": { "isManaged": {
"type": "boolean" "type": "boolean"
}, },
"isDestiny": {
"type": "boolean"
},
"countryFk": { "countryFk": {
"type": "number" "type": "number"
} }

View File

@ -9,7 +9,7 @@
}, },
"vn": { "vn": {
"view": { "view": {
"expeditionPallet_Print": "ced2b84a114fcb99fce05f0c34f4fc03f3fa387bef92621be1bc306608a84345" "expeditionPallet_Print": "99f75145ac2e7b612a6d71e74b6e55f194a465780fd9875a15eb01e6596b447e"
} }
} }
} }

View File

@ -85,7 +85,7 @@ BEGIN
IF(vHasDailyInvoice) AND vHasToInvoice THEN IF(vHasDailyInvoice) AND vHasToInvoice THEN
SELECT invoiceSerial(vClientFk, vCompanyFk, 'quick') INTO vSerial; SELECT invoiceSerial(vClientFk, vCompanyFk, 'quick') INTO vSerial;
IF NOT vSerial THEN IF vSerial IS NULL THEN
CALL util.throw('Cannot booking without a serial'); CALL util.throw('Cannot booking without a serial');
END IF; END IF;

View File

@ -1,4 +1,5 @@
-- Calculamos todos los volumenes de todos los tickets una sola vez -- Calculamos todos los volumenes de todos los tickets una sola vez
/* Se ejecutará el dia de test - master manualmente para no hacer lenta la subida
CREATE OR REPLACE TEMPORARY TABLE tmp.tTicketVolume CREATE OR REPLACE TEMPORARY TABLE tmp.tTicketVolume
(PRIMARY KEY (id)) (PRIMARY KEY (id))
ENGINE = MEMORY ENGINE = MEMORY
@ -14,3 +15,4 @@ UPDATE vn.ticket t
SET t.volume = tv.volume; SET t.volume = tv.volume;
DROP TEMPORARY TABLE tmp.tTicketVolume; DROP TEMPORARY TABLE tmp.tTicketVolume;
*/

View File

@ -0,0 +1,12 @@
-- Place your SQL code here
DELETE FROM salix.ACL WHERE model = 'Province' LIMIT 1;
DELETE FROM salix.ACL WHERE model = 'Town' LIMIT 1;
UPDATE salix.ACL SET accessType = 'READ' WHERE model = 'BankEntity';
INSERT INTO salix.ACL
SET model = 'BankEntity',
property = '*',
accessType = 'WRITE',
permission = 'ALLOW',
principalType = 'ROLE',
principalId = 'financial';

View File

@ -35,6 +35,14 @@ describe('Client Edit billing data path', () => {
it(`should attempt to edit the billing data without an IBAN but fail`, async() => { it(`should attempt to edit the billing data without an IBAN but fail`, async() => {
await page.autocompleteSearch($.payMethod, 'PayMethod with IBAN'); await page.autocompleteSearch($.payMethod, 'PayMethod with IBAN');
await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('That payment method requires an IBAN');
});
it(`should edit the billing data and save the form`, async() => {
await page.autocompleteSearch($.payMethod, 'PayMethod five');
await page.autocompleteSearch($.swiftBic, 'BBKKESMMMMM'); await page.autocompleteSearch($.swiftBic, 'BBKKESMMMMM');
await page.clearInput($.dueDay); await page.clearInput($.dueDay);
await page.write($.dueDay, '60'); await page.write($.dueDay, '60');
@ -45,10 +53,13 @@ describe('Client Edit billing data path', () => {
await page.waitToClick($.saveButton); await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar(); const message = await page.waitForSnackbar();
expect(message.text).toContain('That payment method requires an IBAN'); expect(message.text).toContain('Notification sent!');
}); });
it(`should create a new BIC code`, async() => { it(`should create a new BIC code`, async() => {
await page.loginAndModule('financial', 'client');
await page.accessToSearchResult('Bruce Banner');
await page.accessToSection('client.card.billingData');
await page.waitToClick($.newBankEntityButton); await page.waitToClick($.newBankEntityButton);
await page.write($.newBankEntityName, 'Gotham City Bank'); await page.write($.newBankEntityName, 'Gotham City Bank');
await page.write($.newBankEntityBIC, 'GTHMCT'); await page.write($.newBankEntityBIC, 'GTHMCT');
@ -66,7 +77,7 @@ describe('Client Edit billing data path', () => {
it(`should confirm the IBAN pay method was sucessfully saved`, async() => { it(`should confirm the IBAN pay method was sucessfully saved`, async() => {
const payMethod = await page.waitToGetProperty($.payMethod, 'value'); const payMethod = await page.waitToGetProperty($.payMethod, 'value');
expect(payMethod).toEqual('PayMethod with IBAN'); expect(payMethod).toEqual('PayMethod five');
}); });
it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => { it(`should clear the BIC code field, update the IBAN to see how he BIC code autocompletes`, async() => {
@ -79,14 +90,6 @@ describe('Client Edit billing data path', () => {
expect(automaticCode).toEqual('CAIXESBB'); expect(automaticCode).toEqual('CAIXESBB');
}); });
it(`should save the form with all its new data`, async() => {
await page.waitForWatcherData($.watcher);
await page.waitToClick($.saveButton);
const message = await page.waitForSnackbar();
expect(message.text).toContain('Notification sent!');
});
it('should confirm the billing data have been edited', async() => { it('should confirm the billing data have been edited', async() => {
const dueDate = await page.waitToGetProperty($.dueDay, 'value'); const dueDate = await page.waitToGetProperty($.dueDay, 'value');
const IBAN = await page.waitToGetProperty($.IBAN, 'value'); const IBAN = await page.waitToGetProperty($.IBAN, 'value');
@ -94,7 +97,9 @@ describe('Client Edit billing data path', () => {
const receivedCoreLCR = await page.checkboxState($.receivedCoreLCRCheckbox); const receivedCoreLCR = await page.checkboxState($.receivedCoreLCRCheckbox);
const receivedCoreVNL = await page.checkboxState($.receivedCoreVNLCheckbox); const receivedCoreVNL = await page.checkboxState($.receivedCoreVNLCheckbox);
const receivedB2BVNL = await page.checkboxState($.receivedB2BVNLCheckbox); const receivedB2BVNL = await page.checkboxState($.receivedB2BVNLCheckbox);
const payMethod = await page.waitToGetProperty($.payMethod, 'value');
expect(payMethod).toEqual('PayMethod five');
expect(dueDate).toEqual('60'); expect(dueDate).toEqual('60');
expect(IBAN).toEqual('ES9121000418450200051332'); expect(IBAN).toEqual('ES9121000418450200051332');
expect(swiftBic).toEqual('CAIXESBB'); expect(swiftBic).toEqual('CAIXESBB');

View File

@ -320,7 +320,8 @@ module.exports = Self => {
// Credit management changes // Credit management changes
if (changes?.rating >= 0 || changes?.recommendedCredit >= 0) if ((changes?.rating != null && changes.rating >= 0)
|| (changes?.recommendedCredit != null && changes.recommendedCredit >= 0))
await Self.changeCreditManagement(ctx, finalState, changes); await Self.changeCreditManagement(ctx, finalState, changes);
const oldInstance = {}; const oldInstance = {};

View File

@ -128,6 +128,9 @@ module.exports = Self => {
return {[param]: value}; return {[param]: value};
} }
}); });
if (ctx.req.query?.showBadDates === 'true')
where['fp.started'] = {gte: Date.vnNew()};
filter = mergeFilters(filter, {where}); filter = mergeFilters(filter, {where});
const stmts = []; const stmts = [];
@ -136,6 +139,7 @@ module.exports = Self => {
SELECT DISTINCT fp.id, SELECT DISTINCT fp.id,
fp.itemFk, fp.itemFk,
fp.warehouseFk, fp.warehouseFk,
w.name warehouseName,
fp.rate2, fp.rate2,
fp.rate3, fp.rate3,
fp.started, fp.started,
@ -159,6 +163,7 @@ module.exports = Self => {
FROM priceFixed fp FROM priceFixed fp
JOIN item i ON i.id = fp.itemFk JOIN item i ON i.id = fp.itemFk
JOIN itemType it ON it.id = i.typeFk JOIN itemType it ON it.id = i.typeFk
JOIN warehouse w ON fp.warehouseFk = w.id
`); `);
if (ctx.args.tags) { if (ctx.args.tags) {
@ -184,7 +189,6 @@ module.exports = Self => {
} }
stmt.merge(conn.makeSuffix(filter)); stmt.merge(conn.makeSuffix(filter));
const fixedPriceIndex = stmts.push(stmt) - 1; const fixedPriceIndex = stmts.push(stmt) - 1;
const sql = ParameterizedSQL.join(stmts, ';'); const sql = ParameterizedSQL.join(stmts, ';');
const result = await conn.executeStmt(sql, myOptions); const result = await conn.executeStmt(sql, myOptions);

View File

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