OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 185
Line 1... Line 1...
1
/*
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 * 
3
 * 
4
 * Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
4
 * Copyright 2011-2019 OpenConcerto, by ILM Informatique. All rights reserved.
5
 * 
5
 * 
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
6
 * The contents of this file are subject to the terms of the GNU General Public License Version 3
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
7
 * only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
8
 * copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
9
 * language governing permissions and limitations under the License.
9
 * language governing permissions and limitations under the License.
Line 16... Line 16...
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
17
import org.openconcerto.erp.core.finance.payment.element.ChequeAEncaisserSQLElement;
17
import org.openconcerto.erp.core.finance.payment.element.ChequeAEncaisserSQLElement;
18
import org.openconcerto.erp.rights.ComptaTotalUserRight;
18
import org.openconcerto.erp.rights.ComptaTotalUserRight;
19
import org.openconcerto.sql.Configuration;
19
import org.openconcerto.sql.Configuration;
20
import org.openconcerto.sql.model.SQLRow;
20
import org.openconcerto.sql.model.SQLRow;
-
 
21
import org.openconcerto.sql.model.SQLRowAccessor;
21
import org.openconcerto.sql.model.SQLRowListRSH;
22
import org.openconcerto.sql.model.SQLRowListRSH;
22
import org.openconcerto.sql.model.SQLRowValues;
23
import org.openconcerto.sql.model.SQLRowValues;
23
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
24
import org.openconcerto.sql.sqlobject.SQLRequestComboBox;
24
import org.openconcerto.sql.users.rights.UserRightsManager;
25
import org.openconcerto.sql.users.rights.UserRightsManager;
25
import org.openconcerto.sql.view.EditFrame;
26
import org.openconcerto.sql.view.EditFrame;
26
import org.openconcerto.sql.view.EditPanel.EditMode;
27
import org.openconcerto.sql.view.EditPanel.EditMode;
27
import org.openconcerto.sql.view.list.IListe;
28
import org.openconcerto.sql.view.list.IListe;
-
 
29
import org.openconcerto.sql.view.list.action.ListEvent;
-
 
30
import org.openconcerto.sql.view.list.action.SQLRowValuesAction;
28
import org.openconcerto.ui.JDate;
31
import org.openconcerto.ui.JDate;
29
import org.openconcerto.utils.GestionDevise;
32
import org.openconcerto.utils.GestionDevise;
30
 
33
 
31
import java.awt.event.ActionEvent;
34
import java.awt.event.ActionEvent;
32
import java.awt.event.ActionListener;
35
import java.awt.event.ActionListener;
Line 136... Line 139...
136
                        }
139
                        }
137
                    }
140
                    }
138
                }
141
                }
139
            });
142
            });
140
        }
143
        }
-
 
144
 
-
 
145
        SQLRowValuesAction actionCancel = new SQLRowValuesAction(false, "cancel.regulation.cheque", (ev) -> {
-
 
146
            int answer = JOptionPane.showConfirmDialog(null, "Etes vous sûr de vouloir annuler la régularisation ?");
-
 
147
            if (answer == JOptionPane.YES_OPTION) {
-
 
148
                SQLRowAccessor row = ev.getSelectedRow();
-
 
149
                SQLRowValues rowVals = row.createEmptyUpdateRow();
-
 
150
                rowVals.put("REG_COMPTA", Boolean.FALSE);
-
 
151
                try {
-
 
152
                    rowVals.commit();
-
 
153
                } catch (SQLException e1) {
-
 
154
                    e1.printStackTrace();
-
 
155
                }
-
 
156
            }
-
 
157
        }) {
-
 
158
 
-
 
159
            @Override
-
 
160
            public boolean enabledFor(ListEvent evt) {
-
 
161
                if (evt.getSelectedRows().size() == 1) {
-
 
162
                    SQLRowAccessor row = evt.getSelectedRow();
-
 
163
                    return row.getBoolean("REG_COMPTA");
-
 
164
                } else {
-
 
165
                    return true;
-
 
166
                }
-
 
167
            }
-
 
168
        };
-
 
169
        getListe().addRowValuesAction(actionCancel);
141
    }
170
    }
142
 
171
 
143
    @Override
172
    @Override
144
    protected String getDepositLabel() {
173
    protected String getDepositLabel() {
145
        return "Sélectionner les chéques à déposer, en date du ";
174
        return "Sélectionner les chéques à déposer, en date du ";