Examples of FatturaException


Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

    if("S".equals(tipoIntestatario)){
      codiceMutuoInterno = causaleFattura.getCodiceMutuoInterno();
      codiceMastro = causaleFattura.getCodiceMastro();
      codiceGruppo = causaleFattura.getCodiceGruppo();
      if(codiceMutuoInterno == null){
        throw new FatturaException(messageBundle.getMessage("AlertMsgMutuoInternoNonValorizzato"));
      }else if(codiceMastro == 0){
        throw new FatturaException(messageBundle.getMessage("AlertMsgMastroNonValorizzato"));
      }else if(codiceGruppo == 0){
        throw new FatturaException(messageBundle.getMessage("AlertMsgGruppoNonValorizzato"));
      }
    }else if("M".equals(tipoIntestatario)){
      GruppoDatiFinanziari gdf = null;
      try {
        gdf = gestionePratica.getDatiFinanziariAllaData(numeroIntestatario, testata.getDataFattura());
      } catch (DataAntecedenteDataDecorrenzaException e) {
        log.debug(e.getMessage(), e);
        throw new FatturaException(messageBundle.getMessage("TextDataFatturaAntecDataDecorrenzaMutuo"));
      }
      if(gdf != null){
        codiceMutuoInterno = gdf.getCodiceMutuoInterno();
        codiceGruppo = NumberUtils.checkNull(gdf.getCodiceGruppo()).intValue();
        codiceMastro = NumberUtils.checkNull(gdf.getCodiceMastro()).intValue();
      }else{
        throw new FatturaException(messageBundle.getMessage("AlertMsgDatifinNonValorizzati"));
      }
      List<Legame> legami = gestionePratica.getLegamiPerMutuoRapporto(numeroIntestatario, CodiceRapporto.CODICE_RAPPORTO_TRAENTE.getValue());
      if(legami.size() == 0){
        Pratica pratica = contenziosoFacade.cercaPraticaByConto(numeroIntestatario);
        if(pratica != null){
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

      }
      session.setAttribute("mapSubreport", mapSubreport);
      session.setAttribute("reportList", reportList);
    } catch (Exception e) {
      log.debug(e.getMessage(), e);
      throw new FatturaException(e.getMessage());
    }
  }
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

      }
      session.setAttribute("mapSubreport", mapSubreport);
      session.setAttribute("reportList", reportList);
    } catch (Exception e) {
      log.debug(e.getMessage(), e);
      throw new FatturaException(e.getMessage());
    }
  }
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

                  subReportList.add(subReport);
                }
              }else{
                String msg = messageBundle.getMessage("AlertMsgImpossibileControllareProtocollo") + df.getCodiceTipoProtocollo()
                  + ": " + messageBundle.getMessage("AlertMsgProtocolloInesistente");
                throw new FatturaException(msg);
              }
            }
            //Setto numeroProtocollo nella riga di dettaglio
            df.setNumeroProtocollo(numeroProtocollo);
           
            tipoProtocolloPrec = df.getCodiceTipoProtocollo();
            numeroProtocolloPrec = df.getNumeroProtocollo();
          }
          primaRigaProtocollo = false;
        }
        //Setto la descrizione della voce di fattura
        subReport = new HashMap();
        if(primaRigaProtocollo)
          descrizione = "*\t";
        else{
          descrizione = " \t.";
        }
        descrizione += df.getDescrizioneVoceFattura();
        subReport.put("descrizione", descrizione);
        //Setto importo avere
        if(NumberUtils.checkNull(df.getImportoVoceAvere()) != 0){
          if(NumberUtils.checkNull(df.getImportoIvaAvere()) != 0)
            importoAvere = df.getImportoVoceAvere() - df.getImportoIvaAvere();
          else
            importoAvere = df.getImportoVoceAvere();
        }
        totaleAvere += NumberUtils.checkNull(importoAvere);
        if(importoAvere != null)
          subReport.put("importoAvere", NumberUtils.formattaNumeroMigliaia(importoAvere));
        else
          subReport.put("importoAvere", "");
        //Setto importo dare
        if(NumberUtils.checkNull(df.getImportoVoceDare()) != 0){
          if(NumberUtils.checkNull(df.getImportoIvaDare()) != 0)
            importoDare = df.getImportoVoceDare() - df.getImportoIvaDare();
          else
            importoDare = df.getImportoVoceDare();
        }
        totaleDare += NumberUtils.checkNull(importoDare);
        if(importoDare != null)
          subReport.put("importoDare", NumberUtils.formattaNumeroMigliaia(importoDare));
        else
          subReport.put("importoDare", "");
        subReportList.add(subReport);
        // Setto i dati per l'eventuale riga iva
        if(!"".equals(StringUtility.checkNull(df.getCodiceIva()).trim())){
          subReport = new HashMap();
          subReport.put("descrizione", " \t." + contabilitaFacade.leggiGruppoParametriIva(df.getCodiceIva()).getDescrizioneIva());
          if(NumberUtils.checkNull(df.getImportoIvaAvere()) != 0)
            subReport.put("importoAvere", NumberUtils.formattaNumeroMigliaia(NumberUtils.checkNull(df.getImportoIvaAvere())));
          else
            subReport.put("importoAvere", "");
          totaleAvere += NumberUtils.checkNull(df.getImportoIvaAvere());
          if(NumberUtils.checkNull(df.getImportoIvaDare()) != 0)
            subReport.put("importoDare", NumberUtils.formattaNumeroMigliaia(NumberUtils.checkNull(df.getImportoIvaDare())));
          else
            subReport.put("importoDare", "");
          totaleDare += NumberUtils.checkNull(df.getImportoIvaDare());
          subReportList.add(subReport);
        }else if(!flagBollo){
          if("S".equals(StringUtility.checkNull(df.getFlagBollo())))
            flagBollo = true;
        }
      }
    }else{
      String msg = "La " + messageBundle.getMessage("TextFattura").toLowerCase() + " " + tf.getNumeroFattura() +
        " " + messageBundle.getMessage("AlertMsgFatturaSenzaRighe")
        + "\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
      throw new FatturaException(msg);
    }
    return subReportList;
  }
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

          }
        }
      }else{
        String msg = messageBundle.getMessage("AlertMsgImpossibileControllareProtocollo") + tf.getCodiceTipoProtocollo()
          + ": " + messageBundle.getMessage("AlertMsgProtocolloInesistente");
        throw new FatturaException(msg);
      }
    }
   
    if(!"".equals(StringUtility.checkNull(tf.getDescrizioneFattura()).trim()))
      intestazioneFattura += "\n\n" + tf.getDescrizioneFattura();
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

        numeroProtocollo = calcolaEAggiornaProtocolloSuccessivo(tp, tf, contabilizza, messageBundle);
    }else{
      String msg = messageBundle.getMessage("AlertMsgLaData") + " " + DateUtility.formattaDataBreve(tf.getDataFattura())
        + " " + messageBundle.getMessage("AlertMsgNonGestibile")
        + tp.getTipoProtocolloId().getCodiceTipoProtocollo();
      throw new FatturaException(msg);
    }
    return numeroProtocollo;
  }
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

    if(tp.getDataProtocolloCorrente() != null && tf.getDataFattura().before(tp.getDataProtocolloCorrente())){
      String msg = messageBundle.getMessage("AlertMsgErratoProtocollo") + ": "
        +  tp.getTipoProtocolloId().getCodiceTipoProtocollo()
        + " " + messageBundle.getMessage("AlertMsgPerFattura")
        + tf.getNumeroFattura() + " del " + DateUtility.formattaDataBreve(tf.getDataFattura());
      throw new FatturaException(msg);
    }else{
      numeroProtocollo = mappaProtocolliCorr.get(tp.getTipoProtocolloId().getCodiceTipoProtocollo());
      if(numeroProtocollo == null)
        numeroProtocollo = tp.getNumeroProtocolloCorrente();
      if(numeroProtocollo == null)
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

    if(tp.getDataProtocolloSuccessivo() != null && tf.getDataFattura().before(tp.getDataProtocolloSuccessivo())){
      String msg = messageBundle.getMessage("AlertMsgErratoProtocollo") + ": "
        + tp.getTipoProtocolloId().getCodiceTipoProtocollo()
        + " " + messageBundle.getMessage("AlertMsgPerFattura")
        + tf.getNumeroFattura() + " del " + DateUtility.formattaDataBreve(tf.getDataFattura());
      throw new FatturaException(msg);
    }else{
      numeroProtocollo = mappaProtocolliSucc.get(tp.getTipoProtocolloId().getCodiceTipoProtocollo());
      if(numeroProtocollo == null)
        numeroProtocollo = tp.getNumeroProtocolloSuccessivo();
      if(numeroProtocollo == null)
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

    String msg = messageBundle.getMessage("AlertMsgDataFattura") + numeroFattura
      + " " + messageBundle.getMessage("AlertMsgDataFuoriEsercizio");
    if(dataFattura.compareTo(gpc.getDataInizioEsercizioCorrente()) >= 0
        && dataFattura.compareTo(gpc.getDataFineEsercizioCorrente()) <= 0){
      if(dataFattura.before(gpc.getDataStampaLibroGiornaleCorrente())){
        throw new FatturaException(msg);
      }
    }else if(dataFattura.compareTo(gpc.getDataInizioEsercizioSuccessivo()) >= 0
        && dataFattura.compareTo(gpc.getDataFineEsercizioSuccessivo()) <= 0){
      if(dataFattura.before(gpc.getDataStampaLibroGiornaleSuccessivo())){
        throw new FatturaException(msg);
      }
    }else{
      throw new FatturaException(msg);
    }
   
    if(tipoBollatoIva != null &&
        ("A".equals(tipoBollatoIva) || "V".equals(tipoBollatoIva) || "C".equals(tipoBollatoIva))){
      if(dataFattura.before(gpc.getDataStampaLibroIva())){
        throw new FatturaException(msg);
      }
    }
    return true;
  }
View Full Code Here

Examples of it.pdor.webapp.contabilita.operazioniGiornaliere.fattura.exception.FatturaException

          else{
            String msg = messageBundle.getMessage("AlertMsgMancanoCFPivaSoggetto")
              + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
              + " " + tf.getNumeroFattura()
              + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
            throw new FatturaException(msg);
          }
        }else{
          PersonaGiuridica pg = (PersonaGiuridica)soggetto;
          intestatario.append("Spett.le\n");
          if(!"".equals(StringUtility.checkNull(pg.getPartitaIva()).trim()))
            cfPiva = "P.I. " + pg.getPartitaIva();
          else{
            String msg = messageBundle.getMessage("AlertMsgMancanoCFPivaSoggetto")
              + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
              + " " + tf.getNumeroFattura() +
              ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
            throw new FatturaException(msg);
          }
        }
        intestatario.append(soggetto.getDescrizione() + "\n");
        for(Indirizzo indirizzo : soggetto.getIndirizzi()){
          if(indirizzo.getTipoIndirizzo() != null && "R".equals(indirizzo.getTipoIndirizzo())){
            if(!"".equals(StringUtility.checkNull(indirizzo.getPresso()).trim()))
              intestatario.append("c/o " + indirizzo.getPresso() + "\n");
            if(!"".equals(StringUtility.checkNull(indirizzo.getIndirizzo()).trim()))
              intestatario.append(indirizzo.getIndirizzo() + "\n");
            if(!"".equals(StringUtility.checkNull(indirizzo.getFrazione()).trim()))
              intestatario.append("Fraz. " + indirizzo.getFrazione() + "\n");
            if(!"".equals(StringUtility.checkNull(indirizzo.getCap()).trim()))
              intestatario.append(indirizzo.getCap() + " ");
            if(!"".equals(StringUtility.checkNull(indirizzo.getCodiceLocalita()).trim())){
              Localita localita = dominiFacade.getLocalita(indirizzo.getCodiceLocalita());
              if(localita != null){
                if(!"".equals(localita.getDescrizioneLocalita()))
                  intestatario.append(localita.getDescrizioneLocalita() + " ");
                if(!"".equals(localita.getCodiceProvincia()))
                  intestatario.append(localita.getCodiceProvincia());
              }
            }
          }
        }
      }else{
        String msg = messageBundle.getMessage("AlertMsgMancaSoggetto")
          + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
          + " " + tf.getNumeroFattura()
          + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
        throw new FatturaException(msg);
      }
    }//Tipo intestatario mutuo / finanziamento
    else if("M".equals(tf.getTipoIntestatario())){
      intestatario = new StringBuffer();
      Mutuo mutuo = gestionePratica.getMutuoIndirizziById(tf.getNumeroIntestatario());
      if(mutuo != null){
        intestatario.append("Egr. Sigg.\n");
        IndirizzoMutuo indirizzo = mutuo.getIndirizziMutuo().iterator().next();
        intestatario.append(indirizzo.getDescIndirizzo() + "\n");
        if(!"".equals(StringUtility.checkNull(indirizzo.getIndirizzoPresso()).trim()))
          intestatario.append("c/o " + indirizzo.getIndirizzoPresso() + "\n");
        if(!"".equals(StringUtility.checkNull(indirizzo.getIndirizzo()).trim()))
          intestatario.append(indirizzo.getIndirizzo() + "\n");
        if(!"".equals(StringUtility.checkNull(indirizzo.getFrazione()).trim()))
          intestatario.append("Fraz. " + indirizzo.getFrazione() + "\n");
        if(!"".equals(StringUtility.checkNull(indirizzo.getCap()).trim()))
          intestatario.append(indirizzo.getCap() + " ");
        if(!"".equals(StringUtility.checkNull(indirizzo.getCodiceLocalita()).trim())){
          Localita localita = dominiFacade.getLocalita(indirizzo.getCodiceLocalita());
          if(localita != null && !"".equals(StringUtility.checkNull(localita.getDescrizioneLocalita()).trim())){
            intestatario.append(localita.getDescrizioneLocalita() + " ");
            intestatario.append(localita.getCodiceProvincia());
          }
        }
        List<IntestatariFattura> intestatari = anagraficaFacade.getIntestatariFattura(tf.getNumeroIntestatario());
        if(intestatari.size() > 0){
          int index = 0;
          for(IntestatariFattura intFattura : intestatari){
            if(index == 0){
              nominativo = intFattura.getCognome() + " " + StringUtility.checkNull(intFattura.getNome());
              if("PF".equals(intFattura.getTipoSoggetto())){
                if(!"".equals(StringUtility.checkNull(intFattura.getCodiceFiscale()).trim())){
                  cfPiva = "C.F. " + intFattura.getCodiceFiscale();
                }else{
                  String msg = messageBundle.getMessage("AlertMsgMancanoCFPivaSoggetto")
                    + intFattura.getNumeroSoggetto() + " " + messageBundle.getMessage("AlertMsgDelMutuo")
                    + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
                    + " " + tf.getNumeroFattura()
                    + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
                  throw new FatturaException(msg);
                }
              }else if("PG".equals(intFattura.getTipoSoggetto())){
                if(!"".equals(StringUtility.checkNull(intFattura.getPartitaIva()).trim())){
                  cfPiva = "P.I. " + intFattura.getPartitaIva();
                }else{
                  String msg = messageBundle.getMessage("AlertMsgMancanoCFPivaSoggetto")
                    + intFattura.getNumeroSoggetto() + " " + messageBundle.getMessage("AlertMsgDelMutuo")
                    + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
                    + " " + tf.getNumeroFattura()
                    + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
                  throw new FatturaException(msg);
                }
              }
             
            }else{
              nominativo += "\n" + intFattura.getCognome() + " " + StringUtility.checkNull(intFattura.getNome());
              if("PF".equals(intFattura.getTipoSoggetto())){ 
                if(!"".equals(StringUtility.checkNull(intFattura.getCodiceFiscale()).trim())){
                  cfPiva += "\nC.F. " + intFattura.getCodiceFiscale();
                }else{
                  String msg = messageBundle.getMessage("AlertMsgMancanoCFPivaSoggetto")
                    + intFattura.getNumeroSoggetto() + " " + messageBundle.getMessage("AlertMsgDelMutuo")
                    + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
                    + " " + tf.getNumeroFattura()
                    + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
                  throw new FatturaException(msg);
                }
              }else if("PG".equals(intFattura.getTipoSoggetto())){
                if(!"".equals(StringUtility.checkNull(intFattura.getPartitaIva()).trim())){
                  cfPiva += "\nP.I. " + intFattura.getPartitaIva();
                }else{
                  String msg = messageBundle.getMessage("AlertMsgMancanoCFPivaSoggetto")
                    + intFattura.getNumeroSoggetto() + " " + messageBundle.getMessage("AlertMsgDelMutuo")
                    + tf.getNumeroIntestatario() + " della "+ messageBundle.getMessage("TextFattura").toLowerCase()
                    + " " + tf.getNumeroFattura()
                    + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
                  throw new FatturaException(msg);
                }
              }
            }
            index++;
          }
        }else{
          String msg = messageBundle.getMessage("AlertMsgMancanoSoggettiMutuo") + tf.getNumeroIntestatario()
            + " della " + messageBundle.getMessage("TextFattura") + " " + tf.getNumeroFattura()
            + ".\n" + messageBundle.getMessage("AlertMsgImpossibileStampare");
          throw new FatturaException(msg);
        }
      }else{
        String msg = messageBundle.getMessage("MsgNumeroMutuoNonEsistente") + ": " + tf.getNumeroIntestatario();
        throw new FatturaException(msg);
      }
    }
    mappaIntestazione.put("intestatario", intestatario.toString());
    mappaIntestazione.put("nominativo", nominativo);
    mappaIntestazione.put("cfPiva", cfPiva);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.