OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 149 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 156
Line 21... Line 21...
21
import org.openconcerto.sql.model.SQLBase;
21
import org.openconcerto.sql.model.SQLBase;
22
import org.openconcerto.sql.model.SQLRow;
22
import org.openconcerto.sql.model.SQLRow;
23
import org.openconcerto.sql.model.SQLRowAccessor;
23
import org.openconcerto.sql.model.SQLRowAccessor;
24
import org.openconcerto.sql.model.SQLRowValues;
24
import org.openconcerto.sql.model.SQLRowValues;
25
import org.openconcerto.sql.model.SQLTable;
25
import org.openconcerto.sql.model.SQLTable;
26
import org.openconcerto.sql.sqlobject.ElementComboBox;
26
import org.openconcerto.sql.request.SQLFieldTranslator;
27
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
27
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
28
import org.openconcerto.ui.DefaultGridBagConstraints;
28
import org.openconcerto.ui.DefaultGridBagConstraints;
29
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
29
import org.openconcerto.ui.preferences.DefaultPreferencePanel;
30
 
30
 
31
import java.awt.GridBagConstraints;
31
import java.awt.GridBagConstraints;
32
import java.awt.GridBagLayout;
32
import java.awt.GridBagLayout;
33
import java.sql.SQLException;
33
import java.sql.SQLException;
34
 
34
 
35
import javax.swing.JCheckBox;
35
import javax.swing.JCheckBox;
36
import javax.swing.JLabel;
36
import javax.swing.JLabel;
-
 
37
import javax.swing.JOptionPane;
37
import javax.swing.JPanel;
38
import javax.swing.JPanel;
-
 
39
import javax.swing.SwingUtilities;
38
 
40
 
39
public class CompteCloturePreferencePanel extends DefaultPreferencePanel {
41
public class CompteCloturePreferencePanel extends DefaultPreferencePanel {
40
    private ISQLCompteSelector selCompteOuverture, selCompteFermeture, selCompteResultat, selCompteResultatPerte;
42
    private ISQLCompteSelector selCompteOuverture, selCompteFermeture, selCompteResultat, selCompteResultatPerte;
41
    private SQLRequestComboBox selJournal;
43
    private SQLRequestComboBox selJournal;
42
    private JCheckBox boxCompteSolde;
44
    private JCheckBox boxCompteSolde;
Line 134... Line 136...
134
        this.rowPrefCompteVals.put("ID_COMPTE_PCE_RESULTAT_PERTE", this.selCompteResultat.getValue());
136
        this.rowPrefCompteVals.put("ID_COMPTE_PCE_RESULTAT_PERTE", this.selCompteResultat.getValue());
135
        this.rowPrefCompteVals.put("ID_JOURNAL_AN", this.selJournal.getValue());
137
        this.rowPrefCompteVals.put("ID_JOURNAL_AN", this.selJournal.getValue());
136
        this.rowPrefCompteVals.put("CREATE_NUL_SOLDE_ECR", this.boxCompteSolde.isSelected());
138
        this.rowPrefCompteVals.put("CREATE_NUL_SOLDE_ECR", this.boxCompteSolde.isSelected());
137
 
139
 
138
        try {
140
        try {
-
 
141
            final Object[] pb = this.rowPrefCompteVals.getInvalid();
-
 
142
            if (pb != null) {
-
 
143
                final SQLFieldTranslator trans = Configuration.getInstance().getTranslator();
-
 
144
                JOptionPane.showMessageDialog(SwingUtilities.getRoot(this), "Impossible de valider les modifications! Le champ <"
-
 
145
                        + trans.getLabelFor(this.rowPrefCompteVals.getTable().getField(pb[0].toString())) + "> pointe sur un compte invalide!(" + pb[1] + ")");
-
 
146
            } else {
139
            this.rowPrefCompteVals.update();
147
                this.rowPrefCompteVals.update();
-
 
148
            }
140
        } catch (SQLException e) {
149
        } catch (SQLException e) {
141
            e.printStackTrace();
150
            e.printStackTrace();
142
        }
151
        }
143
    }
152
    }
144
 
153