create new model ticketRequest

This commit is contained in:
Bernat 2018-10-30 12:17:22 +01:00
parent 12fc0941b7
commit ddcd7baaf6
5 changed files with 76 additions and 1 deletions

View File

@ -1 +1,2 @@
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (118, 'WorkerTeam', '*', '*', 'ALLOW', 'role', 'salesPerson');
INSERT INTO `salix`.`ACL` (`id`, `model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES (119, 'TicketRequest', '*', '*', 'ALLOW', 'role', 'salesPerson');

View File

@ -0,0 +1,18 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `ticketRequest` AS
SELECT
`t`.`Id_ORDEN` AS `id`,
`t`.`ORDEN` AS `description`,
`t`.`CodVENDEDOR` AS `requestFk`,
`t`.`CodCOMPRADOR` AS `atenderFk`,
`t`.`CANTIDAD` AS `quantity`,
`t`.`PRECIOMAX` AS `price`,
`t`.`KO` AS `isOk`,
`t`.`Id_Movimiento` AS `saleFk`,
`t`.`odbc_date` AS `created`
FROM
`vn2008`.`Ordenes` `t`;

View File

@ -1017,4 +1017,11 @@ INSERT INTO `vn2008`.`workerTeam`(`id`, `team`, `user`)
(3, 2, 101),
(4, 2, 102),
(5, 3, 103),
(6, 3, 104);
(6, 3, 104);
INSERT INTO `vn`.`ticketRequest`(`id`, `description`, `requestFk`, `atenderFk`, `quantity`, `price`, `isOk`, `saleFk`, `created`)
VALUES
(1, 'Gem of Time', '018', '035', 5, 9.10, 0, 1, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(2, 'Gem of Mind', '018', '035', 10, 1.07, 0, 2, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(3, 'Mark I', '018', '035', 20, 3.06, 0, 4, DATE_ADD(CURDATE(), INTERVAL -15 DAY)),
(4, 'Gem of Mind', '018', '035', 15, 1.30, 0, 7, CURDATE());

View File

@ -0,0 +1,46 @@
{
"name": "TicketRequest",
"base": "VnModel",
"options": {
"mysql": {
"table": "ticketRequest"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"description": {
"type": "String"
},
"created": {
"type": "Date"
},
"quantity": {
"type": "Number"
},
"price": {
"type": "Number"
},
"isOk": {
"type": "Boolean"
},
"atender": {
"type": "String",
"columnName": "atenderFk"
},
"requester": {
"type": "String",
"columnName": "requesterFk"
}
},
"relations": {
"sale": {
"type": "belongsTo",
"model": "Sale",
"foreignKey": "saleFk"
}
}
}

View File

@ -143,5 +143,8 @@
},
"WorkerTeam": {
"dataSource": "vn"
},
"TicketRequest": {
"dataSource": "vn"
}
}