fix: entry ref
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alex Moreno 2022-11-30 15:24:33 +01:00
parent 67cf4ebbea
commit 8df7b91127
13 changed files with 77 additions and 70 deletions

View File

@ -0,0 +1 @@
ALTER TABLE `vn`.`entry` DROP COLUMN `ref`;

View File

@ -2199,7 +2199,8 @@ INSERT INTO `ACL` VALUES
(394,'Url','*','WRITE','ALLOW','ROLE','it'),
(395,'ItemShelving','*','READ','ALLOW','ROLE','employee'),
(396,'ItemShelving','*','WRITE','ALLOW','ROLE','production'),
(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee');
(397,'ItemShelvingPlacementSupplyStock','*','READ','ALLOW','ROLE','employee'),
(407, 'ZipConfig', '*', '*', 'ALLOW', 'ROLE', 'employee');
/*!40000 ALTER TABLE `ACL` ENABLE KEYS */;
UNLOCK TABLES;

View File

@ -1378,16 +1378,16 @@ INSERT INTO `vn`.`travel`(`id`,`shipped`, `landed`, `warehouseInFk`, `warehouseO
(7, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 4, 1, 50.00, 500, 'seventh travel', 2, 1),
(8, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 1, 1, 50.00, 500, 'eight travel', 1, 2);
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `ref`,`isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`)
INSERT INTO `vn`.`entry`(`id`, `supplierFk`, `created`, `travelFk`, `isConfirmed`, `companyFk`, `invoiceNumber`, `reference`, `isExcludedFromAvailable`, `isRaid`, `notes`, `evaNotes`)
VALUES
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'Movement 1', 0, 0, '', ''),
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'Movement 8', 1, 1, '', '');
(1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 1, 1, 442, 'IN2001', 'Movement 1', 0, 0, '', ''),
(2, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 442, 'IN2002', 'Movement 2', 0, 0, 'this is the note two', 'observation two'),
(3, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 3, 0, 442, 'IN2003', 'Movement 3', 0, 0, 'this is the note three', 'observation three'),
(4, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 2, 0, 69, 'IN2004', 'Movement 4', 0, 0, 'this is the note four', 'observation four'),
(5, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 5, 0, 442, 'IN2005', 'Movement 5', 0, 0, 'this is the note five', 'observation five'),
(6, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 6, 0, 442, 'IN2006', 'Movement 6', 0, 0, 'this is the note six', 'observation six'),
(7, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2007', 'Movement 7', 0, 0, 'this is the note seven', 'observation seven'),
(8, 2, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH), 7, 0, 442, 'IN2008', 'Movement 8', 1, 1, '', '');
INSERT INTO `bs`.`waste`(`buyer`, `year`, `week`, `family`, `itemFk`, `itemTypeFk`, `saleTotal`, `saleWaste`, `rate`)
VALUES

View File

@ -19560,6 +19560,7 @@ CREATE TABLE `notificationSubscription` (
-- Table structure for table `version`
--
DROP TABLE IF EXISTS `version`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
@ -19581,7 +19582,7 @@ DROP TABLE IF EXISTS `versionLog`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `versionLog` (
`code` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
`code` varchar(50) COLLATE utf8mb3_unicode_ci NOT NULL,
`number` char(11) COLLATE utf8mb3_unicode_ci NOT NULL,
`file` varchar(255) COLLATE utf8mb3_unicode_ci NOT NULL,
`user` varchar(255) COLLATE utf8mb3_unicode_ci DEFAULT NULL,
@ -36304,8 +36305,6 @@ CREATE TABLE `ticketDown_SelectionType` (
-- Table structure for table `ticketLastState`
--
/
DROP TABLE IF EXISTS `ticketLastState`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
@ -76989,9 +76988,6 @@ DELIMITER ;
-- Current Database: `account`
--
-- Fix strucuture
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES
('ZipConfig', '*', '*', 'ALLOW', 'ROLE', 'employee');
DROP TABLE IF EXISTS `vn`.`zipConfig`;
CREATE TABLE `vn`.`zipConfig` (
@ -80027,3 +80023,4 @@ USE `vncontrol`;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2022-11-21 7:57:28

View File

@ -154,8 +154,8 @@ module.exports = Self => {
e.id,
e.supplierFk,
e.dated,
e.ref reference,
e.ref invoiceNumber,
e.reference,
e.invoiceNumber,
e.isBooked,
e.isExcludedFromAvailable,
e.notes,

View File

@ -19,16 +19,10 @@
"type": "date"
},
"reference": {
"type": "string",
"mysql": {
"columnName": "ref"
}
"type": "string"
},
"invoiceNumber": {
"type": "string",
"mysql": {
"columnName": "ref"
}
"type": "string"
},
"isBooked": {
"type": "boolean"

View File

@ -89,7 +89,7 @@ module.exports = Self => {
ENGINE = MEMORY
SELECT
e.id,
e.ref,
e.reference,
e.supplierFk,
t.shipped
FROM vn.entry e

View File

@ -41,7 +41,8 @@
<vn-th field="data">Date</vn-th>
<vn-td>{{::entry.shipped | date: 'dd/MM/yyyy'}}</vn-td>
<vn-th field="ref">Reference</vn-th>
<vn-td vn-tooltip="{{::entry.ref}}">{{::entry.ref}}</vn-td>
///REVISAR
<vn-td vn-tooltip="{{::entry.reference}}">{{::entry.reference}}</vn-td>
</vn-tr>
</vn-thead>
<vn-tbody>

View File

@ -1,3 +1,2 @@
Total entry: Total entrada
This supplier doesn't have a contact with an email address: Este proveedor no tiene ningún contacto con una dirección de email

View File

@ -159,7 +159,8 @@ module.exports = Self => {
`SELECT
e.id,
e.travelFk,
e.ref,
e.reference,
e.invoiceNumber,
e.loadPriority,
s.id AS supplierFk,
s.name AS supplierName,

View File

@ -1,4 +1,4 @@
/* eslint max-len: ["error", { "code": 150 }]*/
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
module.exports = Self => {
Self.remoteMethod('getEntries', {
@ -25,7 +25,14 @@ module.exports = Self => {
let stmt;
stmt = new ParameterizedSQL(`
SELECT e.travelFk, e.id, e.isConfirmed, e.ref, e.notes, e.evaNotes AS observation,
SELECT
e.travelFk,
e.id,
e.isConfirmed,
e.invoiceNumber,
e.reference,
e.notes,
e.evaNotes AS observation,
s.name AS supplierName,
CAST((SUM(IF(p.volume > 0,p.volume,p.width * p.depth * IF(p.height, p.height, i.size + pconfig.upperGap))
* b.stickers)/1000000)/((pcc.width*pcc.depth*pcc.height)/1000000) AS DECIMAL(10,2)) cc,

View File

@ -1,28 +1,34 @@
const app = require('vn-loopback/server/server');
const models = require('vn-loopback/server/server').models;
describe('travel getEntries()', () => {
const travelId = 1;
it('should check the response contains the id', async() => {
const entries = await app.models.Travel.getEntries(travelId);
const entries = await models.Travel.getEntries(travelId);
expect(entries.length).toEqual(1);
expect(entries[0].id).toEqual(1);
});
it('should check the response contains the travelFk', async() => {
const entries = await app.models.Travel.getEntries(travelId);
const entries = await models.Travel.getEntries(travelId);
expect(entries[0].travelFk).toEqual(1);
});
it('should check the response contains the ref', async() => {
const entries = await app.models.Travel.getEntries(travelId);
it('should check the response contains the reference', async() => {
const entries = await models.Travel.getEntries(travelId);
expect(entries[0].ref).toEqual('Movement 1');
expect(entries[0].reference).toEqual('Movement 1');
});
it('should check the response contains the invoiceNumber', async() => {
const entries = await models.Travel.getEntries(travelId);
expect(entries[0].invoiceNumber).toEqual('IN2001');
});
it('should check the response contains the m3', async() => {
const entries = await app.models.Travel.getEntries(travelId);
const entries = await models.Travel.getEntries(travelId);
expect(entries[0].m3).toEqual(0.22);
});