forked from FITER1/fineract-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SU-488: Archivo de Cartera - Departamento
- Loading branch information
1 parent
3c8ae43
commit d1786c8
Showing
3 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
...n/resources/db/changelog/tenant/parts/20243008011009142_SU_488_update_report._archivo.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd"> | ||
<changeSet id="1" author="fineract"> | ||
<update tableName="STRETCHY_REPORT"> | ||
<column name="REPORT_SQL"> | ||
<![CDATA[ | ||
SELECT | ||
title AS "Titulo", | ||
identificacion AS "Cedula del cliente", | ||
primer_nombre AS "Primer Nombre", | ||
segundo_nombre AS "Segundo Nombre", | ||
primer_apellido AS "Primer Apellido", | ||
segundo_apellido AS "Segundo Apellido", | ||
estado_cliente AS "Estado Cliente", | ||
numero_obligacion AS "Numero Cuenta Cuota", | ||
nit_empresa AS "Nit Empresa", | ||
telefono_sac_1 AS "Telefono", | ||
celular_sac_1 AS "Mobile No", | ||
telefono_sac_2 AS "Telefono Sac 2", | ||
celular_sac_2 AS "Celular Sac 2", | ||
email_sac AS "Email", | ||
direccion_sac AS "Direccion", | ||
barrio_sac AS "Barrio", | ||
ciudad_sac AS "Ciudad", | ||
COALESCE(departamento,(select code_value | ||
from m_code_value mcv where code_id = 40 and code_score =(select CASE | ||
WHEN LEFT(LPAD(code_score::TEXT, 5, '0'), 2)::INTEGER < 10 THEN | ||
LEFT(LPAD(code_score::TEXT, 5, '0'), 2)::INTEGER::VARCHAR | ||
ELSE | ||
LEFT(LPAD(code_score::TEXT, 5, '0'), 2) | ||
END as departement_id from m_code_value mcv where code_value =ciudad_sac) )) AS "Departamento", | ||
tipo_credito AS "Categoria punto de venta de origen del credito", | ||
COALESCE(fecha_vencimiento::text, '') AS "Vencimiento cuota", | ||
dias_mora AS "Dias de mora de la cuenta", | ||
valor_cuota AS "Cuota", | ||
capital AS "Capital", | ||
monto_inicial AS "Monto inicial", | ||
aval AS "Aval", | ||
intereses AS "Intereses", | ||
intereses_de_mora AS "Intereses de mora", | ||
iva_interes_de_mora AS "IVA de mora", | ||
seguro AS "Seguro obligatorio cuota", | ||
seguros_voluntarios AS "Seguros voluntarios cuota", | ||
punto_de_venta AS "Punto de venta de origen del credito", | ||
tipo_documento AS "Tipo de documento", | ||
empresa AS "Empresa", | ||
nit_empresa_aliada AS "Nit empresa aliada", | ||
marca AS "Nombre Aliado", | ||
razon_social AS "Nombre completo del cliente", | ||
ciudad_punto_credito AS "Ciudad punto de venta", | ||
estado_cuota AS "Estado de la cuenta", | ||
nombre_familiar_1 AS "Referencia del cliente", | ||
parentesco_familiar_1 AS "Parentesco referencia", | ||
celular_familiar_1 AS "Celular referencia", | ||
nombre_familiar_2 AS "Nombre familiar", | ||
parentesco_familiar_2 AS "Parentesco familiar", | ||
celular_familiar_2 AS "Celular familiar", | ||
COALESCE(fecha_financiacion::text, '') AS "Fecha de desembolso", | ||
COALESCE(fecha_nacimiento::text, '') AS "Fecha nacimiento cliente", | ||
genero AS "Genero cliente", | ||
empresa_labora AS "Nombre empresa donde labora", | ||
ingresos AS "Media de ingresos", | ||
periodicidad AS "Mensual", | ||
COALESCE(antiguedad_cliente::text, '') AS "Fecha de creacion del cliente", | ||
empresa_reporta AS "Intercredito", | ||
abono AS "Abonos cuota", | ||
condonaciones AS "Condonaciones cuota", | ||
actividad_laboral AS "Actividad laboral del cliente", | ||
cre_estado AS "Estado cliente", | ||
cre_saldo AS "Saldo total del credito", | ||
cuo_saldo AS "Saldo total cuota", | ||
cuo_estado AS "Cuo Estado de la cuenta", | ||
estado_civil AS "Estado civil del cliente", | ||
numero_de_reprogramaciones AS "Numero de reprogramaciones" | ||
FROM m_archive_loan_history | ||
ORDER BY | ||
identificacion DESC, | ||
CAST(SPLIT_PART(numero_obligacion, '+', 1) AS INTEGER) DESC, | ||
CAST(SPLIT_PART(numero_obligacion, '+', -1) AS INTEGER) ASC | ||
]]> | ||
</column> | ||
<where>report_name = 'Archivo de cartera'</where> | ||
</update> | ||
</changeSet> | ||
</databaseChangeLog> |