Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 5914-transferInvoiceOut
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
commit
87cee57e56
16
CHANGELOG.md
16
CHANGELOG.md
|
@ -6,6 +6,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [2340.01] - 2023-10-05
|
||||
|
||||
### Added
|
||||
### Changed
|
||||
|
||||
### Fixed
|
||||
|
||||
## [2338.01] - 2023-09-21
|
||||
|
||||
### Added
|
||||
- (Ticket -> Servicios) Se pueden abonar servicios
|
||||
### Changed
|
||||
- (Trabajadores -> Calendario) Icono de check arreglado cuando pulsas un tipo de dia
|
||||
|
||||
### Fixed
|
||||
|
||||
## [2336.01] - 2023-09-07
|
||||
|
||||
### Added
|
||||
|
|
|
@ -71,11 +71,10 @@ module.exports = Self => {
|
|||
}
|
||||
|
||||
try {
|
||||
const response = await Self.get(fileCabinet, filter);
|
||||
const [documents] = response.Items;
|
||||
if (!documents) return false;
|
||||
const [response] = await Self.get(fileCabinet, filter);
|
||||
if (!response) return false;
|
||||
|
||||
return {id: documents.Id};
|
||||
return {id: response['Document ID']};
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ module.exports = Self => {
|
|||
|
||||
const email = new Email('delivery-note', params);
|
||||
|
||||
const docuwareFile = await models.Docuware.download(ctx, id, 'deliveryNote');
|
||||
const docuwareFile = await models.Docuware.download(id, 'deliveryNote');
|
||||
|
||||
return email.send({
|
||||
overrideAttachments: true,
|
||||
|
|
|
@ -16,19 +16,9 @@ describe('docuware download()', () => {
|
|||
|
||||
it('should return the document data', async() => {
|
||||
const docuwareId = 1;
|
||||
const response = {
|
||||
Items: [
|
||||
{
|
||||
Id: docuwareId,
|
||||
Fields: [
|
||||
{
|
||||
FieldName: 'ESTADO',
|
||||
Item: 'Firmado'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
const response = [{
|
||||
'Document ID': docuwareId
|
||||
}];
|
||||
spyOn(docuwareModel, 'get').and.returnValue((new Promise(resolve => resolve(response))));
|
||||
|
||||
const result = await models.Docuware.checkFile(ticketId, fileCabinetName, null, true);
|
||||
|
|
|
@ -111,7 +111,7 @@ module.exports = Self => {
|
|||
throw new UserError('Action not allowed on the test environment');
|
||||
|
||||
// delete old
|
||||
const docuwareFile = await models.Docuware.checkFile(ctx, id, fileCabinet, false);
|
||||
const docuwareFile = await models.Docuware.checkFile(id, fileCabinet, false);
|
||||
if (docuwareFile) {
|
||||
const deleteJson = {
|
||||
'Field': [{'FieldName': 'ESTADO', 'Item': 'Pendiente eliminar', 'ItemElementName': 'String'}]
|
||||
|
|
|
@ -139,7 +139,7 @@ module.exports = Self => {
|
|||
ftpClient.exec((err, response) => {
|
||||
if (err || response.error) {
|
||||
console.debug(`Error downloading checksum file... ${response.error}`);
|
||||
return reject(err);
|
||||
return reject(response.error || err);
|
||||
}
|
||||
|
||||
resolve(response);
|
||||
|
|
|
@ -33,14 +33,14 @@ module.exports = Self => {
|
|||
await Self.app.models.EmailUser.findById(ctx.req.accessToken.userId, {fields: ['email']});
|
||||
|
||||
let html = `<strong>Motivo</strong>:<br/>${reason}<br/>`;
|
||||
html += `<strong>Usuario</strong>:<br/>${ctx.req.accessToken.userId} ${emailUser.email}<br/>`;
|
||||
|
||||
for (const data in additionalData)
|
||||
html += `<strong>${data}</strong>:<br/>${tryParse(additionalData[data])}<br/>`;
|
||||
|
||||
const subjectReason = JSON.parse(additionalData?.httpRequest)?.data?.error;
|
||||
smtp.send({
|
||||
to: config.app.reportEmail,
|
||||
replyTo: emailUser.email,
|
||||
to: `${config.app.reportEmail}, ${emailUser.email}`,
|
||||
subject:
|
||||
'[Support-Salix] ' +
|
||||
additionalData?.frontPath + ' ' +
|
||||
|
|
|
@ -15,6 +15,9 @@
|
|||
},
|
||||
"Bank": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Buyer": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Campaign": {
|
||||
"dataSource": "vn"
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"name": "Buyer",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "buyer"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"userFk": {
|
||||
"type": "number",
|
||||
"required": true,
|
||||
"id": true
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"acls": [
|
||||
{
|
||||
"accessType": "READ",
|
||||
"principalType": "ROLE",
|
||||
"principalId": "employee",
|
||||
"permission": "ALLOW"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||
VALUES
|
||||
('SaleTracking', 'deleteSaleGroupDetail', 'WRITE', 'ALLOW', 'ROLE', 'employee'),
|
||||
('SaleTracking', 'replaceOrCreate', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,3 @@
|
|||
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||
VALUES
|
||||
('Worker', 'search', 'READ', 'ALLOW', 'ROLE', 'employee');
|
|
@ -0,0 +1,2 @@
|
|||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalId`)
|
||||
VALUES ('ExpeditionState','addExpeditionState','WRITE','ALLOW','ROLE','delivery');
|
|
@ -0,0 +1,31 @@
|
|||
INSERT INTO `account`.`role` (`name`, `description`, `hasLogin`)
|
||||
VALUES ('claimViewer','Trabajadores que consulta las reclamaciones ',1);
|
||||
|
||||
INSERT INTO `account`.`roleInherit` (`role`,`inheritsFrom`)
|
||||
SELECT `r`.`id`, `r2`.`id`
|
||||
FROM `account`.`role` `r`
|
||||
JOIN `account`.`role` `r2` ON `r2`.`name` = 'claimViewer'
|
||||
WHERE `r`.`name` IN (
|
||||
'salesPerson',
|
||||
'buyer',
|
||||
'deliveryBoss',
|
||||
'handmadeBoss'
|
||||
);
|
||||
|
||||
DELETE FROM `salix`.`ACL`
|
||||
WHERE `model`= 'claim'
|
||||
AND `property` IN (
|
||||
'filter',
|
||||
'find',
|
||||
'findById',
|
||||
'getSummary'
|
||||
);
|
||||
|
||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
||||
VALUES ('Claim','filter','READ','ALLOW','ROLE','claimViewer');
|
||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
||||
VALUES ('Claim','find','READ','ALLOW','ROLE','claimViewer');
|
||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
||||
VALUES ('Claim','findById','READ','ALLOW','ROLE','claimViewer');
|
||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
||||
VALUES ('Claim','getSummary','READ','ALLOW','ROLE','claimViewer');
|
|
@ -0,0 +1,3 @@
|
|||
UPDATE `vn`.`department`
|
||||
SET code='VN'
|
||||
WHERE name='VERDNATURA';
|
|
@ -0,0 +1,7 @@
|
|||
DELETE FROM `vn`.`saleGroupDetail` WHERE id IN (468106,468104,468107,468105,495210,495208,495207,495209,462879,462880,447186,450623,450622,455606,455605,455827,455829,455828,459067,460689,460691,460690,460692,462408,463403,463405,463404,463129,463127,463126,463128,468098,468096,468099,468097,468310,468314,468313,475654,468325,473248,474803,474739,475042,475052,475047,475041,475051,475046,475040,475050,475045,475039,475049,475044,475038,475048,475043,474888,474892,474890,474887,474891,474889,481109,481107,481105,481108,481106,481110,479008,490787,490792,490791,485295,485294,485293,485528,490796,487853,487959,491303,490789,490914,490913,492305,492310,492307,492304,492309,492306,492303,492308,494111,494110,494480,494482,494481,494483,495202,495200,495199,495201,497209,499765,499763,499767,499764,499768,499766,502014,502013,508820,508819,508818,463133,463131,463130,463132,468102,468100,468103,468101,468311,468316,468315,468327,474894,474898,474896,474893,474897,474895,495206,495204,495203,495205,499771,499769,499773,499770,499774,499772);
|
||||
ALTER TABLE `vn`.`saleGroupDetail` ADD CONSTRAINT saleGroupDetail_UN UNIQUE KEY (saleFk);
|
||||
|
||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalId`)
|
||||
VALUES
|
||||
('SaleGroupDetail','deleteById','WRITE','ALLOW','employee');
|
||||
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE `vn`.`province` ADD CONSTRAINT `countryName_UN` UNIQUE KEY (`countryFk`,`name`);
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`item_setVisibleDiscard`(
|
||||
vItemFk INT,
|
||||
vWarehouseFk INT,
|
||||
vQuantity INT,
|
||||
vAddressFk INT)
|
||||
|
||||
BEGIN
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vClientFk INT;
|
||||
DECLARE vCompanyVnlFk INT;
|
||||
DECLARE vCalc INT;
|
||||
|
||||
SELECT barcodeToItem(vItemFk) INTO vItemFk;
|
||||
|
||||
SELECT DEFAULT(companyFk) INTO vCompanyVnlFk
|
||||
FROM vn.ticket LIMIT 1;
|
||||
|
||||
SELECT a.clientFk INTO vClientFk
|
||||
FROM address a
|
||||
WHERE a.id = vAddressFk;
|
||||
|
||||
SELECT t.id INTO vTicketFk
|
||||
FROM ticket t
|
||||
JOIN address a ON a.id = t.addressFk
|
||||
WHERE t.warehouseFk = vWarehouseFk
|
||||
AND a.id = vAddressFk
|
||||
AND DATE(t.shipped) = util.VN_CURDATE();
|
||||
|
||||
CALL cache.visible_refresh(vCalc, TRUE, vWarehouseFk);
|
||||
|
||||
IF vTicketFk IS NULL THEN
|
||||
CALL ticket_add(
|
||||
vClientFk,
|
||||
util.VN_CURDATE(),
|
||||
vWarehouseFk,
|
||||
vCompanyVnlFk,
|
||||
vAddressFk,
|
||||
NULL,
|
||||
NULL,
|
||||
util.VN_CURDATE(),
|
||||
account.myUser_getId(),
|
||||
FALSE,
|
||||
vTicketFk);
|
||||
END IF;
|
||||
|
||||
INSERT INTO sale(ticketFk, itemFk, concept, quantity)
|
||||
SELECT vTicketFk,
|
||||
vItemFk,
|
||||
CONCAT(longName,' ', getWorkerCode(), ' ', LEFT(CAST(util.VN_NOW() AS TIME),5)),
|
||||
vQuantity
|
||||
FROM item
|
||||
WHERE id = vItemFk;
|
||||
|
||||
UPDATE cache.visible
|
||||
SET visible = visible - vQuantity
|
||||
WHERE calc_id = vCalc
|
||||
AND item_id = vItemFk;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
|
||||
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||
VALUES('Item', 'setVisibleDiscard', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
||||
|
||||
INSERT INTO `salix`.`ACL` (model, property, accessType, permission, principalType, principalId)
|
||||
VALUES('Address', 'getAddress', 'READ', 'ALLOW', 'ROLE', 'employee');
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
|
||||
ALTER TABLE `vn`.`deviceLog` ADD serialNumber varchar(45) DEFAULT NULL NULL;
|
||||
|
||||
INSERT INTO `salix`.`ACL` ( model, property, accessType, permission, principalType, principalId)
|
||||
VALUES( 'DeviceLog', 'create', 'WRITE', 'ALLOW', 'ROLE', 'employee');
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -358,20 +358,20 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`)
|
|||
(4, 'GCN Channel'),
|
||||
(5, 'The Newspaper');
|
||||
|
||||
INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`)
|
||||
INSERT INTO `vn`.`client`(`id`,`name`,`fi`,`socialName`,`contact`,`street`,`city`,`postcode`,`phone`,`mobile`,`isRelevant`,`email`,`iban`,`dueDay`,`accountingAccount`,`isEqualizated`,`provinceFk`,`hasToInvoice`,`credit`,`countryFk`,`isActive`,`gestdocFk`,`quality`,`payMethodFk`,`created`,`isToBeMailed`,`contactChannelFk`,`hasSepaVnl`,`hasCoreVnl`,`hasCoreVnh`,`riskCalculated`,`clientTypeFk`, `hasToInvoiceByAddress`,`isTaxDataChecked`,`isFreezed`,`creditInsurance`,`isCreatedAsServed`,`hasInvoiceSimplified`,`salesPersonFk`,`isVies`,`eypbc`, `businessTypeFk`,`typeFk`)
|
||||
VALUES
|
||||
(1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
|
||||
(1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
|
||||
(1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
|
||||
(1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist'),
|
||||
(1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist'),
|
||||
(1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist'),
|
||||
(1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist'),
|
||||
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist'),
|
||||
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist'),
|
||||
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist'),
|
||||
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others'),
|
||||
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others');
|
||||
(1101, 'Bruce Wayne', '84612325V', 'BATMAN', 'Alfred', '1007 MOUNTAIN DRIVE, GOTHAM', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceWayne@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','loses'),
|
||||
(1102, 'Petter Parker', '87945234L', 'SPIDER MAN', 'Aunt May', '20 INGRAM STREET, QUEENS, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'PetterParker@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
|
||||
(1103, 'Clark Kent', '06815934E', 'SUPER MAN', 'lois lane', '344 CLINTON STREET, APARTAMENT 3-D', 'Gotham', 46460, 1111111111, 222222222, 1, 'ClarkKent@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 0, 19, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
|
||||
(1104, 'Tony Stark', '06089160W', 'IRON MAN', 'Pepper Potts', '10880 MALIBU POINT, 90265', 'Gotham', 46460, 1111111111, 222222222, 1, 'TonyStark@mydomain.com', NULL, 0, 1234567890, 0, 2, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
|
||||
(1105, 'Max Eisenhardt', '251628698', 'MAGNETO', 'Rogue', 'UNKNOWN WHEREABOUTS', 'Gotham', 46460, 1111111111, 222222222, 1, 'MaxEisenhardt@mydomain.com', NULL, 0, 1234567890, 0, 3, 1, 300, 8, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 18, 0, 1, 'florist','normal'),
|
||||
(1106, 'DavidCharlesHaller', '53136686Q', 'LEGION', 'Charles Xavier', 'CITY OF NEW YORK, NEW YORK, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'DavidCharlesHaller@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 0, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
|
||||
(1107, 'Hank Pym', '09854837G', 'ANT MAN', 'Hawk', 'ANTHILL, SAN FRANCISCO, CALIFORNIA', 'Gotham', 46460, 1111111111, 222222222, 1, 'HankPym@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
|
||||
(1108, 'Charles Xavier', '22641921P', 'PROFESSOR X', 'Beast', '3800 VICTORY PKWY, CINCINNATI, OH 45207, USA', 'Gotham', 46460, 1111111111, 222222222, 1, 'CharlesXavier@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 1, 1, NULL, 0, 0, 19, 0, 1, 'florist','normal'),
|
||||
(1109, 'Bruce Banner', '16104829E', 'HULK', 'Black widow', 'SOMEWHERE IN NEW YORK', 'Gotham', 46460, 1111111111, 222222222, 1, 'BruceBanner@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, 9, 0, 1, 'florist','normal'),
|
||||
(1110, 'Jessica Jones', '58282869H', 'JESSICA JONES', 'Luke Cage', 'NYCC 2015 POSTER', 'Gotham', 46460, 1111111111, 222222222, 1, 'JessicaJones@mydomain.com', NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 1, 1, 0, 0, NULL, 0, 0, NULL, 0, 1, 'florist','normal'),
|
||||
(1111, 'Missing', NULL, 'MISSING MAN', 'Anton', 'THE SPACE, UNIVERSE FAR AWAY', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','normal'),
|
||||
(1112, 'Trash', NULL, 'GARBAGE MAN', 'Unknown name', 'NEW YORK CITY, UNDERGROUND', 'Gotham', 46460, 1111111111, 222222222, 1, NULL, NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1, NULL, 10, 5, util.VN_CURDATE(), 1, 5, 1, 1, 1, '0000-00-00', 4, 0, 1, 0, NULL, 1, 0, NULL, 0, 1, 'others','normal');
|
||||
|
||||
INSERT INTO `vn`.`client`(`id`, `name`, `fi`, `socialName`, `contact`, `street`, `city`, `postcode`, `isRelevant`, `email`, `iban`,`dueDay`,`accountingAccount`, `isEqualizated`, `provinceFk`, `hasToInvoice`, `credit`, `countryFk`, `isActive`, `gestdocFk`, `quality`, `payMethodFk`,`created`, `isTaxDataChecked`)
|
||||
SELECT id, name, CONCAT(RPAD(CONCAT(id,9),8,id),'A'), CONCAT(name, 'Social'), CONCAT(name, 'Contact'), CONCAT(name, 'Street'), 'GOTHAM', 46460, 1, CONCAT(name,'@mydomain.com'), NULL, 0, 1234567890, 0, 1, 1, 300, 1, 1,NULL, 10, 5, util.VN_CURDATE(), 1
|
||||
|
@ -871,7 +871,9 @@ INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`, `hex`)
|
|||
('SLV', 'Silver', 1, 4, 'CACFD2'),
|
||||
('BRW', 'Brown', 1, 5, 'DC7633'),
|
||||
('BLK', 'Black', 1, 6, '000000'),
|
||||
('BAS', 'Blue/Silver', 1, 7, '5DADE2');
|
||||
('BAS', 'Blue/Silver', 1, 7, '5DADE2'),
|
||||
('GRN', 'Green', 1, 8, '28A745'),
|
||||
('WHT', 'White', 1, 9, 'FFFFFF');
|
||||
|
||||
INSERT INTO `vn`.`origin`(`id`,`code`, `name`)
|
||||
VALUES
|
||||
|
@ -918,26 +920,26 @@ INSERT INTO `vn`.`itemFamily`(`code`, `description`)
|
|||
('SER', 'Services'),
|
||||
('VT', 'Sales');
|
||||
|
||||
INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`,
|
||||
INSERT INTO `vn`.`item`(`id`, `typeFk`, `stems`, `originFk`, `description`, `producerFk`, `intrastatFk`, `expenceFk`,
|
||||
`comment`, `relevancy`, `image`, `subName`, `minPrice`, `stars`, `family`, `isFloramondo`, `genericFk`, `itemPackingTypeFk`, `hasMinPrice`, `packingShelve`, `weightByPiece`)
|
||||
VALUES
|
||||
(1, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'EMB', 0, NULL, 'V', 0, 15,3),
|
||||
(2, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0, 10,2),
|
||||
(3, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, 5,5),
|
||||
(4, 1, 60, 'YEL', 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(5, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(6, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(7, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(8, 2, 70, 'YEL', 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(9, 2, 70, 'BLU', 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL,NULL),
|
||||
(10, 1, 60, 'YEL', 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(11, 1, 60, 'YEL', 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(12, 3, 30, 'RED', 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 2, 'VT', 1, NULL, NULL, 1, NULL,NULL),
|
||||
(14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL,NULL),
|
||||
(15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL);
|
||||
(1, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '1', NULL, 0, 1, 'EMB', 0, NULL, 'V', 0, 15,3),
|
||||
(2, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '2', NULL, 0, 2, 'VT', 0, NULL, 'H', 0, 10,2),
|
||||
(3, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '3', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, 5,5),
|
||||
(4, 1, 1, 1, 'Increases block', 1, 05080000, 4751000000, NULL, 0, '4', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(5, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '5', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(6, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '6', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(7, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '7', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(8, 2, 1, 1, NULL, 1, 06021010, 2000000000, NULL, 0, '8', NULL, 0, 5, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(9, 2, 1, 2, NULL, 1, 06021010, 2000000000, NULL, 0, '9', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL,NULL),
|
||||
(10, 1, 1, 3, NULL, 1, 05080000, 4751000000, NULL, 0, '10', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(11, 1, 1, 1, NULL, 1, 05080000, 4751000000, NULL, 0, '11', NULL, 0, 4, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(12, 3, 1, 2, NULL, 2, 06021010, 4751000000, NULL, 0, '12', NULL, 0, 3, 'VT', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(13, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 1, 2, 'VT', 1, NULL, NULL, 1, NULL,NULL),
|
||||
(14, 5, 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT', 1, NULL, NULL, 0, NULL,NULL),
|
||||
(15, 4, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(16, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB', 0, NULL, NULL, 0, NULL,NULL),
|
||||
(71, 6, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT', 0, NULL, NULL, 0, NULL,NULL);
|
||||
|
||||
-- Update the taxClass after insert of the items
|
||||
UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2
|
||||
|
@ -1005,45 +1007,45 @@ INSERT INTO `vn`.`ticketPackaging`(`id`, `ticketFk`, `packagingFk`, `quantity`,
|
|||
|
||||
INSERT INTO `vn`.`sale`(`id`, `itemFk`, `ticketFk`, `concept`, `quantity`, `price`, `discount`, `reserved`, `isPicked`, `created`)
|
||||
VALUES
|
||||
(1, 1, 1, 'Ranged weapon longbow 2m', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(1, 1, 1, 'Ranged weapon longbow 200cm', 5, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(2, 2, 1, 'Melee weapon combat fist 15cm', 10, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(3, 1, 1, 'Ranged weapon longbow 2m', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(4, 4, 1, 'Melee weapon heavy shield 1x0.5m', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(5, 1, 2, 'Ranged weapon longbow 2m', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(6, 1, 3, 'Ranged weapon longbow 2m', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
|
||||
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.44, 0, 0, 0, util.VN_CURDATE()),
|
||||
(8, 4, 11, 'Melee weapon heavy shield 1x0.5m', 10, 1.79, 0, 0, 0, util.VN_CURDATE()),
|
||||
(9, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(3, 1, 1, 'Ranged weapon longbow 200cm', 2, 100.39, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(4, 4, 1, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(5, 1, 2, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(6, 1, 3, 'Ranged weapon longbow 200cm', 1, 110.33, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -2 MONTH)),
|
||||
(7, 2, 11, 'Melee weapon combat fist 15cm', 15, 7.74, 0, 0, 0, util.VN_CURDATE()),
|
||||
(8, 4, 11, 'Melee weapon heavy shield 100cm', 10, 1.79, 0, 0, 0, util.VN_CURDATE()),
|
||||
(9, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(10, 2, 16, 'Melee weapon combat fist 15cm', 10, 7.09, 0, 0, 0, util.VN_CURDATE()),
|
||||
(11, 1, 16, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(12, 4, 16, 'Melee weapon heavy shield 1x0.5m', 20, 1.71, 0, 0, 0, util.VN_CURDATE()),
|
||||
(11, 1, 16, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(12, 4, 16, 'Melee weapon heavy shield 100cm', 20, 1.71, 0, 0, 0, util.VN_CURDATE()),
|
||||
(13, 2, 8, 'Melee weapon combat fist 15cm', 10, 7.08, 0, 0, 0, util.VN_CURDATE()),
|
||||
(14, 1, 8, 'Ranged weapon longbow 2m', 2, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(15, 1, 19, 'Ranged weapon longbow 2m', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(14, 1, 8, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(15, 1, 19, 'Ranged weapon longbow 200cm', 1, 103.49, 0, 0, 0, util.VN_CURDATE()),
|
||||
(16, 2, 20, 'Melee weapon combat fist 15cm', 20, 7.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(17, 2, 22, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
||||
(18, 4, 22, 'Melee weapon heavy shield 1x0.5m', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
||||
(19, 1, 4, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)),
|
||||
(20, 1, 5, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)),
|
||||
(21, 1, 6, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(22, 1, 7, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(23, 1, 9, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(24, 1, 10, 'Ranged weapon longbow 2m', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(25, 4, 12, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(26, 4, 13, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(27, 4, 14, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(28, 4, 15, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(29, 4, 17, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(30, 4, 18, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(18, 4, 22, 'Melee weapon heavy shield 100cm', 20, 1.69, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
||||
(19, 1, 4, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -3 MONTH)),
|
||||
(20, 1, 5, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -4 MONTH)),
|
||||
(21, 1, 6, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL -1 MONTH)),
|
||||
(22, 1, 7, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(23, 1, 9, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(24, 1, 10, 'Ranged weapon longbow 200cm', 1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(25, 4, 12, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(26, 4, 13, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(27, 4, 14, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(28, 4, 15, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(29, 4, 17, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(30, 4, 18, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(31, 2, 23, 'Melee weapon combat fist 15cm', -5, 7.08, 0, 0, 0, util.VN_CURDATE()),
|
||||
(32, 1, 24, 'Ranged weapon longbow 2m', -1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(32, 1, 24, 'Ranged weapon longbow 200cm', -1, 8.07, 0, 0, 0, util.VN_CURDATE()),
|
||||
(33, 5, 14, 'Ranged weapon pistol 9mm', 50, 1.79, 0, 0, 0, util.VN_CURDATE()),
|
||||
(34, 4, 28, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(35, 4, 29, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(37, 4, 31, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(36, 4, 30, 'Melee weapon heavy shield 1x0.5m', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(34, 4, 28, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(35, 4, 29, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(37, 4, 31, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(36, 4, 30, 'Melee weapon heavy shield 100cm', 20, 1.72, 0, 0, 0, util.VN_CURDATE()),
|
||||
(38, 2, 32, 'Melee weapon combat fist 15cm', 30, 7.07, 0, 0, 0, DATE_ADD(util.VN_CURDATE(), INTERVAL +1 MONTH)),
|
||||
(39, 1, 32, 'Ranged weapon longbow 2m', 2, 103.49, 0, 0, 0, util.VN_CURDATE());
|
||||
(39, 1, 32, 'Ranged weapon longbow 200cm', 2, 103.49, 0, 0, 0, util.VN_CURDATE());
|
||||
|
||||
INSERT INTO `vn`.`saleComponent`(`saleFk`, `componentFk`, `value`)
|
||||
VALUES
|
||||
|
@ -1259,7 +1261,7 @@ INSERT INTO `vn`.`tag`(`id`, `code`, `name`, `isFree`, `isQuantitatif`, `sourceT
|
|||
(5, NULL, 'Diámetro', 1, 1, NULL, 'mm',NULL, 'diameter'),
|
||||
(7, NULL, 'Ancho de la base', 1, 1, NULL, 'mm',NULL, NULL),
|
||||
(23, 'stems', 'Tallos', 1, 1, NULL, NULL, NULL, 'stems'),
|
||||
(27, NULL, 'Longitud(cm)', 1, 1, NULL, 'cm', NULL, NULL),
|
||||
(27, NULL, 'Longitud(cm)', 1, 1, NULL, 'cm', NULL, 'size'),
|
||||
(36, 'producer', 'Proveedor', 1, 0, NULL, NULL, NULL, 'producer'),
|
||||
(56, NULL, 'Genero', 1, 0, NULL, NULL, NULL, NULL),
|
||||
(58, NULL, 'Variedad', 1, 0, NULL, NULL, NULL, NULL),
|
||||
|
@ -1270,7 +1272,7 @@ INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
|||
VALUES
|
||||
(1, 1, 56, 'Ranged weapon', 1),
|
||||
(2, 1, 58, 'longbow', 2),
|
||||
(3, 1, 27, '2m', 3),
|
||||
(3, 1, 27, '200cm', 3),
|
||||
(4, 1, 36, 'Stark Industries', 4),
|
||||
(5, 1, 1, 'Brown', 5),
|
||||
(6, 1, 67, '+1 precission', 6),
|
||||
|
@ -1284,42 +1286,42 @@ INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
|||
(14, 2, 23, '2', 7),
|
||||
(15, 3, 56, 'Ranged weapon', 1),
|
||||
(16, 3, 58, 'sniper rifle', 2),
|
||||
(17, 3, 4, '300mm', 3),
|
||||
(17, 3, 4, '113cm', 3),
|
||||
(18, 3, 36, 'Stark Industries', 4),
|
||||
(19, 3, 1, 'Green', 5),
|
||||
(20, 3, 67, 'precission', 6),
|
||||
(21, 3, 23, '3', 7),
|
||||
(22, 4, 56, 'Melee weapon', 1),
|
||||
(23, 4, 58, 'heavy shield', 2),
|
||||
(24, 4, 4, '1x0.5m', 3),
|
||||
(24, 4, 4, '100cm', 3),
|
||||
(25, 4, 36, 'Stark Industries', 4),
|
||||
(26, 4, 1, 'Black', 5),
|
||||
(27, 4, 67, 'containtment', 6),
|
||||
(28, 4, 23, '4', 7),
|
||||
(29, 5, 56, 'Ranged weapon', 1),
|
||||
(30, 5, 58, 'pistol', 2),
|
||||
(31, 5, 27, '9mm', 3),
|
||||
(31, 5, 67, '9mm', 3),
|
||||
(32, 5, 36, 'Stark Industries', 4),
|
||||
(33, 5, 1, 'Silver', 5),
|
||||
(34, 5, 67, 'rapid fire', 6),
|
||||
(34, 5, 27, '15cm', 6),
|
||||
(35, 5, 23, '5', 7),
|
||||
(36, 6, 56, 'Container', 1),
|
||||
(37, 6, 58, 'ammo box', 2),
|
||||
(38, 6, 27, '1m', 3),
|
||||
(38, 6, 27, '100cm', 3),
|
||||
(39, 6, 36, 'Stark Industries', 4),
|
||||
(40, 6, 1, 'Green', 5),
|
||||
(41, 6, 67, 'supply', 6),
|
||||
(42, 6, 23, '6', 7),
|
||||
(43, 7, 56, 'Container', 1),
|
||||
(44, 7, 58, 'medical box', 2),
|
||||
(45, 7, 27, '1m', 3),
|
||||
(45, 7, 27, '100cm', 3),
|
||||
(46, 7, 36, 'Stark Industries', 4),
|
||||
(47, 7, 1, 'White', 5),
|
||||
(48, 7, 67, 'supply', 6),
|
||||
(49, 7, 23, '7', 7),
|
||||
(50, 8, 56, 'Ranged Reinforced weapon', 1),
|
||||
(51, 8, 58, '+1 longbow', 2),
|
||||
(52, 8, 27, '2m', 3),
|
||||
(52, 8, 27, '200cm', 3),
|
||||
(53, 8, 36, 'Stark Industries', 4),
|
||||
(54, 8, 1, 'Brown', 5),
|
||||
(55, 8, 67, 'precission', 6),
|
||||
|
@ -1333,14 +1335,14 @@ INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
|||
(63, 9, 23, '9', 7),
|
||||
(64, 10, 56, 'Ranged Reinforced weapon', 1),
|
||||
(65, 10, 58, 'sniper rifle', 2),
|
||||
(66, 10, 4, '300mm', 3),
|
||||
(66, 10, 67, '700mm', 3),
|
||||
(67, 10, 36, 'Stark Industries', 4),
|
||||
(68, 10, 1, 'Green', 5),
|
||||
(69, 10, 67, 'precission', 6),
|
||||
(69, 10, 27, '130cm', 6),
|
||||
(70, 10, 23, '10', 7),
|
||||
(71, 11, 56, 'Melee Reinforced weapon', 1),
|
||||
(72, 11, 58, 'heavy shield', 2),
|
||||
(73, 11, 4, '1x0.5m', 3),
|
||||
(73, 11, 4, '120cm', 3),
|
||||
(74, 11, 36, 'Stark Industries', 4),
|
||||
(75, 11, 1, 'Black', 5),
|
||||
(76, 11, 67, 'containtment', 6),
|
||||
|
@ -1350,18 +1352,18 @@ INSERT INTO `vn`.`itemTag`(`id`,`itemFk`,`tagFk`,`value`,`priority`)
|
|||
(80, 12, 27, '9mm', 3),
|
||||
(81, 12, 36, 'Stark Industries', 4),
|
||||
(82, 12, 1, 'Silver', 5),
|
||||
(83, 12, 67, 'rapid fire', 6),
|
||||
(83, 12, 67, '23cm', 6),
|
||||
(84, 12, 23, '12', 7),
|
||||
(85, 13, 56, 'Chest', 1),
|
||||
(86, 13, 58, 'ammo box', 2),
|
||||
(87, 13, 27, '1m', 3),
|
||||
(87, 13, 27, '100cm', 3),
|
||||
(88, 13, 36, 'Stark Industries', 4),
|
||||
(89, 13, 1, 'Green', 5),
|
||||
(90, 13, 67, 'supply', 6),
|
||||
(91, 13, 23, '13', 7),
|
||||
(92, 14, 56, 'Chest', 1),
|
||||
(93, 14, 58, 'medical box', 2),
|
||||
(94, 14, 27, '1m', 3),
|
||||
(94, 14, 27, '100cm', 3),
|
||||
(95, 14, 36, 'Stark Industries', 4),
|
||||
(96, 14, 1, 'White', 5),
|
||||
(97, 14, 67, 'supply', 6),
|
||||
|
@ -1927,9 +1929,9 @@ INSERT INTO `vn`.`workerTeam`(`id`, `team`, `workerFk`)
|
|||
|
||||
INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requesterFk`, `attenderFk`, `quantity`, `itemFk`, `price`, `isOk`, `saleFk`, `ticketFk`, `created`)
|
||||
VALUES
|
||||
(1, 'Ranged weapon longbow 2m', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY)),
|
||||
(1, 'Ranged weapon longbow 200cm', 18, 35, 5, 1, 9.10, 1, 1, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY)),
|
||||
(2, 'Melee weapon combat first 15cm', 18, 35, 10, 2, 1.07, 0, NULL, 1, DATE_ADD(util.VN_CURDATE(), INTERVAL -15 DAY)),
|
||||
(3, 'Melee weapon heavy shield 1x0.5m', 18, 35, 20, NULL, 3.06, NULL, NULL, 23, util.VN_CURDATE()),
|
||||
(3, 'Melee weapon heavy shield 100cm', 18, 35, 20, NULL, 3.06, NULL, NULL, 23, util.VN_CURDATE()),
|
||||
(4, 'Melee weapon combat first 15cm', 18, 35, 15, NULL, 1.30, NULL, NULL, 11, util.VN_CURDATE()),
|
||||
(5, 'Melee weapon combat first 15cm', 18, 35, 15, 4, 1.30, 0, NULL, 18, util.VN_CURDATE());
|
||||
|
||||
|
@ -1965,6 +1967,8 @@ INSERT INTO `vn`.`calendarType` (`id`, `description`, `hoursWeek`, `isPartial`)
|
|||
VALUES
|
||||
(1, 'General schedule', 40, 0);
|
||||
|
||||
INSERT INTO `vn`.`workerBusinessAgreement` (`id`, `name`, `monthHolidays`, `yearHours`, `started`, `ended`)
|
||||
VALUES(1, 'flowers', 2.5, 1830, '2001-01-01', NULL);
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.worker;
|
||||
CREATE TEMPORARY TABLE tmp.worker
|
||||
|
@ -2776,11 +2780,13 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
|||
(2, 'invoice-electronic', 'A electronic invoice has been generated'),
|
||||
(3, 'not-main-printer-configured', 'A printer distinct than main has been configured'),
|
||||
(4, 'supplier-pay-method-update', 'A supplier pay method has been updated'),
|
||||
(5, 'modified-entry', 'An entry has been modified');
|
||||
(5, 'modified-entry', 'An entry has been modified'),
|
||||
(6, 'book-entry-deleted', 'accounting entries deleted');
|
||||
|
||||
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||
VALUES
|
||||
(1, 9);
|
||||
(1, 9),
|
||||
(6, 9);
|
||||
|
||||
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
||||
VALUES
|
||||
|
@ -2793,8 +2799,9 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`)
|
|||
(1, 1109),
|
||||
(1, 1110),
|
||||
(2, 1109),
|
||||
(1,9),
|
||||
(1,3);
|
||||
(1, 9),
|
||||
(1, 3),
|
||||
(6, 9);
|
||||
|
||||
|
||||
INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`)
|
||||
|
@ -2830,7 +2837,7 @@ INSERT INTO `vn`.`ticketLog` (`originFk`, userFk, `action`, changedModel, oldIns
|
|||
(7, 18, 'update', 'Sale', '{"quantity":1}', '{"quantity":10}', 1, NULL),
|
||||
(7, 18, 'update', 'Ticket', '{"quantity":1,"concept":"Chest ammo box"}', '{"quantity":10,"concept":"Chest ammo box"}', 1, NULL),
|
||||
(7, 18, 'update', 'Sale', '{"price":3}', '{"price":5}', 1, NULL),
|
||||
(7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 1x0.5m de '5' a '10'"),
|
||||
(7, 18, 'update', NULL, NULL, NULL, NULL, "Cambio cantidad Melee weapon heavy shield 100cm de '5' a '10'"),
|
||||
(16, 9, 'update', 'Sale', '{"quantity":10,"concept":"Shield", "price": 10.5, "itemFk": 1}', '{"quantity":8,"concept":"Shield", "price": 10.5, "itemFk": 1}' , 5689, 'Shield');
|
||||
|
||||
|
||||
|
@ -2896,11 +2903,11 @@ INSERT INTO `vn`.`deviceProductionState` (`code`, `description`)
|
|||
('retired', 'retirada');
|
||||
|
||||
INSERT INTO `vn`.`deviceProduction` (`imei`, `modelFk`, `macWifi`, `serialNumber`, `android_id`, `purchased`, `stateFk`, `isInScalefusion`, `description`)
|
||||
VALUES
|
||||
('ime1', 'BLACKVIEW', 'macWifi1', 'serialNumber1', 'android_id1', util.VN_NOW(), 'active', 0, NULL),
|
||||
('ime2', 'DODGEE', 'macWifi2', 'serialNumber2', 'android_id2', util.VN_NOW(), 'idle', 0, NULL),
|
||||
('ime3', 'ZEBRA', 'macWifi3', 'serialNumber3', 'android_id3', util.VN_NOW(), 'active', 0, NULL),
|
||||
('ime4', 'BLACKVIEW', 'macWifi4', 'serialNumber4', 'android_id4', util.VN_NOW(), 'idle', 0, NULL);
|
||||
VALUES
|
||||
('ime1', 'BLACKVIEW', 'macWifi1', 'serialNumber1', 'androidid11234567890', util.VN_NOW(), 'active', 0, NULL),
|
||||
('ime2', 'DODGEE', 'macWifi2', 'serialNumber2', 'androidid21234567890', util.VN_NOW(), 'idle', 0, NULL),
|
||||
('ime3', 'ZEBRA', 'macWifi3', 'serialNumber3', 'androidid31234567890', util.VN_NOW(), 'active', 0, NULL),
|
||||
('ime4', 'BLACKVIEW', 'macWifi4', 'serialNumber4', 'androidid41234567890', util.VN_NOW(), 'idle', 0, NULL);
|
||||
|
||||
INSERT INTO `vn`.`deviceProductionUser` (`deviceProductionFk`, `userFk`, `created`)
|
||||
VALUES
|
||||
|
@ -2959,6 +2966,7 @@ INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
|
|||
VALUES
|
||||
(1, 0, 0, 'marvel.com');
|
||||
|
||||
<<<<<<< HEAD
|
||||
INSERT INTO `vn`.`cplusCorrectingType` (`description`)
|
||||
VALUES
|
||||
('Embalajes'),
|
||||
|
@ -2971,3 +2979,13 @@ INSERT INTO `vn`.`invoiceCorrectionType` (`description`)
|
|||
('Error en el cálculo del IVA'),
|
||||
('Error en el detalle de las ventas'),
|
||||
('Error en los datos del cliente');
|
||||
=======
|
||||
INSERT INTO vn.XDiario (id, ASIEN, FECHA, SUBCTA, CONTRA, CONCEPTO, EURODEBE, EUROHABER, BASEEURO, SERIE, FACTURA, IVA, RECEQUIV, CLAVE, CAMBIO, DEBEME, HABERME, AUXILIAR, MONEDAUSO, TIPOOPE, NFACTICK, TERIDNIF, TERNIF, TERNOM, OPBIENES, L340, enlazado, FECHA_EX, LRECT349, empresa_id, LDIFADUAN, METAL, METALIMP, CLIENTE, METALEJE, FECHA_OP, FACTURAEX, TIPOCLAVE, TIPOEXENCI, TIPONOSUJE, TIPOFACT, TIPORECTIF, SERIE_RT, FACTU_RT, BASEIMP_RT, BASEIMP_RF, RECTIFICA, FECHA_RT, FECREGCON, enlazadoSage)
|
||||
VALUES
|
||||
(1, 1.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T3333333', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1),
|
||||
(2, 1.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T3333333 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1),
|
||||
(3, 1.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T3333333 Tony Stark', NULL, 0.81, 8.07, 'T', '3333333', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 1),
|
||||
(4, 2.0, util.VN_CURDATE(), '4300001104', NULL, 'n/fra T4444444', 8.88, NULL, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
|
||||
(5, 2.0, util.VN_CURDATE(), '2000000000', '4300001104', 'n/fra T4444444 Tony Stark', NULL, 8.07, NULL, NULL, '0', NULL, 0.00, NULL, NULL, NULL, NULL, NULL, '2', NULL, 1, 2, 'I.F.', 'Nombre Importador', 1, 0, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0),
|
||||
(6, 2.0, util.VN_CURDATE(), '4770000010', '4300001104', 'Inmovilizado pendiente : n/fra T4444444 Tony Stark', NULL, 0.81, 8.07, 'T', '4444444', 10.00, NULL, NULL, NULL, NULL, NULL, '', '2', '', 1, 1, '06089160W', 'IRON MAN', 1, 1, 0, util.VN_CURDATE(), 0, 442, 0, 0, 0.00, NULL, NULL, util.VN_CURDATE(), NULL, 1, 1, 1, 1, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, 0);
|
||||
>>>>>>> 72a8256aee7bff0be1dd68c8d4cfbe2edcf8ce60
|
||||
|
|
20878
db/dump/structure.sql
20878
db/dump/structure.sql
File diff suppressed because it is too large
Load Diff
|
@ -97,13 +97,6 @@ TABLES=(
|
|||
)
|
||||
dump_tables ${TABLES[@]}
|
||||
|
||||
TABLES=(
|
||||
postgresql
|
||||
labour_agreement
|
||||
media_type
|
||||
)
|
||||
dump_tables ${TABLES[@]}
|
||||
|
||||
TABLES=(
|
||||
sage
|
||||
TiposIva
|
||||
|
|
|
@ -7,7 +7,6 @@ SCHEMAS=(
|
|||
edi
|
||||
hedera
|
||||
pbx
|
||||
postgresql
|
||||
sage
|
||||
salix
|
||||
stock
|
||||
|
@ -23,7 +22,6 @@ IGNORETABLES=(
|
|||
--ignore-table=bs.productionIndicators
|
||||
--ignore-table=bs.VentasPorCliente
|
||||
--ignore-table=bs.v_ventas
|
||||
--ignore-table=postgresql.currentWorkersStats
|
||||
--ignore-table=vn.accounting__
|
||||
--ignore-table=vn.agencyModeZone
|
||||
--ignore-table=vn.agencyProvince
|
||||
|
|
|
@ -6,13 +6,13 @@ describe('item_getBalance()', () => {
|
|||
let stmts = [];
|
||||
|
||||
let params = {
|
||||
warehouseFk: 1,
|
||||
itemFk: 1
|
||||
itemFk: 1,
|
||||
warehouseFk: 1
|
||||
};
|
||||
|
||||
const conn = await app.models.Item.dataSource.connector;
|
||||
|
||||
stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?)', [
|
||||
stmts.push(new ParameterizedSQL('CALL vn.item_getBalance(?, ?, NULL)', [
|
||||
params.warehouseFk,
|
||||
params.itemFk
|
||||
]));
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
const app = require('vn-loopback/server/server');
|
||||
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
|
||||
|
||||
describe('logAddWithUser()', () => {
|
||||
it('should log any action taken by the user in a table ending in Log', async() => {
|
||||
let stmts = [];
|
||||
let stmt;
|
||||
|
||||
stmts.push('START TRANSACTION');
|
||||
|
||||
let params = {
|
||||
ticketFk: 1,
|
||||
userId: 9,
|
||||
actionCode: 'update',
|
||||
targetEntity: 'ticket',
|
||||
description: 'we are testing stuff'
|
||||
};
|
||||
|
||||
stmt = new ParameterizedSQL('CALL vn.logAddWithUser(?, ?, ?, ?, ?)', [
|
||||
params.ticketFk,
|
||||
params.userId,
|
||||
params.actionCode,
|
||||
params.targetEntity,
|
||||
params.description
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
|
||||
stmt = new ParameterizedSQL('SELECT * FROM vn.ticketLog WHERE description = ?', [
|
||||
params.description
|
||||
]);
|
||||
let ticketLogIndex = stmts.push(stmt) - 1;
|
||||
|
||||
stmts.push('ROLLBACK');
|
||||
|
||||
let sql = ParameterizedSQL.join(stmts, ';');
|
||||
let result = await app.models.Ticket.rawStmt(sql);
|
||||
|
||||
savedDescription = result[ticketLogIndex][0].description;
|
||||
|
||||
expect(savedDescription).toEqual(params.description);
|
||||
});
|
||||
});
|
|
@ -14,14 +14,6 @@ describe('timeControl_calculateByUser()', () => {
|
|||
let stmts = [];
|
||||
let stmt;
|
||||
|
||||
stmts.push('START TRANSACTION');
|
||||
|
||||
stmts.push(`
|
||||
DROP TEMPORARY TABLE IF EXISTS
|
||||
tmp.timeControlCalculate,
|
||||
tmp.timeBusinessCalculate
|
||||
`);
|
||||
|
||||
let params = {
|
||||
workerID: 1106,
|
||||
start: start,
|
||||
|
@ -37,17 +29,15 @@ describe('timeControl_calculateByUser()', () => {
|
|||
|
||||
let tableIndex = stmts.push('SELECT * FROM tmp.timeControlCalculate') - 1;
|
||||
|
||||
stmts.push('ROLLBACK');
|
||||
|
||||
let sql = ParameterizedSQL.join(stmts, ';');
|
||||
let result = await app.models.Ticket.rawStmt(sql);
|
||||
|
||||
let [timeControlCalculateTable] = result[tableIndex];
|
||||
|
||||
expect(timeControlCalculateTable.timeWorkSeconds).toEqual(29400);
|
||||
expect(timeControlCalculateTable.timeWorkSeconds).toEqual(28200);
|
||||
});
|
||||
|
||||
it(`should return the worked hours between last sunday and monday`, async() => {
|
||||
// #2261
|
||||
xit(`should return the worked hours between last sunday and monday`, async() => {
|
||||
let lastSunday = Date.vnNew();
|
||||
let daysSinceSunday = lastSunday.getDay();
|
||||
if (daysSinceSunday === 0) // this means today is sunday but you need the previous sunday :)
|
||||
|
@ -65,13 +55,7 @@ describe('timeControl_calculateByUser()', () => {
|
|||
|
||||
stmts.push('START TRANSACTION');
|
||||
|
||||
stmts.push(`
|
||||
DROP TEMPORARY TABLE IF EXISTS
|
||||
tmp.timeControlCalculate,
|
||||
tmp.timeBusinessCalculate
|
||||
`);
|
||||
|
||||
const workerID = 1107;
|
||||
const workerID = 1108;
|
||||
|
||||
stmt = new ParameterizedSQL(`
|
||||
INSERT INTO vn.workerTimeControl(userFk, timed, manual, direction)
|
||||
|
|
|
@ -54,7 +54,6 @@ xdescribe('worker workerTimeControl_check()', () => {
|
|||
});
|
||||
|
||||
it('should throw an error if the worker with a special category has not finished the 9h break', async() => {
|
||||
// dayBreak to 9h in postgresql.professional_category
|
||||
const workerId = 1110;
|
||||
const tabletId = 1;
|
||||
let stmts = [];
|
||||
|
@ -91,7 +90,6 @@ xdescribe('worker workerTimeControl_check()', () => {
|
|||
});
|
||||
|
||||
it('should check f the worker with a special category has finished the 9h break', async() => {
|
||||
// dayBreak to 9h in postgresql.professional_category
|
||||
const workerId = 1110;
|
||||
const tabletId = 1;
|
||||
let stmts = [];
|
||||
|
@ -239,12 +237,6 @@ xdescribe('worker workerTimeControl_check()', () => {
|
|||
|
||||
stmts.push('START TRANSACTION');
|
||||
|
||||
stmt = new ParameterizedSQL(`INSERT INTO postgresql.calendar_employee(businessFk,calendar_state_id,date)
|
||||
VALUES
|
||||
(?,1,CURDATE())`, [
|
||||
workerId
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
stmt = new ParameterizedSQL(`INSERT INTO vn.workerTimeControl(userFk,timed,manual,direction)
|
||||
VALUES
|
||||
(?,TIMESTAMPADD(HOUR,-24,NOW()),0,"in"),
|
||||
|
|
|
@ -7,7 +7,7 @@ describe('zone zone_getFromGeo()', () => {
|
|||
let stmt;
|
||||
|
||||
stmts.push('START TRANSACTION');
|
||||
let geoFk = 17;
|
||||
let geoFk = 16;
|
||||
|
||||
stmt = new ParameterizedSQL('CALL zone_getFromGeo(?)', [
|
||||
geoFk,
|
||||
|
|
|
@ -632,6 +632,7 @@ let actions = {
|
|||
await this.write(selector, value.toString());
|
||||
break;
|
||||
case 'vn-autocomplete':
|
||||
case 'vn-worker-autocomplete':
|
||||
if (value)
|
||||
await this.autocompleteSearch(selector, value.toString());
|
||||
else
|
||||
|
@ -667,6 +668,7 @@ let actions = {
|
|||
switch (tagName) {
|
||||
case 'vn-textfield':
|
||||
case 'vn-autocomplete':
|
||||
case 'vn-worker-autocomplete':
|
||||
case 'vn-input-time':
|
||||
case 'vn-datalist':
|
||||
el = await input.$('input');
|
||||
|
|
|
@ -187,7 +187,7 @@ export default {
|
|||
country: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.countryFk"]',
|
||||
userName: 'vn-client-create vn-textfield[ng-model="$ctrl.client.userName"]',
|
||||
email: 'vn-client-create vn-textfield[ng-model="$ctrl.client.email"]',
|
||||
salesPerson: 'vn-client-create vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
salesPerson: 'vn-client-create vn-worker-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
saveNewProvicenButton: '#saveProvince',
|
||||
saveNewCityButton: '#saveCity',
|
||||
saveNewPoscode: '#savePostcode',
|
||||
|
@ -199,7 +199,7 @@ export default {
|
|||
email: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.email"]',
|
||||
phone: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.phone"]',
|
||||
mobile: 'vn-client-basic-data vn-textfield[ng-model="$ctrl.client.mobile"]',
|
||||
salesPerson: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
salesPerson: 'vn-client-basic-data vn-worker-autocomplete[ng-model="$ctrl.client.salesPersonFk"]',
|
||||
channel: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.contactChannelFk"]',
|
||||
transferor: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.transferorFk"]',
|
||||
businessType: 'vn-client-basic-data vn-autocomplete[ng-model="$ctrl.client.businessTypeFk"]',
|
||||
|
@ -671,8 +671,8 @@ export default {
|
|||
firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]',
|
||||
firstServiceType: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
|
||||
firstQuantity: 'vn-ticket-service vn-input-number[ng-model="service.quantity"]',
|
||||
firstPrice: 'vn-ticket-service vn-horizontal:nth-child(1) vn-input-number[ng-model="service.price"]',
|
||||
fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(1) vn-icon-button[icon="delete"]',
|
||||
firstPrice: 'vn-ticket-service vn-horizontal:nth-child(2) vn-input-number[ng-model="service.price"]',
|
||||
fistDeleteServiceButton: 'vn-ticket-service form vn-horizontal:nth-child(2) vn-icon-button[icon="delete"]',
|
||||
newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="newServiceType.name"]',
|
||||
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
|
||||
saveServiceButton: 'button[type=submit]',
|
||||
|
@ -735,7 +735,7 @@ export default {
|
|||
},
|
||||
createStateView: {
|
||||
state: 'vn-autocomplete[ng-model="$ctrl.stateFk"]',
|
||||
worker: 'vn-autocomplete[ng-model="$ctrl.workerFk"]',
|
||||
worker: 'vn-worker-autocomplete[ng-model="$ctrl.workerFk"]',
|
||||
saveStateButton: `button[type=submit]`
|
||||
},
|
||||
claimsIndex: {
|
||||
|
@ -781,12 +781,12 @@ export default {
|
|||
firstClaimReason: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||
firstClaimResult: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||
firstClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||
firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
firstClaimWorker: 'vn-claim-development vn-horizontal:nth-child(1) vn-worker-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
firstClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(1) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||
secondClaimReason: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimReasonFk"]',
|
||||
secondClaimResult: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResultFk"]',
|
||||
secondClaimResponsible: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimResponsibleFk"]',
|
||||
secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
secondClaimWorker: 'vn-claim-development vn-horizontal:nth-child(2) vn-worker-autocomplete[ng-model="claimDevelopment.workerFk"]',
|
||||
secondClaimRedelivery: 'vn-claim-development vn-horizontal:nth-child(2) vn-autocomplete[ng-model="claimDevelopment.claimRedeliveryFk"]',
|
||||
saveDevelopmentButton: 'button[type=submit]'
|
||||
},
|
||||
|
@ -854,7 +854,7 @@ export default {
|
|||
|
||||
},
|
||||
createRouteView: {
|
||||
worker: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||
worker: 'vn-route-create vn-worker-autocomplete[ng-model="$ctrl.route.workerFk"]',
|
||||
createdDatePicker: 'vn-route-create vn-date-picker[ng-model="$ctrl.route.created"]',
|
||||
vehicleAuto: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.vehicleFk"]',
|
||||
agency: 'vn-route-create vn-autocomplete[ng-model="$ctrl.route.agencyModeFk"]',
|
||||
|
@ -976,7 +976,7 @@ export default {
|
|||
street: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.street"]',
|
||||
user: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.name"]',
|
||||
email: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.email"]',
|
||||
boss: 'vn-worker-create vn-autocomplete[ng-model="$ctrl.worker.bossFk"]',
|
||||
boss: 'vn-worker-create vn-worker-autocomplete[ng-model="$ctrl.worker.bossFk"]',
|
||||
role: 'vn-worker-create vn-autocomplete[ng-model="$ctrl.worker.roleFk"]',
|
||||
iban: 'vn-worker-create vn-textfield[ng-model="$ctrl.worker.iban"]',
|
||||
createButton: 'vn-worker-create vn-submit[label="Create"]',
|
||||
|
|
|
@ -27,10 +27,10 @@ describe('Item summary path', () => {
|
|||
});
|
||||
|
||||
it(`should check the item summary preview shows fields from basic data`, async() => {
|
||||
await page.waitForTextInElement(selectors.itemSummary.basicData, 'Ranged weapon longbow 2m');
|
||||
await page.waitForTextInElement(selectors.itemSummary.basicData, 'Ranged weapon longbow 200cm');
|
||||
const result = await page.waitToGetProperty(selectors.itemSummary.basicData, 'innerText');
|
||||
|
||||
expect(result).toContain('Ranged weapon longbow 2m');
|
||||
expect(result).toContain('Ranged weapon longbow 200cm');
|
||||
});
|
||||
|
||||
it(`should check the item summary preview shows fields from tags`, async() => {
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Item edit tax path', () => {
|
|||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('buyer', 'item');
|
||||
await page.accessToSearchResult('Ranged weapon longbow 2m');
|
||||
await page.accessToSearchResult('Ranged weapon longbow 200cm');
|
||||
await page.accessToSection('item.card.tax');
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Item create tags path', () => {
|
|||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('buyer', 'item');
|
||||
await page.accessToSearchResult('Ranged weapon longbow 2m');
|
||||
await page.accessToSearchResult('Ranged weapon longbow 200cm');
|
||||
await page.accessToSection('item.card.tags');
|
||||
});
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Item Create barcodes path', () => {
|
|||
browser = await getBrowser();
|
||||
page = browser.page;
|
||||
await page.loginAndModule('buyer', 'item');
|
||||
await page.accessToSearchResult('Ranged weapon longbow 2m');
|
||||
await page.accessToSearchResult('Ranged weapon longbow 200cm');
|
||||
await page.accessToSection('item.card.itemBarcode');
|
||||
});
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@ describe('Item request path', () => {
|
|||
it('should fill the id and quantity then check the concept was updated', async() => {
|
||||
await page.writeOnEditableTD(selectors.itemRequest.firstRequestItemID, '4');
|
||||
await page.writeOnEditableTD(selectors.itemRequest.firstRequestQuantity, '10');
|
||||
await page.waitForTextInElement(selectors.itemRequest.firstRequestConcept, 'Melee weapon heavy shield 1x0.5m');
|
||||
await page.waitForTextInElement(selectors.itemRequest.firstRequestConcept, 'Melee weapon heavy shield 100cm');
|
||||
let filledConcept = await page.waitToGetProperty(selectors.itemRequest.firstRequestConcept, 'innerText');
|
||||
|
||||
expect(filledConcept).toContain('Melee weapon heavy shield 1x0.5m');
|
||||
expect(filledConcept).toContain('Melee weapon heavy shield 100cm');
|
||||
});
|
||||
|
||||
it('should check the status of the request should now be accepted', async() => {
|
||||
|
|
|
@ -54,7 +54,7 @@ describe('Ticket List sale path', () => {
|
|||
});
|
||||
|
||||
it('should select a valid item to be added as the second item in the sales list', async() => {
|
||||
let searchValue = 'Melee weapon heavy shield 1x0.5m';
|
||||
let searchValue = 'Melee weapon heavy shield 100cm';
|
||||
await page.autocompleteSearch(selectors.ticketSales.secondSaleIdAutocomplete, searchValue);
|
||||
await page.waitToClick(selectors.ticketSales.secondSaleQuantityCell);
|
||||
await page.type(selectors.ticketSales.secondSaleQuantity, '1');
|
||||
|
|
|
@ -36,7 +36,7 @@ describe('Ticket Create packages path', () => {
|
|||
|
||||
it(`should delete the first package and receive and error to save a new one with blank quantity`, async() => {
|
||||
await page.clearInput($.firstQuantity);
|
||||
await page.autocompleteSearch($.firstPackage, 'Container medical box 1m');
|
||||
await page.autocompleteSearch($.firstPackage, 'Container medical box 100cm');
|
||||
await page.waitToClick($.savePackagesButton);
|
||||
const message = await page.waitForSnackbar();
|
||||
|
||||
|
@ -63,10 +63,10 @@ describe('Ticket Create packages path', () => {
|
|||
|
||||
it(`should confirm the first select is the expected one`, async() => {
|
||||
await page.reloadSection('ticket.card.package');
|
||||
await page.waitForTextInField($.firstPackage, 'Container medical box 1m');
|
||||
await page.waitForTextInField($.firstPackage, 'Container medical box 100cm');
|
||||
const result = await page.waitToGetProperty($.firstPackage, 'value');
|
||||
|
||||
expect(result).toEqual('Container medical box 1m');
|
||||
expect(result).toEqual('Container medical box 100cm');
|
||||
});
|
||||
|
||||
it(`should confirm quantity is just a number and the string part was ignored by the imput number`, async() => {
|
||||
|
|
|
@ -59,7 +59,7 @@ describe('Ticket Create new tracking state path', () => {
|
|||
const result = await page
|
||||
.waitToGetProperty(selectors.createStateView.worker, 'value');
|
||||
|
||||
expect(result).toEqual('salesPersonNick');
|
||||
expect(result).toEqual('salesPerson');
|
||||
});
|
||||
|
||||
it(`should succesfully create a valid state`, async() => {
|
||||
|
|
|
@ -75,7 +75,7 @@ describe('Ticket Edit basic data path', () => {
|
|||
const result = await page
|
||||
.waitToGetProperty(selectors.ticketBasicData.stepTwoTotalPriceDif, 'innerText');
|
||||
|
||||
expect(result).toContain('-€232.75');
|
||||
expect(result).toContain('-€228.25');
|
||||
});
|
||||
|
||||
it(`should select a new reason for the changes made then click on finalize`, async() => {
|
||||
|
|
|
@ -82,32 +82,24 @@ describe('InvoiceIn basic data path', () => {
|
|||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||
let message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('The company can\'t be empty');
|
||||
|
||||
await page.clearInput(selectors.invoiceInBasicData.companyId);
|
||||
await page.autocompleteSearch(selectors.invoiceInBasicData.companyId, 'VNL');
|
||||
|
||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||
message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('The warehouse can\'t be empty');
|
||||
|
||||
await page.clearInput(selectors.invoiceInBasicData.warehouseId);
|
||||
await page.autocompleteSearch(selectors.invoiceInBasicData.warehouseId, 'Warehouse One');
|
||||
|
||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||
message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('The DMS Type can\'t be empty');
|
||||
|
||||
await page.clearInput(selectors.invoiceInBasicData.dmsTypeId);
|
||||
await page.autocompleteSearch(selectors.invoiceInBasicData.dmsTypeId, 'Ticket');
|
||||
|
||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||
message = await page.waitForSnackbar();
|
||||
|
||||
expect(message.text).toContain('The description can\'t be empty');
|
||||
|
||||
await page.waitToClick(selectors.invoiceInBasicData.description);
|
||||
await page.write(selectors.invoiceInBasicData.description, 'Dms without edition.');
|
||||
|
||||
|
|
|
@ -41,10 +41,10 @@ describe('Entry import, create and edit buys path', () => {
|
|||
await page.waitForTextInField(selectors.entryBuys.ref, '200573095, 200573106, 200573117, 200573506');
|
||||
await page.waitForTextInField(selectors.entryBuys.observation, '729-6340 2846');
|
||||
|
||||
await page.autocompleteSearch(selectors.entryBuys.firstImportedItem, 'Ranged weapon longbow 2m');
|
||||
await page.autocompleteSearch(selectors.entryBuys.secondImportedItem, 'Ranged weapon longbow 2m');
|
||||
await page.autocompleteSearch(selectors.entryBuys.thirdImportedItem, 'Ranged weapon sniper rifle 300mm');
|
||||
await page.autocompleteSearch(selectors.entryBuys.fourthImportedItem, 'Melee weapon heavy shield 1x0.5m');
|
||||
await page.autocompleteSearch(selectors.entryBuys.firstImportedItem, 'Ranged weapon longbow 200cm');
|
||||
await page.autocompleteSearch(selectors.entryBuys.secondImportedItem, 'Ranged weapon longbow 200cm');
|
||||
await page.autocompleteSearch(selectors.entryBuys.thirdImportedItem, 'Ranged weapon sniper rifle 113cm');
|
||||
await page.autocompleteSearch(selectors.entryBuys.fourthImportedItem, 'Melee weapon heavy shield 100cm');
|
||||
|
||||
await page.waitToClick(selectors.entryBuys.importBuysButton);
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<label>
|
||||
<span translate>{{$ctrl.label}}</span>
|
||||
<span class="required">*</span>
|
||||
</label>
|
||||
</label>
|
||||
</div>
|
||||
<div class="icons pre">
|
||||
<vn-icon
|
||||
|
@ -50,4 +50,4 @@
|
|||
on-select="$ctrl.onDropDownSelect(item)"
|
||||
on-data-ready="$ctrl.onDataReady()"
|
||||
on-close-start="$ctrl.onDropDownClose()">
|
||||
</vn-drop-down>
|
||||
</vn-drop-down>
|
||||
|
|
|
@ -17,10 +17,9 @@ import './style.scss';
|
|||
* @event change Thrown when value is changed
|
||||
*/
|
||||
export default class Autocomplete extends Field {
|
||||
constructor($element, $, $compile, $transclude) {
|
||||
super($element, $, $compile);
|
||||
constructor($element, $, $transclude) {
|
||||
super($element, $, $transclude);
|
||||
this.$transclude = $transclude;
|
||||
this.$compile = $compile;
|
||||
this._selection = null;
|
||||
this.input = this.element.querySelector('input');
|
||||
}
|
||||
|
@ -153,7 +152,14 @@ export default class Autocomplete extends Field {
|
|||
filter.include = this.include;
|
||||
|
||||
let json = encodeURIComponent(JSON.stringify(filter));
|
||||
this.$http.get(`${this.url}?filter=${json}`).then(
|
||||
|
||||
let url;
|
||||
if (this.url.includes('?'))
|
||||
url = `${this.url}&filter=${json}`;
|
||||
else
|
||||
url = `${this.url}?filter=${json}`;
|
||||
|
||||
this.$http.get(url).then(
|
||||
json => this.onSelectionRequest(json.data),
|
||||
() => this.onSelectionRequest()
|
||||
);
|
||||
|
@ -282,7 +288,7 @@ export default class Autocomplete extends Field {
|
|||
this.refreshSelection();
|
||||
}
|
||||
}
|
||||
Autocomplete.$inject = ['$element', '$scope', '$compile', '$transclude'];
|
||||
Autocomplete.$inject = ['$element', '$scope', '$transclude'];
|
||||
|
||||
ngModule.vnComponent('vnAutocomplete', {
|
||||
template: require('./index.html'),
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
class="dropdown"
|
||||
ng-click="$ctrl.onContainerClick($event)">
|
||||
</ul>
|
||||
<div
|
||||
ng-if="$ctrl.statusText"
|
||||
<div
|
||||
ng-if="$ctrl.statusText"
|
||||
ng-click="$ctrl.onLoadMoreClick($event)"
|
||||
class="status"
|
||||
translate>
|
||||
{{$ctrl.statusText}}
|
||||
</div>
|
||||
</div>
|
||||
</default>
|
||||
</default>
|
||||
|
|
|
@ -3,8 +3,8 @@ import FormInput from '../form-input';
|
|||
import './style.scss';
|
||||
|
||||
export default class Field extends FormInput {
|
||||
constructor($element, $scope) {
|
||||
super($element, $scope);
|
||||
constructor($element, $scope, $transclude) {
|
||||
super($element, $scope, $transclude);
|
||||
|
||||
this.prefix = null;
|
||||
this.suffix = null;
|
||||
|
@ -197,7 +197,7 @@ export default class Field extends FormInput {
|
|||
});
|
||||
}
|
||||
}
|
||||
Field.$inject = ['$element', '$scope'];
|
||||
Field.$inject = ['$element', '$scope', '$transclude'];
|
||||
|
||||
ngModule.vnComponent('vnField', {
|
||||
template: require('./index.html'),
|
||||
|
|
|
@ -51,6 +51,7 @@ import './textarea';
|
|||
import './th';
|
||||
import './treeview';
|
||||
import './wday-picker';
|
||||
import './worker-autocomplete';
|
||||
import './datalist';
|
||||
import './contextmenu';
|
||||
import './rating';
|
||||
|
|
|
@ -27,7 +27,7 @@ export default class Controller extends Component {
|
|||
setTimeout(() => element.classList.add('shown'), 30);
|
||||
shape.element = element;
|
||||
|
||||
if (data.additionalData) {
|
||||
if (data.additionalData && this.vnToken.token) {
|
||||
this.additionalData = data.additionalData;
|
||||
let supportButton = document.createElement('i');
|
||||
supportButton.setAttribute('class', 'material-icons clickable');
|
||||
|
|
|
@ -7,12 +7,15 @@ export default class Controller extends Dialog {
|
|||
}
|
||||
|
||||
responseHandler(response) {
|
||||
if (response !== 'accept')
|
||||
return super.responseHandler(response);
|
||||
|
||||
this.$http.post('Ostickets/send-to-support', {
|
||||
reason: this.reason,
|
||||
additionalData: this.additionalData
|
||||
})
|
||||
.then(() => super.responseHandler(response))
|
||||
.then(() => this.vnApp.showSuccess(this.$t('Email sended!')));
|
||||
.then(() => super.responseHandler(response))
|
||||
.then(() => this.vnApp.showSuccess(this.$t('Email sended!')));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
<tpl-item>
|
||||
<div>
|
||||
{{name}}
|
||||
</div>
|
||||
<div class="text-caption text-secondary">
|
||||
{{nickname}}, {{code}}
|
||||
</div>
|
||||
</tpl-item>
|
|
@ -0,0 +1,40 @@
|
|||
import ngModule from '../../module';
|
||||
import Autocomplete from '../autocomplete';
|
||||
|
||||
export default class WorkerAutocomplete extends Autocomplete {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
super.$onInit();
|
||||
|
||||
let url = 'Workers/search';
|
||||
if (this.departments) {
|
||||
const parameter = encodeURIComponent(JSON.stringify(this.departments));
|
||||
url = `Workers/search?departmentCodes=${parameter}`;
|
||||
}
|
||||
Object.assign(this, {
|
||||
label: 'Worker',
|
||||
url,
|
||||
searchFunction: function({$search}) {
|
||||
return {and: [
|
||||
{'active': {neq: false}},
|
||||
{or: [
|
||||
{'name': $search},
|
||||
{'nickname': {like: '%' + $search + '%'}},
|
||||
{'code': {like: $search + '%'}}
|
||||
]}
|
||||
]};
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnWorkerAutocomplete', {
|
||||
slotTemplate: require('./index.html'),
|
||||
controller: WorkerAutocomplete,
|
||||
bindings: {
|
||||
departments: '<?'
|
||||
},
|
||||
});
|
|
@ -5,6 +5,10 @@ export const validators = {
|
|||
if (validator.isEmpty(value ? String(value) : ''))
|
||||
throw new Error(_($translate, `Value can't be empty`));
|
||||
},
|
||||
negative: $translate => {
|
||||
if (validator < 0)
|
||||
throw new Error(_($translate, `Negative numbers are not allowed. Please enter a valid number.`));
|
||||
},
|
||||
absence: ($translate, value) => {
|
||||
if (!validator.isEmpty(value))
|
||||
throw new Error(_($translate, `Value should be empty`));
|
||||
|
@ -104,9 +108,8 @@ export function checkNull($translate, value, conf) {
|
|||
export function _($translate, text, params = []) {
|
||||
text = $translate.instant(text);
|
||||
|
||||
for (let i = 0; i < params.length; i++) {
|
||||
for (let i = 0; i < params.length; i++)
|
||||
text = text.replace('%s', params[i]);
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ Value can't be empty: El valor no puede estar vacío
|
|||
Value should be empty: El valor debe estar vacío
|
||||
Value should be integer: El valor debe ser entero
|
||||
Value should be a number: El valor debe ser numérico
|
||||
Negative numbers are not allowed. Please enter a valid number: No se permiten números negativos. Por favor, ingrese un número válido
|
||||
Invalid value: Valor incorrecto
|
||||
Value can't be blank: El valor no puede estar en blanco
|
||||
Value can't be null: El valor no puede ser nulo
|
||||
|
|
|
@ -60,7 +60,7 @@ export default class Token {
|
|||
if (!this.token) return;
|
||||
const created = storage.getItem('vnTokenCreated');
|
||||
this.created = created && new Date(created);
|
||||
this.renewPeriod = storage.getItem('vnTokenRenewPeriod');
|
||||
this.ttl = storage.getItem('vnTokenTtl');
|
||||
}
|
||||
|
||||
setStorage(storage, token, created, ttl) {
|
||||
|
|
|
@ -179,11 +179,13 @@
|
|||
"You can not use the same password": "You can not use the same password",
|
||||
"Valid priorities": "Valid priorities: %d",
|
||||
"Negative basis of tickets": "Negative basis of tickets: {{ticketsIds}}",
|
||||
"This ticket cannot be left empty.": "This ticket cannot be left empty. %s",
|
||||
"This ticket cannot be left empty.": "This ticket cannot be left empty. %s",
|
||||
"Social name should be uppercase": "Social name should be uppercase",
|
||||
"Street should be uppercase": "Street should be uppercase",
|
||||
"You don't have enough privileges.": "You don't have enough privileges.",
|
||||
"This ticket is locked.": "This ticket is locked.",
|
||||
"This ticket is not editable.": "This ticket is not editable.",
|
||||
"The ticket doesn't exist.": "The ticket doesn't exist."
|
||||
"The ticket doesn't exist.": "The ticket doesn't exist.",
|
||||
"The sales do not exists": "The sales do not exists",
|
||||
"Ticket without Route": "Ticket without route"
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"Invalid email": "Invalid email",
|
||||
"Phone cannot be blank": "Phone cannot be blank",
|
||||
"The credit must be an integer greater than or equal to zero": "The credit must be an integer greater than or equal to zero",
|
||||
<<<<<<< HEAD
|
||||
"The grade must be an integer greater than or equal to zero": "The grade must be an integer greater than or equal to zero",
|
||||
"Description should have maximum of 45 characters": "Description should have maximum of 45 characters",
|
||||
"Amount cannot be zero": "Amount cannot be zero",
|
||||
|
@ -23,4 +24,302 @@
|
|||
"Description cannot be blank": "Description cannot be blank",
|
||||
"Agency cannot be blank": "Agency cannot be blank",
|
||||
"The renew period has not been exceeded": "The renew period has not been exceeded"
|
||||
}
|
||||
}
|
||||
=======
|
||||
"The grade must be similar to the last one": "El grade debe ser similar al último",
|
||||
"Only manager can change the credit": "Solo el gerente puede cambiar el credito de este cliente",
|
||||
"Name cannot be blank": "El nombre no puede estar en blanco",
|
||||
"Phone cannot be blank": "El teléfono no puede estar en blanco",
|
||||
"Period cannot be blank": "El periodo no puede estar en blanco",
|
||||
"Choose a company": "Selecciona una empresa",
|
||||
"Se debe rellenar el campo de texto": "Se debe rellenar el campo de texto",
|
||||
"Description should have maximum of 45 characters": "La descripción debe tener maximo 45 caracteres",
|
||||
"Cannot be blank": "El campo no puede estar en blanco",
|
||||
"The grade must be an integer greater than or equal to zero": "El grade debe ser un entero mayor o igual a cero",
|
||||
"Sample type cannot be blank": "El tipo de plantilla no puede quedar en blanco",
|
||||
"Description cannot be blank": "Se debe rellenar el campo de texto",
|
||||
"The new quantity should be smaller than the old one": "La nueva cantidad debe de ser menor que la anterior",
|
||||
"The value should not be greater than 100%": "El valor no debe de ser mayor de 100%",
|
||||
"The value should be a number": "El valor debe ser un numero",
|
||||
"This order is not editable": "Esta orden no se puede modificar",
|
||||
"You can't create an order for a frozen client": "No puedes crear una orden para un cliente congelado",
|
||||
"You can't create an order for a client that has a debt": "No puedes crear una orden para un cliente con deuda",
|
||||
"is not a valid date": "No es una fecha valida",
|
||||
"Barcode must be unique": "El código de barras debe ser único",
|
||||
"The warehouse can't be repeated": "El almacén no puede repetirse",
|
||||
"The tag or priority can't be repeated for an item": "El tag o prioridad no puede repetirse para un item",
|
||||
"The observation type can't be repeated": "El tipo de observación no puede repetirse",
|
||||
"A claim with that sale already exists": "Ya existe una reclamación para esta línea",
|
||||
"You don't have enough privileges to change that field": "No tienes permisos para cambiar ese campo",
|
||||
"Warehouse cannot be blank": "El almacén no puede quedar en blanco",
|
||||
"Agency cannot be blank": "La agencia no puede quedar en blanco",
|
||||
"Not enough privileges to edit a client with verified data": "No tienes permisos para hacer cambios en un cliente con datos comprobados",
|
||||
"This address doesn't exist": "Este consignatario no existe",
|
||||
"You must delete the claim id %d first": "Antes debes borrar la reclamación %d",
|
||||
"You don't have enough privileges": "No tienes suficientes permisos",
|
||||
"Cannot check Equalization Tax in this NIF/CIF": "No se puede marcar RE en este NIF/CIF",
|
||||
"You can't make changes on the basic data of an confirmed order or with rows": "No puedes cambiar los datos basicos de una orden con artículos",
|
||||
"INVALID_USER_NAME": "El nombre de usuario solo debe contener letras minúsculas o, a partir del segundo carácter, números o subguiones, no esta permitido el uso de la letra ñ",
|
||||
"You can't create a ticket for a frozen client": "No puedes crear un ticket para un cliente congelado",
|
||||
"You can't create a ticket for a inactive client": "No puedes crear un ticket para un cliente inactivo",
|
||||
"Tag value cannot be blank": "El valor del tag no puede quedar en blanco",
|
||||
"ORDER_EMPTY": "Cesta vacía",
|
||||
"You don't have enough privileges to do that": "No tienes permisos para cambiar esto",
|
||||
"NO SE PUEDE DESACTIVAR EL CONSIGNAT": "NO SE PUEDE DESACTIVAR EL CONSIGNAT",
|
||||
"Error. El NIF/CIF está repetido": "Error. El NIF/CIF está repetido",
|
||||
"Street cannot be empty": "Dirección no puede estar en blanco",
|
||||
"City cannot be empty": "Cuidad no puede estar en blanco",
|
||||
"Code cannot be blank": "Código no puede estar en blanco",
|
||||
"You cannot remove this department": "No puedes eliminar este departamento",
|
||||
"The extension must be unique": "La extensión debe ser unica",
|
||||
"The secret can't be blank": "La contraseña no puede estar en blanco",
|
||||
"We weren't able to send this SMS": "No hemos podido enviar el SMS",
|
||||
"This client can't be invoiced": "Este cliente no puede ser facturado",
|
||||
"This ticket can't be invoiced": "Este ticket no puede ser facturado",
|
||||
"You cannot add or modify services to an invoiced ticket": "No puedes añadir o modificar servicios a un ticket facturado",
|
||||
"This ticket can not be modified": "Este ticket no puede ser modificado",
|
||||
"The introduced hour already exists": "Esta hora ya ha sido introducida",
|
||||
"INFINITE_LOOP": "Existe una dependencia entre dos Jefes",
|
||||
"The sales of the receiver ticket can't be modified": "Las lineas del ticket al que envias no pueden ser modificadas",
|
||||
"NO_AGENCY_AVAILABLE": "No hay una zona de reparto disponible con estos parámetros",
|
||||
"ERROR_PAST_SHIPMENT": "No puedes seleccionar una fecha de envío en pasado",
|
||||
"The current ticket can't be modified": "El ticket actual no puede ser modificado",
|
||||
"The current claim can't be modified": "La reclamación actual no puede ser modificada",
|
||||
"The sales of this ticket can't be modified": "Las lineas de este ticket no pueden ser modificadas",
|
||||
"The sales do not exists": "La(s) línea(s) seleccionada(s) no existe(n)",
|
||||
"Please select at least one sale": "Por favor selecciona al menos una linea",
|
||||
"All sales must belong to the same ticket": "Todas las lineas deben pertenecer al mismo ticket",
|
||||
"NO_ZONE_FOR_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
|
||||
"This item doesn't exists": "El artículo no existe",
|
||||
"NOT_ZONE_WITH_THIS_PARAMETERS": "Para este día no hay ninguna zona configurada",
|
||||
"Extension format is invalid": "El formato de la extensión es inválido",
|
||||
"Invalid parameters to create a new ticket": "Parámetros inválidos para crear un nuevo ticket",
|
||||
"This item is not available": "Este artículo no está disponible",
|
||||
"This postcode already exists": "Este código postal ya existe",
|
||||
"Concept cannot be blank": "El concepto no puede quedar en blanco",
|
||||
"File doesn't exists": "El archivo no existe",
|
||||
"You don't have privileges to change the zone": "No tienes permisos para cambiar la zona o para esos parámetros hay más de una opción de envío, hable con las agencias",
|
||||
"This ticket is already on weekly tickets": "Este ticket ya está en tickets programados",
|
||||
"Ticket id cannot be blank": "El id de ticket no puede quedar en blanco",
|
||||
"Weekday cannot be blank": "El día de la semana no puede quedar en blanco",
|
||||
"You can't delete a confirmed order": "No puedes borrar un pedido confirmado",
|
||||
"The social name has an invalid format": "El nombre fiscal tiene un formato incorrecto",
|
||||
"Invalid quantity": "Cantidad invalida",
|
||||
"This postal code is not valid": "This postal code is not valid",
|
||||
"is invalid": "is invalid",
|
||||
"The postcode doesn't exist. Please enter a correct one": "El código postal no existe. Por favor, introduce uno correcto",
|
||||
"The department name can't be repeated": "El nombre del departamento no puede repetirse",
|
||||
"This phone already exists": "Este teléfono ya existe",
|
||||
"You cannot move a parent to its own sons": "No puedes mover un elemento padre a uno de sus hijos",
|
||||
"You can't create a claim for a removed ticket": "No puedes crear una reclamación para un ticket eliminado",
|
||||
"You cannot delete a ticket that part of it is being prepared": "No puedes eliminar un ticket en el que una parte que está siendo preparada",
|
||||
"You must delete all the buy requests first": "Debes eliminar todas las peticiones de compra primero",
|
||||
"You should specify a date": "Debes especificar una fecha",
|
||||
"You should specify at least a start or end date": "Debes especificar al menos una fecha de inicio o de fín",
|
||||
"Start date should be lower than end date": "La fecha de inicio debe ser menor que la fecha de fín",
|
||||
"You should mark at least one week day": "Debes marcar al menos un día de la semana",
|
||||
"Swift / BIC can't be empty": "Swift / BIC no puede estar vacío",
|
||||
"Customs agent is required for a non UEE member": "El agente de aduanas es requerido para los clientes extracomunitarios",
|
||||
"Incoterms is required for a non UEE member": "El incoterms es requerido para los clientes extracomunitarios",
|
||||
"Deleted sales from ticket": "He eliminado las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{deletions}}}",
|
||||
"Added sale to ticket": "He añadido la siguiente linea al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{addition}}}",
|
||||
"Changed sale discount": "He cambiado el descuento de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||
"Created claim": "He creado la reclamación [{{claimId}}]({{{claimUrl}}}) de las siguientes lineas del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||
"Changed sale price": "He cambiado el precio de [{{itemId}} {{concept}}]({{{itemUrl}}}) ({{quantity}}) de {{oldPrice}}€ ➔ *{{newPrice}}€* del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||
"Changed sale quantity": "He cambiado la cantidad de [{{itemId}} {{concept}}]({{{itemUrl}}}) de {{oldQuantity}} ➔ *{{newQuantity}}* del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||
"State": "Estado",
|
||||
"regular": "normal",
|
||||
"reserved": "reservado",
|
||||
"Changed sale reserved state": "He cambiado el estado reservado de las siguientes lineas al ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||
"Bought units from buy request": "Se ha comprado {{quantity}} unidades de [{{itemId}} {{concept}}]({{{urlItem}}}) para el ticket id [{{ticketId}}]({{{url}}})",
|
||||
"Deny buy request": "Se ha rechazado la petición de compra para el ticket id [{{ticketId}}]({{{url}}}). Motivo: {{observation}}",
|
||||
"MESSAGE_INSURANCE_CHANGE": "He cambiado el crédito asegurado del cliente [{{clientName}} ({{clientId}})]({{{url}}}) a *{{credit}} €*",
|
||||
"Changed client paymethod": "He cambiado la forma de pago del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
|
||||
"Sent units from ticket": "Envio *{{quantity}}* unidades de [{{concept}} ({{itemId}})]({{{itemUrl}}}) a *\"{{nickname}}\"* provenientes del ticket id [{{ticketId}}]({{{ticketUrl}}})",
|
||||
"Change quantity": "{{concept}} cambia de {{oldQuantity}} a {{newQuantity}}",
|
||||
"Claim will be picked": "Se recogerá el género de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}*",
|
||||
"Claim state has changed to incomplete": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *incompleta*",
|
||||
"Claim state has changed to canceled": "Se ha cambiado el estado de la reclamación [({{claimId}})]({{{claimUrl}}}) del cliente *{{clientName}}* a *anulado*",
|
||||
"Client checked as validated despite of duplication": "Cliente comprobado a pesar de que existe el cliente id {{clientId}}",
|
||||
"ORDER_ROW_UNAVAILABLE": "No hay disponibilidad de este producto",
|
||||
"Distance must be lesser than 1000": "La distancia debe ser inferior a 1000",
|
||||
"This ticket is deleted": "Este ticket está eliminado",
|
||||
"Unable to clone this travel": "No ha sido posible clonar este travel",
|
||||
"This thermograph id already exists": "La id del termógrafo ya existe",
|
||||
"Choose a date range or days forward": "Selecciona un rango de fechas o días en adelante",
|
||||
"ORDER_ALREADY_CONFIRMED": "ORDER_ALREADY_CONFIRMED",
|
||||
"Invalid password": "Invalid password",
|
||||
"Password does not meet requirements": "La contraseña no cumple los requisitos",
|
||||
"Role already assigned": "Role already assigned",
|
||||
"Invalid role name": "Invalid role name",
|
||||
"Role name must be written in camelCase": "Role name must be written in camelCase",
|
||||
"Email already exists": "Email already exists",
|
||||
"User already exists": "User already exists",
|
||||
"Absence change notification on the labour calendar": "Notificacion de cambio de ausencia en el calendario laboral",
|
||||
"Record of hours week": "Registro de horas semana {{week}} año {{year}} ",
|
||||
"Created absence": "El empleado <strong>{{author}}</strong> ha añadido una ausencia de tipo '{{absenceType}}' a <a href='{{{workerUrl}}}'><strong>{{employee}}</strong></a> para el día {{dated}}.",
|
||||
"Deleted absence": "El empleado <strong>{{author}}</strong> ha eliminado una ausencia de tipo '{{absenceType}}' a <a href='{{{workerUrl}}}'><strong>{{employee}}</strong></a> del día {{dated}}.",
|
||||
"I have deleted the ticket id": "He eliminado el ticket id [{{id}}]({{{url}}})",
|
||||
"I have restored the ticket id": "He restaurado el ticket id [{{id}}]({{{url}}})",
|
||||
"You can only restore a ticket within the first hour after deletion": "Únicamente puedes restaurar el ticket dentro de la primera hora después de su eliminación",
|
||||
"Changed this data from the ticket": "He cambiado estos datos del ticket [{{ticketId}}]({{{ticketUrl}}}): {{{changes}}}",
|
||||
"agencyModeFk": "Agencia",
|
||||
"clientFk": "Cliente",
|
||||
"zoneFk": "Zona",
|
||||
"warehouseFk": "Almacén",
|
||||
"shipped": "F. envío",
|
||||
"landed": "F. entrega",
|
||||
"addressFk": "Consignatario",
|
||||
"companyFk": "Empresa",
|
||||
"The social name cannot be empty": "La razón social no puede quedar en blanco",
|
||||
"The nif cannot be empty": "El NIF no puede quedar en blanco",
|
||||
"You need to fill sage information before you check verified data": "Debes rellenar la información de sage antes de marcar datos comprobados",
|
||||
"ASSIGN_ZONE_FIRST": "Asigna una zona primero",
|
||||
"Amount cannot be zero": "El importe no puede ser cero",
|
||||
"Company has to be official": "Empresa inválida",
|
||||
"You can not select this payment method without a registered bankery account": "No se puede utilizar este método de pago si no has registrado una cuenta bancaria",
|
||||
"Action not allowed on the test environment": "Esta acción no está permitida en el entorno de pruebas",
|
||||
"The selected ticket is not suitable for this route": "El ticket seleccionado no es apto para esta ruta",
|
||||
"New ticket request has been created with price": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}* y un precio de *{{price}} €*",
|
||||
"New ticket request has been created": "Se ha creado una nueva petición de compra '{{description}}' para el día *{{shipped}}*, con una cantidad de *{{quantity}}*",
|
||||
"Swift / BIC cannot be empty": "Swift / BIC no puede estar vacío",
|
||||
"This BIC already exist.": "Este BIC ya existe.",
|
||||
"That item doesn't exists": "Ese artículo no existe",
|
||||
"There's a new urgent ticket:": "Hay un nuevo ticket urgente:",
|
||||
"Invalid account": "Cuenta inválida",
|
||||
"Compensation account is empty": "La cuenta para compensar está vacia",
|
||||
"This genus already exist": "Este genus ya existe",
|
||||
"This specie already exist": "Esta especie ya existe",
|
||||
"Client assignment has changed": "He cambiado el comercial ~*\"<{{previousWorkerName}}>\"*~ por *\"<{{currentWorkerName}}>\"* del cliente [{{clientName}} ({{clientId}})]({{{url}}})",
|
||||
"None": "Ninguno",
|
||||
"The contract was not active during the selected date": "El contrato no estaba activo durante la fecha seleccionada",
|
||||
"Cannot add more than one '1/2 day vacation'": "No puedes añadir más de un 'Vacaciones 1/2 dia'",
|
||||
"This document already exists on this ticket": "Este documento ya existe en el ticket",
|
||||
"Some of the selected tickets are not billable": "Algunos de los tickets seleccionados no son facturables",
|
||||
"You can't invoice tickets from multiple clients": "No puedes facturar tickets de multiples clientes",
|
||||
"nickname": "nickname",
|
||||
"INACTIVE_PROVIDER": "Proveedor inactivo",
|
||||
"This client is not invoiceable": "Este cliente no es facturable",
|
||||
"serial non editable": "Esta serie no permite asignar la referencia",
|
||||
"Max shipped required": "La fecha límite es requerida",
|
||||
"Can't invoice to future": "No se puede facturar a futuro",
|
||||
"Can't invoice to past": "No se puede facturar a pasado",
|
||||
"This ticket is already invoiced": "Este ticket ya está facturado",
|
||||
"A ticket with an amount of zero can't be invoiced": "No se puede facturar un ticket con importe cero",
|
||||
"A ticket with a negative base can't be invoiced": "No se puede facturar un ticket con una base negativa",
|
||||
"Global invoicing failed": "[Facturación global] No se han podido facturar algunos clientes",
|
||||
"Wasn't able to invoice the following clients": "No se han podido facturar los siguientes clientes",
|
||||
"Can't verify data unless the client has a business type": "No se puede verificar datos de un cliente que no tiene tipo de negocio",
|
||||
"You don't have enough privileges to set this credit amount": "No tienes suficientes privilegios para establecer esta cantidad de crédito",
|
||||
"You can't change the credit set to zero from a financialBoss": "No puedes cambiar el cŕedito establecido a cero por un jefe de finanzas",
|
||||
"Amounts do not match": "Las cantidades no coinciden",
|
||||
"The PDF document does not exist": "El documento PDF no existe. Prueba a regenerarlo desde la opción 'Regenerar PDF factura'",
|
||||
"The type of business must be filled in basic data": "El tipo de negocio debe estar rellenado en datos básicos",
|
||||
"You can't create a claim from a ticket delivered more than seven days ago": "No puedes crear una reclamación de un ticket entregado hace más de siete días",
|
||||
"The worker has hours recorded that day": "El trabajador tiene horas fichadas ese día",
|
||||
"The worker has a marked absence that day": "El trabajador tiene marcada una ausencia ese día",
|
||||
"You can not modify is pay method checked": "No se puede modificar el campo método de pago validado",
|
||||
"Can't transfer claimed sales": "No puedes transferir lineas reclamadas",
|
||||
"You don't have privileges to create refund": "No tienes permisos para crear un abono",
|
||||
"The item is required": "El artículo es requerido",
|
||||
"The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
|
||||
"date in the future": "Fecha en el futuro",
|
||||
"reference duplicated": "Referencia duplicada",
|
||||
"This ticket is already a refund": "Este ticket ya es un abono",
|
||||
"isWithoutNegatives": "isWithoutNegatives",
|
||||
"routeFk": "routeFk",
|
||||
"Can't change the password of another worker": "No se puede cambiar la contraseña de otro trabajador",
|
||||
"No hay un contrato en vigor": "No hay un contrato en vigor",
|
||||
"No se permite fichar a futuro": "No se permite fichar a futuro",
|
||||
"No está permitido trabajar": "No está permitido trabajar",
|
||||
"Fichadas impares": "Fichadas impares",
|
||||
"Descanso diario 12h.": "Descanso diario 12h.",
|
||||
"Descanso semanal 36h. / 72h.": "Descanso semanal 36h. / 72h.",
|
||||
"Dirección incorrecta": "Dirección incorrecta",
|
||||
"Modifiable user details only by an administrator": "Detalles de usuario modificables solo por un administrador",
|
||||
"Modifiable password only via recovery or by an administrator": "Contraseña modificable solo a través de la recuperación o por un administrador",
|
||||
"Not enough privileges to edit a client": "No tienes suficientes privilegios para editar un cliente",
|
||||
"This route does not exists": "Esta ruta no existe",
|
||||
"Claim pickup order sent": "Reclamación Orden de recogida enviada [{{claimId}}]({{{claimUrl}}}) al cliente *{{clientName}}*",
|
||||
"You don't have grant privilege": "No tienes privilegios para dar privilegios",
|
||||
"You don't own the role and you can't assign it to another user": "No eres el propietario del rol y no puedes asignarlo a otro usuario",
|
||||
"Ticket merged": "Ticket [{{originId}}]({{{originFullPath}}}) ({{{originDated}}}) fusionado con [{{destinationId}}]({{{destinationFullPath}}}) ({{{destinationDated}}})",
|
||||
"Already has this status": "Ya tiene este estado",
|
||||
"There aren't records for this week": "No existen registros para esta semana",
|
||||
"Empty data source": "Origen de datos vacio",
|
||||
"App locked": "Aplicación bloqueada por el usuario {{userId}}",
|
||||
"Email verify": "Correo de verificación",
|
||||
"Landing cannot be lesser than shipment": "Landing cannot be lesser than shipment",
|
||||
"Receipt's bank was not found": "No se encontró el banco del recibo",
|
||||
"This receipt was not compensated": "Este recibo no ha sido compensado",
|
||||
"Client's email was not found": "No se encontró el email del cliente",
|
||||
"Negative basis": "Base negativa",
|
||||
"This worker code already exists": "Este codigo de trabajador ya existe",
|
||||
"This personal mail already exists": "Este correo personal ya existe",
|
||||
"This worker already exists": "Este trabajador ya existe",
|
||||
"App name does not exist": "El nombre de aplicación no es válido",
|
||||
"Try again": "Vuelve a intentarlo",
|
||||
"Aplicación bloqueada por el usuario 9": "Aplicación bloqueada por el usuario 9",
|
||||
"Failed to upload delivery note": "Error al subir albarán {{id}}",
|
||||
"The DOCUWARE PDF document does not exists": "El documento PDF Docuware no existe",
|
||||
"It is not possible to modify tracked sales": "No es posible modificar líneas de pedido que se hayan empezado a preparar",
|
||||
"It is not possible to modify sales that their articles are from Floramondo": "No es posible modificar líneas de pedido cuyos artículos sean de Floramondo",
|
||||
"It is not possible to modify cloned sales": "No es posible modificar líneas de pedido clonadas",
|
||||
"A supplier with the same name already exists. Change the country.": "Un proveedor con el mismo nombre ya existe. Cambie el país.",
|
||||
"There is no assigned email for this client": "No hay correo asignado para este cliente",
|
||||
"Exists an invoice with a future date": "Existe una factura con fecha posterior",
|
||||
"Invoice date can't be less than max date": "La fecha de factura no puede ser inferior a la fecha límite",
|
||||
"Warehouse inventory not set": "El almacén inventario no está establecido",
|
||||
"This locker has already been assigned": "Esta taquilla ya ha sido asignada",
|
||||
"Tickets with associated refunds": "No se pueden borrar tickets con abonos asociados. Este ticket está asociado al abono Nº %d",
|
||||
"Not exist this branch": "La rama no existe",
|
||||
"This ticket cannot be signed because it has not been boxed": "Este ticket no puede firmarse porque no ha sido encajado",
|
||||
"Collection does not exist": "La colección no existe",
|
||||
"Cannot obtain exclusive lock": "No se puede obtener un bloqueo exclusivo",
|
||||
"Insert a date range": "Inserte un rango de fechas",
|
||||
"Added observation": "{{user}} añadió esta observacion: {{text}}",
|
||||
"Comment added to client": "Observación añadida al cliente {{clientFk}}",
|
||||
"Invalid auth code": "Código de verificación incorrecto",
|
||||
"Invalid or expired verification code": "Código de verificación incorrecto o expirado",
|
||||
"Cannot create a new claimBeginning from a different ticket": "No se puede crear una línea de reclamación de un ticket diferente al origen",
|
||||
"company": "Compañía",
|
||||
"country": "País",
|
||||
"clientId": "Id cliente",
|
||||
"clientSocialName": "Cliente",
|
||||
"amount": "Importe",
|
||||
"taxableBase": "Base",
|
||||
"ticketFk": "Id ticket",
|
||||
"isActive": "Activo",
|
||||
"hasToInvoice": "Facturar",
|
||||
"isTaxDataChecked": "Datos comprobados",
|
||||
"comercialId": "Id comercial",
|
||||
"comercialName": "Comercial",
|
||||
"Pass expired": "La contraseña ha caducado, cambiela desde Salix",
|
||||
"Invalid NIF for VIES": "Invalid NIF for VIES",
|
||||
"Ticket does not exist": "Este ticket no existe",
|
||||
"Ticket is already signed": "Este ticket ya ha sido firmado",
|
||||
"Authentication failed": "Autenticación fallida",
|
||||
"You can't use the same password": "No puedes usar la misma contraseña",
|
||||
"You can only add negative amounts in refund tickets": "Solo se puede añadir cantidades negativas en tickets abono",
|
||||
"Fecha fuera de rango": "Fecha fuera de rango",
|
||||
"Error while generating PDF": "Error al generar PDF",
|
||||
"Error when sending mail to client": "Error al enviar el correo al cliente",
|
||||
"Mail not sent": "Se ha producido un fallo al enviar la factura al cliente [{{clientId}}]({{{clientUrl}}}), por favor revisa la dirección de correo electrónico",
|
||||
"The renew period has not been exceeded": "El periodo de renovación no ha sido superado",
|
||||
"Valid priorities": "Prioridades válidas: %d",
|
||||
"Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
|
||||
"You cannot assign an alias that you are not assigned to": "No puede asignar un alias que no tenga asignado",
|
||||
"This ticket cannot be left empty.": "Este ticket no se puede dejar vacío. %s",
|
||||
"The company has not informed the supplier account for bank transfers": "La empresa no tiene informado la cuenta de proveedor para transferencias bancarias",
|
||||
"You cannot assign/remove an alias that you are not assigned to": "No puede asignar/eliminar un alias que no tenga asignado",
|
||||
"This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado",
|
||||
"You don't have enough privileges.": "No tienes suficientes permisos.",
|
||||
"This ticket is locked.": "Este ticket está bloqueado.",
|
||||
"This ticket is not editable.": "Este ticket no es editable.",
|
||||
"The ticket doesn't exist.": "No existe el ticket.",
|
||||
"Social name should be uppercase": "La razón social debe ir en mayúscula",
|
||||
"Street should be uppercase": "La dirección fiscal debe ir en mayúscula",
|
||||
"The response is not a PDF": "La respuesta no es un PDF",
|
||||
"Ticket without Route": "Ticket sin ruta"
|
||||
}
|
||||
>>>>>>> 72a8256aee7bff0be1dd68c8d4cfbe2edcf8ce60
|
||||
|
|
|
@ -1,21 +1,45 @@
|
|||
const validateIban = require('../validateIban');
|
||||
|
||||
describe('IBAN validation', () => {
|
||||
it('should return false for non-IBAN input', () => {
|
||||
let isValid = validateIban('Pepinillos');
|
||||
it('should return false for invalid Spanish IBAN format', () => {
|
||||
let isValid = validateIban('ES00 9999 0000 9999 0000 9999', 'ES');
|
||||
|
||||
expect(isValid).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return false for invalid spanish IBAN input', () => {
|
||||
let isValid = validateIban('ES00 9999 0000 9999 0000 9999');
|
||||
|
||||
expect(isValid).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return true for valid spanish IBAN', () => {
|
||||
let isValid = validateIban('ES91 2100 0418 4502 0005 1332');
|
||||
it('should return true for valid Spanish IBAN', () => {
|
||||
let isValid = validateIban('ES91 2100 0418 4502 0005 1332', 'ES');
|
||||
|
||||
expect(isValid).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return false for invalid Spanish IBAN with incorrect length', () => {
|
||||
let isValid = validateIban('ES91210004184502000513', 'ES');
|
||||
|
||||
expect(isValid).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return false for invalid Spanish IBAN with incorrect module97 result', () => {
|
||||
let isValid = validateIban('ES9121000418450200051331', 'ES');
|
||||
|
||||
expect(isValid).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return true for a non-Spanish countryCode', () => {
|
||||
let isValid = validateIban('DE89370400440532013000', 'AT');
|
||||
|
||||
expect(isValid).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return true for null IBAN', () => {
|
||||
let isValid = validateIban(null, 'ES');
|
||||
|
||||
expect(isValid).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return false for non-string IBAN', () => {
|
||||
let isValid = validateIban(12345, 'ES');
|
||||
|
||||
expect(isValid).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = function(iban) {
|
||||
module.exports = function(iban, countryCode) {
|
||||
if (iban == null) return true;
|
||||
if (typeof iban != 'string') return false;
|
||||
if (countryCode?.toLowerCase() != 'es') return true;
|
||||
|
||||
iban = iban.toUpperCase();
|
||||
iban = trim(iban);
|
||||
|
|
|
@ -25,15 +25,13 @@
|
|||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
disabled="false"
|
||||
ng-model="$ctrl.claim.workerFk"
|
||||
url="Workers/activeWithRole"
|
||||
show-field="nickname"
|
||||
search-function="{firstName: $search}"
|
||||
where="{role: 'salesPerson'}"
|
||||
ng-model="$ctrl.claim.workerFk"
|
||||
departments="['VT']"
|
||||
label="Attended by">
|
||||
</vn-autocomplete>
|
||||
</vn-worker-autocomplete>
|
||||
<vn-autocomplete
|
||||
ng-model="$ctrl.claim.claimStateFk"
|
||||
data="claimStates"
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
data="claimDevelopments"
|
||||
form="form">
|
||||
</vn-watcher>
|
||||
<vn-vertical class="vn-w-md">
|
||||
<vn-vertical class="vn-w-lg">
|
||||
<vn-card class="vn-pa-lg">
|
||||
<vn-vertical>
|
||||
<form name="form">
|
||||
|
@ -66,16 +66,11 @@
|
|||
show-field="description"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
ng-model="claimDevelopment.workerFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
show-field="nickname"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: 'employee'}"
|
||||
label="Worker"
|
||||
rule>
|
||||
</vn-autocomplete>
|
||||
</vn-worker-autocomplete>
|
||||
<vn-autocomplete
|
||||
label="Redelivery"
|
||||
ng-model="claimDevelopment.claimRedeliveryFk"
|
||||
|
@ -118,4 +113,4 @@
|
|||
ng-click="watcher.loadOriginalData()">
|
||||
</vn-button> -->
|
||||
</vn-button-bar>
|
||||
</vn-vertical>
|
||||
</vn-vertical>
|
||||
|
|
|
@ -22,26 +22,18 @@
|
|||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.salesPersonFk"
|
||||
url="Workers/activeWithRole"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: {inq: ['salesTeamBoss', 'salesPerson', 'officeBoss']}}"
|
||||
departments="['VT']"
|
||||
label="Salesperson">
|
||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
</vn-worker-autocomplete>
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.attenderFk"
|
||||
url="Workers/activeWithRole"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: {inq: ['salesTeamBoss', 'salesPerson']}}"
|
||||
departments="['VT']"
|
||||
label="Attended by">
|
||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-worker-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete vn-one
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethod('getAddress', {
|
||||
description: 'Get all activated address with loses client activated',
|
||||
accessType: 'READ',
|
||||
accepts: [],
|
||||
returns: {
|
||||
type: ['object'],
|
||||
root: true
|
||||
},
|
||||
http: {
|
||||
path: `/getAddress`,
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
Self.getAddress = async() => {
|
||||
let getAddressQuery = `
|
||||
SELECT a.id, a.nickname
|
||||
FROM vn.address a
|
||||
JOIN vn.client c ON a.clientFk = c.id AND c.isActive <> FALSE
|
||||
WHERE c.typeFk = 'loses' AND a.isActive <> FALSE;`;
|
||||
|
||||
return result = await Self.rawSql(getAddressQuery);
|
||||
};
|
||||
};
|
|
@ -0,0 +1,9 @@
|
|||
const {models} = require('vn-loopback/server/server');
|
||||
|
||||
describe('getAddress()', () => {
|
||||
it('return list of activated address with loses client activated', async() => {
|
||||
let response = await models.Address.getAddress();
|
||||
|
||||
expect(response.length).toEqual(2);
|
||||
});
|
||||
});
|
|
@ -80,10 +80,15 @@ module.exports = Self => {
|
|||
Object.assign(myOptions, options);
|
||||
|
||||
if (args.zoneFk) {
|
||||
query = `CALL vn.zone_getPostalCode(?)`;
|
||||
const [geos] = await Self.rawSql(query, [args.zoneFk]);
|
||||
for (let geo of geos)
|
||||
postalCode.push(geo.name);
|
||||
let stmts = [];
|
||||
stmts.push(new ParameterizedSQL('CALL vn.zone_getPostalCode(?)', [args.zoneFk]));
|
||||
stmts.push(`SELECT name FROM tmp.zoneNodes`);
|
||||
stmts.push(`DROP TEMPORARY TABLE tmp.zoneNodes`);
|
||||
const sql = ParameterizedSQL.join(stmts, ';');
|
||||
const [results] = await conn.executeStmt(sql);
|
||||
|
||||
for (let result of results)
|
||||
postalCode.push(result.name);
|
||||
}
|
||||
|
||||
const where = buildFilter(ctx.args, (param, value) => {
|
||||
|
|
|
@ -136,5 +136,8 @@
|
|||
},
|
||||
"Incoterms": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Xdiario": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "XDiario",
|
||||
"name": "Xdiario",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
|
@ -7,10 +7,12 @@
|
|||
}
|
||||
},
|
||||
"properties": {
|
||||
"ASIEN": {
|
||||
"id": {
|
||||
"type": "number",
|
||||
"id": true,
|
||||
"description": "Identifier"
|
||||
"id": true
|
||||
},
|
||||
"ASIEN": {
|
||||
"type": "number"
|
||||
},
|
||||
"FECHA": {
|
||||
"type": "date"
|
||||
|
@ -71,6 +73,9 @@
|
|||
},
|
||||
"MONEDAUSO": {
|
||||
"type": "string"
|
||||
},
|
||||
"enlazadoSage": {
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
|
|
|
@ -3,6 +3,8 @@ let getFinalState = require('vn-loopback/util/hook').getFinalState;
|
|||
let isMultiple = require('vn-loopback/util/hook').isMultiple;
|
||||
|
||||
module.exports = Self => {
|
||||
require('../methods/address/getAddress')(Self);
|
||||
|
||||
Self.validateAsync('isEqualizated', cannotHaveET, {
|
||||
message: 'Cannot check Equalization Tax in this NIF/CIF'
|
||||
});
|
||||
|
|
|
@ -90,16 +90,17 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
async function ibanNeedsValidation(err, done) {
|
||||
const filter = {
|
||||
fields: ['code'],
|
||||
where: {id: this.countryFk}
|
||||
};
|
||||
const country = await Self.app.models.Country.findOne(filter);
|
||||
const code = country ? country.code.toLowerCase() : null;
|
||||
if (code != 'es')
|
||||
if (!this.bankEntityFk)
|
||||
return done();
|
||||
|
||||
if (!validateIban(this.iban))
|
||||
const bankEntity = await Self.app.models.BankEntity.findById(this.bankEntityFk);
|
||||
const filter = {
|
||||
fields: ['code'],
|
||||
where: {id: bankEntity.countryFk}
|
||||
};
|
||||
const country = await Self.app.models.Country.findOne(filter);
|
||||
|
||||
if (!validateIban(this.iban, country?.code))
|
||||
err();
|
||||
done();
|
||||
}
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
<vn-card class="vn-pa-lg">
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Comercial Name"
|
||||
vn-one
|
||||
label="Comercial Name"
|
||||
ng-model="$ctrl.client.name"
|
||||
rule
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
<vn-autocomplete
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
ng-model="$ctrl.client.businessTypeFk"
|
||||
url="BusinessTypes"
|
||||
|
@ -37,8 +37,8 @@
|
|||
rule>
|
||||
</vn-textfield>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Email"
|
||||
vn-one
|
||||
label="Email"
|
||||
ng-model="$ctrl.client.email"
|
||||
rule
|
||||
info="You can save multiple emails">
|
||||
|
@ -59,18 +59,15 @@
|
|||
</vn-textfield>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="$ctrl.client.salesPersonFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
departments="['VT']"
|
||||
show-field="nickname"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: 'salesPerson'}"
|
||||
label="Salesperson"
|
||||
vn-acl="salesAssistant">
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
</vn-worker-autocomplete>
|
||||
<vn-autocomplete
|
||||
vn-one
|
||||
ng-model="$ctrl.client.contactChannelFk"
|
||||
data="contactChannels"
|
||||
|
|
|
@ -17,12 +17,11 @@
|
|||
<vn-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.buyerId"
|
||||
url="Workers/activeWithRole"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
search-function="{firstName: $search}"
|
||||
show-field="nickname"
|
||||
value-field="id"
|
||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
||||
label="Buyer">
|
||||
<tpl-item>{{nickname}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
|
|
|
@ -15,18 +15,15 @@
|
|||
rule
|
||||
vn-focus>
|
||||
</vn-textfield>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
label="Salesperson"
|
||||
ng-model="$ctrl.client.salesPersonFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
search-function="{firstName: $search}"
|
||||
show-field="firstName"
|
||||
where="{role: 'salesPerson'}">
|
||||
<tpl-item>{{firstName}} {{lastName}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
departments="['VT']"
|
||||
show-field="nickname">
|
||||
</vn-worker-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-autocomplete
|
||||
<vn-autocomplete
|
||||
vn-id="businessTypeFk"
|
||||
ng-model="$ctrl.client.businessTypeFk"
|
||||
url="BusinessTypes"
|
||||
|
@ -68,7 +65,7 @@
|
|||
show-field="code"
|
||||
rule>
|
||||
<tpl-item>
|
||||
{{code}} - {{town.name}} ({{town.province.name}},
|
||||
{{code}} - {{town.name}} ({{town.province.name}},
|
||||
{{town.province.country.country}})
|
||||
</tpl-item>
|
||||
<append>
|
||||
|
@ -82,7 +79,7 @@
|
|||
</append>
|
||||
</vn-datalist>
|
||||
<vn-datalist
|
||||
vn-id="town"
|
||||
vn-id="town"
|
||||
label="City"
|
||||
ng-model="$ctrl.client.city"
|
||||
selection="$ctrl.town"
|
||||
|
@ -90,7 +87,7 @@
|
|||
fields="['id', 'name', 'provinceFk']"
|
||||
value-field="name">
|
||||
<tpl-item>
|
||||
{{name}}, {{province.name}}
|
||||
{{name}}, {{province.name}}
|
||||
({{province.country.country}})
|
||||
</tpl-item>
|
||||
</vn-datalist>
|
||||
|
@ -150,4 +147,4 @@
|
|||
<vn-geo-postcode
|
||||
vn-id="postcode"
|
||||
on-response="$ctrl.onResponse($response)">
|
||||
</vn-geo-postcode>
|
||||
</vn-geo-postcode>
|
||||
|
|
|
@ -14,17 +14,12 @@
|
|||
vn-one label="Name"
|
||||
ng-model="filter.name">
|
||||
</vn-textfield>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.salesPersonFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
search-function="{firstName: $search}"
|
||||
show-field="firstName"
|
||||
value-field="id"
|
||||
where="{role: 'salesPerson'}"
|
||||
departments="['VT']"
|
||||
label="Salesperson">
|
||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-worker-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-textfield
|
||||
|
|
|
@ -255,7 +255,7 @@
|
|||
value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}">
|
||||
</vn-label-value>
|
||||
<vn-label-value label="Claims"
|
||||
value="{{$ctrl.claimingRate($ctrl.summary.claimsRatio.claimingRate) | percentage}}">
|
||||
value="{{$ctrl.claimingRate($ctrl.summary.claimsRatio.claimingRate / 100) | percentage}}">
|
||||
</vn-label-value>
|
||||
</vn-one>
|
||||
<vn-one>
|
||||
|
|
|
@ -4,14 +4,14 @@ columns:
|
|||
dated: fecha
|
||||
reference: referencia
|
||||
invoiceNumber: número factura
|
||||
isBooked: reservado
|
||||
isBooked: contabilizado
|
||||
isExcludedFromAvailable: excluido del disponible
|
||||
notes: notas
|
||||
isConfirmed: confirmado
|
||||
isVirtual: virtual
|
||||
isRaid: incursión
|
||||
isRaid: redada
|
||||
commission: comisión
|
||||
isOrdered: precio3
|
||||
isOrdered: pedida
|
||||
created: creado
|
||||
observation: observación
|
||||
isBlocked: bloqueado
|
||||
|
|
|
@ -85,7 +85,6 @@ module.exports = Self => {
|
|||
price2: buyUltimate.price2,
|
||||
price3: buyUltimate.price3,
|
||||
minPrice: buyUltimate.minPrice,
|
||||
printedStickers: args.printedStickers,
|
||||
workerFk: buyUltimate.workerFk,
|
||||
isChecked: buyUltimate.isChecked,
|
||||
isPickedOff: buyUltimate.isPickedOff,
|
||||
|
@ -95,6 +94,8 @@ module.exports = Self => {
|
|||
deliveryFk: buyUltimate.deliveryFk,
|
||||
itemOriginalFk: buyUltimate.itemOriginalFk
|
||||
}, myOptions);
|
||||
if (buy)
|
||||
await buy.updateAttribute('printedStickers', args.printedStickers, myOptions);
|
||||
}
|
||||
|
||||
if (tx) await tx.commit();
|
||||
|
|
|
@ -33,7 +33,6 @@ module.exports = Self => {
|
|||
const models = Self.app.models;
|
||||
const where = {isActive: true};
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
|
@ -47,34 +46,30 @@ module.exports = Self => {
|
|||
}
|
||||
}]
|
||||
}, myOptions);
|
||||
|
||||
const travel = entry.travel();
|
||||
|
||||
const stmts = [];
|
||||
let stmt;
|
||||
|
||||
stmt = new ParameterizedSQL(`CALL buyUltimate(?, ?)`, [
|
||||
travel.warehouseInFk,
|
||||
travel.landed
|
||||
]);
|
||||
stmts.push(stmt);
|
||||
|
||||
stmts.push('DROP TEMPORARY TABLE IF EXISTS tmp.item');
|
||||
stmt = new ParameterizedSQL(
|
||||
`CREATE TEMPORARY TABLE tmp.item
|
||||
(PRIMARY KEY (id))
|
||||
SELECT
|
||||
SELECT
|
||||
i.*,
|
||||
p.name AS producerName,
|
||||
nk.name AS inkName
|
||||
FROM item i
|
||||
JOIN producer p ON p.id = i.producerFk
|
||||
JOIN ink nk ON nk.id = i.inkFk
|
||||
LEFT JOIN producer p ON p.id = i.producerFk
|
||||
LEFT JOIN ink nk ON nk.id = i.inkFk
|
||||
JOIN tmp.buyUltimate bu ON i.id = bu.itemFk
|
||||
AND bu.warehouseFk = ?
|
||||
`, [travel.warehouseInFk]);
|
||||
stmts.push(stmt);
|
||||
|
||||
stmt = new ParameterizedSQL('SELECT * FROM tmp.item');
|
||||
stmt.merge(conn.makeSuffix(filter));
|
||||
|
||||
|
@ -84,7 +79,6 @@ module.exports = Self => {
|
|||
|
||||
const sql = ParameterizedSQL.join(stmts, ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
|
||||
return result[itemsIndex];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -24,7 +24,7 @@ describe('Buy editLatestsBuys()', () => {
|
|||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
search: 'Ranged weapon longbow 2m'
|
||||
search: 'Ranged weapon longbow 200cm'
|
||||
},
|
||||
req: {accessToken: {userId: 1}}
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('Entry latests buys filter()', () => {
|
|||
try {
|
||||
const ctx = {
|
||||
args: {
|
||||
search: 'Ranged weapon longbow 2m'
|
||||
search: 'Ranged weapon longbow 200cm'
|
||||
},
|
||||
req: {accessToken: {userId: 1}}
|
||||
};
|
||||
|
@ -17,7 +17,7 @@ describe('Entry latests buys filter()', () => {
|
|||
const firstBuy = results[0];
|
||||
|
||||
expect(results.length).toEqual(1);
|
||||
expect(firstBuy.size).toEqual(70);
|
||||
expect(firstBuy.size).toEqual(200);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
@ -57,7 +57,7 @@ describe('Entry latests buys filter()', () => {
|
|||
const ctx = {
|
||||
args: {
|
||||
tags: [
|
||||
{tagFk: 27, value: '2m'}
|
||||
{tagFk: 27, value: '200cm'}
|
||||
]
|
||||
},
|
||||
req: {accessToken: {userId: 1}}
|
||||
|
|
|
@ -54,11 +54,10 @@
|
|||
vn-id="salesPerson"
|
||||
disabled="false"
|
||||
ng-model="$ctrl.filter.salesPersonFk"
|
||||
url="Workers/activeWithRole"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
show-field="nickname"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
||||
label="Buyer"
|
||||
on-change="$ctrl.addFilters()">
|
||||
</vn-autocomplete>
|
||||
|
|
|
@ -67,17 +67,22 @@ class Controller extends Section {
|
|||
}
|
||||
|
||||
openCreateDialog() {
|
||||
this.dms = {
|
||||
reference: null,
|
||||
warehouseId: null,
|
||||
companyId: null,
|
||||
dmsTypeId: null,
|
||||
description: null,
|
||||
hasFile: true,
|
||||
hasFileAttached: true,
|
||||
files: null
|
||||
};
|
||||
this.$.dmsCreateDialog.show();
|
||||
const params = {filter: {
|
||||
where: {code: 'invoiceIn'}
|
||||
}};
|
||||
this.$http.get('DmsTypes/findOne', {params}).then(res => {
|
||||
this.dms = {
|
||||
reference: this.invoiceIn.supplierRef,
|
||||
warehouseId: this.vnConfig.warehouseFk,
|
||||
companyId: this.vnConfig.companyFk,
|
||||
dmsTypeId: res.data.id,
|
||||
description: this.invoiceIn.supplier.name,
|
||||
hasFile: true,
|
||||
hasFileAttached: true,
|
||||
files: null
|
||||
};
|
||||
this.$.dmsCreateDialog.show();
|
||||
});
|
||||
}
|
||||
|
||||
downloadFile(dmsId) {
|
||||
|
|
|
@ -6,6 +6,7 @@ class Controller extends Section {
|
|||
this.invoiceIn = {};
|
||||
if (this.$params && this.$params.supplierFk)
|
||||
this.invoiceIn.supplierFk = this.$params.supplierFk;
|
||||
this.invoiceIn.issued = Date.vnNew();
|
||||
}
|
||||
|
||||
get companyFk() {
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
import './index.js';
|
||||
import watcher from 'core/mocks/watcher';
|
||||
|
||||
describe('InvoiceIn', () => {
|
||||
describe('Component vnInvoiceInCreate', () => {
|
||||
let controller;
|
||||
let $element;
|
||||
|
||||
beforeEach(ngModule('invoiceIn'));
|
||||
|
||||
beforeEach(inject(($componentController, $rootScope) => {
|
||||
const $scope = $rootScope.$new();
|
||||
$scope.watcher = watcher;
|
||||
$element = angular.element('<vn-invoice-in-create></vn-invoice-in-create>');
|
||||
controller = $componentController('vnInvoiceInCreate', {$element, $scope});
|
||||
controller.$params = {};
|
||||
}));
|
||||
|
||||
afterEach(() => {
|
||||
$element.remove();
|
||||
});
|
||||
|
||||
describe('onInit()', () => {
|
||||
it(`should defined the controller's invoiceIn property`, () => {
|
||||
expect(controller.invoiceIn).toBeUndefined();
|
||||
|
||||
controller.$onInit();
|
||||
|
||||
expect(controller.invoiceIn).toEqual({});
|
||||
});
|
||||
|
||||
it(`should define invoiceIn and it's supplierFk when received via params`, () => {
|
||||
controller.$params.supplierFk = 'supplierId';
|
||||
|
||||
controller.$onInit();
|
||||
|
||||
expect(controller.invoiceIn.supplierFk).toEqual('supplierId');
|
||||
});
|
||||
});
|
||||
|
||||
describe('onSubmit()', () => {
|
||||
it(`should redirect to basic data by calling the $state.go function`, () => {
|
||||
jest.spyOn(controller.$state, 'go');
|
||||
|
||||
controller.onSubmit();
|
||||
|
||||
expect(controller.$state.go).toHaveBeenCalledWith('invoiceIn.card.basicData', {id: 1234});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('delete', {
|
||||
description: 'Delete a invoiceOut',
|
||||
|
@ -34,19 +33,41 @@ module.exports = Self => {
|
|||
|
||||
try {
|
||||
const invoiceOut = await Self.findById(id, {}, myOptions);
|
||||
const tickets = await Self.app.models.Ticket.find({
|
||||
const models = Self.app.models;
|
||||
const tickets = await models.Ticket.find({
|
||||
where: {refFk: invoiceOut.ref}
|
||||
}, myOptions);
|
||||
|
||||
|
||||
const [bookEntry] = await models.Xdiario.find({
|
||||
where: {
|
||||
SERIE: invoiceOut.ref[0],
|
||||
FACTURA: invoiceOut.ref.slice(1)
|
||||
}
|
||||
}, myOptions);
|
||||
const promises = [];
|
||||
|
||||
for (let ticket of tickets)
|
||||
promises.push(ticket.updateAttribute('refFk', null, myOptions));
|
||||
|
||||
await Promise.all(promises);
|
||||
|
||||
await invoiceOut.destroy(myOptions);
|
||||
|
||||
if (bookEntry) {
|
||||
if (bookEntry.enlazadoSage) {
|
||||
const params = {
|
||||
bookEntry: bookEntry.ASIEN,
|
||||
invoiceOutRef: invoiceOut.ref
|
||||
}
|
||||
await Self.rawSql(`SELECT util.notification_send('book-entry-deleted', ?, NULL)`,
|
||||
[JSON.stringify(params)],
|
||||
myOptions);
|
||||
};
|
||||
|
||||
await models.Xdiario.destroyAll({
|
||||
ASIEN: bookEntry.ASIEN
|
||||
});
|
||||
}
|
||||
|
||||
if (tx) await tx.commit();
|
||||
|
||||
return tickets;
|
||||
|
|
|
@ -2,18 +2,24 @@ const models = require('vn-loopback/server/server').models;
|
|||
const LoopBackContext = require('loopback-context');
|
||||
|
||||
describe('invoiceOut delete()', () => {
|
||||
const invoiceOutId = 2;
|
||||
const userId = 1106;
|
||||
const invoiceOutId = 2;
|
||||
const userId = 106;
|
||||
const activeCtx = {
|
||||
accessToken: {userId: userId},
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
});
|
||||
|
||||
it('should check that there is one ticket in the target invoiceOut', async() => {
|
||||
const tx = await models.InvoiceOut.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const invoiceOut = await models.InvoiceOut.findById(invoiceOutId, {}, options);
|
||||
const invoiceOut = await models.InvoiceOut.findById(invoiceOutId , {}, options);
|
||||
const tickets = await models.Ticket.find({where: {refFk: invoiceOut.ref}}, options);
|
||||
|
||||
expect(tickets.length).toEqual(1);
|
||||
|
@ -31,12 +37,7 @@ describe('invoiceOut delete()', () => {
|
|||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||
active: activeCtx
|
||||
});
|
||||
|
||||
await models.InvoiceOut.delete(invoiceOutId, options);
|
||||
|
||||
const originalTicket = await models.Ticket.findById(3, {}, options);
|
||||
|
||||
const deletedInvoiceOut = await models.InvoiceOut.findById(invoiceOutId, {}, options);
|
||||
|
@ -50,4 +51,107 @@ describe('invoiceOut delete()', () => {
|
|||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should delete the corresponding bookEntry and not notify', async () => {
|
||||
const tx = await models.InvoiceOut.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const filter = {
|
||||
where: {
|
||||
ASIEN: 2
|
||||
},
|
||||
fields: ['id', 'enlazadoSage']
|
||||
};
|
||||
|
||||
const [beforeXdiario] = await models.Xdiario.find(filter, options)
|
||||
|
||||
const [beforeNotification] = await models.NotificationQueue.find({
|
||||
where: {
|
||||
notificationFk: 'book-entry-deleted',
|
||||
status: 'pending'
|
||||
}
|
||||
}, options);
|
||||
|
||||
expect(beforeXdiario).toBeDefined();
|
||||
expect(beforeXdiario.enlazadoSage).toBeFalsy;
|
||||
expect(beforeNotification).not.toBeDefined();
|
||||
|
||||
await models.InvoiceOut.delete(4, options);
|
||||
|
||||
const [afterXdiario] = await models.Xdiario.find({
|
||||
where: {
|
||||
ASIEN: 2
|
||||
}
|
||||
}, options);
|
||||
|
||||
const [afterNotification] = await models.NotificationQueue.find({
|
||||
where: {
|
||||
notificationFk: 'book-entry-deleted',
|
||||
params: '{"bookEntry":2,"invoiceOutRef":"T4444444"}',
|
||||
status: 'pending'
|
||||
}
|
||||
}, options);
|
||||
|
||||
expect(afterXdiario).not.toBeDefined();
|
||||
expect(afterNotification).not.toBeDefined();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
it('should delete the corresponding bookEntry and notify', async () => {
|
||||
const tx = await models.InvoiceOut.beginTransaction({});
|
||||
const options = {transaction: tx};
|
||||
|
||||
try {
|
||||
const filter = {
|
||||
where: {
|
||||
ASIEN: 1
|
||||
},
|
||||
fields: ['id', 'enlazadoSage']
|
||||
};
|
||||
|
||||
const [beforeXdiario] = await models.Xdiario.find(filter, options)
|
||||
|
||||
const [beforeNotification] = await models.NotificationQueue.find({
|
||||
where: {
|
||||
notificationFk: 'book-entry-deleted',
|
||||
status: 'pending'
|
||||
}
|
||||
}, options);
|
||||
|
||||
expect(beforeXdiario).toBeDefined();
|
||||
expect(beforeXdiario.enlazadoSage).toBeTruthy();
|
||||
expect(beforeNotification).not.toBeDefined();
|
||||
|
||||
await models.InvoiceOut.delete(3, options);
|
||||
|
||||
const [afterXdiario] = await models.Xdiario.find({
|
||||
where: {
|
||||
ASIEN: 1
|
||||
}
|
||||
}, options);
|
||||
|
||||
const [afterNotification] = await models.NotificationQueue.find({
|
||||
where: {
|
||||
notificationFk: 'book-entry-deleted',
|
||||
params: '{"bookEntry":1,"invoiceOutRef":"T3333333"}',
|
||||
status: 'pending'
|
||||
}
|
||||
}, options);
|
||||
|
||||
expect(afterXdiario).not.toBeDefined();
|
||||
expect(afterNotification).toBeDefined();
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
await tx.rollback();
|
||||
throw e;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -28,11 +28,15 @@ module.exports = Self => {
|
|||
Object.assign(myOptions, options);
|
||||
|
||||
const stmt = new ParameterizedSQL(`
|
||||
SELECT iss.created,
|
||||
SELECT
|
||||
iss.id,
|
||||
iss.created,
|
||||
iss.saleFk,
|
||||
iss.quantity,
|
||||
iss.userFk,
|
||||
ish.id itemShelvingFk,
|
||||
ish.shelvingFk,
|
||||
s.parkingFk,
|
||||
p.code,
|
||||
u.name
|
||||
FROM itemShelvingSale iss
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('setVisibleDiscard', {
|
||||
description: 'Change visible for item',
|
||||
accessType: 'WRITE',
|
||||
accepts: [{
|
||||
arg: 'itemFk',
|
||||
type: 'Number',
|
||||
required: false,
|
||||
description: 'The item id'
|
||||
}, {
|
||||
arg: 'warehouseFk',
|
||||
type: 'Number',
|
||||
required: true,
|
||||
description: 'The warehouse of item'
|
||||
}, {
|
||||
arg: 'quantity',
|
||||
type: 'Number',
|
||||
required: true,
|
||||
description: 'The quantity to modify'
|
||||
},
|
||||
{
|
||||
arg: 'addressFk',
|
||||
type: 'Number',
|
||||
required: true,
|
||||
description: 'The address id'
|
||||
}],
|
||||
http: {
|
||||
path: `/setVisibleDiscard`,
|
||||
verb: 'POST'
|
||||
}
|
||||
});
|
||||
|
||||
Self.setVisibleDiscard = async(ctx, itemFk, warehouseFk, quantity, addressFk) => {
|
||||
const query = `CALL vn.item_setVisibleDiscard(?, ?, ?, ?)`;
|
||||
await Self.rawSql(query, [itemFk, warehouseFk, quantity, addressFk]);
|
||||
};
|
||||
};
|
|
@ -41,11 +41,6 @@
|
|||
"type": "belongsTo",
|
||||
"model": "VnUser",
|
||||
"foreignKey": "userFk"
|
||||
},
|
||||
"shelving": {
|
||||
"type": "belongsTo",
|
||||
"model": "Shelving",
|
||||
"foreignKey": "shelvingFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ module.exports = Self => {
|
|||
require('../methods/item/createIntrastat')(Self);
|
||||
require('../methods/item/buyerWasteEmail')(Self);
|
||||
require('../methods/item/labelPdf')(Self);
|
||||
require('../methods/item/setVisibleDiscard')(Self);
|
||||
|
||||
Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'});
|
||||
|
||||
|
|
|
@ -54,11 +54,10 @@
|
|||
vn-id="buyer"
|
||||
disabled="false"
|
||||
ng-model="$ctrl.filter.buyerFk"
|
||||
url="Workers/activeWithRole"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
show-field="nickname"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
||||
label="Buyer"
|
||||
on-change="$ctrl.addFilters()">
|
||||
</vn-autocomplete>
|
||||
|
|
|
@ -44,8 +44,7 @@ class Controller extends Section {
|
|||
{
|
||||
field: 'buyerFk',
|
||||
autocomplete: {
|
||||
url: 'Workers/activeWithRole',
|
||||
where: `{role: {inq: ['logistic', 'buyer']}}`,
|
||||
url: 'TicketRequests/getItemTypeWorker',
|
||||
searchFunction: '{firstName: $search}',
|
||||
showField: 'nickname',
|
||||
valueField: 'id',
|
||||
|
|
|
@ -22,12 +22,11 @@
|
|||
<vn-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.attenderFk"
|
||||
url="Workers/activeWithRole"
|
||||
url="TicketRequests/getItemTypeWorker"
|
||||
search-function="{firstName: $search}"
|
||||
show-field="nickname"
|
||||
value-field="id"
|
||||
where="{role: {inq: ['logistic', 'buyer']}}"
|
||||
label="Buyer">
|
||||
<tpl-item>{{nickname}}</tpl-item>
|
||||
label="Atender">
|
||||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal class="vn-px-lg">
|
||||
|
@ -46,18 +45,13 @@
|
|||
</vn-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal class="vn-px-lg">
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.requesterFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: 'salesPerson'}"
|
||||
label="Comercial">
|
||||
<tpl-item>{{firstName}} {{lastName}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
departments="['VT']"
|
||||
label="Salesperson">
|
||||
</vn-worker-autocomplete>
|
||||
</vn-horizontal>
|
||||
|
||||
<section class="vn-px-md">
|
||||
<vn-horizontal class="manifold-panel vn-pa-md">
|
||||
<vn-date-picker
|
||||
|
|
|
@ -39,7 +39,7 @@ describe('SalesMonitor salesFilter()', () => {
|
|||
const filter = {};
|
||||
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
|
||||
|
||||
expect(result.length).toBeGreaterThan(15);
|
||||
expect(result.length).toBeGreaterThan(11);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
@ -151,7 +151,7 @@ describe('SalesMonitor salesFilter()', () => {
|
|||
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
|
||||
const firstRow = result[0];
|
||||
|
||||
expect(result.length).toEqual(12);
|
||||
expect(result.length).toEqual(15);
|
||||
expect(firstRow.alertLevel).not.toEqual(0);
|
||||
|
||||
await tx.rollback();
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<vn-thead>
|
||||
<vn-tr>
|
||||
<vn-th shrink>
|
||||
<vn-multi-check
|
||||
<vn-multi-check
|
||||
model="model">
|
||||
</vn-multi-check>
|
||||
</vn-th>
|
||||
|
@ -46,7 +46,7 @@
|
|||
ui-sref="order.card.summary({id: {{::order.id}}})" target="_blank">
|
||||
<vn-tr>
|
||||
<vn-td>
|
||||
<vn-check
|
||||
<vn-check
|
||||
ng-model="order.checked"
|
||||
vn-click-stop>
|
||||
</vn-check>
|
||||
|
@ -98,7 +98,7 @@
|
|||
scroll-offset="100">
|
||||
</vn-pagination>
|
||||
</vn-card>
|
||||
<vn-worker-descriptor-popover
|
||||
<vn-worker-descriptor-popover
|
||||
vn-id="workerDescriptor">
|
||||
</vn-worker-descriptor-popover>
|
||||
<vn-client-descriptor-popover
|
||||
|
@ -112,22 +112,22 @@
|
|||
ng-click="contextmenu.filterBySelection()">
|
||||
Filter by selection
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
ng-click="contextmenu.excludeSelection()">
|
||||
Exclude selection
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isFilterAllowed()"
|
||||
ng-click="contextmenu.removeFilter()">
|
||||
Remove filter
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
<vn-item translate
|
||||
ng-click="contextmenu.removeAllFilters()">
|
||||
Remove all filters
|
||||
</vn-item>
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isActionAllowed()"
|
||||
<vn-item translate
|
||||
ng-if="contextmenu.isActionAllowed()"
|
||||
ng-click="contextmenu.copyValue()">
|
||||
Copy value
|
||||
</vn-item>
|
||||
|
@ -138,4 +138,4 @@
|
|||
on-accept="$ctrl.onDelete()"
|
||||
question="All the selected elements will be deleted. Are you sure you want to continue?"
|
||||
message="Delete selected elements">
|
||||
</vn-confirm>
|
||||
</vn-confirm>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<div class="search-panel">
|
||||
<vn-crud-model
|
||||
auto-load="true"
|
||||
url="Warehouses"
|
||||
auto-load="true"
|
||||
url="Warehouses"
|
||||
data="warehouses">
|
||||
</vn-crud-model>
|
||||
<form id="manifold-form" ng-submit="$ctrl.onSearch()">
|
||||
|
@ -43,16 +43,12 @@
|
|||
label="Nickname"
|
||||
ng-model="filter.nickname">
|
||||
</vn-textfield>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.salesPersonFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
search-function="{firstName: $search}"
|
||||
value-field="id"
|
||||
where="{role: 'employee'}"
|
||||
departments="['VT']"
|
||||
label="Sales person">
|
||||
<tpl-item>{{firstName}} {{name}}</tpl-item>
|
||||
</vn-autocomplete>
|
||||
</vn-worker-autocomplete>
|
||||
<vn-textfield
|
||||
vn-one
|
||||
label="Invoice"
|
||||
|
|
|
@ -25,10 +25,6 @@ class Controller extends SearchPanel {
|
|||
this.filter.values.push({});
|
||||
setTimeout(() => this.parentPopover.relocate());
|
||||
}
|
||||
|
||||
changeTag() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnOrderCatalogSearchPanel', {
|
||||
|
|
|
@ -25,16 +25,13 @@
|
|||
show-field="name"
|
||||
value-field="id">
|
||||
</vn-autocomplete>
|
||||
<vn-autocomplete
|
||||
<vn-worker-autocomplete
|
||||
vn-one
|
||||
ng-model="filter.workerFk"
|
||||
url="Workers/activeWithInheritedRole"
|
||||
search-function="{firstName: $search}"
|
||||
departments="['VT']"
|
||||
show-field="nickname"
|
||||
value-field="id"
|
||||
where="{role: 'salesPerson'}"
|
||||
label="Sales person">
|
||||
</vn-autocomplete>
|
||||
</vn-worker-autocomplete>
|
||||
</vn-horizontal>
|
||||
<vn-horizontal>
|
||||
<vn-date-picker
|
||||
|
@ -86,4 +83,4 @@
|
|||
<vn-submit label="Search"></vn-submit>
|
||||
</vn-horizontal>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
const JSZip = require('jszip');
|
||||
const axios = require('axios');
|
||||
const UserError = require('vn-loopback/util/user-error');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethodCtx('downloadCmrsZip', {
|
||||
description: 'Download a zip file with multiple cmrs pdfs',
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'ids',
|
||||
type: 'string',
|
||||
description: 'The cmrs ids',
|
||||
}
|
||||
],
|
||||
returns: [
|
||||
{
|
||||
arg: 'body',
|
||||
type: 'file',
|
||||
root: true
|
||||
}, {
|
||||
arg: 'Content-Type',
|
||||
type: 'string',
|
||||
http: {target: 'header'}
|
||||
}, {
|
||||
arg: 'Content-Disposition',
|
||||
type: 'string',
|
||||
http: {target: 'header'}
|
||||
}
|
||||
],
|
||||
http: {
|
||||
path: '/downloadCmrsZip',
|
||||
verb: 'GET'
|
||||
}
|
||||
});
|
||||
|
||||
Self.downloadCmrsZip = async function(ctx, ids, options) {
|
||||
const models = Self.app.models;
|
||||
const myOptions = {};
|
||||
const token = ctx.req.accessToken;
|
||||
const zip = new JSZip();
|
||||
|
||||
if (typeof options == 'object')
|
||||
Object.assign(myOptions, options);
|
||||
|
||||
const zipConfig = await models.ZipConfig.findOne(null, myOptions);
|
||||
let totalSize = 0;
|
||||
ids = ids.split(',');
|
||||
try {
|
||||
for (let id of ids) {
|
||||
if (zipConfig && totalSize > zipConfig.maxSize) throw new UserError('Files are too large');
|
||||
const response = await axios.get(
|
||||
`${ctx.req.headers.referer}api/Routes/${id}/cmr?access_token=${token.id}`, {
|
||||
...myOptions,
|
||||
responseType: 'arraybuffer',
|
||||
});
|
||||
|
||||
if (response.headers['content-type'] !== 'application/pdf')
|
||||
throw new UserError(`The response is not a PDF`);
|
||||
|
||||
zip.file(`${id}.pdf`, response.data, { binary: true });
|
||||
}
|
||||
|
||||
const zipStream = zip.generateNodeStream({ streamFiles: true });
|
||||
|
||||
return [zipStream, 'application/zip', `filename="cmrs.zip"`];
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
};
|
|
@ -22,6 +22,11 @@ module.exports = Self => {
|
|||
type: 'integer',
|
||||
description: 'The worker id',
|
||||
},
|
||||
{
|
||||
arg: 'routeFk',
|
||||
type: 'integer',
|
||||
description: 'The route id',
|
||||
},
|
||||
{
|
||||
arg: 'country',
|
||||
type: 'string',
|
||||
|
@ -57,6 +62,7 @@ module.exports = Self => {
|
|||
filter,
|
||||
cmrFk,
|
||||
ticketFk,
|
||||
routeFk,
|
||||
country,
|
||||
clientFk,
|
||||
hasCmrDms,
|
||||
|
@ -66,6 +72,7 @@ module.exports = Self => {
|
|||
const params = {
|
||||
cmrFk,
|
||||
ticketFk,
|
||||
routeFk,
|
||||
country,
|
||||
clientFk,
|
||||
hasCmrDms,
|
||||
|
@ -89,37 +96,38 @@ module.exports = Self => {
|
|||
|
||||
let stmts = [];
|
||||
const stmt = new ParameterizedSQL(`
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT t.cmrFk,
|
||||
t.id ticketFk,
|
||||
co.country,
|
||||
t.clientFk,
|
||||
sub.id hasCmrDms,
|
||||
DATE(t.shipped) shipped
|
||||
FROM ticket t
|
||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN state s ON s.id = ts.stateFk
|
||||
JOIN alertLevel al ON al.id = s.alertLevel
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
JOIN address a ON a.id = t.addressFk
|
||||
JOIN province p ON p.id = a.provinceFk
|
||||
JOIN country co ON co.id = p.countryFk
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
||||
JOIN warehouse w ON w.id = t.warehouseFk
|
||||
LEFT JOIN (
|
||||
SELECT td.ticketFk, d.id
|
||||
FROM ticketDms td
|
||||
JOIN dms d ON d.id = td.dmsFk
|
||||
JOIN dmsType dt ON dt.id = d.dmsTypeFk
|
||||
WHERE dt.name = 'cmr'
|
||||
) sub ON sub.ticketFk = t.id
|
||||
WHERE co.code <> 'ES'
|
||||
AND am.name <> 'ABONO'
|
||||
AND w.code = 'ALG'
|
||||
AND dm.code = 'DELIVERY'
|
||||
AND t.cmrFk
|
||||
SELECT *
|
||||
FROM (
|
||||
SELECT t.cmrFk,
|
||||
t.id ticketFk,
|
||||
t.routeFk,
|
||||
co.country,
|
||||
t.clientFk,
|
||||
IF(sub.id, TRUE, FALSE) hasCmrDms,
|
||||
DATE(t.shipped) shipped
|
||||
FROM ticket t
|
||||
JOIN ticketState ts ON ts.ticketFk = t.id
|
||||
JOIN state s ON s.id = ts.stateFk
|
||||
JOIN alertLevel al ON al.id = s.alertLevel
|
||||
JOIN client c ON c.id = t.clientFk
|
||||
JOIN address a ON a.id = t.addressFk
|
||||
JOIN province p ON p.id = a.provinceFk
|
||||
JOIN country co ON co.id = p.countryFk
|
||||
JOIN agencyMode am ON am.id = t.agencyModeFk
|
||||
JOIN deliveryMethod dm ON dm.id = am.deliveryMethodFk
|
||||
JOIN warehouse w ON w.id = t.warehouseFk
|
||||
LEFT JOIN (
|
||||
SELECT td.ticketFk, d.id
|
||||
FROM ticketDms td
|
||||
JOIN dms d ON d.id = td.dmsFk
|
||||
JOIN dmsType dt ON dt.id = d.dmsTypeFk
|
||||
WHERE dt.name = 'cmr'
|
||||
) sub ON sub.ticketFk = t.id
|
||||
WHERE co.code <> 'ES'
|
||||
AND am.name <> 'ABONO'
|
||||
AND w.code = 'ALG'
|
||||
AND dm.code = 'DELIVERY'
|
||||
AND t.cmrFk
|
||||
) sub
|
||||
`);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue