Skip to content

Commit

Permalink
correcao erro mensagem validacao com conta nao encontrada
Browse files Browse the repository at this point in the history
  • Loading branch information
suzigit committed May 29, 2019
1 parent 7ee26c7 commit bfcce57
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
1 change: 0 additions & 1 deletion Front/src/app/associa-conta-cliente/Cliente.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export class Cliente {
cnpj: string;
cnpjWithMask: string;
dadosCadastrais: {
cidade: string;
razaoSocial: string;
CNAE: string;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class DashboardIdEmpresaComponent implements OnInit {
console.log("Evento Cadastro");
console.log(eventoCadastro);


transacaoPJ = {
cnpj: eventoCadastro.args.cnpj,
razaoSocial: "",
Expand All @@ -111,6 +111,10 @@ export class DashboardIdEmpresaComponent implements OnInit {
status: "Conta Cadastrada"
}

if (transacaoPJ.salic=="0") transacaoPJ.salic="-";
if (transacaoPJ.nomeConta=="0") transacaoPJ.nomeConta="-";


self.includeIfNotExists(transacaoPJ);

self.pessoaJuridicaService.recuperaEmpresaPorCnpj(transacaoPJ.cnpj).subscribe(
Expand Down Expand Up @@ -177,8 +181,11 @@ export class DashboardIdEmpresaComponent implements OnInit {
nomeConta: eventoTroca.args.idFinancialSupportAgreement,
status: "Conta Associada por Troca"
};

if (transacaoPJ.salic=="0") transacaoPJ.salic="-";
if (transacaoPJ.nomeConta=="0") transacaoPJ.nomeConta="-";

self.includeIfNotExists(transacaoPJ);


self.pessoaJuridicaService.recuperaEmpresaPorCnpj(transacaoPJ.cnpj).subscribe(
data => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export class DashboardTransferenciasComponent implements OnInit {

for (var i = 0; i < data.subcreditos.length; i++) {
if (eventoLiberacao.args.idFinancialSupportAgreement == data.subcreditos[i].numero) {
subcredito = data.subcreditos[i].nome + " - " + data.subcreditos[i].numero
subcredito = data.subcreditos[i].numero
}
}

Expand Down
1 change: 0 additions & 1 deletion Front/src/app/fornecedor/Fornecedor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export class Fornecedor {
cnpj: string;
cnpjWithMask: string;
dadosCadastrais: {
cidade: string;
razaoSocial: string;
CNAE: string;
email: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export class LiquidacaoResgateComponent implements OnInit {
data => {

self.liquidacaoResgate.razaoSocial = data.dadosCadastrais.razaoSocial;
self.liquidacaoResgate.cidadeResgate = data.dadosCadastrais.cidade;
self.liquidacaoResgate.cnpj = eventoResgate.args.cnpj;
self.liquidacaoResgate.valorResgate = self.web3Service.converteInteiroParaDecimal(parseInt(eventoResgate.args.value)),

Expand Down
1 change: 0 additions & 1 deletion Front/src/app/liquidacao-resgate/liquidacao-resgate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export class LiquidacaoResgate {
cnpj: string;
valorResgate: number;
hashResgate; string;
cidadeResgate: string;
dataHoraResgate: Date;

dataHoraLiquidacao: Date;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ <h2 class="page-header">Validação de Cadastro</h2>
</table>
</div>

<div class="msg-conta-invalida" *ngIf="pj.cnpj && !estaContaEstadoAguardandoValidacao()">
<div class="msg-conta-invalida" *ngIf="!contaBuscadaENaoAssociada && pj.cnpj && !estaContaEstadoAguardandoValidacao()">
Conta não está no status aguardando validação
</div>
<div class="msg-conta-invalida" *ngIf="pj.cnpj && hashDeclaracaoDigitado && !isHashDigitadoIgualAHashDeclaracao()">
<div class="msg-conta-invalida" *ngIf="contaBuscadaENaoAssociada">
Conta não associada a uma empresa
</div>
<div class="msg-conta-invalida" *ngIf="!contaBuscadaENaoAssociada && pj.cnpj && hashDeclaracaoDigitado && !isHashDigitadoIgualAHashDeclaracao()">
Hash digitado é diferente do hash da declaração
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class ValidacaoCadastroComponent implements OnInit {
isHashInvalido: boolean = false;
hashDeclaracaoDigitado: string;
selectedAccount: any;
contaBuscadaENaoAssociada: boolean = false;

constructor(private pessoaJuridicaService: PessoaJuridicaService, protected bnAlertsService: BnAlertsService, private web3Service: Web3Service,
private router: Router, private ref: ChangeDetectorRef, private zone: NgZone) {
Expand All @@ -46,6 +47,7 @@ export class ValidacaoCadastroComponent implements OnInit {

recuperaClientePorContaBlockchain(conta) {
let self = this;
self.contaBuscadaENaoAssociada = false;

if ( conta != undefined && conta != "" && conta.length == 42 ) {

Expand All @@ -57,7 +59,6 @@ export class ValidacaoCadastroComponent implements OnInit {

console.log("#### result da validacao cadastro da conta " + conta);
console.log(result);

self.pj.cnpj = result.cnpj;
self.pj.idSubcredito = result.idSubcredito;
self.pj.salic = result.salic;
Expand All @@ -74,9 +75,12 @@ export class ValidacaoCadastroComponent implements OnInit {
}
}) //fecha busca PJInfo


} //fecha if de PJ valida

else {
self.contaBuscadaENaoAssociada = true;

self.apagaCamposDaEstrutura();
console.log("Não encontrou PJ valida para a conta blockchain");
}
Expand Down

0 comments on commit bfcce57

Please sign in to comment.