// Lettre la ligne passée en parametre private void actionLettrage(int[] rowIndex) { String codeLettre = this.codeLettrage.getText().trim(); List<SQLRow> rowsSelected = new ArrayList<SQLRow>(rowIndex.length); long solde = 0; for (int i = 0; i < rowIndex.length; i++) { int id = this.ecriturePanel.getListe().idFromIndex(rowIndex[i]); SQLRow row = this.tableEcr.getRow(id); rowsSelected.add(row); solde += ((Long) row.getObject("DEBIT")).longValue(); solde -= ((Long) row.getObject("CREDIT")).longValue(); } if (solde == 0) { for (SQLRow row2 : rowsSelected) { SQLRowValues rowVals = new SQLRowValues(this.tableEcr); // Lettrage // On lettre ou relettre la ligne avec le code saisi if (codeLettre.length() > 0) { // Si la ligne est en brouillard on valide le mouvement associé if (this.boxValidEcriture.isSelected() && (!row2.getBoolean("VALIDE"))) { EcritureSQLElement.validationEcritures(row2.getInt("ID_MOUVEMENT")); } rowVals.put("LETTRAGE", codeLettre); rowVals.put("DATE_LETTRAGE", this.dateLettrage.getDate()); try { rowVals.update(row2.getID()); } catch (SQLException e1) { e1.printStackTrace(); } } } // Mise à jour du code de lettrage SQLElement elt = Configuration.getInstance().getDirectory().getElement("NUMEROTATION_AUTO"); SQLRowValues rowVals = elt.getTable().getRow(2).createEmptyUpdateRow(); rowVals.put("CODE_LETTRAGE", codeLettre); try { rowVals.update(); } catch (SQLException e) { e.printStackTrace(); } this.codeLettrage.setText(NumerotationAutoSQLElement.getNextCodeLettrage()); this.model.updateTotauxCompte(); } }