Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void processPurchase(PaidPurchase paidPurchase)
- throws ClienteInexistente_Exception, FaturaInvalida_Exception,
- TotaisIncoerentes_Exception {
- RegistoFaturaPortType registoFatura = new RegistoFaturaLocal();
- System.out.println("PROCESS");
- System.out.println(this.getNif());
- System.out.println(this.getName());
- try {
- Serie serie = registoFatura.pedirSerie(this.getNif());
- Fatura fatura = new Fatura();
- fatura.setNifCliente(paidPurchase.getClient().getNif());
- fatura.setNifEmissor(this.getNif());
- fatura.setNomeEmissor(this.getName());
- fatura.setNumSeqFatura(1);
- System.out.println(serie == null);
- System.out.println("PROCESS1");
- fatura.setNumSerie(serie.getNumSerie());
- System.out.println("PROCESS2");
- fatura.setTotal((int) paidPurchase.getTotalPrice());
- System.out.println("PROCESS3");
- XMLGregorianCalendar now = getXMLGregorianCalendarNow();
- fatura.setIva(registoFatura.consultarIVADevido(this.getNif(), now));
- registoFatura.comunicarFatura(fatura);
- } catch (EmissorInexistente_Exception e) {
- // TODO Auto-generated catch block
- System.out.println("ERF");
- e.printStackTrace();
- } catch (DatatypeConfigurationException e) {
- // TODO Auto-generated catch block
- System.out.println("ERF2");
- e.printStackTrace();
- }
- System.out.println("PROCESS4");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement