Rev 158 | Rev 162 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 158 | Rev 161 | ||
|---|---|---|---|
| Line 789... | Line 789... | ||
| 789 | 789 | ||
| 790 | for (JAXBElement<?> elemento : produtoNota.getImposto().getContent()) { |
790 | for (JAXBElement<?> elemento : produtoNota.getImposto().getContent()) { |
| 791 | if (elemento.getDeclaredType().equals(nfce.java.TNFe.InfNFe.Det.Imposto.ICMS.class)) { |
791 | if (elemento.getDeclaredType().equals(nfce.java.TNFe.InfNFe.Det.Imposto.ICMS.class)) { |
| 792 | nfce.java.TNFe.InfNFe.Det.Imposto.ICMS icms = (nfce.java.TNFe.InfNFe.Det.Imposto.ICMS) elemento.getValue(); |
792 | nfce.java.TNFe.InfNFe.Det.Imposto.ICMS icms = (nfce.java.TNFe.InfNFe.Det.Imposto.ICMS) elemento.getValue(); |
| 793 | if (VerificadorUtil.naoEstaNulo(icms.getICMS00())) { |
793 | if (VerificadorUtil.naoEstaNulo(icms.getICMS00())) { |
| 794 | Double aliquotaIcms = Double.valueOf(icms.getICMS00().getPICMS()); |
- | |
| 795 | if (aliquotaIcms > 0.0) { |
- | |
| 796 | this.setAliquotaIcmsNotaFiscal(aliquotaIcms); |
- | |
| 797 | this.setAliquotaIcms(aliquotaIcms); |
- | |
| 798 | } else { |
- | |
| 799 | this.setAliquotaIcmsNotaFiscal(0.0); |
- | |
| 800 | this.setAliquotaIcms(ConstantesSEC.NotaFiscal.Imposto.ALIQUOTA_INTERNA_ICMS_PADRAO_12); |
- | |
| 801 | }
|
- | |
| - | 794 | preencherAliquotaIcms(Double.valueOf(icms.getICMS00().getPICMS())); |
|
| - | 795 | }
|
|
| - | 796 | if (VerificadorUtil.naoEstaNulo(icms.getICMS10())) { |
|
| - | 797 | preencherAliquotaIcms(Double.valueOf(icms.getICMS10().getPICMS())); |
|
| 802 | }
|
798 | }
|
| 803 | }
|
799 | }
|
| 804 | if (elemento.getDeclaredType().equals(nfce.java.TIpi.class)) { |
800 | if (elemento.getDeclaredType().equals(nfce.java.TIpi.class)) { |
| 805 | nfce.java.TIpi ipi = (nfce.java.TIpi) elemento.getValue(); |
801 | nfce.java.TIpi ipi = (nfce.java.TIpi) elemento.getValue(); |
| 806 | if (VerificadorUtil.naoEstaNulo(ipi.getIPITrib())) { |
802 | if (VerificadorUtil.naoEstaNulo(ipi.getIPITrib())) { |
| Line 818... | Line 814... | ||
| 818 | 814 | ||
| 819 | if (VerificadorUtil.estaNulo(this.getValorCompra())) { |
815 | if (VerificadorUtil.estaNulo(this.getValorCompra())) { |
| 820 | if (VerificadorUtil.naoEstaNulo(produtoNota.getProd().getVUnCom())) { |
816 | if (VerificadorUtil.naoEstaNulo(produtoNota.getProd().getVUnCom())) { |
| 821 | this.setValorCompra(retornarValorComDesconto(produtoNota.getProd())); |
817 | this.setValorCompra(retornarValorComDesconto(produtoNota.getProd())); |
| 822 | }
|
818 | }
|
| - | 819 | }
|
|
| - | 820 | }
|
|
| - | 821 | private void preencherAliquotaIcms(Double aliquotaIcms) { |
|
| - | 822 | if (aliquotaIcms > 0.0) { |
|
| - | 823 | this.setAliquotaIcmsNotaFiscal(aliquotaIcms); |
|
| - | 824 | this.setAliquotaIcms(aliquotaIcms); |
|
| - | 825 | } else { |
|
| - | 826 | this.setAliquotaIcmsNotaFiscal(0.0); |
|
| - | 827 | this.setAliquotaIcms(ConstantesSEC.NotaFiscal.Imposto.ALIQUOTA_INTERNA_ICMS_PADRAO_12); |
|
| 823 | }
|
828 | }
|
| 824 | }
|
829 | }
|
| 825 | 830 | ||
| 826 | public Double retornarValorComDesconto(nfce.java.TNFe.InfNFe.Det.Prod produto) { |
831 | public Double retornarValorComDesconto(nfce.java.TNFe.InfNFe.Det.Prod produto) { |
| 827 | Double valor = 0.0; |
832 | Double valor = 0.0; |