2017-06-22 12:51:37 +00:00
|
|
|
select tmp.Id_Ticket as ticketFk,
|
|
|
|
tmp.Id_Cliente as clientFk,
|
|
|
|
tmp.Alias as client,
|
2017-07-12 06:53:55 +00:00
|
|
|
tmp.Fecha as `date`,
|
2017-06-22 12:51:37 +00:00
|
|
|
tmp.Hora as hour,
|
|
|
|
tmp.POBLACION as city,
|
|
|
|
tmp.PROVINCIA as province,
|
|
|
|
tmp.province_id as provinceFk,
|
|
|
|
tmp.Agencia as agency,
|
|
|
|
tmp.agency_id as agencyFk,
|
|
|
|
tmp.lines,
|
|
|
|
tmp.m3,
|
|
|
|
tmp.problems,
|
|
|
|
tmp.problem,
|
|
|
|
tmp.state as stateFk,
|
|
|
|
t.Id_Trabajador as workerfk,
|
|
|
|
concat(t.Nombre, ' ', t.Apellidos) as worker,
|
|
|
|
tt.Id_Trabajador as salesPersonFk,
|
|
|
|
concat(tt.Nombre, ' ', tt.Apellidos) as salesPerson,
|
|
|
|
s.name as state,
|
2017-07-06 06:45:33 +00:00
|
|
|
tmp.Cajas as boxes,
|
|
|
|
tmp.Id_Ruta as routeFk
|
2017-06-22 12:51:37 +00:00
|
|
|
from tmp.production_buffer tmp
|
|
|
|
inner join state s
|
|
|
|
on tmp.state = s.id
|
|
|
|
inner join Trabajadores t
|
|
|
|
on tmp.CodigoTrabajador = t.CodigoTrabajador collate utf8_unicode_ci
|
|
|
|
inner join Trabajadores tt
|
|
|
|
on tmp.Comercial = tt.CodigoTrabajador collate utf8_unicode_ci;
|
|
|
|
|
|
|
|
ALTER TABLE `salix`.`FakeProduction`
|
|
|
|
CHANGE COLUMN `client` `client` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `hour` `hour` TIME NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `city` `city` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `province` `province` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `agency` `agency` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `problem` `problem` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `worker` `worker` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `salesPerson` `salesPerson` VARCHAR(50) NULL DEFAULT NULL ,
|
|
|
|
CHANGE COLUMN `state` `state` VARCHAR(50) NULL DEFAULT NULL ;
|
|
|
|
|
|
|
|
update salix.FakeProduction set problem = null where problem like '% %';
|