OpenConcerto

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

svn://code.openconcerto.org/openconcerto

Rev

Rev 151 | Rev 174 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 151 Rev 156
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 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.
10
 * 
10
 * 
11
 * When distributing the software, include this License Header Notice in each file.
11
 * When distributing the software, include this License Header Notice in each file.
12
 */
12
 */
13
 
13
 
14
 package org.openconcerto.erp.core.sales.pos.ui;
14
 package org.openconcerto.erp.core.sales.pos.ui;
15
 
15
 
16
import org.openconcerto.erp.core.sales.pos.POSConfiguration;
-
 
17
import org.openconcerto.erp.core.sales.pos.TicketPrinterConfiguration;
16
import org.openconcerto.erp.core.sales.pos.TicketPrinterConfiguration;
18
import org.openconcerto.erp.core.sales.pos.io.Printable;
17
import org.openconcerto.erp.core.sales.pos.io.Printable;
19
import org.openconcerto.erp.core.sales.pos.io.TicketPrinter;
18
import org.openconcerto.erp.core.sales.pos.io.TicketPrinter;
20
import org.openconcerto.erp.core.sales.pos.model.Article;
19
import org.openconcerto.erp.core.sales.pos.model.Article;
21
import org.openconcerto.erp.core.sales.pos.model.RegisterFiles;
20
import org.openconcerto.erp.core.sales.pos.model.RegisterFiles;
22
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
21
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
23
import org.openconcerto.erp.core.sales.pos.model.Ticket;
22
import org.openconcerto.erp.core.sales.pos.model.Ticket;
24
import org.openconcerto.ui.DefaultListModel;
23
import org.openconcerto.ui.DefaultListModel;
25
import org.openconcerto.ui.touch.ScrollableList;
24
import org.openconcerto.ui.touch.ScrollableList;
26
import org.openconcerto.utils.ExceptionHandler;
25
import org.openconcerto.utils.ExceptionHandler;
27
import org.openconcerto.utils.Pair;
26
import org.openconcerto.utils.Pair;
28
 
27
 
29
import java.awt.Color;
28
import java.awt.Color;
30
import java.awt.Component;
29
import java.awt.Component;
31
import java.awt.Dimension;
30
import java.awt.Dimension;
32
import java.awt.FlowLayout;
31
import java.awt.FlowLayout;
33
import java.awt.Font;
32
import java.awt.Font;
34
import java.awt.Graphics;
33
import java.awt.Graphics;
35
import java.awt.Graphics2D;
34
import java.awt.Graphics2D;
36
import java.awt.GridBagConstraints;
35
import java.awt.GridBagConstraints;
37
import java.awt.GridBagLayout;
36
import java.awt.GridBagLayout;
38
import java.awt.Insets;
37
import java.awt.Insets;
39
import java.awt.RenderingHints;
38
import java.awt.RenderingHints;
40
import java.awt.event.ActionEvent;
39
import java.awt.event.ActionEvent;
41
import java.awt.event.ActionListener;
40
import java.awt.event.ActionListener;
42
import java.io.IOException;
41
import java.io.IOException;
43
import java.text.ParseException;
42
import java.text.ParseException;
44
import java.util.Calendar;
43
import java.util.Calendar;
45
import java.util.Date;
44
import java.util.Date;
46
import java.util.List;
45
import java.util.List;
47
 
46
 
48
import javax.swing.JLabel;
47
import javax.swing.JLabel;
49
import javax.swing.JList;
48
import javax.swing.JList;
50
import javax.swing.JPanel;
49
import javax.swing.JPanel;
51
import javax.swing.JScrollPane;
50
import javax.swing.JScrollPane;
52
import javax.swing.ListCellRenderer;
51
import javax.swing.ListCellRenderer;
53
import javax.swing.ListSelectionModel;
52
import javax.swing.ListSelectionModel;
54
import javax.swing.event.ListSelectionEvent;
53
import javax.swing.event.ListSelectionEvent;
55
import javax.swing.event.ListSelectionListener;
54
import javax.swing.event.ListSelectionListener;
56
 
55
 
57
import org.jdom2.JDOMException;
56
import org.jdom2.JDOMException;
58
 
57
 
59
public class ListeDesTicketsPanel extends JPanel implements ListSelectionListener {
58
public class ListeDesTicketsPanel extends JPanel implements ListSelectionListener {
60
 
59
 
61
    private static final String ARIAL_FONT = "Arial";
60
    private static final String ARIAL_FONT = "Arial";
62
 
61
 
63
    static private final class X extends RegisterSummary {
62
    static private final class X extends RegisterSummary {
64
 
63
 
65
        private final List<Ticket> receipts;
64
        private final List<Ticket> receipts;
66
 
65
 
67
        protected X(final RegisterLog log, final List<Ticket> receipts) {
66
        protected X(final RegisterLog log, final List<Ticket> receipts) {
68
            super("X", log);
67
            super("X", log);
69
            this.receipts = receipts;
68
            this.receipts = receipts;
70
        }
69
        }
71
 
70
 
72
        @Override
71
        @Override
73
        protected final List<Ticket> getReceipts() {
72
        protected final List<Ticket> getReceipts() {
74
            return this.receipts;
73
            return this.receipts;
75
        }
74
        }
76
 
75
 
77
        @Override
76
        @Override
78
        public String getLabel() {
77
        public String getLabel() {
79
            return "Synthèse actuelle (X)";
78
            return "Synthèse actuelle (X)";
80
        }
79
        }
81
    }
80
    }
82
 
81
 
83
    static private final class XLite extends RegisterSummary {
82
    static private final class XLite extends RegisterSummary {
84
 
83
 
85
        private final List<Ticket> receipts;
84
        private final List<Ticket> receipts;
86
 
85
 
87
        protected XLite(final RegisterLog log, final List<Ticket> receipts) {
86
        protected XLite(final RegisterLog log, final List<Ticket> receipts) {
88
            super("X", log);
87
            super("X", log);
89
            this.receipts = receipts;
88
            this.receipts = receipts;
90
        }
89
        }
91
 
90
 
92
        @Override
91
        @Override
93
        public boolean isPrintingTicketsList() {
92
        public boolean isPrintingTicketsList() {
94
            return false;
93
            return false;
95
        }
94
        }
96
 
95
 
97
        @Override
96
        @Override
98
        protected final List<Ticket> getReceipts() {
97
        protected final List<Ticket> getReceipts() {
99
            return this.receipts;
98
            return this.receipts;
100
        }
99
        }
101
 
100
 
102
        @Override
101
        @Override
103
        public String getLabel() {
102
        public String getLabel() {
104
            return "Synthèse actuelle simplifiée (résumé du X)";
103
            return "Synthèse actuelle simplifiée (résumé du X)";
105
        }
104
        }
106
    }
105
    }
107
 
106
 
108
    static private final class Z extends RegisterSummary {
107
    static private final class Z extends RegisterSummary {
109
 
108
 
110
        protected Z(final RegisterFiles files, final Calendar day) throws IOException, JDOMException {
109
        protected Z(final RegisterFiles files, final Calendar day) throws IOException, JDOMException {
111
            super("Z", new RegisterLog(files.getLogFile(day)).parse());
110
            super("Z", new RegisterLog(files.getLogFile(day)).parse());
112
        }
111
        }
113
 
112
 
114
        @Override
113
        @Override
115
        protected final List<Ticket> getReceipts() throws ParseException {
114
        protected final List<Ticket> getReceipts() throws ParseException {
116
            return this.getLog().parseReceipts();
115
            return this.getLog().parseReceipts();
117
        }
116
        }
118
 
117
 
119
        @Override
118
        @Override
120
        public String getLabel() {
119
        public String getLabel() {
121
            return "Synthèse précédente (Z)";
120
            return "Synthèse précédente (Z)";
122
        }
121
        }
123
    }
122
    }
124
 
123
 
125
    private JList l;
124
    private JList l;
126
    private CaisseFrame frame;
125
    private CaisseFrame frame;
127
 
126
 
128
    private TextAreaTicketPrinter ticketP;
127
    private TextAreaTicketPrinter ticketP;
129
    private ScrollableList ticketList;
128
    private ScrollableList ticketList;
130
    private DefaultListModel ticketLlistModel;
129
    private DefaultListModel ticketLlistModel;
131
 
130
 
132
    ListeDesTicketsPanel(CaisseFrame caisseFrame) {
131
    ListeDesTicketsPanel(CaisseFrame caisseFrame) {
133
        this.frame = caisseFrame;
132
        this.frame = caisseFrame;
134
        this.setBackground(Color.WHITE);
133
        this.setBackground(Color.WHITE);
135
        this.setOpaque(true);
134
        this.setOpaque(true);
136
        this.setLayout(new GridBagLayout());
135
        this.setLayout(new GridBagLayout());
137
        GridBagConstraints c = new GridBagConstraints();
136
        GridBagConstraints c = new GridBagConstraints();
138
        c.fill = GridBagConstraints.BOTH;
137
        c.fill = GridBagConstraints.BOTH;
139
        c.anchor = GridBagConstraints.CENTER;
138
        c.anchor = GridBagConstraints.CENTER;
140
        c.weightx = 1;
139
        c.weightx = 1;
141
        c.weighty = 0;
140
        c.weighty = 0;
142
        c.gridx = 0;
141
        c.gridx = 0;
143
        c.gridy = 0;
142
        c.gridy = 0;
144
        c.gridwidth = 2;
143
        c.gridwidth = 2;
145
 
144
 
146
        // Place pour le menu
145
        // Place pour le menu
147
        StatusBar p = new StatusBar();
146
        StatusBar p = new StatusBar();
148
        p.setTitle("Liste des tickets");
147
        p.setTitle("Liste des tickets");
149
        p.setLayout(new FlowLayout(FlowLayout.RIGHT));
148
        p.setLayout(new FlowLayout(FlowLayout.RIGHT));
150
        POSButton bBack = new POSButton("Fermer");
149
        POSButton bBack = new POSButton("Fermer");
151
        p.add(bBack);
150
        p.add(bBack);
152
 
151
 
153
        this.add(p, c);
152
        this.add(p, c);
154
 
153
 
155
        // Liste des tickets
154
        // Liste des tickets
156
        c.gridy++;
155
        c.gridy++;
157
        c.gridwidth = 1;
156
        c.gridwidth = 1;
158
        c.weighty = 1;
157
        c.weighty = 1;
159
        c.gridheight = 2;
158
        c.gridheight = 2;
160
 
159
 
161
        try {
160
        try {
162
            final RegisterLog lastLog = this.frame.getFiles().getLastLog();
161
            final RegisterLog lastLog = this.frame.getFiles().getLastLog();
163
            final List<Ticket> receipts = lastLog.parseReceipts();
162
            final List<Ticket> receipts = lastLog.parseReceipts();
164
            ticketLlistModel = new DefaultListModel();
163
            ticketLlistModel = new DefaultListModel();
165
            ticketLlistModel.addElement(new X(lastLog, receipts));
164
            ticketLlistModel.addElement(new X(lastLog, receipts));
166
            ticketLlistModel.addElement(new XLite(lastLog, receipts));
165
            ticketLlistModel.addElement(new XLite(lastLog, receipts));
167
            final Date previousDate = lastLog.getFirstRegisterEvent().getPreviousDate();
166
            final Date previousDate = lastLog.getFirstRegisterEvent().getPreviousDate();
168
            if (previousDate != null) {
167
            if (previousDate != null) {
169
                final Calendar cal = Calendar.getInstance();
168
                final Calendar cal = Calendar.getInstance();
170
                cal.setTime(previousDate);
169
                cal.setTime(previousDate);
171
                ticketLlistModel.addElement(new Z(this.frame.getFiles(), cal));
170
                ticketLlistModel.addElement(new Z(this.frame.getFiles(), cal));
172
            }
171
            }
173
            ticketLlistModel.addAll(receipts);
172
            ticketLlistModel.addAll(receipts);
174
 
173
 
175
        } catch (Exception exn) {
174
        } catch (Exception exn) {
176
            ExceptionHandler.handle(this.frame, "Impossible de charger les tickets", exn);
175
            ExceptionHandler.handle(this.frame, "Impossible de charger les tickets", exn);
177
        }
176
        }
178
        final Font f = new Font(ARIAL_FONT, Font.PLAIN, 24);
177
        final Font f = new Font(ARIAL_FONT, Font.PLAIN, 24);
179
        ticketList = new ScrollableList(ticketLlistModel) {
178
        ticketList = new ScrollableList(ticketLlistModel) {
180
            @Override
179
            @Override
181
            public void paintCell(Graphics g, Object object, int index, boolean isSelected, int posY) {
180
            public void paintCell(Graphics g, Object object, int index, boolean isSelected, int posY) {
182
                g.setFont(f);
181
                g.setFont(f);
183
 
182
 
184
                if (isSelected) {
183
                if (isSelected) {
185
                    g.setColor(new Color(232, 242, 254));
184
                    g.setColor(new Color(232, 242, 254));
186
                } else {
185
                } else {
187
                    g.setColor(Color.WHITE);
186
                    g.setColor(Color.WHITE);
188
                }
187
                }
189
                g.fillRect(0, posY, getWidth(), getCellHeight());
188
                g.fillRect(0, posY, getWidth(), getCellHeight());
190
 
189
 
191
                //
190
                //
192
                g.setColor(Color.GRAY);
191
                g.setColor(Color.GRAY);
193
                g.drawLine(0, posY + this.getCellHeight() - 1, this.getWidth(), posY + this.getCellHeight() - 1);
192
                g.drawLine(0, posY + this.getCellHeight() - 1, this.getWidth(), posY + this.getCellHeight() - 1);
194
 
193
 
195
                if (isSelected) {
194
                if (isSelected) {
196
                    g.setColor(Color.BLACK);
195
                    g.setColor(Color.BLACK);
197
                } else {
196
                } else {
198
                    g.setColor(Color.GRAY);
197
                    g.setColor(Color.GRAY);
199
                }
198
                }
200
                ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
199
                ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
201
                if (object instanceof Ticket) {
200
                if (object instanceof Ticket) {
202
                    Ticket article = (Ticket) object;
201
                    Ticket article = (Ticket) object;
203
                    String label = "Ticket " + article.getCode();
202
                    String label = "Ticket " + article.getCode();
204
 
203
 
205
                    String euro = TicketCellRenderer.centsToString(article.getTotalInCents()) + "€";
204
                    String euro = TicketCellRenderer.centsToString(article.getTotalInCents()) + "€";
206
 
205
 
207
                    int wEuro = (int) g.getFontMetrics().getStringBounds(euro, g).getWidth();
206
                    int wEuro = (int) g.getFontMetrics().getStringBounds(euro, g).getWidth();
208
                    g.drawString(label, 10, posY + 39);
207
                    g.drawString(label, 10, posY + 39);
209
                    g.drawString(euro, getWidth() - 5 - wEuro, posY + 39);
208
                    g.drawString(euro, getWidth() - 5 - wEuro, posY + 39);
210
                } else {
209
                } else {
211
                    g.drawString(((RegisterSummary) object).getLabel(), 10, posY + 39);
210
                    g.drawString(((RegisterSummary) object).getLabel(), 10, posY + 39);
212
                }
211
                }
213
            }
212
            }
214
        };
213
        };
215
        this.add(ticketList, c);
214
        this.add(ticketList, c);
216
        // Ticket
215
        // Ticket
217
        c.fill = GridBagConstraints.VERTICAL;
216
        c.fill = GridBagConstraints.VERTICAL;
218
        c.gridx++;
217
        c.gridx++;
219
        c.gridheight = 1;
218
        c.gridheight = 1;
220
        c.insets = new Insets(10, 10, 10, 10);
219
        c.insets = new Insets(10, 10, 10, 10);
221
        ticketP = new TextAreaTicketPrinter();
220
        ticketP = new TextAreaTicketPrinter();
222
 
221
 
223
        JScrollPane scrollPane = new JScrollPane(ticketP);
222
        JScrollPane scrollPane = new JScrollPane(ticketP);
224
        scrollPane.setPreferredSize(new Dimension(400, 200));
223
        scrollPane.setPreferredSize(new Dimension(400, 200));
225
        scrollPane.setMinimumSize(new Dimension(400, 200));
224
        scrollPane.setMinimumSize(new Dimension(400, 200));
226
        this.add(scrollPane, c);
225
        this.add(scrollPane, c);
227
 
226
 
228
        ticketList.addListSelectionListener(new ListSelectionListener() {
227
        ticketList.addListSelectionListener(new ListSelectionListener() {
229
 
228
 
230
            @Override
229
            @Override
231
            public void valueChanged(ListSelectionEvent e) {
230
            public void valueChanged(ListSelectionEvent e) {
232
                Object selectedValue = ticketList.getSelectedValue();
231
                Object selectedValue = ticketList.getSelectedValue();
233
                setSelectedTicket(selectedValue);
232
                setSelectedTicket(selectedValue);
234
            }
233
            }
235
        });
234
        });
236
 
235
 
237
        // Menu
236
        // Menu
238
 
237
 
239
        c.gridy++;
238
        c.gridy++;
240
        c.weighty = 0;
239
        c.weighty = 0;
241
        c.fill = GridBagConstraints.NONE;
240
        c.fill = GridBagConstraints.NONE;
242
        final Font font = new Font(ARIAL_FONT, Font.PLAIN, 46);
241
        final Font font = new Font(ARIAL_FONT, Font.PLAIN, 46);
243
        l = new JList(new String[] { "Imprimer", "Annuler" });
242
        l = new JList(new String[] { "Imprimer", "Annuler" });
244
        l.setCellRenderer(new ListCellRenderer() {
243
        l.setCellRenderer(new ListCellRenderer() {
245
 
244
 
246
            @Override
245
            @Override
247
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
246
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
248
                JLabel l = new JLabel(value.toString()) {
247
                JLabel l = new JLabel(value.toString()) {
249
                    @Override
248
                    @Override
250
                    public void paint(Graphics g) {
249
                    public void paint(Graphics g) {
251
 
250
 
252
                        super.paint(g);
251
                        super.paint(g);
253
 
252
 
254
                        g.setColor(Color.LIGHT_GRAY);
253
                        g.setColor(Color.LIGHT_GRAY);
255
                        g.drawLine(0, 0, this.getWidth(), 0);
254
                        g.drawLine(0, 0, this.getWidth(), 0);
256
                    }
255
                    }
257
                };
256
                };
258
                l.setFont(font);
257
                l.setFont(font);
259
                return l;
258
                return l;
260
            }
259
            }
261
 
260
 
262
        });
261
        });
263
        l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
262
        l.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
264
        l.getSelectionModel().addListSelectionListener(this);
263
        l.getSelectionModel().addListSelectionListener(this);
265
 
264
 
266
        l.setFixedCellHeight(160);
265
        l.setFixedCellHeight(160);
267
        this.add(l, c);
266
        this.add(l, c);
268
 
267
 
269
        setFont(new Font(ARIAL_FONT, Font.BOLD, 24));
268
        setFont(new Font(ARIAL_FONT, Font.BOLD, 24));
270
 
269
 
271
        // Listeners
270
        // Listeners
272
        bBack.addActionListener(new ActionListener() {
271
        bBack.addActionListener(new ActionListener() {
273
 
272
 
274
            @Override
273
            @Override
275
            public void actionPerformed(ActionEvent e) {
274
            public void actionPerformed(ActionEvent e) {
276
                frame.showCaisse();
275
                frame.showCaisse();
277
 
276
 
278
            }
277
            }
279
        });
278
        });
280
 
279
 
281
    }
280
    }
282
 
281
 
283
    @Override
282
    @Override
284
    public void valueChanged(ListSelectionEvent e) {
283
    public void valueChanged(ListSelectionEvent e) {
285
        if (e.getValueIsAdjusting()) {
284
        if (e.getValueIsAdjusting()) {
286
            return;
285
            return;
287
        }
286
        }
288
        Object selectedValue = ticketList.getSelectedValue();
287
        Object selectedValue = ticketList.getSelectedValue();
289
        int selectedIndex = l.getSelectedIndex();
288
        int selectedIndex = l.getSelectedIndex();
290
        if (selectedIndex == 0 && selectedValue != null) {
289
        if (selectedIndex == 0 && selectedValue != null) {
291
            POSConfiguration.getInstance().printOnceOnFirstPrinter(((Printable) selectedValue));
290
            this.frame.getPOSConf().printOnceOnFirstPrinter(((Printable) selectedValue));
292
        } else if (selectedIndex == 1 && selectedValue != null) {
291
        } else if (selectedIndex == 1 && selectedValue != null) {
293
            // Annulation du ticket
292
            // Annulation du ticket
294
            Ticket t = (Ticket) selectedValue;
293
            Ticket t = (Ticket) selectedValue;
295
            for (Pair<Article, Integer> a : t.getArticles()) {
294
            for (Pair<Article, Integer> a : t.getArticles()) {
296
                frame.getControler().addArticle(a.getFirst());
295
                frame.getControler().addArticle(a.getFirst());
297
                frame.getControler().setArticleCount(a.getFirst(), -a.getSecond());
296
                frame.getControler().setArticleCount(a.getFirst(), -a.getSecond());
298
                frame.getControler().setArticleHT(a.getFirst(), a.getFirst().getPriceWithoutTax());
297
                frame.getControler().setArticleHT(a.getFirst(), a.getFirst().getPriceWithoutTax());
299
            }
298
            }
300
            frame.showCaisse();
299
            frame.showCaisse();
301
        }
300
        }
302
        l.clearSelection();
301
        l.clearSelection();
303
    }
302
    }
304
 
303
 
305
    public void setSelectedTicket(Object selectedValue) {
304
    public void setSelectedTicket(Object selectedValue) {
306
        ticketP.clear();
305
        ticketP.clear();
307
        if (selectedValue != null) {
306
        if (selectedValue != null) {
308
            POSConfiguration.getInstance().print(((Printable) selectedValue), new TicketPrinterConfiguration() {
307
            this.frame.getPOSConf().print(((Printable) selectedValue), new TicketPrinterConfiguration() {
309
                @Override
308
                @Override
310
                public TicketPrinter createTicketPrinter() {
309
                public TicketPrinter createTicketPrinter() {
311
                    return ticketP;
310
                    return ticketP;
312
                }
311
                }
313
 
312
 
314
                @Override
313
                @Override
315
                public int getCopyCount() {
314
                public int getCopyCount() {
316
                    return 1;
315
                    return 1;
317
                }
316
                }
318
 
317
 
319
                @Override
318
                @Override
320
                public boolean isValid() {
319
                public boolean isValid() {
321
                    return true;
320
                    return true;
322
                }
321
                }
323
            });
322
            });
324
            try {
323
            try {
325
                ticketP.printBuffer();
324
                ticketP.printBuffer();
326
            } catch (Exception e1) {
325
            } catch (Exception e1) {
327
                e1.printStackTrace();
326
                e1.printStackTrace();
328
            }
327
            }
329
        }
328
        }
330
        ticketList.setSelectedValue(selectedValue, true);
329
        ticketList.setSelectedValue(selectedValue, true);
331
    }
330
    }
332
}
331
}