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 11... |
Line 11... |
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.config.ComptaPropsConfiguration;
|
16 |
import org.openconcerto.erp.core.sales.pos.TicketPrinterConfiguration;
|
17 |
import org.openconcerto.erp.core.sales.pos.TicketPrinterConfiguration;
|
- |
|
18 |
import org.openconcerto.erp.core.sales.pos.TicketSheetXML;
|
17 |
import org.openconcerto.erp.core.sales.pos.io.Printable;
|
19 |
import org.openconcerto.erp.core.sales.pos.io.Printable;
|
18 |
import org.openconcerto.erp.core.sales.pos.io.TicketPrinter;
|
20 |
import org.openconcerto.erp.core.sales.pos.io.TicketPrinter;
|
19 |
import org.openconcerto.erp.core.sales.pos.model.RegisterFiles;
|
21 |
import org.openconcerto.erp.core.sales.pos.model.RegisterFiles;
|
20 |
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
|
22 |
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
|
21 |
import org.openconcerto.erp.core.sales.pos.model.Ticket;
|
23 |
import org.openconcerto.erp.core.sales.pos.model.Ticket;
|
Line 37... |
Line 39... |
37 |
import java.awt.event.ActionEvent;
|
39 |
import java.awt.event.ActionEvent;
|
38 |
import java.awt.event.ActionListener;
|
40 |
import java.awt.event.ActionListener;
|
39 |
import java.io.IOException;
|
41 |
import java.io.IOException;
|
40 |
import java.text.ParseException;
|
42 |
import java.text.ParseException;
|
41 |
import java.util.Calendar;
|
43 |
import java.util.Calendar;
|
- |
|
44 |
import java.util.Collections;
|
42 |
import java.util.Date;
|
45 |
import java.util.Date;
|
43 |
import java.util.List;
|
46 |
import java.util.List;
|
44 |
|
47 |
|
45 |
import javax.swing.JLabel;
|
48 |
import javax.swing.JLabel;
|
46 |
import javax.swing.JList;
|
49 |
import javax.swing.JList;
|
Line 235... |
Line 238... |
235 |
// Menu
|
238 |
// Menu
|
236 |
|
239 |
|
237 |
c.gridy++;
|
240 |
c.gridy++;
|
238 |
c.weighty = 0;
|
241 |
c.weighty = 0;
|
239 |
c.fill = GridBagConstraints.NONE;
|
242 |
c.fill = GridBagConstraints.NONE;
|
240 |
final Font font = new Font(ARIAL_FONT, Font.PLAIN, 46);
|
243 |
final Font font = new Font(ARIAL_FONT, Font.PLAIN, 32);
|
241 |
this.l = new JList(new String[] { "Imprimer", "Annuler le ticket" });
|
244 |
this.l = new JList(new String[] { "Imprimer la facture", "Imprimer le ticket", "Annuler le ticket" });
|
242 |
this.l.setCellRenderer(new ListCellRenderer() {
|
245 |
this.l.setCellRenderer(new ListCellRenderer() {
|
243 |
|
246 |
|
244 |
@Override
|
247 |
@Override
|
245 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
248 |
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
|
246 |
JLabel l = new JLabel(value.toString()) {
|
249 |
JLabel l = new JLabel(value.toString()) {
|
Line 284... |
Line 287... |
284 |
return;
|
287 |
return;
|
285 |
}
|
288 |
}
|
286 |
Object selectedValue = this.ticketList.getSelectedValue();
|
289 |
Object selectedValue = this.ticketList.getSelectedValue();
|
287 |
int selectedIndex = this.l.getSelectedIndex();
|
290 |
int selectedIndex = this.l.getSelectedIndex();
|
288 |
if (selectedIndex == 0 && selectedValue != null) {
|
291 |
if (selectedIndex == 0 && selectedValue != null) {
|
- |
|
292 |
if (selectedValue instanceof Ticket) {
|
- |
|
293 |
Ticket ticket = (Ticket) selectedValue;
|
- |
|
294 |
ListeDesTicketsPanel.this.frame.showTicketClientNamePanel(ticket);
|
- |
|
295 |
return;
|
- |
|
296 |
}
|
- |
|
297 |
} else if (selectedIndex == 1 && selectedValue != null) {
|
289 |
this.frame.getPOSConf().printOnceOnFirstPrinter(((Printable) selectedValue));
|
298 |
this.frame.getPOSConf().printOnceOnFirstPrinter(((Printable) selectedValue));
|
290 |
} else if (selectedIndex == 1 && selectedValue != null && selectedValue instanceof Ticket) {
|
299 |
} else if (selectedIndex == 2 && selectedValue != null && selectedValue instanceof Ticket) {
|
291 |
Ticket t = (Ticket) selectedValue;
|
300 |
Ticket t = (Ticket) selectedValue;
|
292 |
this.frame.getControler().cancel(t);
|
301 |
this.frame.getControler().cancel(t);
|
293 |
|
302 |
|
294 |
}
|
303 |
}
|
295 |
this.l.clearSelection();
|
304 |
this.l.clearSelection();
|