Skip to content

Commit

Permalink
Merge pull request #465 from RJ-SMTR/feature/remessa_pendente
Browse files Browse the repository at this point in the history
ajuste sincronismo
  • Loading branch information
williamfl2007 authored Sep 16, 2024
2 parents 22b1123 + 0de2f04 commit 66173e1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/cron-jobs/cron-jobs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,12 @@ export class CronJobsService {
}
this.logger.log('Tarefa iniciada', METHOD);
const startDate = new Date();
const sex = subDays(today, 7);
const qui = subDays(today, 1);
// const sex = subDays(today, 7);
// const qui = subDays(today, 1);

const sex = new Date('2024-07-12');
const qui = new Date('2024-09-06');

await this.cnabService.saveTransacoesJae(sex, qui, 0, 'Van');
const listCnab = await this.cnabService.generateRemessa({
tipo: PagadorContaEnum.ContaBilhetagem,
Expand Down
9 changes: 6 additions & 3 deletions src/relatorio/relatorio-sintetico.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,12 @@ export class RelatorioSinteticoRepository {
in ('STPC','STPL','VLT','Santa Cruz','Internorte','Intersul','Transcarioca','MobiRio') `;
}else

if((['Todos'].some(i=>args.favorecidoNome?.includes(i)))){
query = query +` and tv."nomeConsorcio" in('STPC','STPL') `;
}
if((['Todos'].some(i=>args.favorecidoNome?.includes(i))) && (args.consorcioNome!==undefined)){
query = query +` and tv."nomeConsorcio" in('STPC','STPL',${args.consorcioNome?.join("','")}) `;
}else
if((['Todos'].some(i=>args.favorecidoNome?.includes(i)))){
query = query +` and tv."nomeConsorcio" in('STPC','STPL') `;
}

if(args.valorMin!==undefined)
query = query +` and tv."valorPago">=${args.valorMin}`;
Expand Down
2 changes: 1 addition & 1 deletion src/transacao-view/transacao-view.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class TransacaoViewRepository {
AND tv."datetimeTransacao"::DATE BETWEEN
(ita."dataOrdem"::DATE - (CASE WHEN ita."nomeConsorcio" = 'VLT' THEN INTERVAL '2 DAYS' ELSE INTERVAL '8 DAYS' END)) -- VENCIMENTO - 2 SE VLT; SENÃO QUINTA PGTO
AND (DATE(ita."dataOrdem") - INTERVAL '2 DAYS') -- VENCIMENTO - 2 (OU QUARTA PGTO SE NÃO for VLT)
WHERE ${where.length ? `AND ${where.join(' AND ')}` : ''}
WHERE (1=1) ${where.length ? `AND ${where.join(' AND ')}` : ''}
ORDER BY tv.id ASC, ita.id DESC
) associados
WHERE id = associados.tv_id
Expand Down

0 comments on commit 66173e1

Please sign in to comment.