update fixtures for bi.rotacion and add mobel annualAverageInvoiced

This commit is contained in:
Bernat Exposito 2018-03-20 15:01:49 +01:00
parent d4e3855b0d
commit 1ceab52d0d
4 changed files with 45 additions and 1 deletions

View File

@ -510,3 +510,10 @@ INSERT INTO `vn`.`recovery`(`id`, `clientFk`, `started`, `finished`, `amount`, `
( 2, 102, CURDATE(), date_add(CURDATE(),INTERVAL 3 MONTH), 100, 1),
( 3, 102, CURDATE(), date_add(CURDATE(),INTERVAL 1 MONTH), 50, 7),
( 4, 103, CURDATE(), NULL, 50, 7);
INSERT INTO `bi`.`rotacion`(`Id_Article`, `warehouse_id`, `total`, `rotacion`, `cm3`, `almacenaje`, `manipulacion`, `auxiliar`, `mermas`)
VALUES
( 1, 1, 0, 0.0000, 1500, 0.0015, 0.0250, 0.0085, 0.0000),
( 1, 2, 0, 0.0000, 100, 0.0060, 0.0200, 0.0080, 0.0000),
( 2, 1, 10, 3.5000, 0, 0.0000, 0.0000, 0.0080, 0.0000),
( 3, 1, 50, 5.5000, 100, 0.0000, 0.0000, 0.0080, 0.0000);

View File

@ -0,0 +1,10 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`annualAverageInvoiced` AS
SELECT
`e`.`Id_Cliente` AS `clientFk`, `e`.`Consumo` AS `invoiced`
FROM
`bi`.`facturacion_media_anual` `e`;

View File

@ -0,0 +1,24 @@
{
"name": "AnnualAverageInvoiced",
"base": "VnModel",
"options": {
"mysql": {
"table": "annualAverageInvoiced"
}
},
"properties": {
"invoiced": {
"type": "Number"
},
"clientFk": {
"id": true
}
},
"relations": {
"client": {
"type": "belongsTo",
"model": "client",
"foreignKey": "clientFk"
}
}
}

View File

@ -28,6 +28,9 @@
},
"Expedition": {
"dataSource": "vn"
},
"AnnualAverageInvoiced": {
"dataSource": "vn"
}
}