salix/db/routines/vn2008/views/Clientes.sql

49 lines
1.6 KiB
SQL

CREATE OR REPLACE DEFINER=`root`@`localhost`
SQL SECURITY DEFINER
VIEW `vn2008`.`Clientes`
AS SELECT `c`.`id` AS `id_cliente`,
`c`.`name` AS `cliente`,
`c`.`fi` AS `if`,
`c`.`socialName` AS `razonSocial`,
`c`.`contact` AS `contacto`,
`c`.`street` AS `domicilio`,
`c`.`city` AS `poblacion`,
`c`.`postcode` AS `codPostal`,
`c`.`phone` AS `telefono`,
`c`.`mobile` AS `movil`,
`c`.`isRelevant` AS `real`,
`c`.`email` AS `e-mail`,
`c`.`iban` AS `iban`,
`c`.`dueDay` AS `vencimiento`,
`c`.`accountingAccount` AS `Cuenta`,
`c`.`isEqualizated` AS `RE`,
`c`.`provinceFk` AS `province_id`,
`c`.`hasToInvoice` AS `invoice`,
`c`.`credit` AS `credito`,
`c`.`countryFk` AS `Id_Pais`,
`c`.`isActive` AS `activo`,
`c`.`gestdocFk` AS `gestdoc_id`,
`c`.`quality` AS `calidad`,
`c`.`payMethodFk` AS `pay_met_id`,
`c`.`created` AS `created`,
`c`.`isToBeMailed` AS `mail`,
`c`.`contactChannelFk` AS `chanel_id`,
`c`.`hasSepaVnl` AS `sepaVnl`,
`c`.`hasCoreVnl` AS `coreVnl`,
`c`.`hasCoreVnh` AS `coreVnh`,
`c`.`hasLcr` AS `hasLcr`,
`c`.`defaultAddressFk` AS `default_address`,
`c`.`riskCalculated` AS `risk_calculated`,
`c`.`hasToInvoiceByAddress` AS `invoiceByAddress`,
`c`.`isTaxDataChecked` AS `contabilizado`,
`c`.`isFreezed` AS `congelado`,
`c`.`creditInsurance` AS `creditInsurance`,
`c`.`isCreatedAsServed` AS `isCreatedAsServed`,
`c`.`hasInvoiceSimplified` AS `hasInvoiceSimplified`,
`c`.`salesPersonFk` AS `Id_Trabajador`,
`c`.`isVies` AS `vies`,
`c`.`eypbc` AS `EYPBC`,
`c`.`bankEntityFk` AS `bankEntityFk`,
`c`.`typeFk` AS `typeFk`
FROM `vn`.`client` `c`