OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 156 Rev 180
Line 12... Line 12...
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.finance.accounting.model;
14
 package org.openconcerto.erp.core.finance.accounting.model;
15
 
15
 
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
16
import org.openconcerto.erp.config.ComptaPropsConfiguration;
-
 
17
import org.openconcerto.erp.core.common.ui.DeviseField;
17
import org.openconcerto.erp.core.finance.accounting.ui.PointagePanel;
18
import org.openconcerto.erp.core.finance.accounting.ui.PointagePanel;
18
import org.openconcerto.sql.Configuration;
19
import org.openconcerto.sql.Configuration;
19
import org.openconcerto.sql.model.SQLBase;
20
import org.openconcerto.sql.model.SQLBase;
20
import org.openconcerto.sql.model.SQLRow;
21
import org.openconcerto.sql.model.SQLRow;
21
import org.openconcerto.sql.model.SQLRowValues;
22
import org.openconcerto.sql.model.SQLRowValues;
Line 109... Line 110...
109
    }
110
    }
110
 
111
 
111
    private SwingWorker<String, Object> workerUpdater;
112
    private SwingWorker<String, Object> workerUpdater;
112
 
113
 
113
    public void updateTotauxCompte() {
114
    public void updateTotauxCompte() {
-
 
115
        updateTotauxCompte(null, null, null);
-
 
116
    }
-
 
117
 
-
 
118
    public void updateTotauxCompte(final DeviseField depart, final DeviseField arrive, final DeviseField ecart) {
-
 
119
 
114
        final Date deb = panel.getDateDeb();
120
        final Date deb = panel.getDateDeb();
115
        final Date fin = panel.getDateFin();
121
        final Date fin = panel.getDateFin();
116
 
122
 
117
        if (workerUpdater != null) {
123
        if (workerUpdater != null) {
118
            workerUpdater.cancel(true);
124
            workerUpdater.cancel(true);
Line 230... Line 236...
230
            protected void done() {
236
            protected void done() {
231
 
237
 
232
                if (isCancelled()) {
238
                if (isCancelled()) {
233
                    return;
239
                    return;
234
                }
240
                }
-
 
241
                if (arrive != null && depart != null && ecart != null) {
-
 
242
                    final Long valueArrive = arrive.getValue();
-
 
243
                    final Long valueDepart = depart.getValue();
-
 
244
                    if (valueArrive != null && valueDepart != null) {
-
 
245
                        ecart.setValue(valueArrive - valueDepart + PointageModel.this.debitNonPointe - PointageModel.this.creditNonPointe);
-
 
246
                    } else {
-
 
247
                        ecart.setValue(null);
-
 
248
                    }
-
 
249
                }
235
                PointageModel.this.fireTableDataChanged();
250
                PointageModel.this.fireTableDataChanged();
236
            }
251
            }
237
        };
252
        };
238
        workerUpdater.execute();
253
        workerUpdater.execute();
239
 
254