public void run() { DBUtils.whereWeAre(); empresa = ServiceLocator2.getConfiguracion().getSucursal().getEmpresa(); System.out.println( "Cancelando pendientes para sucursal: " + ServiceLocator2.getConfiguracion().getSucursalLocalId()); try { client = new CfdiClient(); String sql = "SELECT x.uuid FROM sx_cxc_cargos_cancelados c join sx_cfdi x on(x.origen_id=c.cargo_id) where X.UUID is not null and x.cancelacion is null"; // Object args[]=new Object[]{}; List<String> rows = ServiceLocator2.getJdbcTemplate() .queryForList( sql // , args , String.class); for (String uuid : rows) { // System.out.println("Cancelando uuid: "+uuid); try { cancelar(uuid); } catch (Exception e) { System.out.println( "Error cancelando: " + uuid + " Error: " + ExceptionUtils.getRootCause(e)); } } } catch (CfdiException e) { e.printStackTrace(); System.out.println("Error en EDICOM: " + ExceptionUtils.getRootCauseMessage(e)); } }
private JComboBox createSucursalControl() { final JComboBox box = new JComboBox(ServiceLocator2.getLookupManager().getSucursalesOperativas().toArray()); Sucursal local = ServiceLocator2.getConfiguracion().getSucursal(); for (int index = 0; index < box.getModel().getSize(); index++) { Sucursal s = (Sucursal) box.getModel().getElementAt(index); if (s.equals(local)) { box.setSelectedIndex(index); break; } } return box; }