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.core.sales.pos.POSConfiguration;
|
- |
|
17 |
import org.openconcerto.erp.core.sales.pos.io.Printable;
|
16 |
import org.openconcerto.erp.core.sales.pos.io.Printable;
|
18 |
import org.openconcerto.erp.core.sales.pos.io.TicketPrinter;
|
17 |
import org.openconcerto.erp.core.sales.pos.io.TicketPrinter;
|
19 |
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
|
18 |
import org.openconcerto.erp.core.sales.pos.model.RegisterLog;
|
20 |
import org.openconcerto.task.config.ComptaBasePropsConfiguration;
|
19 |
import org.openconcerto.task.config.ComptaBasePropsConfiguration;
|
21 |
import org.openconcerto.utils.ExceptionHandler;
|
20 |
import org.openconcerto.utils.ExceptionHandler;
|
Line 67... |
Line 66... |
67 |
b.addActionListener(new ActionListener() {
|
66 |
b.addActionListener(new ActionListener() {
|
68 |
|
67 |
|
69 |
@Override
|
68 |
@Override
|
70 |
public void actionPerformed(ActionEvent e) {
|
69 |
public void actionPerformed(ActionEvent e) {
|
71 |
System.err.println("CaisseMenuPanel.CaisseMenuPanel(...).new ActionListener() {...}.actionPerformed()");
|
70 |
System.err.println("CaisseMenuPanel.CaisseMenuPanel(...).new ActionListener() {...}.actionPerformed()");
|
72 |
POSConfiguration.getInstance().printOnceOnFirstPrinter(new Printable() {
|
71 |
caisseFrame.getPOSConf().printOnceOnFirstPrinter(new Printable() {
|
73 |
|
72 |
|
74 |
@Override
|
73 |
@Override
|
75 |
public void print(TicketPrinter prt, int ticketWidth) {
|
74 |
public void print(TicketPrinter prt, int ticketWidth) {
|
76 |
prt.clearBuffer(f.getName());
|
75 |
prt.clearBuffer(f.getName());
|
77 |
System.err.println("CaisseMenuPanel.CaisseMenuPanel(...)print()");
|
76 |
System.err.println("CaisseMenuPanel.CaisseMenuPanel(...)print()");
|
Line 161... |
Line 160... |
161 |
public void actionPerformed(ActionEvent e) {
|
160 |
public void actionPerformed(ActionEvent e) {
|
162 |
try {
|
161 |
try {
|
163 |
final boolean quit = caisseFrame.getDB().fetchRegisterState().checkIfMoved();
|
162 |
final boolean quit = caisseFrame.getDB().fetchRegisterState().checkIfMoved();
|
164 |
if (!quit) {
|
163 |
if (!quit) {
|
165 |
frame.getControler().setLCD("Cloture", "En cours...", 0);
|
164 |
frame.getControler().setLCD("Cloture", "En cours...", 0);
|
166 |
final int userID = POSConfiguration.getInstance().getUserID();
|
165 |
final int userID = caisseFrame.getPOSConf().getUserID();
|
167 |
final RegisterLog newLog = caisseFrame.getFiles().close(userID);
|
166 |
final RegisterLog newLog = caisseFrame.getFiles().close(userID);
|
168 |
caisseFrame.getDB().close(userID, newLog);
|
167 |
caisseFrame.getDB().close(caisseFrame.getPOSConf(), newLog);
|
169 |
frame.getControler().setLCD("Cloture", "Terminee", 0);
|
168 |
frame.getControler().setLCD("Cloture", "Terminee", 0);
|
170 |
// TODO lock down the UI until open again
|
169 |
// TODO lock down the UI until open again
|
171 |
}
|
170 |
}
|
172 |
quit();
|
171 |
quit();
|
173 |
} catch (Exception ex) {
|
172 |
} catch (Exception ex) {
|