Skip to content

Commit

Permalink
Anomalia squadratura con fattura elettronica in caso di nota credito
Browse files Browse the repository at this point in the history
  • Loading branch information
raffaelepagano committed Feb 24, 2017
1 parent 1e5bd92 commit 4fb291a
Showing 1 changed file with 7 additions and 3 deletions.
Expand Up @@ -7480,7 +7480,7 @@ public void validaFatturaElettronica(UserContext aUC,Fattura_passivaBulk fattura
DocumentoEleIvaBulk rigaEle=(DocumentoEleIvaBulk)i.next();
String key = null;
Hashtable<String, BigDecimal> currentMap = null;
if(rigaEle.getImponibileImporto()!=null && (noSegno?rigaEle.getImponibileImporto().abs():rigaEle.getImponibileImporto()).compareTo(BigDecimal.ZERO)!=0){
if(rigaEle.getImponibileImporto()!=null && rigaEle.getImponibileImporto().compareTo(BigDecimal.ZERO)!=0){
if (rigaEle.getNatura()!=null) {
key = rigaEle.getNatura();
currentMap = mapNaturaEle;
Expand All @@ -7490,9 +7490,9 @@ public void validaFatturaElettronica(UserContext aUC,Fattura_passivaBulk fattura
}

if (currentMap.get(key)!=null)
currentMap.put(key, currentMap.get(key).add( (noSegno?rigaEle.getImposta().abs():rigaEle.getImposta())));
currentMap.put(key, currentMap.get(key).add(rigaEle.getImposta()));
else
currentMap.put(key, (noSegno?rigaEle.getImposta().abs():rigaEle.getImposta()));
currentMap.put(key, rigaEle.getImposta());
}
}

Expand Down Expand Up @@ -7521,6 +7521,8 @@ public void validaFatturaElettronica(UserContext aUC,Fattura_passivaBulk fattura
String key = (String)i.next();
BigDecimal value = mapNatura.get(key);
BigDecimal valueEle = mapNaturaEle.get(key);
if (noSegno)
valueEle = valueEle.abs();
BigDecimal valueEleArr = Utility.nvl(mapNaturaEleArr.get(key));
if (!(value!=null && valueEle!=null && value.compareTo(valueEle)==0))
if ((valueEleArr.compareTo(new BigDecimal(0))==0 && value!=null && valueEle!=null && value.compareTo(valueEle)!=0) ||
Expand All @@ -7538,6 +7540,8 @@ public void validaFatturaElettronica(UserContext aUC,Fattura_passivaBulk fattura
String key = (String)i.next();
BigDecimal value = mapIva.get(key);
BigDecimal valueEle = mapIvaEle.get(key);
if (noSegno)
valueEle = valueEle.abs();
BigDecimal valueEleArr = Utility.nvl(mapIvaEleArr.get(key));
if(!(value!=null && valueEle!=null && value.compareTo(valueEle)==0))
if ((valueEleArr.compareTo(new BigDecimal(0))==0 && value!=null && valueEle!=null && value.compareTo(valueEle)!=0) ||
Expand Down

0 comments on commit 4fb291a

Please sign in to comment.