Repository navigation
Expand file tree
/
Copy pathdefineValueWithComma.js
More file actions
33 lines (24 loc) · 3.84 KB
/
Copy pathdefineValueWithComma.js
File metadata and controls
33 lines (24 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//function run(productsInSaleRemoveCard, responseGetProductsSale) {
let responseTotal = {"page":"1","total":"2","registros":[{"estoque":"N","filial_id":"1","pcomissao":"","fator_conversao":"1.000000000","ultima_atualizacao":"","id_almox":"1","tipo_produto":"S","qtde_pedido":"","ultima_situacao_patrimonio":"","movimento_cancelamento_venda":"N","id":"6214492","pdesconto":"0.00000","id_saida":"3841465","tipo":"S","quantidade":"0.000000000","id_produto":"47","descricao":"MULTI 100 (SCI)","id_unidade":"13","qtde_saida":"1.000000000","unidade_sigla":"SER","id_moeda":"","valor_unitario":"39.960000000","vdesconto":"0.00","vacrescimo":"0.00","vdesconto_finan":"0.00","valor_total":"39.96","id_classificacao_tributaria":"21","id_ajuste_estoque":"","pacrescimo":"0.00000","id_oss_chamado":"","id_patrimonio":"","id_tipo_documento":"0"},{"estoque":"N","filial_id":"1","pcomissao":"","fator_conversao":"1.000000000","ultima_atualizacao":"","id_almox":"1","tipo_produto":"S","qtde_pedido":"","ultima_situacao_patrimonio":"","movimento_cancelamento_venda":"N","id":"6214491","pdesconto":"0.00000","id_saida":"3841465","tipo":"S","quantidade":"0.000000000","id_produto":"10","descricao":"MULTI 100 (SCM)","id_unidade":"13","qtde_saida":"1.000000000","unidade_sigla":"SER","id_moeda":"","valor_unitario":"59.940000000","vdesconto":"0.00","vacrescimo":"0.00","vdesconto_finan":"0.00","valor_total":"59.94","id_classificacao_tributaria":"1","id_ajuste_estoque":"","pacrescimo":"0.00000","id_oss_chamado":"","id_patrimonio":"","id_tipo_documento":"0"}]}//JSON.parse(responseGetProductsSale)
let totalProduct = responseTotal.total
let response = {"sci":{"estoque":"N","filial_id":"1","pcomissao":"","fator_conversao":"1.000000000","ultima_atualizacao":"","id_almox":"1","tipo_produto":"S","qtde_pedido":"","ultima_situacao_patrimonio":"","movimento_cancelamento_venda":"N","id":"6214492","pdesconto":"0.00000","id_saida":"3841465","tipo":"S","quantidade":"0.000000000","id_produto":"47","descricao":"MULTI 100 (SCI)","id_unidade":"13","qtde_saida":"1.000000000","unidade_sigla":"SER","id_moeda":"","valor_unitario":"39.960000000","vdesconto":"0.00","vacrescimo":"0.00","vdesconto_finan":"0.00","valor_total":"39.96","id_classificacao_tributaria":"21","id_ajuste_estoque":"","pacrescimo":"0.00000","id_oss_chamado":"","id_patrimonio":"","id_tipo_documento":"0"},"scm":{"estoque":"N","filial_id":"1","pcomissao":"","fator_conversao":"1.000000000","ultima_atualizacao":"","id_almox":"1","tipo_produto":"S","qtde_pedido":"","ultima_situacao_patrimonio":"","movimento_cancelamento_venda":"N","id":"6214491","pdesconto":"0.00000","id_saida":"3841465","tipo":"S","quantidade":"0.000000000","id_produto":"10","descricao":"MULTI 100 (SCM)","id_unidade":"13","qtde_saida":"1.000000000","unidade_sigla":"SER","id_moeda":"","valor_unitario":"59.940000000","vdesconto":"0.00","vacrescimo":"0.00","vdesconto_finan":"0.00","valor_total":"59.94","id_classificacao_tributaria":"1","id_ajuste_estoque":"","pacrescimo":"0.00000","id_oss_chamado":"","id_patrimonio":"","id_tipo_documento":"0"}}//JSON.parse(productsInSaleRemoveCard)
if (totalProduct == '2') {
let valueSciComa = response.sci.valor_total
valueSciComa = valueSciComa.replace('.', ',')
let valueScmComma = response.scm.valor_total
valueScmComma = valueScmComma.replace('.', ',')
console.log({ valueSciComa, valueScmComma })
return { valueSciComa, valueScmComma }
}
if (totalProduct == '4') {
let valueSciComa = response.sci.valor_total
valueSciComa = valueSciComa.replace('.', ',')
let valueScmComma = response.scm.valor_total
valueScmComma = valueScmComma.replace('.', ',')
let valueWatchComma = response.uol.valor_total
valueWatchComma = valueWatchComma.replace('.', ',')
let valueUolComma = response.watch.valor_total
valueUolComma = valueUolComma.replace('.', ',')
return { valueSciComa, valueScmComma, valueWatchComma, valueUolComma }
}
//}