create or replace view vw_fco_integrada_rt04 as
select compania,
       anio,
       mes,
       sucursal,
       tipo_planilla,
       secuencia,
       '04' || ltrim(to_char(secuencia, '00000')) ||
       LPAD(fn_fco_cod_super('EPS', cod_EPS), 6, ' ') ||
       LPAD(nit, 16, '0') || dv ||
       ltrim(to_char(suma_aportes, '0000000000')) ||
       ltrim(to_char(suma_UPC, '0000000000')) ||
       lpad(nro_aut_IGE, 15, ' ') ||
       ltrim(to_char(suma_aut_IGE, '0000000000')) ||
       lpad(nro_aut_LMA, 15, ' ') ||
       ltrim(to_char(suma_aut_LMA, '0000000000')) ||
       ltrim(to_char(neto_aportes, '0000000000')) ||
       ltrim(to_char(dias_mora, '0000')) ||
       ltrim(to_char(int_mora_aportes, '0000000000')) ||
       ltrim(to_char(int_mora_UPC, '0000000000')) ||
       ltrim(to_char(subtotal_aportes, '0000000000')) ||
       ltrim(to_char(subtotal_UPC, '0000000000')) ||
       lpad(nro_radicacion, 10, '0') ||
       ltrim(to_char(saldo_favor_aportes, '0000000000')) ||
       ltrim(to_char(saldo_favor_UPC, '0000000000')) ||
       ltrim(to_char(total_aportes, '0000000000')) ||
       ltrim(to_char(total_UPC, '0000000000')) ||
       ltrim(to_char(total_pagar, '0000000000')) ||
       ltrim(to_char(FOSYGA, '0000000000')) ||
       ltrim(to_char(total_afiliados, '000000')) registro
  from fco_integrada_rt04;
