export structure db from production and fix test
This commit is contained in:
parent
f03fd334da
commit
d9601ec4ac
|
@ -188,7 +188,7 @@ export default {
|
|||
originSelect: `vn-autocomplete[field="$ctrl.item.originFk"] input`,
|
||||
originSelectOptionTwo: `vn-autocomplete[field="$ctrl.item.originFk"] vn-drop-down ul > li:nth-child(2)`,
|
||||
expenceSelect: `vn-autocomplete[field="$ctrl.item.expenceFk"] input`,
|
||||
expenceSelectOptionTwo: `vn-autocomplete[field="$ctrl.item.expenceFk"] vn-drop-down ul > li:nth-child(2)`,
|
||||
expenceSelectOptionThree: `vn-autocomplete[field="$ctrl.item.expenceFk"] vn-drop-down ul > li:nth-child(3)`,
|
||||
longNameInput: `vn-horizontal:nth-child(5) > ${components.vnTextfield}`,
|
||||
submitBasicDataButton: `${components.vnSubmit}`
|
||||
},
|
||||
|
|
|
@ -57,7 +57,7 @@ describe('Item', () => {
|
|||
.waitToClick(selectors.itemBasicData.originSelect)
|
||||
.waitToClick(selectors.itemBasicData.originSelectOptionTwo)
|
||||
.waitToClick(selectors.itemBasicData.expenceSelect)
|
||||
.waitToClick(selectors.itemBasicData.expenceSelectOptionTwo)
|
||||
.waitToClick(selectors.itemBasicData.expenceSelectOptionThree)
|
||||
.clearInput(selectors.itemBasicData.longNameInput)
|
||||
.type(selectors.itemBasicData.longNameInput, 'RS Rose of Purity')
|
||||
.click(selectors.itemBasicData.submitBasicDataButton)
|
||||
|
|
|
@ -121,6 +121,7 @@ module.exports = Self => {
|
|||
insertIntoClaimEnd(createdSales, id, worker.id, {transaction: transaction});
|
||||
await Self.rawSql('CALL vn.ticketCalculateClon(?)', [newRefundTicket], {transaction: transaction});
|
||||
await transaction.commit();
|
||||
return newRefundTicket;
|
||||
} catch (e) {
|
||||
await transaction.rollback();
|
||||
throw e;
|
||||
|
|
|
@ -12,7 +12,7 @@ mysqldump --defaults-file=connect.ini --no-create-info bi tarifa_componentes tar
|
|||
echo USE `cache`; >> install/dump/03-dumpedFixtures.sql
|
||||
mysqldump --defaults-file=connect.ini --no-create-info cache cache >> install/dump/03-dumpedFixtures.sql
|
||||
echo USE `hedera`; >> install/dump/03-dumpedFixtures.sql
|
||||
mysqldump --defaults-file=connect.ini --no-create-info hedera tpvError tpvResponse >> install/dump/03-dumpedFixtures.sql
|
||||
mysqldump --defaults-file=connect.ini --no-create-info hedera tpvError tpvResponse tpvConfig >> install/dump/03-dumpedFixtures.sql
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -13,4 +13,4 @@ mysqldump --defaults-file=connect.ini --no-create-info bi tarifa_componentes tar
|
|||
echo "USE \`cache\`;" >> install/dump/03-dumpedFixtures.sql
|
||||
mysqldump --defaults-file=connect.ini --no-create-info cache cache >> install/dump/03-dumpedFixtures.sql
|
||||
echo "USE \`hedera\`;" >> install/dump/03-dumpedFixtures.sql
|
||||
mysqldump --defaults-file=connect.ini --no-create-info hedera tpvError tpvResponse >> install/dump/03-dumpedFixtures.sql
|
||||
mysqldump --defaults-file=connect.ini --no-create-info hedera tpvError tpvResponse tpvConfig >> install/dump/03-dumpedFixtures.sql
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `itemCategory` AS
|
||||
SELECT
|
||||
`r`.`id` AS `id`,
|
||||
`r`.`reino` AS `name`,
|
||||
`r`.`display` AS `display`,
|
||||
`r`.`color` AS `color`,
|
||||
`r`.`icon` AS `icon`,
|
||||
`r`.`mercancia` AS `merchandise`
|
||||
FROM
|
||||
`vn2008`.`reinos` `r`;
|
|
@ -0,0 +1,40 @@
|
|||
DROP TRIGGER IF EXISTS `vn2008`.`CompresAfterInsert`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn2008`$$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `CompresAfterInsert` AFTER INSERT ON `Compres` FOR EACH ROW BEGIN
|
||||
|
||||
DECLARE vWarehouse INT;
|
||||
DECLARE vWarehouseOut INT;
|
||||
DECLARE isMerchandise BOOLEAN;
|
||||
|
||||
CALL stock.queueAdd ('buy', NEW.Id_Compra, NULL);
|
||||
|
||||
SELECT warehouse_id, warehouse_id_out INTO vWarehouse, vWarehouseOut
|
||||
FROM Entradas E
|
||||
JOIN travel T ON T.id = E.travel_id
|
||||
WHERE E.Id_Entrada = NEW.Id_Entrada;
|
||||
|
||||
-- Actualiza el volumen unitario
|
||||
SELECT k.merchandise INTO isMerchandise
|
||||
FROM vn.itemCategory k
|
||||
JOIN vn.itemType it ON it.categoryFk = k.id
|
||||
JOIN vn.item i ON i.typeFk = it.id
|
||||
WHERE i.id = NEW.Id_Article;
|
||||
|
||||
If isMerchandise THEN
|
||||
|
||||
REPLACE bi.rotacion(Id_Article, warehouse_id, cm3)
|
||||
VALUES (NEW.Id_ARticle, vWarehouse, vn2008.cm3_unidad(NEW.Id_Compra));
|
||||
|
||||
END IF;
|
||||
|
||||
IF (SELECT fuente FROM warehouse where id = vWarehouseOut AND id <> 13) AND
|
||||
(SELECT has_notify_passport(NEW.Id_Article,NEW.Id_Compra))
|
||||
THEN
|
||||
CALL notify_passport(NEW.Id_Article, NEW.Etiquetas, NEW.Packing,NEW.Id_Compra);
|
||||
CALL insert_producer_plantpassport(NEW.Id_Compra);
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,38 @@
|
|||
DROP TRIGGER IF EXISTS `vn2008`.`CompresAfterUpdate`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn2008`$$
|
||||
CREATE DEFINER=`root`@`%` TRIGGER `CompresAfterUpdate`
|
||||
AFTER UPDATE ON `Compres` FOR EACH ROW
|
||||
BEGIN
|
||||
DECLARE vWarehouse INT;
|
||||
DECLARE vWarehouseOut INT;
|
||||
DECLARE isMerchandise BOOLEAN;
|
||||
|
||||
CALL stock.queueAdd ('buy', NEW.Id_Compra, OLD.Id_Compra);
|
||||
|
||||
SELECT warehouse_id, warehouse_id_out INTO vWarehouse, vWarehouseOut
|
||||
FROM Entradas E
|
||||
JOIN travel T ON T.id = E.travel_id
|
||||
WHERE E.Id_Entrada = NEW.Id_Entrada;
|
||||
|
||||
SELECT k.merchandise INTO isMerchandise
|
||||
FROM vn.itemCategory k
|
||||
JOIN vn.itemType it ON it.categoryFk = k.id
|
||||
JOIN vn.item i ON i.typeFk = it.id
|
||||
WHERE i.id = NEW.Id_Article;
|
||||
|
||||
IF isMerchandise AND NOT(NEW.Id_Cubo <=> OLD.Id_Cubo AND NEW.Id_Entrada <=> OLD.Id_Entrada)
|
||||
THEN
|
||||
REPLACE bi.rotacion(Id_Article, warehouse_id, cm3)
|
||||
VALUES (NEW.Id_ARticle, vWarehouse, vn2008.cm3_unidad(NEW.Id_Compra));
|
||||
END IF;
|
||||
|
||||
IF (SELECT fuente FROM warehouse where id = vWarehouseOut AND id <> 13) AND
|
||||
(SELECT has_notify_passport(NEW.Id_Article,NEW.Id_Compra)) > 0
|
||||
THEN
|
||||
CALL notify_passport(NEW.Id_Article, NEW.Etiquetas, NEW.Packing,NEW.Id_Compra);
|
||||
CALL insert_producer_plantpassport(NEW.Id_Compra);
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -1,11 +0,0 @@
|
|||
ALTER TABLE `vn2008`.`cl_det`
|
||||
DROP FOREIGN KEY `cl_det_ibfk_6`;
|
||||
ALTER TABLE `vn2008`.`cl_det`
|
||||
DROP INDEX `cl_pet_id` ;
|
||||
|
||||
|
||||
|
||||
ALTER TABLE `vn2008`.`cl_det`
|
||||
DROP FOREIGN KEY `cl_det_ibfk_5`;
|
||||
ALTER TABLE `vn2008`.`cl_det`
|
||||
DROP INDEX `cl_que_id` ;
|
|
@ -1,7 +0,0 @@
|
|||
UPDATE `salix`.`ACL` SET `model`='ClaimEnd' WHERE `id`='96';
|
||||
UPDATE `salix`.`ACL` SET `model`='ClaimEnd' WHERE `id`='97';
|
||||
UPDATE `salix`.`ACL` SET `model`='ClaimBeginning', `accessType`='*' WHERE `id`='98';
|
||||
UPDATE `salix`.`ACL` SET `model`='ClaimDevelopment' WHERE `id`='99';
|
||||
UPDATE `salix`.`ACL` SET `model`='ClaimDevelopment' WHERE `id`='100';
|
||||
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (101, 'Claim', '*', '*', 'ALLOW', 'ROLE', 'employee');
|
||||
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (102, 'Claim', 'createFromSales', '*', 'ALLOW', 'ROLE', 'employee');
|
|
@ -1,107 +0,0 @@
|
|||
USE `hedera`;
|
||||
DROP procedure IF EXISTS `orderAddItem`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `hedera`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `orderAddItem`(
|
||||
vOrder INT,
|
||||
vWarehouse INT,
|
||||
vItem INT,
|
||||
vAmount INT)
|
||||
BEGIN
|
||||
DECLARE vRow INT;
|
||||
DECLARE vAdd INT;
|
||||
DECLARE vAvailable INT;
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vGrouping INT;
|
||||
DECLARE vRate INT;
|
||||
DECLARE vShipment DATE;
|
||||
DECLARE vPrice DECIMAL(10,2);
|
||||
DECLARE vDate DATE;
|
||||
DECLARE vAddress INT;
|
||||
DECLARE vAgencyMode INT;
|
||||
DECLARE cur CURSOR FOR
|
||||
SELECT grouping, price, rate
|
||||
FROM tmp.bionic_price
|
||||
WHERE warehouse_id = vWarehouse
|
||||
AND item_id = vItem
|
||||
ORDER BY grouping DESC;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET vDone = TRUE;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
ROLLBACK;
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
SELECT date_send, address_id, agency_id
|
||||
INTO vDate, vAddress, vAgencyMode
|
||||
FROM `order`
|
||||
WHERE id = vOrder;
|
||||
|
||||
CALL vn2008.bionic_from_item(vDate, vAddress, vAgencyMode, vItem);
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SELECT shipped INTO vShipment
|
||||
FROM tmp.travel_tree
|
||||
WHERE warehouseFk = vWarehouse;
|
||||
|
||||
SELECT available INTO vAvailable
|
||||
FROM tmp.bionic_lot
|
||||
WHERE warehouse_id = vWarehouse
|
||||
AND item_id = vItem;
|
||||
|
||||
IF vAmount > vAvailable
|
||||
THEN
|
||||
CALL util.throw ('ORDER_ROW_UNAVAILABLE');
|
||||
END IF;
|
||||
|
||||
OPEN cur;
|
||||
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH cur INTO vGrouping, vPrice, vRate;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
SET vAdd = vAmount - MOD(vAmount, vGrouping);
|
||||
SET vAmount = vAmount - vAdd;
|
||||
|
||||
IF vAdd = 0 THEN
|
||||
ITERATE l;
|
||||
END IF;
|
||||
|
||||
INSERT INTO order_row SET
|
||||
order_id = vOrder,
|
||||
item_id = vItem,
|
||||
warehouse_id = vWarehouse,
|
||||
shipment = vShipment,
|
||||
rate = vRate,
|
||||
amount = vAdd,
|
||||
price = vPrice;
|
||||
|
||||
SET vRow = LAST_INSERT_ID();
|
||||
|
||||
INSERT INTO order_component (order_row_id, component_id, price)
|
||||
SELECT vRow, c.component_id, c.cost
|
||||
FROM tmp.bionic_component c
|
||||
JOIN bi.tarifa_componentes t
|
||||
ON t.Id_Componente = c.component_id
|
||||
AND (t.tarifa_class IS NULL OR t.tarifa_class = vRate)
|
||||
WHERE c.warehouse_id = vWarehouse
|
||||
AND c.item_id = vItem;
|
||||
END LOOP;
|
||||
|
||||
CLOSE cur;
|
||||
COMMIT;
|
||||
|
||||
CALL vn2008.bionic_free ();
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
USE `hedera`;
|
||||
DROP procedure IF EXISTS `basketAddItem`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `hedera`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `basketAddItem`(
|
||||
vWarehouse INT,
|
||||
vItem INT,
|
||||
vAmount INT)
|
||||
BEGIN
|
||||
DECLARE vOrder INT;
|
||||
|
||||
SET vOrder = myBasketGetId();
|
||||
|
||||
CALL orderAddItem(vOrder,vWarehouse, vItem, vAmount);
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
ALTER TABLE `vn2008`.`Agencias`
|
||||
ADD COLUMN `code` VARCHAR(45) NULL DEFAULT NULL AFTER `flag`;
|
|
@ -1,23 +0,0 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `agencyMode` AS
|
||||
SELECT
|
||||
`a`.`Id_Agencia` AS `id`,
|
||||
`a`.`Agencia` AS `name`,
|
||||
`a`.`description` AS `description`,
|
||||
`a`.`Vista` AS `deliveryMethodFk`,
|
||||
`a`.`m3` AS `m3`,
|
||||
`a`.`cod71` AS `cod71`,
|
||||
`a`.`web` AS `web`,
|
||||
`a`.`agency_id` AS `agencyFk`,
|
||||
`a`.`agency_service_id` AS `agencyServiceFk`,
|
||||
`a`.`inflacion` AS `inflation`,
|
||||
`a`.`is_volumetric` AS `isVolumetric`,
|
||||
`a`.`send_mail` AS `reportMail`,
|
||||
`a`.`tpv` AS `isActive`,
|
||||
`a`.`code` AS `code`
|
||||
FROM
|
||||
`vn2008`.`Agencias` `a`;
|
|
@ -1,81 +0,0 @@
|
|||
USE `vn`;
|
||||
DROP procedure IF EXISTS `ticketCalculateClon`;
|
||||
|
||||
DELIMITER $$
|
||||
USE `vn`$$
|
||||
CREATE DEFINER=`root`@`%` PROCEDURE `ticketCalculateClon`(IN vTicket BIGINT)
|
||||
BEGIN
|
||||
|
||||
/*
|
||||
*
|
||||
* Este procedimiento "rebioniza" una linea, eliminando los componentes existentes e insertandolos de nuevo
|
||||
*/
|
||||
DECLARE vShipped DATE;
|
||||
DECLARE vClient INT;
|
||||
DECLARE vWarehouse SMALLINT;
|
||||
DECLARE vAgencyMode INT;
|
||||
DECLARE vAddress INT;
|
||||
DECLARE vLanded DATE;
|
||||
DECLARE vAgency INT;
|
||||
|
||||
REPLACE orderTicket(orderFk,ticketFk) VALUES(48, vTicket);
|
||||
|
||||
SELECT t.clientFk , t.warehouseFk, date(t.shipped), t.addressFk, t.agencyModeFk, t.landed, a.agencyFk
|
||||
INTO vClient, vWarehouse, vShipped, vAddress, vAgencyMode, vLanded, vAgency
|
||||
FROM vn.agencyMode a
|
||||
JOIN vn.ticket t ON t.agencyModeFk = a.id
|
||||
WHERE t.id = vTicket;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.agencyHourGetShipped;
|
||||
CREATE TEMPORARY TABLE tmp.agencyHourGetShipped ENGINE = MEMORY
|
||||
SELECT vWarehouse warehouseFk, vShipped shipped, vLanded landed;
|
||||
|
||||
CALL buyUltimate(vWarehouse, vShipped); -- rellena la tabla tmp.buyUltimate con la ultima compra
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot;
|
||||
CREATE TEMPORARY TABLE tmp.ticketLot
|
||||
SELECT vWarehouse warehouseFk,NULL available,s.itemFk, bu.buyFk
|
||||
FROM sale s
|
||||
LEFT JOIN tmp.buyUltimate bu ON bu.itemFk = s.itemFk
|
||||
WHERE s.ticketFk = vTicket GROUP BY s.itemFk;
|
||||
|
||||
CALL ticketComponentCalculate(vAddress,vAgencyMode);
|
||||
|
||||
-- Bionizamos lineas con Preu = 0
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
|
||||
CREATE TEMPORARY TABLE tmp.sale
|
||||
(PRIMARY KEY (saleFk)) ENGINE = MEMORY
|
||||
SELECT s.id saleFk, vWarehouse warehouseFk
|
||||
FROM sale s
|
||||
JOIN ticket t on t.id = s.ticketFk WHERE s.ticketFk = vTicket AND s.price = 0;
|
||||
|
||||
CALL ticketComponentUpdateSale(1);
|
||||
|
||||
-- Bionizamos lineas con Preu > 0
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.sale;
|
||||
CREATE TEMPORARY TABLE tmp.sale
|
||||
(PRIMARY KEY (saleFk)) ENGINE = MEMORY
|
||||
SELECT s.id saleFk, vWarehouse warehouseFk
|
||||
FROM sale s
|
||||
JOIN ticket t on t.id = s.ticketFk WHERE s.ticketFk = vTicket AND s.price > 0;
|
||||
|
||||
CALL ticketComponentUpdateSale(6);
|
||||
|
||||
IF vLanded IS NULL THEN
|
||||
CALL agencyHourGetLanded(vShipped, vAddress, vAgency,vWarehouse);
|
||||
|
||||
UPDATE ticket t
|
||||
JOIN tmp.agencyHourGetLanded ah ON t.warehouseFk = ah.warehouseFk
|
||||
SET t.landed = ah.landed
|
||||
WHERE t.id = vTicket;
|
||||
END IF;
|
||||
|
||||
-- Log
|
||||
CALL `logAdd`(vTicket, 'update', ' ticket' , 'Bioniza Ticket');
|
||||
|
||||
-- Limpieza
|
||||
DROP TEMPORARY TABLE tmp.buyUltimate;
|
||||
END$$
|
||||
|
||||
DELIMITER ;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
USE `vn`;
|
||||
CREATE
|
||||
OR REPLACE ALGORITHM = UNDEFINED
|
||||
DEFINER = `root`@`%`
|
||||
SQL SECURITY DEFINER
|
||||
VIEW `vn`.`orderTicket` AS
|
||||
SELECT
|
||||
`b`.`order_id` AS `orderFk`, `b`.`Id_Ticket` AS `ticketFk`
|
||||
FROM
|
||||
`vn2008`.`order_Tickets` `b`;
|
|
@ -1,25 +0,0 @@
|
|||
ALTER TABLE `vn`.`zoneGeo`
|
||||
RENAME TO `vn`.`zoneIncluded` ;
|
||||
|
||||
ALTER TABLE `vn`.`zoneNest`
|
||||
RENAME TO `vn`.`zoneGeo` ;
|
||||
|
||||
ALTER TABLE `vn`.`zone`
|
||||
CHANGE COLUMN `agencyFk` `agencyModeFk` INT(11) NOT NULL,
|
||||
CHANGE COLUMN `hour` `hour` DATETIME NOT NULL,
|
||||
CHANGE COLUMN `warehouseFk` `warehouseFk` SMALLINT(6) UNSIGNED NOT NULL ;
|
||||
|
||||
ALTER TABLE `vn`.`zone`
|
||||
ADD INDEX `fk_zone_1_idx` (`warehouseFk` ASC),
|
||||
ADD INDEX `fk_zone_2_idx` (`agencyModeFk` ASC);
|
||||
ALTER TABLE `vn`.`zone`
|
||||
ADD CONSTRAINT `fk_zone_1`
|
||||
FOREIGN KEY (`warehouseFk`)
|
||||
REFERENCES `vn2008`.`warehouse` (`id`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE CASCADE,
|
||||
ADD CONSTRAINT `fk_zone_2`
|
||||
FOREIGN KEY (`agencyModeFk`)
|
||||
REFERENCES `vn2008`.`Agencias` (`Id_Agencia`)
|
||||
ON DELETE NO ACTION
|
||||
ON UPDATE NO ACTION;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
|
@ -68,19 +68,19 @@ INSERT INTO `vn`.`accountingType`(`id`, `description`)
|
|||
|
||||
INSERT INTO `vn`.`bank`(`id`, `bank`, `account`, `cash`, `entityFk`, `isActive`)
|
||||
VALUES
|
||||
(8, 'Pay on receipt', '0000000000', 4, 0, 1);
|
||||
(1, 'Pay on receipt', '0000000000', 4, 0, 1);
|
||||
|
||||
INSERT INTO `vn`.`agency`(`id`, `name`, `warehouseFk`, `isVolumetric`, `bankFk`, `warehouseAliasFk`)
|
||||
VALUES
|
||||
(1, 'inhouse pickup' , 1, 0, 8, 1),
|
||||
(2, 'Super-Man delivery' , 1, 0, 8, 1),
|
||||
(3, 'Teleportation device' , 1, 0, 8, 1),
|
||||
(4, 'Entanglement' , 1, 0, 8, 1),
|
||||
(5, 'Quantum break device' , 1, 0, 8, 1),
|
||||
(6, 'Walking' , 1, 0, 8, 1),
|
||||
(7, 'Silla247' , 1, 0, 8, 1),
|
||||
(8, 'Silla247Expensive' , 1, 0, 8, 1),
|
||||
(9, 'Abono' , 1, 0, 8, 1);
|
||||
(1, 'inhouse pickup' , 1, 0, 1, 1),
|
||||
(2, 'Super-Man delivery' , 1, 0, 1, 1),
|
||||
(3, 'Teleportation device' , 1, 0, 1, 1),
|
||||
(4, 'Entanglement' , 1, 0, 1, 1),
|
||||
(5, 'Quantum break device' , 1, 0, 1, 1),
|
||||
(6, 'Walking' , 1, 0, 1, 1),
|
||||
(7, 'Silla247' , 1, 0, 1, 1),
|
||||
(8, 'Silla247Expensive' , 1, 0, 1, 1),
|
||||
(9, 'Abono' , 1, 0, 1, 1);
|
||||
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 1 WHERE `name` = 'inhouse pickup';
|
||||
UPDATE `vn`.`agencyMode` SET `id` = 2 WHERE `name` = 'Super-Man delivery';
|
||||
|
@ -333,11 +333,11 @@ INSERT INTO `vn`.`bankEntity`(`id`, `countryFk`, `name`, `bic`)
|
|||
|
||||
INSERT INTO `vn`.`invoiceOut`(`id`, `ref`, `serial`, `amount`, `issued`,`clientFk`, `created`, `companyFk`, `dued`, `booked`, `bankFk`, `pdf`)
|
||||
VALUES
|
||||
( 1, 'T1111111' , 'T', 500 , DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 101, CURDATE(), 442, CURDATE(), CURDATE(), 8, 1),
|
||||
( 2, 'V2222222' , 'V', 350.50 , DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 102, CURDATE(), 442, CURDATE(), CURDATE(), 8, 1),
|
||||
( 3, 'E3333333' , 'E', 90.30 , CURDATE(), 103, CURDATE(), 442, CURDATE(), CURDATE(), 8, 1),
|
||||
( 4, 'E4444444' , 'E', 290.30 , DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 103, CURDATE(), 442, CURDATE(), CURDATE(), 8, 1),
|
||||
( 5, 'E5555555' , 'E', 190.30 , DATE_ADD(CURDATE(), INTERVAL +2 MONTH), 103, CURDATE(), 442, CURDATE(), CURDATE(), 8, 1);
|
||||
( 1, 'T1111111' , 'T', 500 , DATE_ADD(CURDATE(), INTERVAL -2 MONTH), 101, CURDATE(), 442, CURDATE(), CURDATE(), 1, 1),
|
||||
( 2, 'V2222222' , 'V', 350.50 , DATE_ADD(CURDATE(), INTERVAL -1 MONTH), 102, CURDATE(), 442, CURDATE(), CURDATE(), 1, 1),
|
||||
( 3, 'E3333333' , 'E', 90.30 , CURDATE(), 103, CURDATE(), 442, CURDATE(), CURDATE(), 1, 1),
|
||||
( 4, 'E4444444' , 'E', 290.30 , DATE_ADD(CURDATE(), INTERVAL +1 MONTH), 103, CURDATE(), 442, CURDATE(), CURDATE(), 1, 1),
|
||||
( 5, 'E5555555' , 'E', 190.30 , DATE_ADD(CURDATE(), INTERVAL +2 MONTH), 103, CURDATE(), 442, CURDATE(), CURDATE(), 1, 1);
|
||||
|
||||
INSERT INTO `vn`.`ticket`(`id`, `agencyModeFk`,`warehouseFk`,`routeFk`, `shipped`, `landed`, `clientFk`,`nickname`, `addressFk`, `refFk`, `isDeleted`, `created`)
|
||||
VALUES
|
||||
|
@ -872,3 +872,12 @@ INSERT INTO `hedera`.`tpvMerchant`(`id`, `description`, `companyFk`, `bankFk`, `
|
|||
VALUES
|
||||
( 1, 'Arkham Bank', 442, 1, 'h12387193H10238'),
|
||||
( 2, 'NewYork Bank', 442, 1, '7981ugsgd1hsdad');
|
||||
|
||||
|
||||
|
||||
INSERT INTO `hedera`.`tpvTransaction`(`id`,`merchantFk`, `clientFk`,`receiptFk`, `amount`, `response`, `errorCode`, `status`, `created`)
|
||||
VALUES
|
||||
(1, 1, 101, NULL, 2000, NULL, 'SIS0042', 'ok', CURDATE()),
|
||||
(2, 1, 101, NULL, 1000, NULL, 'SIS0051', 'started', CURDATE()),
|
||||
(3, 2, 101, NULL, 7268, 0, NULL, 'ok', CURDATE()),
|
||||
(4, 2, 101, NULL, 4698, 100, NULL, 'started', CURDATE());
|
|
@ -7,6 +7,6 @@ describe('Client card', () => {
|
|||
|
||||
expect(result.id).toEqual(101);
|
||||
expect(result.name).toEqual('Bruce Wayne');
|
||||
expect(result.debt).toEqual(972.78);
|
||||
expect(result.debt).toEqual(880.1);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -4,7 +4,7 @@ describe('client getDebt()', () => {
|
|||
it('should return the client debt', async() => {
|
||||
let result = await app.models.Client.getDebt(101);
|
||||
|
||||
expect(result.debt).toEqual(972.78);
|
||||
expect(result.debt).toEqual(880.1);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('client summary()', () => {
|
|||
it('should return a summary object containing debt', async() => {
|
||||
let result = await app.models.Client.summary(101);
|
||||
|
||||
expect(result.debt.debt).toEqual(972.78);
|
||||
expect(result.debt.debt).toEqual(880.1);
|
||||
});
|
||||
|
||||
it('should return a summary object containing averageInvoiced', async() => {
|
||||
|
|
Loading…
Reference in New Issue