Skip to content

Instantly share code, notes, and snippets.

@Alvarocda
Created May 26, 2020 13:31
Show Gist options
  • Save Alvarocda/92627d3b4a293912a00c1017a30df78f to your computer and use it in GitHub Desktop.
Save Alvarocda/92627d3b4a293912a00c1017a30df78f to your computer and use it in GitHub Desktop.
carregaCondicoesEParcelasSalvas (valorTotal, codCondicaoPagamento, parcelas, modoLeitura = false) {
this.criaParcelasAoCarregarGrade = false
while (this.listaFormasPagamento === null) {
setTimeout(() => {
console.log('esperando carregar formas de pagamento')
}, 100)
}
this.condicacaoPagamentoSelecionada = this.listaCondicoesPagamento.filter(c => Number(c.codCondicaoPagamento) === codCondicaoPagamento)[0]
this.valorTotal = valorTotal
this.modoLeitura = modoLeitura
this.statusCarregamento = true
if (parcelas !== null) {
parcelas.forEach(async p => {
var parcela = p
var formaPagamento = this.listaFormasPagamento.filter(f => f.codFormaPagamento === parcela.codFormaPagamento)[0]
parcela.descricao = formaPagamento.descricao
console.log(parcela)
parcela.dataVencimento = await ConverteDatetimePraString(parcela.dataVencimento)
this.parcelasOrcamento.push(parcela)
})
}
this.statusCarregamento = false
setTimeout(() => {
this.criaParcelasAoCarregarGrade = true
}, 200)
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment