OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

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

Rev 177 Rev 182
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.common.ui.IListFilterDatePanel;
17
import org.openconcerto.erp.core.common.ui.IListFilterDatePanel;
18
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
18
import org.openconcerto.erp.core.common.ui.IListTotalPanel;
19
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
19
import org.openconcerto.erp.core.common.ui.ListeViewPanel;
20
import org.openconcerto.erp.core.finance.accounting.ui.ListeGestCommEltPanel;
20
import org.openconcerto.erp.core.finance.accounting.ui.ListeGestCommEltPanel;
21
import org.openconcerto.erp.core.finance.payment.element.SDDMessageSQLElement;
-
 
22
import org.openconcerto.erp.core.finance.payment.element.SDDMessageSQLElement.GenerationResult;
-
 
23
import org.openconcerto.erp.core.finance.payment.element.SDDMessageSQLElement.IgnoreReason;
-
 
24
import org.openconcerto.erp.core.sales.invoice.element.SaisieVenteFactureSQLElement;
21
import org.openconcerto.erp.core.sales.invoice.element.SaisieVenteFactureSQLElement;
25
import org.openconcerto.erp.core.sales.pos.POSConfiguration;
22
import org.openconcerto.erp.core.sales.pos.POSConfiguration;
-
 
23
import org.openconcerto.erp.core.sales.pos.element.TicketCaisseSQLElement;
-
 
24
import org.openconcerto.erp.core.sales.pos.model.ArticleCache;
26
import org.openconcerto.erp.core.sales.pos.ui.TextAreaTicketPanel;
25
import org.openconcerto.erp.core.sales.pos.ui.TextAreaTicketPanel;
27
import org.openconcerto.erp.utils.TM;
-
 
28
import org.openconcerto.sql.element.SQLElement;
26
import org.openconcerto.sql.element.SQLElement;
29
import org.openconcerto.sql.element.SQLElementDirectory;
27
import org.openconcerto.sql.element.SQLElementDirectory;
30
import org.openconcerto.sql.model.FieldPath;
28
import org.openconcerto.sql.model.FieldPath;
31
import org.openconcerto.sql.model.SQLField;
29
import org.openconcerto.sql.model.SQLField;
32
import org.openconcerto.sql.model.SQLRowAccessor;
30
import org.openconcerto.sql.model.SQLRowAccessor;
33
import org.openconcerto.sql.model.SQLRowValues;
31
import org.openconcerto.sql.model.SQLRowValues;
34
import org.openconcerto.sql.model.Where;
32
import org.openconcerto.sql.model.Where;
35
import org.openconcerto.sql.model.graph.Path;
33
import org.openconcerto.sql.model.graph.Path;
36
import org.openconcerto.sql.request.UpdateBuilder;
-
 
37
import org.openconcerto.sql.view.list.IListe;
34
import org.openconcerto.sql.view.list.IListe;
38
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
35
import org.openconcerto.sql.view.list.IListeAction.IListeEvent;
39
import org.openconcerto.sql.view.list.ITableModel;
36
import org.openconcerto.sql.view.list.ITableModel;
40
import org.openconcerto.sql.view.list.RowAction;
-
 
41
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
37
import org.openconcerto.sql.view.list.RowAction.PredicateRowAction;
42
import org.openconcerto.sql.view.list.SQLTableModelColumn;
38
import org.openconcerto.sql.view.list.SQLTableModelColumn;
43
import org.openconcerto.sql.view.list.SQLTableModelColumnPath;
39
import org.openconcerto.sql.view.list.SQLTableModelColumnPath;
44
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
40
import org.openconcerto.sql.view.list.SQLTableModelSourceOnline;
45
import org.openconcerto.ui.DefaultGridBagConstraints;
41
import org.openconcerto.ui.DefaultGridBagConstraints;
46
import org.openconcerto.ui.JLabelBold;
42
import org.openconcerto.ui.JLabelBold;
47
import org.openconcerto.ui.PanelFrame;
43
import org.openconcerto.ui.PanelFrame;
48
import org.openconcerto.utils.ExceptionHandler;
44
import org.openconcerto.utils.ExceptionHandler;
49
import org.openconcerto.utils.TableSorter;
45
import org.openconcerto.utils.TableSorter;
50
import org.openconcerto.utils.cc.IClosure;
46
import org.openconcerto.utils.cc.IClosure;
51
import org.openconcerto.utils.i18n.Grammar_fr;
-
 
52
 
47
 
53
import java.awt.GridBagConstraints;
48
import java.awt.GridBagConstraints;
54
import java.awt.GridBagLayout;
49
import java.awt.GridBagLayout;
55
import java.awt.Insets;
50
import java.awt.Insets;
56
import java.awt.event.ActionEvent;
51
import java.awt.event.ActionEvent;
57
import java.math.BigInteger;
52
import java.math.BigInteger;
58
import java.sql.SQLException;
53
import java.sql.SQLException;
59
import java.util.ArrayList;
54
import java.util.ArrayList;
60
import java.util.Collections;
-
 
61
import java.util.Date;
55
import java.util.Date;
62
import java.util.HashMap;
-
 
63
import java.util.List;
56
import java.util.List;
64
import java.util.Map;
-
 
65
 
57
 
66
import javax.swing.AbstractAction;
58
import javax.swing.AbstractAction;
67
import javax.swing.JButton;
59
import javax.swing.JButton;
68
import javax.swing.JOptionPane;
-
 
69
import javax.swing.JPanel;
60
import javax.swing.JPanel;
70
import javax.swing.JTabbedPane;
61
import javax.swing.JTabbedPane;
71
import javax.swing.JTable;
62
import javax.swing.JTable;
72
import javax.swing.SwingWorker;
-
 
73
import javax.swing.table.TableColumn;
63
import javax.swing.table.TableColumn;
74
 
64
 
75
public class ListeDesVentesPanel extends JPanel {
65
public class ListeDesVentesPanel extends JPanel {
76
 
66
 
77
    private ListeGestCommEltPanel listeFact;
67
    private ListeGestCommEltPanel listeFact;
Line 231... Line 221...
231
        this.listeFact.getListe().addIListeAction(actionEnvoye);
221
        this.listeFact.getListe().addIListeAction(actionEnvoye);
232
 
222
 
233
 
223
 
234
            {
224
            {
235
                // Tab Vente caisse
225
                // Tab Vente caisse
-
 
226
                final TicketCaisseSQLElement ticketElement = dir.getElement(TicketCaisseSQLElement.class);
236
                ListeViewPanel panelTicket = new ListeViewPanel(dir.getElement("TICKET_CAISSE")) {
227
                ListeViewPanel panelTicket = new ListeViewPanel(ticketElement) {
237
                    @Override
228
                    @Override
238
                    protected void handleAction(JButton source, ActionEvent evt) {
229
                    protected void handleAction(JButton source, ActionEvent evt) {
239
                        if (source == this.buttonModifier) {
230
                        if (source == this.buttonModifier) {
240
                            POSConfiguration posConf = POSConfiguration.getInstance();
231
                            POSConfiguration posConf = POSConfiguration.getInstance();
241
                            try {
232
                            try {
242
                                if (posConf == null)
233
                                if (posConf == null) {
243
                                    posConf = POSConfiguration.setInstance();
234
                                    posConf = POSConfiguration.setInstance();
-
 
235
                                    ArticleCache.initCache(dir);
-
 
236
                                }
244
                            } catch (Exception e) {
237
                            } catch (Exception e) {
245
                                ExceptionHandler.handle(source, "Impossible d'initialiser la configuration de la caisse", e);
238
                                ExceptionHandler.handle(source, "Impossible d'initialiser la configuration de la caisse", e);
246
                                return;
239
                                return;
247
                            }
240
                            }
248
                            new PanelFrame(new TextAreaTicketPanel(posConf, this.getListe().fetchSelectedRow()), "Ticket").setVisible(true);
241
                            new PanelFrame(new TextAreaTicketPanel(ticketElement, posConf, this.getListe().fetchSelectedRow()), "Ticket").setVisible(true);
249
                        } else {
242
                        } else {
250
                            super.handleAction(source, evt);
243
                            super.handleAction(source, evt);
251
                        }
244
                        }
252
                    }
245
                    }
253
                };
246
                };