Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 6119-addMicrosipLink
This commit is contained in:
commit
32a0aedf11
|
@ -6,10 +6,17 @@ 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).
|
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
|
## [2338.01] - 2023-09-21
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- (Ticket -> Servicios) Se pueden abonar servicios
|
||||||
### Changed
|
### Changed
|
||||||
- (Trabajadores -> Calendario) Icono de check arreglado cuando pulsas un tipo de dia
|
- (Trabajadores -> Calendario) Icono de check arreglado cuando pulsas un tipo de dia
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,9 @@
|
||||||
},
|
},
|
||||||
"Bank": {
|
"Bank": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"Buyer": {
|
||||||
|
"dataSource": "vn"
|
||||||
},
|
},
|
||||||
"Campaign": {
|
"Campaign": {
|
||||||
"dataSource": "vn"
|
"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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
INSERT INTO `account`.`role` (`id`, `name`, `description`, `hasLogin`)
|
INSERT INTO `account`.`role` (`name`, `description`, `hasLogin`)
|
||||||
VALUES ('claimViewer','Trabajadores que consulta las reclamaciones ',1);
|
VALUES ('claimViewer','Trabajadores que consulta las reclamaciones ',1);
|
||||||
|
|
||||||
INSERT INTO `account`.`roleInherit` (`role`,`inheritsFrom`)
|
INSERT INTO `account`.`roleInherit` (`role`,`inheritsFrom`)
|
||||||
|
@ -10,7 +10,7 @@ INSERT INTO `account`.`roleInherit` (`role`,`inheritsFrom`)
|
||||||
'buyer',
|
'buyer',
|
||||||
'deliveryBoss',
|
'deliveryBoss',
|
||||||
'handmadeBoss'
|
'handmadeBoss'
|
||||||
)
|
);
|
||||||
|
|
||||||
DELETE FROM `salix`.`ACL`
|
DELETE FROM `salix`.`ACL`
|
||||||
WHERE `model`= 'claim'
|
WHERE `model`= 'claim'
|
||||||
|
@ -28,5 +28,4 @@ INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`princip
|
||||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
||||||
VALUES ('Claim','findById','READ','ALLOW','ROLE','claimViewer');
|
VALUES ('Claim','findById','READ','ALLOW','ROLE','claimViewer');
|
||||||
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
INSERT INTO `salix`.`ACL` (`model`,`property`,`accessType`,`permission`,`principalType`,`principalid`)
|
||||||
VALUES ('Claim','getSummary','READ','ALLOW','ROLE','claimViewer');
|
VALUES ('Claim','getSummary','READ','ALLOW','ROLE','claimViewer');
|
||||||
|
|
|
@ -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');
|
||||||
|
|
|
@ -358,20 +358,20 @@ INSERT INTO `vn`.`contactChannel`(`id`, `name`)
|
||||||
(4, 'GCN Channel'),
|
(4, 'GCN Channel'),
|
||||||
(5, 'The Newspaper');
|
(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
|
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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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'),
|
(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');
|
(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`)
|
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
|
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
|
||||||
|
@ -2780,11 +2780,13 @@ INSERT INTO `util`.`notification` (`id`, `name`, `description`)
|
||||||
(2, 'invoice-electronic', 'A electronic invoice has been generated'),
|
(2, 'invoice-electronic', 'A electronic invoice has been generated'),
|
||||||
(3, 'not-main-printer-configured', 'A printer distinct than main has been configured'),
|
(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'),
|
(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`)
|
INSERT INTO `util`.`notificationAcl` (`notificationFk`, `roleFk`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 9);
|
(1, 9),
|
||||||
|
(6, 9);
|
||||||
|
|
||||||
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
INSERT INTO `util`.`notificationQueue` (`id`, `notificationFk`, `params`, `authorFk`, `status`, `created`)
|
||||||
VALUES
|
VALUES
|
||||||
|
@ -2797,8 +2799,9 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`)
|
||||||
(1, 1109),
|
(1, 1109),
|
||||||
(1, 1110),
|
(1, 1110),
|
||||||
(2, 1109),
|
(2, 1109),
|
||||||
(1,9),
|
(1, 9),
|
||||||
(1,3);
|
(1, 3),
|
||||||
|
(6, 9);
|
||||||
|
|
||||||
|
|
||||||
INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`)
|
INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`)
|
||||||
|
@ -2962,3 +2965,14 @@ INSERT INTO `vn`.`invoiceInSerial` (`code`, `description`, `cplusTerIdNifFk`, `t
|
||||||
INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
|
INSERT INTO `hedera`.`imageConfig` (`id`, `maxSize`, `useXsendfile`, `url`)
|
||||||
VALUES
|
VALUES
|
||||||
(1, 0, 0, 'marvel.com');
|
(1, 0, 0, 'marvel.com');
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
|
@ -671,8 +671,8 @@ export default {
|
||||||
firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]',
|
firstAddServiceTypeButton: 'vn-ticket-service vn-icon-button[vn-tooltip="New service type"]',
|
||||||
firstServiceType: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
|
firstServiceType: 'vn-ticket-service vn-autocomplete[ng-model="service.ticketServiceTypeFk"]',
|
||||||
firstQuantity: 'vn-ticket-service vn-input-number[ng-model="service.quantity"]',
|
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"]',
|
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(1) vn-icon-button[icon="delete"]',
|
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"]',
|
newServiceTypeName: '.vn-dialog.shown vn-textfield[ng-model="newServiceType.name"]',
|
||||||
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
|
serviceLine: 'vn-ticket-service > form > vn-card > vn-one:nth-child(2) > vn-horizontal',
|
||||||
saveServiceButton: 'button[type=submit]',
|
saveServiceButton: 'button[type=submit]',
|
||||||
|
|
|
@ -82,32 +82,24 @@ describe('InvoiceIn basic data path', () => {
|
||||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||||
let message = await page.waitForSnackbar();
|
let message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('The company can\'t be empty');
|
|
||||||
|
|
||||||
await page.clearInput(selectors.invoiceInBasicData.companyId);
|
await page.clearInput(selectors.invoiceInBasicData.companyId);
|
||||||
await page.autocompleteSearch(selectors.invoiceInBasicData.companyId, 'VNL');
|
await page.autocompleteSearch(selectors.invoiceInBasicData.companyId, 'VNL');
|
||||||
|
|
||||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||||
message = await page.waitForSnackbar();
|
message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('The warehouse can\'t be empty');
|
|
||||||
|
|
||||||
await page.clearInput(selectors.invoiceInBasicData.warehouseId);
|
await page.clearInput(selectors.invoiceInBasicData.warehouseId);
|
||||||
await page.autocompleteSearch(selectors.invoiceInBasicData.warehouseId, 'Warehouse One');
|
await page.autocompleteSearch(selectors.invoiceInBasicData.warehouseId, 'Warehouse One');
|
||||||
|
|
||||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||||
message = await page.waitForSnackbar();
|
message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('The DMS Type can\'t be empty');
|
|
||||||
|
|
||||||
await page.clearInput(selectors.invoiceInBasicData.dmsTypeId);
|
await page.clearInput(selectors.invoiceInBasicData.dmsTypeId);
|
||||||
await page.autocompleteSearch(selectors.invoiceInBasicData.dmsTypeId, 'Ticket');
|
await page.autocompleteSearch(selectors.invoiceInBasicData.dmsTypeId, 'Ticket');
|
||||||
|
|
||||||
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
await page.waitToClick(selectors.invoiceInBasicData.confirm);
|
||||||
message = await page.waitForSnackbar();
|
message = await page.waitForSnackbar();
|
||||||
|
|
||||||
expect(message.text).toContain('The description can\'t be empty');
|
|
||||||
|
|
||||||
await page.waitToClick(selectors.invoiceInBasicData.description);
|
await page.waitToClick(selectors.invoiceInBasicData.description);
|
||||||
await page.write(selectors.invoiceInBasicData.description, 'Dms without edition.');
|
await page.write(selectors.invoiceInBasicData.description, 'Dms without edition.');
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,10 @@ export const validators = {
|
||||||
if (validator.isEmpty(value ? String(value) : ''))
|
if (validator.isEmpty(value ? String(value) : ''))
|
||||||
throw new Error(_($translate, `Value can't be empty`));
|
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) => {
|
absence: ($translate, value) => {
|
||||||
if (!validator.isEmpty(value))
|
if (!validator.isEmpty(value))
|
||||||
throw new Error(_($translate, `Value should be empty`));
|
throw new Error(_($translate, `Value should be empty`));
|
||||||
|
@ -104,9 +108,8 @@ export function checkNull($translate, value, conf) {
|
||||||
export function _($translate, text, params = []) {
|
export function _($translate, text, params = []) {
|
||||||
text = $translate.instant(text);
|
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]);
|
text = text.replace('%s', params[i]);
|
||||||
}
|
|
||||||
|
|
||||||
return text;
|
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 empty: El valor debe estar vacío
|
||||||
Value should be integer: El valor debe ser entero
|
Value should be integer: El valor debe ser entero
|
||||||
Value should be a number: El valor debe ser numérico
|
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
|
Invalid value: Valor incorrecto
|
||||||
Value can't be blank: El valor no puede estar en blanco
|
Value can't be blank: El valor no puede estar en blanco
|
||||||
Value can't be null: El valor no puede ser nulo
|
Value can't be null: El valor no puede ser nulo
|
||||||
|
|
|
@ -307,7 +307,7 @@
|
||||||
"Negative basis of tickets": "Base negativa para los tickets: {{ticketsIds}}",
|
"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",
|
"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",
|
"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",
|
"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",
|
"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",
|
"This invoice has a linked vehicle.": "Esta factura tiene un vehiculo vinculado",
|
||||||
"You don't have enough privileges.": "No tienes suficientes permisos.",
|
"You don't have enough privileges.": "No tienes suficientes permisos.",
|
||||||
|
|
|
@ -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);
|
||||||
|
});
|
||||||
|
});
|
|
@ -136,5 +136,8 @@
|
||||||
},
|
},
|
||||||
"Incoterms": {
|
"Incoterms": {
|
||||||
"dataSource": "vn"
|
"dataSource": "vn"
|
||||||
|
},
|
||||||
|
"Xdiario": {
|
||||||
|
"dataSource": "vn"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "XDiario",
|
"name": "Xdiario",
|
||||||
"base": "VnModel",
|
"base": "VnModel",
|
||||||
"options": {
|
"options": {
|
||||||
"mysql": {
|
"mysql": {
|
||||||
|
@ -7,10 +7,12 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
"ASIEN": {
|
"id": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"id": true,
|
"id": true
|
||||||
"description": "Identifier"
|
},
|
||||||
|
"ASIEN": {
|
||||||
|
"type": "number"
|
||||||
},
|
},
|
||||||
"FECHA": {
|
"FECHA": {
|
||||||
"type": "date"
|
"type": "date"
|
||||||
|
@ -71,6 +73,9 @@
|
||||||
},
|
},
|
||||||
"MONEDAUSO": {
|
"MONEDAUSO": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"enlazadoSage": {
|
||||||
|
"type": "boolean"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"relations": {
|
"relations": {
|
||||||
|
|
|
@ -3,6 +3,8 @@ let getFinalState = require('vn-loopback/util/hook').getFinalState;
|
||||||
let isMultiple = require('vn-loopback/util/hook').isMultiple;
|
let isMultiple = require('vn-loopback/util/hook').isMultiple;
|
||||||
|
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
|
require('../methods/address/getAddress')(Self);
|
||||||
|
|
||||||
Self.validateAsync('isEqualizated', cannotHaveET, {
|
Self.validateAsync('isEqualizated', cannotHaveET, {
|
||||||
message: 'Cannot check Equalization Tax in this NIF/CIF'
|
message: 'Cannot check Equalization Tax in this NIF/CIF'
|
||||||
});
|
});
|
||||||
|
|
|
@ -262,7 +262,7 @@
|
||||||
value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}">
|
value="{{$ctrl.summary.averageInvoiced.invoiced | currency: 'EUR':2}}">
|
||||||
</vn-label-value>
|
</vn-label-value>
|
||||||
<vn-label-value label="Claims"
|
<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-label-value>
|
||||||
</vn-one>
|
</vn-one>
|
||||||
<vn-one>
|
<vn-one>
|
||||||
|
|
|
@ -4,14 +4,14 @@ columns:
|
||||||
dated: fecha
|
dated: fecha
|
||||||
reference: referencia
|
reference: referencia
|
||||||
invoiceNumber: número factura
|
invoiceNumber: número factura
|
||||||
isBooked: reservado
|
isBooked: contabilizado
|
||||||
isExcludedFromAvailable: excluido del disponible
|
isExcludedFromAvailable: excluido del disponible
|
||||||
notes: notas
|
notes: notas
|
||||||
isConfirmed: confirmado
|
isConfirmed: confirmado
|
||||||
isVirtual: virtual
|
isVirtual: virtual
|
||||||
isRaid: incursión
|
isRaid: redada
|
||||||
commission: comisión
|
commission: comisión
|
||||||
isOrdered: precio3
|
isOrdered: pedida
|
||||||
created: creado
|
created: creado
|
||||||
observation: observación
|
observation: observación
|
||||||
isBlocked: bloqueado
|
isBlocked: bloqueado
|
||||||
|
|
|
@ -67,17 +67,22 @@ class Controller extends Section {
|
||||||
}
|
}
|
||||||
|
|
||||||
openCreateDialog() {
|
openCreateDialog() {
|
||||||
this.dms = {
|
const params = {filter: {
|
||||||
reference: null,
|
where: {code: 'invoiceIn'}
|
||||||
warehouseId: null,
|
}};
|
||||||
companyId: null,
|
this.$http.get('DmsTypes/findOne', {params}).then(res => {
|
||||||
dmsTypeId: null,
|
this.dms = {
|
||||||
description: null,
|
reference: this.invoiceIn.supplierRef,
|
||||||
hasFile: true,
|
warehouseId: this.vnConfig.warehouseFk,
|
||||||
hasFileAttached: true,
|
companyId: this.vnConfig.companyFk,
|
||||||
files: null
|
dmsTypeId: res.data.id,
|
||||||
};
|
description: this.invoiceIn.supplier.name,
|
||||||
this.$.dmsCreateDialog.show();
|
hasFile: true,
|
||||||
|
hasFileAttached: true,
|
||||||
|
files: null
|
||||||
|
};
|
||||||
|
this.$.dmsCreateDialog.show();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFile(dmsId) {
|
downloadFile(dmsId) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ class Controller extends Section {
|
||||||
this.invoiceIn = {};
|
this.invoiceIn = {};
|
||||||
if (this.$params && this.$params.supplierFk)
|
if (this.$params && this.$params.supplierFk)
|
||||||
this.invoiceIn.supplierFk = this.$params.supplierFk;
|
this.invoiceIn.supplierFk = this.$params.supplierFk;
|
||||||
|
this.invoiceIn.issued = Date.vnNew();
|
||||||
}
|
}
|
||||||
|
|
||||||
get companyFk() {
|
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 => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('delete', {
|
Self.remoteMethod('delete', {
|
||||||
description: 'Delete a invoiceOut',
|
description: 'Delete a invoiceOut',
|
||||||
|
@ -34,19 +33,41 @@ module.exports = Self => {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const invoiceOut = await Self.findById(id, {}, myOptions);
|
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}
|
where: {refFk: invoiceOut.ref}
|
||||||
}, myOptions);
|
}, myOptions);
|
||||||
|
|
||||||
|
const [bookEntry] = await models.Xdiario.find({
|
||||||
|
where: {
|
||||||
|
SERIE: invoiceOut.ref[0],
|
||||||
|
FACTURA: invoiceOut.ref.slice(1)
|
||||||
|
}
|
||||||
|
}, myOptions);
|
||||||
const promises = [];
|
const promises = [];
|
||||||
|
|
||||||
for (let ticket of tickets)
|
for (let ticket of tickets)
|
||||||
promises.push(ticket.updateAttribute('refFk', null, myOptions));
|
promises.push(ticket.updateAttribute('refFk', null, myOptions));
|
||||||
|
|
||||||
await Promise.all(promises);
|
await Promise.all(promises);
|
||||||
|
|
||||||
await invoiceOut.destroy(myOptions);
|
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();
|
if (tx) await tx.commit();
|
||||||
|
|
||||||
return tickets;
|
return tickets;
|
||||||
|
|
|
@ -2,18 +2,24 @@ const models = require('vn-loopback/server/server').models;
|
||||||
const LoopBackContext = require('loopback-context');
|
const LoopBackContext = require('loopback-context');
|
||||||
|
|
||||||
describe('invoiceOut delete()', () => {
|
describe('invoiceOut delete()', () => {
|
||||||
const invoiceOutId = 2;
|
const invoiceOutId = 2;
|
||||||
const userId = 1106;
|
const userId = 106;
|
||||||
const activeCtx = {
|
const activeCtx = {
|
||||||
accessToken: {userId: userId},
|
accessToken: {userId: userId},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
||||||
|
active: activeCtx
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should check that there is one ticket in the target invoiceOut', async() => {
|
it('should check that there is one ticket in the target invoiceOut', async() => {
|
||||||
const tx = await models.InvoiceOut.beginTransaction({});
|
const tx = await models.InvoiceOut.beginTransaction({});
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
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);
|
const tickets = await models.Ticket.find({where: {refFk: invoiceOut.ref}}, options);
|
||||||
|
|
||||||
expect(tickets.length).toEqual(1);
|
expect(tickets.length).toEqual(1);
|
||||||
|
@ -31,12 +37,7 @@ describe('invoiceOut delete()', () => {
|
||||||
const options = {transaction: tx};
|
const options = {transaction: tx};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({
|
|
||||||
active: activeCtx
|
|
||||||
});
|
|
||||||
|
|
||||||
await models.InvoiceOut.delete(invoiceOutId, options);
|
await models.InvoiceOut.delete(invoiceOutId, options);
|
||||||
|
|
||||||
const originalTicket = await models.Ticket.findById(3, {}, options);
|
const originalTicket = await models.Ticket.findById(3, {}, options);
|
||||||
|
|
||||||
const deletedInvoiceOut = await models.InvoiceOut.findById(invoiceOutId, {}, options);
|
const deletedInvoiceOut = await models.InvoiceOut.findById(invoiceOutId, {}, options);
|
||||||
|
@ -50,4 +51,107 @@ describe('invoiceOut delete()', () => {
|
||||||
throw e;
|
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;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -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]);
|
||||||
|
};
|
||||||
|
};
|
|
@ -16,6 +16,7 @@ module.exports = Self => {
|
||||||
require('../methods/item/createIntrastat')(Self);
|
require('../methods/item/createIntrastat')(Self);
|
||||||
require('../methods/item/buyerWasteEmail')(Self);
|
require('../methods/item/buyerWasteEmail')(Self);
|
||||||
require('../methods/item/labelPdf')(Self);
|
require('../methods/item/labelPdf')(Self);
|
||||||
|
require('../methods/item/setVisibleDiscard')(Self);
|
||||||
|
|
||||||
Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'});
|
Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'});
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ describe('SalesMonitor salesFilter()', () => {
|
||||||
const filter = {};
|
const filter = {};
|
||||||
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
|
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
|
||||||
|
|
||||||
expect(result.length).toBeGreaterThan(15);
|
expect(result.length).toBeGreaterThan(11);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -151,7 +151,7 @@ describe('SalesMonitor salesFilter()', () => {
|
||||||
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
|
const result = await models.SalesMonitor.salesFilter(ctx, filter, options);
|
||||||
const firstRow = result[0];
|
const firstRow = result[0];
|
||||||
|
|
||||||
expect(result.length).toEqual(12);
|
expect(result.length).toEqual(15);
|
||||||
expect(firstRow.alertLevel).not.toEqual(0);
|
expect(firstRow.alertLevel).not.toEqual(0);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
|
|
|
@ -13,7 +13,7 @@ module.exports = Self => {
|
||||||
const bankEntity = await Self.app.models.BankEntity.findById(this.bankEntityFk);
|
const bankEntity = await Self.app.models.BankEntity.findById(this.bankEntityFk);
|
||||||
const filter = {
|
const filter = {
|
||||||
fields: ['code'],
|
fields: ['code'],
|
||||||
where: {id: bankEntity.countryFk}
|
where: {id: bankEntity?.countryFk}
|
||||||
};
|
};
|
||||||
|
|
||||||
const country = await Self.app.models.Country.findOne(filter);
|
const country = await Self.app.models.Country.findOne(filter);
|
||||||
|
|
|
@ -5,8 +5,7 @@ module.exports = Self => {
|
||||||
accepts: [
|
accepts: [
|
||||||
{
|
{
|
||||||
arg: 'salesIds',
|
arg: 'salesIds',
|
||||||
type: ['number'],
|
type: ['number']
|
||||||
required: true
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
arg: 'servicesIds',
|
arg: 'servicesIds',
|
||||||
|
@ -41,6 +40,7 @@ module.exports = Self => {
|
||||||
myOptions.transaction = tx;
|
myOptions.transaction = tx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let refundTicket = null;
|
||||||
try {
|
try {
|
||||||
const refundAgencyMode = await models.AgencyMode.findOne({
|
const refundAgencyMode = await models.AgencyMode.findOne({
|
||||||
include: {
|
include: {
|
||||||
|
@ -55,42 +55,55 @@ module.exports = Self => {
|
||||||
|
|
||||||
const refoundZoneId = refundAgencyMode.zones()[0].id;
|
const refoundZoneId = refundAgencyMode.zones()[0].id;
|
||||||
|
|
||||||
const salesFilter = {
|
if (salesIds) {
|
||||||
where: {id: {inq: salesIds}},
|
const salesFilter = {
|
||||||
include: {
|
where: {id: {inq: salesIds}},
|
||||||
relation: 'components',
|
include: {
|
||||||
scope: {
|
relation: 'components',
|
||||||
fields: ['saleFk', 'componentFk', 'value']
|
scope: {
|
||||||
|
fields: ['saleFk', 'componentFk', 'value']
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
const sales = await models.Sale.find(salesFilter, myOptions);
|
||||||
|
const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
|
||||||
|
|
||||||
|
const now = Date.vnNew();
|
||||||
|
const [firstTicketId] = ticketsIds;
|
||||||
|
|
||||||
|
// eslint-disable-next-line max-len
|
||||||
|
refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
|
||||||
|
|
||||||
|
for (const sale of sales) {
|
||||||
|
const createdSale = await models.Sale.create({
|
||||||
|
ticketFk: refundTicket.id,
|
||||||
|
itemFk: sale.itemFk,
|
||||||
|
quantity: - sale.quantity,
|
||||||
|
concept: sale.concept,
|
||||||
|
price: sale.price,
|
||||||
|
discount: sale.discount,
|
||||||
|
}, myOptions);
|
||||||
|
|
||||||
|
const components = sale.components();
|
||||||
|
for (const component of components)
|
||||||
|
component.saleFk = createdSale.id;
|
||||||
|
|
||||||
|
await models.SaleComponent.create(components, myOptions);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
const sales = await models.Sale.find(salesFilter, myOptions);
|
|
||||||
const ticketsIds = [...new Set(sales.map(sale => sale.ticketFk))];
|
|
||||||
|
|
||||||
let [firstTicketId] = ticketsIds;
|
|
||||||
if (!firstTicketId) {
|
|
||||||
[ticketServices] = await models.TicketService.find({where: {id: {inq: servicesIds}}}, myOptions);
|
|
||||||
firstTicketId = ticketServices.ticketFk;
|
|
||||||
}
|
}
|
||||||
const now = Date.vnNew();
|
|
||||||
|
|
||||||
const refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
|
if (!refundTicket) {
|
||||||
|
const servicesFilter = {
|
||||||
|
where: {id: {inq: servicesIds}}
|
||||||
|
};
|
||||||
|
const services = await models.TicketService.find(servicesFilter, myOptions);
|
||||||
|
const ticketsIds = [...new Set(services.map(service => service.ticketFk))];
|
||||||
|
|
||||||
for (const sale of sales) {
|
const now = Date.vnNew();
|
||||||
const createdSale = await models.Sale.create({
|
const [firstTicketId] = ticketsIds;
|
||||||
ticketFk: refundTicket.id,
|
|
||||||
itemFk: sale.itemFk,
|
|
||||||
quantity: - sale.quantity,
|
|
||||||
concept: sale.concept,
|
|
||||||
price: sale.price,
|
|
||||||
discount: sale.discount,
|
|
||||||
}, myOptions);
|
|
||||||
|
|
||||||
const components = sale.components();
|
// eslint-disable-next-line max-len
|
||||||
for (const component of components)
|
refundTicket = await createTicketRefund(firstTicketId, now, refundAgencyMode, refoundZoneId, withWarehouse, myOptions);
|
||||||
component.saleFk = createdSale.id;
|
|
||||||
|
|
||||||
await models.SaleComponent.create(components, myOptions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (servicesIds && servicesIds.length > 0) {
|
if (servicesIds && servicesIds.length > 0) {
|
||||||
|
@ -101,8 +114,8 @@ module.exports = Self => {
|
||||||
for (const service of services) {
|
for (const service of services) {
|
||||||
await models.TicketService.create({
|
await models.TicketService.create({
|
||||||
description: service.description,
|
description: service.description,
|
||||||
quantity: - service.quantity,
|
quantity: service.quantity,
|
||||||
price: service.price,
|
price: - service.price,
|
||||||
taxClassFk: service.taxClassFk,
|
taxClassFk: service.taxClassFk,
|
||||||
ticketFk: refundTicket.id,
|
ticketFk: refundTicket.id,
|
||||||
ticketServiceTypeFk: service.ticketServiceTypeFk,
|
ticketServiceTypeFk: service.ticketServiceTypeFk,
|
||||||
|
|
|
@ -68,7 +68,7 @@ describe('ticket filter()', () => {
|
||||||
const filter = {};
|
const filter = {};
|
||||||
const result = await models.Ticket.filter(ctx, filter, options);
|
const result = await models.Ticket.filter(ctx, filter, options);
|
||||||
|
|
||||||
expect(result.length).toEqual(6);
|
expect(result.length).toEqual(9);
|
||||||
|
|
||||||
await tx.rollback();
|
await tx.rollback();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -154,7 +154,7 @@ describe('ticket filter()', () => {
|
||||||
const secondRow = result[1];
|
const secondRow = result[1];
|
||||||
const thirdRow = result[2];
|
const thirdRow = result[2];
|
||||||
|
|
||||||
expect(result.length).toBeGreaterThan(15);
|
expect(result.length).toBeGreaterThan(11);
|
||||||
expect(firstRow.state).toEqual('Entregado');
|
expect(firstRow.state).toEqual('Entregado');
|
||||||
expect(secondRow.state).toEqual('Entregado');
|
expect(secondRow.state).toEqual('Entregado');
|
||||||
expect(thirdRow.state).toEqual('Entregado');
|
expect(thirdRow.state).toEqual('Entregado');
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
vn-id="model"
|
vn-id="model"
|
||||||
url="TicketServices"
|
url="TicketServices"
|
||||||
link="{ticketFk: $ctrl.$params.id}"
|
link="{ticketFk: $ctrl.$params.id}"
|
||||||
|
@ -24,7 +24,21 @@
|
||||||
</vn-watcher>
|
</vn-watcher>
|
||||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||||
<vn-card class="vn-pa-lg">
|
<vn-card class="vn-pa-lg">
|
||||||
<vn-horizontal ng-repeat="service in $ctrl.services track by $index">
|
<vn-button-bar>
|
||||||
|
<vn-button
|
||||||
|
disabled="watcher.dataChanged() || !$ctrl.checkeds.length"
|
||||||
|
label="Pay"
|
||||||
|
ng-click="$ctrl.createRefund()"
|
||||||
|
vn-acl="invoicing, claimManager, salesAssistant"
|
||||||
|
vn-acl-action="remove">
|
||||||
|
</vn-button>
|
||||||
|
</vn-button-bar>
|
||||||
|
<vn-horizontal ng-repeat="service in $ctrl.services">
|
||||||
|
<vn-check
|
||||||
|
tabindex="1"
|
||||||
|
on-change="$ctrl.addChecked(service.id)"
|
||||||
|
disabled="!service.id">
|
||||||
|
</vn-check>
|
||||||
<vn-autocomplete vn-two vn-focus
|
<vn-autocomplete vn-two vn-focus
|
||||||
data="ticketServiceTypes"
|
data="ticketServiceTypes"
|
||||||
label="Description"
|
label="Description"
|
||||||
|
@ -43,10 +57,12 @@
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
<vn-input-number
|
<vn-input-number
|
||||||
vn-one
|
vn-one
|
||||||
step="1"
|
step="1"
|
||||||
label="Quantity"
|
label="Quantity"
|
||||||
|
info="To create services with negative amounts mark the service on the source ticket and press the pay button."
|
||||||
ng-model="service.quantity"
|
ng-model="service.quantity"
|
||||||
rule="TicketService">
|
rule="TicketService"
|
||||||
|
min="0">
|
||||||
</vn-input-number>
|
</vn-input-number>
|
||||||
<vn-input-number
|
<vn-input-number
|
||||||
vn-one
|
vn-one
|
||||||
|
@ -60,7 +76,7 @@
|
||||||
vn-tooltip="Remove service"
|
vn-tooltip="Remove service"
|
||||||
icon="delete"
|
icon="delete"
|
||||||
ng-click="model.remove($index)">
|
ng-click="model.remove($index)">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
</vn-auto>
|
</vn-auto>
|
||||||
</vn-horizontal>
|
</vn-horizontal>
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
|
@ -76,18 +92,11 @@
|
||||||
disabled="!watcher.dataChanged()"
|
disabled="!watcher.dataChanged()"
|
||||||
label="Save">
|
label="Save">
|
||||||
</vn-submit>
|
</vn-submit>
|
||||||
<!-- # #2680 Undo changes button bugs -->
|
|
||||||
<!-- <vn-button
|
|
||||||
class="cancel"
|
|
||||||
label="Undo changes"
|
|
||||||
disabled="!watcher.dataChanged()"
|
|
||||||
ng-click="watcher.loadOriginalData()">
|
|
||||||
</vn-button> -->
|
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<!-- Create service type dialog -->
|
<!-- Create service type dialog -->
|
||||||
<vn-dialog class="edit"
|
<vn-dialog class="edit"
|
||||||
vn-id="newServiceTypeDialog"
|
vn-id="newServiceTypeDialog"
|
||||||
on-accept="$ctrl.onNewServiceTypeAccept($data)"
|
on-accept="$ctrl.onNewServiceTypeAccept($data)"
|
||||||
on-close="newServiceType = null"
|
on-close="newServiceType = null"
|
||||||
|
@ -106,4 +115,4 @@
|
||||||
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
<input type="button" response="cancel" translate-attr="{value: 'Cancel'}"/>
|
||||||
<button response="accept" translate>Create</button>
|
<button response="accept" translate>Create</button>
|
||||||
</tpl-buttons>
|
</tpl-buttons>
|
||||||
</vn-dialog>
|
</vn-dialog>
|
||||||
|
|
|
@ -6,6 +6,8 @@ class Controller extends Section {
|
||||||
$onInit() {
|
$onInit() {
|
||||||
this.services = [];
|
this.services = [];
|
||||||
this.getDefaultTaxClass();
|
this.getDefaultTaxClass();
|
||||||
|
this.isDataSaved = false;
|
||||||
|
this.checkeds = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
getDefaultTaxClass() {
|
getDefaultTaxClass() {
|
||||||
|
@ -49,6 +51,26 @@ class Controller extends Section {
|
||||||
.then(() => this.$.model.refresh())
|
.then(() => this.$.model.refresh())
|
||||||
.then(() => this.$.watcher.notifySaved());
|
.then(() => this.$.watcher.notifySaved());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createRefund() {
|
||||||
|
if (!this.checkeds.length) return;
|
||||||
|
|
||||||
|
const params = {servicesIds: this.checkeds, withWarehouse: false};
|
||||||
|
const query = 'Sales/refund';
|
||||||
|
this.$http.post(query, params).then(res => {
|
||||||
|
const refundTicket = res.data;
|
||||||
|
this.vnApp.showSuccess(this.$t('The following refund ticket have been created', {
|
||||||
|
ticketId: refundTicket.id
|
||||||
|
}));
|
||||||
|
this.$state.go('ticket.card.sale', {id: refundTicket.id});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
addChecked(id) {
|
||||||
|
if (this.checkeds.includes(id))
|
||||||
|
return this.checkeds = this.checkeds.filter(check => check != id);
|
||||||
|
this.checkeds.push(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngModule.vnComponent('vnTicketService', {
|
ngModule.vnComponent('vnTicketService', {
|
||||||
|
|
|
@ -19,12 +19,11 @@ describe('Ticket component vnTicketService', () => {
|
||||||
|
|
||||||
describe('getDefaultTaxClass', () => {
|
describe('getDefaultTaxClass', () => {
|
||||||
it('should set the default tax class in the controller', () => {
|
it('should set the default tax class in the controller', () => {
|
||||||
$httpBackend.whenRoute('GET', `TaxClasses/findOne`)
|
$httpBackend.whenRoute('GET', `TaxClasses/findOne`).respond({
|
||||||
.respond({
|
id: 4000,
|
||||||
id: 4000,
|
name: 'Whatever',
|
||||||
name: 'Whatever',
|
code: 'GG',
|
||||||
code: 'GG'
|
});
|
||||||
});
|
|
||||||
controller.getDefaultTaxClass();
|
controller.getDefaultTaxClass();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
@ -49,15 +48,15 @@ describe('Ticket component vnTicketService', () => {
|
||||||
it('should set the description of the selected service upon service type creation', () => {
|
it('should set the description of the selected service upon service type creation', () => {
|
||||||
const service = {
|
const service = {
|
||||||
id: 1,
|
id: 1,
|
||||||
quantity: 10
|
quantity: 10,
|
||||||
};
|
};
|
||||||
$scope.newServiceType = {
|
$scope.newServiceType = {
|
||||||
name: 'Totally new stuff'
|
name: 'Totally new stuff',
|
||||||
};
|
};
|
||||||
|
|
||||||
$httpBackend.when('POST', 'TicketServiceTypes').respond({
|
$httpBackend.when('POST', 'TicketServiceTypes').respond({
|
||||||
id: 4001,
|
id: 4001,
|
||||||
name: 'Totally new stuff'
|
name: 'Totally new stuff',
|
||||||
});
|
});
|
||||||
controller.onNewServiceTypeAccept(service);
|
controller.onNewServiceTypeAccept(service);
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
@ -65,4 +64,20 @@ describe('Ticket component vnTicketService', () => {
|
||||||
expect(service.ticketServiceTypeFk).toEqual(4001);
|
expect(service.ticketServiceTypeFk).toEqual(4001);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('addChecked', () => {
|
||||||
|
it('should add an item to the checkeds array', () => {
|
||||||
|
controller.checkeds = [];
|
||||||
|
controller.addChecked(1);
|
||||||
|
|
||||||
|
expect(controller.checkeds).toEqual([1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should remove an item if it is already in the checkeds array', () => {
|
||||||
|
controller.checkeds = [1, 2, 3];
|
||||||
|
controller.addChecked(2);
|
||||||
|
|
||||||
|
expect(controller.checkeds).toEqual([1, 3]);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,4 +2,6 @@ Service: Servicios
|
||||||
Tax class: Tipo IVA
|
Tax class: Tipo IVA
|
||||||
Add service: Añadir servicio
|
Add service: Añadir servicio
|
||||||
Remove service: Quitar servicio
|
Remove service: Quitar servicio
|
||||||
New service type: Nuevo tipo de servicio
|
New service type: Nuevo tipo de servicio
|
||||||
|
Pay: Abonar
|
||||||
|
To create services with negative amounts mark the service on the source ticket and press the pay button.: Para crear sevicios con cantidades negativas marcar servicio en el ticket origen y apretar el boton abonar.
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "salix-back",
|
"name": "salix-back",
|
||||||
"version": "23.38.01",
|
"version": "23.40.01",
|
||||||
"author": "Verdnatura Levante SL",
|
"author": "Verdnatura Levante SL",
|
||||||
"description": "Salix backend",
|
"description": "Salix backend",
|
||||||
"license": "GPL-3.0",
|
"license": "GPL-3.0",
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
const Stylesheet = require(`vn-print/core/stylesheet`);
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const vnPrintPath = path.resolve('print');
|
||||||
|
|
||||||
|
module.exports = new Stylesheet([
|
||||||
|
`${vnPrintPath}/common/css/spacing.css`,
|
||||||
|
`${vnPrintPath}/common/css/misc.css`,
|
||||||
|
`${vnPrintPath}/common/css/layout.css`,
|
||||||
|
`${vnPrintPath}/common/css/email.css`])
|
||||||
|
.mergeStyles();
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<email-body v-bind="$props">
|
||||||
|
<div class="grid-row">
|
||||||
|
<div class="grid-block vn-pa-ml">
|
||||||
|
<h1>{{ $t('title') }}</h1>
|
||||||
|
<p v-html="$t('description', [bookEntry], [invoiceOutRef])"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</email-body>
|
|
@ -0,0 +1,19 @@
|
||||||
|
const Component = require(`vn-print/core/component`);
|
||||||
|
const emailBody = new Component();
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: 'book-entry-deleted',
|
||||||
|
components: {
|
||||||
|
'email-body': emailBody.build(),
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
bookEntry: {
|
||||||
|
type: Number,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
invoiceOutRef: {
|
||||||
|
type: String,
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,5 @@
|
||||||
|
Subject: Linked Accounting Entry Deleted
|
||||||
|
Title: Linked Accounting Entry Deleted
|
||||||
|
Description: The linked accounting entry that was associated with SAGE has been deleted. <br/><br/>
|
||||||
|
Entry No. {0} <br/><br/>
|
||||||
|
This entry has been deleted because the associated invoice {1} has been removed.
|
|
@ -0,0 +1,5 @@
|
||||||
|
subject: Asiento contable enlazado eliminado
|
||||||
|
title: Asiento contable enlazado eliminado
|
||||||
|
description: Se ha borrado el asiento contable que se encuentraba enlazado a SAGE <br/><br/>
|
||||||
|
Asientos nº {0} <br/><br/>
|
||||||
|
Este asiento se ha borrado porque se ha eliminado la factura asociada {1}
|
|
@ -8,8 +8,8 @@ description:
|
||||||
<a href='https://www.youtube.com/watch?v=qhb0kgQF3o8' title='Youtube' target='_blank'
|
<a href='https://www.youtube.com/watch?v=qhb0kgQF3o8' title='Youtube' target='_blank'
|
||||||
style='color:#8dba25'>https://www.youtube.com/watch?v=qhb0kgQF3o8</a>. También
|
style='color:#8dba25'>https://www.youtube.com/watch?v=qhb0kgQF3o8</a>. También
|
||||||
necesitarás el GoLabel, el programa para imprimir las cintas.
|
necesitarás el GoLabel, el programa para imprimir las cintas.
|
||||||
downloadFrom: Puedes descargarlo desde este enlace <a href='https://godex.s3-accelerate.amazonaws.com/_6f5glRrVhQAEBGhdUsqJA.file?v01'
|
downloadFrom: Puedes descargarlo desde este enlace <a href='https://cdn.verdnatura.es/public/GoLabel.zip'
|
||||||
title='Descargar GoLabel' target='_blank' style='color:#8dba25'>https://godex.s3-accelerate.amazonaws.com/_6f5glRrVhQAEBGhdUsqJA.file?v01</a>
|
title='Descargar GoLabel' target='_blank' style='color:#8dba25'>https://cdn.verdnatura.es/public/GoLabel.zip</a>
|
||||||
downloadDriver: En este enlace puedes descargar el driver de la impresora <a href='https://es.seagullscientific.com/support/downloads/drivers/godex/download/'
|
downloadDriver: En este enlace puedes descargar el driver de la impresora <a href='https://es.seagullscientific.com/support/downloads/drivers/godex/download/'
|
||||||
title='Descargar driver' target='_blank' style='color:#8dba25'>https://es.seagullscientific.com/support/downloads/drivers/godex/download/</a>
|
title='Descargar driver' target='_blank' style='color:#8dba25'>https://es.seagullscientific.com/support/downloads/drivers/godex/download/</a>
|
||||||
sections:
|
sections:
|
||||||
|
@ -40,4 +40,4 @@ help: Cualquier duda que te surja, no dudes en consultarla, <strong>¡estamos pa
|
||||||
atenderte!</strong>
|
atenderte!</strong>
|
||||||
salesPersonName: Soy tu comercial y mi nombre es
|
salesPersonName: Soy tu comercial y mi nombre es
|
||||||
salesPersonPhone: Teléfono y whatsapp
|
salesPersonPhone: Teléfono y whatsapp
|
||||||
salesPersonEmail: Dirección de e-mail
|
salesPersonEmail: Dirección de e-mail
|
||||||
|
|
Loading…
Reference in New Issue