This commit is contained in:
parent
7d5591462d
commit
7194e62cae
|
@ -1,53 +0,0 @@
|
|||
ALTER TABLE `vn`.`entry` ADD observationEditorFk INT(10) unsigned NULL COMMENT 'Último usuario que ha modificado el campo evaNotes';
|
||||
ALTER TABLE `vn`.`entry` ADD CONSTRAINT entry_observationEditorFk FOREIGN KEY (observationEditorFk) REFERENCES account.user(id) ON UPDATE CASCADE;
|
||||
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost`
|
||||
VIEW `vn2008`.`entrySource` AS
|
||||
select
|
||||
`e`.`gestDocFk` AS `gestdoc_id`,
|
||||
`e`.`id` AS `Id_Entrada`,
|
||||
`e`.`invoiceNumber` AS `invoiceNumber`,
|
||||
`e`.`reference` AS `reference`,
|
||||
`e`.`isExcludedFromAvailable` AS `Inventario`,
|
||||
`e`.`notes` AS `observaciones`,
|
||||
`e`.`isConfirmed` AS `Confirmada`,
|
||||
`e`.`isOrdered` AS `Pedida`,
|
||||
`e`.`isRaid` AS `Redada`,
|
||||
`e`.`evaNotes` AS `notas`,
|
||||
`e`.`supplierFk` AS `Id_Proveedor`,
|
||||
`tr`.`shipped` AS `shipment`,
|
||||
`tr`.`landed` AS `landing`,
|
||||
`w2`.`name` AS `wh_in`,
|
||||
`w1`.`name` AS `wh_out`,
|
||||
`am`.`name` AS `Agencia`,
|
||||
`e`.`commission` AS `comision`,
|
||||
`tr`.`warehouseInFk` AS `warehouse_id`,
|
||||
`w1`.`id` AS `warehouse_id_out`,
|
||||
`e`.`isBooked` AS `anotadoencaja`,
|
||||
`e`.`invoiceInFk` AS `invoiceInFk`,
|
||||
`e`.`companyFk` AS `empresa_id`,
|
||||
`e`.`currencyFk` AS `Id_Moneda`,
|
||||
`tr`.`id` AS `TravelFk`,
|
||||
`e`.`sub` AS `sub`,
|
||||
`e`.`kop` AS `kop`,
|
||||
`e`.`pro` AS `pro`,
|
||||
`e`.`invoiceAmount` AS `invoiceAmount`,
|
||||
`w`.`code` AS `buyerCode`,
|
||||
`e`.`typeFk` AS `typeFk`,
|
||||
`w3`.`code` AS `observationWorkerCode`
|
||||
from
|
||||
(((((((`vn`.`entry` `e`
|
||||
left join `vn`.`travel` `tr` on
|
||||
(`e`.`travelFk` = `tr`.`id`))
|
||||
left join `vn`.`agencyMode` `am` on
|
||||
(`am`.`id` = `tr`.`agencyModeFk`))
|
||||
left join `vn`.`warehouse` `w1` on
|
||||
(`tr`.`warehouseOutFk` = `w1`.`id`))
|
||||
left join `vn`.`warehouse` `w2` on
|
||||
(`tr`.`warehouseInFk` = `w2`.`id`))
|
||||
left join `vn`.`supplier` `s` on
|
||||
(`e`.`supplierFk` = `s`.`id`))
|
||||
left join `vn`.`worker` `w` on
|
||||
(`w`.`id` = `e`.`buyerFk`))
|
||||
left join `vn`.`worker` `w3` on
|
||||
(`w3`.`id` = `e`.`observationEditorFk`));
|
|
@ -26286,6 +26286,7 @@ CREATE TABLE `entry` (
|
|||
`typeFk` varchar(100) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Tipo de entrada',
|
||||
`reference` varchar(50) COLLATE utf8mb3_unicode_ci DEFAULT NULL COMMENT 'Referencia para eti',
|
||||
`ref` varchar(50) GENERATED ALWAYS AS (`invoiceNumber`) VIRTUAL COMMENT 'Columna virtual provisional para Salix',
|
||||
`observationEditorFk` INT(10) unsigned NULL COMMENT 'Último usuario que ha modificado el campo evaNotes',
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `Id_Proveedor` (`supplierFk`),
|
||||
KEY `Fecha` (`dated`),
|
||||
|
@ -26300,7 +26301,8 @@ CREATE TABLE `entry` (
|
|||
CONSTRAINT `entry_FK_1` FOREIGN KEY (`typeFk`) REFERENCES `entryType` (`code`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `entry_ibfk_1` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `entry_ibfk_6` FOREIGN KEY (`travelFk`) REFERENCES `travel` (`id`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `entry_ibfk_7` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE
|
||||
CONSTRAINT `entry_ibfk_7` FOREIGN KEY (`companyFk`) REFERENCES `company` (`id`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `entry_observationEditorFk` FOREIGN KEY (`observationEditorFk`) REFERENCES `account`.`user`(`id`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDBDEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci COMMENT='InnoDB free: 88064 kB; (`Id_Proveedor`) REFER `vn2008/Provee';
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
||||
|
|
Loading…
Reference in New Issue