diff --git a/src/puntocassa/PuntoCassa.form b/src/puntocassa/PuntoCassa.form index 04502fa..18588c7 100644 --- a/src/puntocassa/PuntoCassa.form +++ b/src/puntocassa/PuntoCassa.form @@ -1156,6 +1156,9 @@ + + + @@ -1174,6 +1177,9 @@ + + + @@ -1193,6 +1199,9 @@ + + + @@ -1211,6 +1220,9 @@ + + + diff --git a/src/puntocassa/PuntoCassa.java b/src/puntocassa/PuntoCassa.java index 517a180..1c4340b 100644 --- a/src/puntocassa/PuntoCassa.java +++ b/src/puntocassa/PuntoCassa.java @@ -18,6 +18,7 @@ import java.sql.*; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.ArrayList; @@ -60,7 +61,7 @@ public class PuntoCassa extends JFrame implements ActionListener { // ========================================================================== // *** Variabili globali relative alle connessioni // ========================================================================== - public static String versione = "2.4"; + public static String versione = "3.0"; public static String dbStringa = ""; private String dbTipo = ""; private String dbDriver = ""; @@ -1444,6 +1445,7 @@ public class PuntoCassa extends JFrame implements ActionListener { pnlLogin.getAccessibleContext().setAccessibleName("pnlLogin"); pnlLogin.getAccessibleContext().setAccessibleDescription(""); + lblUtenteLoggato.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N lblUtenteLoggato.setText("[Nessun utente connesso]"); lblUtenteLoggato.setVerticalAlignment(javax.swing.SwingConstants.TOP); lblUtenteLoggato.setAlignmentY(0.0F); @@ -1452,6 +1454,7 @@ public class PuntoCassa extends JFrame implements ActionListener { getContentPane().add(lblUtenteLoggato); lblUtenteLoggato.setBounds(20, 310, 130, 20); + lblStatoConnessione.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N lblStatoConnessione.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lblStatoConnessione.setText("[Nessuna connessione]"); lblStatoConnessione.setVerticalAlignment(javax.swing.SwingConstants.TOP); @@ -1461,6 +1464,7 @@ public class PuntoCassa extends JFrame implements ActionListener { getContentPane().add(lblStatoConnessione); lblStatoConnessione.setBounds(425, 340, 120, 20); + lblInfo.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N lblInfo.setText("[Info Turno]"); lblInfo.setVerticalAlignment(javax.swing.SwingConstants.TOP); lblInfo.setAlignmentY(0.0F); @@ -1469,6 +1473,7 @@ public class PuntoCassa extends JFrame implements ActionListener { getContentPane().add(lblInfo); lblInfo.setBounds(180, 340, 130, 20); + lblInfo2.setFont(new java.awt.Font("Segoe UI", 0, 11)); // NOI18N lblInfo2.setText("[Info Incassi]"); lblInfo2.setVerticalAlignment(javax.swing.SwingConstants.TOP); lblInfo2.setAlignmentY(0.0F); @@ -1512,7 +1517,7 @@ public class PuntoCassa extends JFrame implements ActionListener { w = (tw / 8); h = 60; - int part = (displayWidth - lblDB.getWidth()) / 8; + int part = (displayWidth - lblDB.getWidth()) / 9; lblUtenteLoggato.setLocation(x, y); //lblUtenteLoggato.setSize(w, h); @@ -1530,7 +1535,7 @@ public class PuntoCassa extends JFrame implements ActionListener { int larg = tw - (w * 2 + 10) - 359; //lblInfo2.setSize(larg, h); //lblInfo2.setSize(444, h); - lblInfo2.setSize((int)(part * 3), h); + lblInfo2.setSize((int)(part * 4), h); //lblStatoConnessione.setLocation(tw - 181 - lblDB.getWidth(), y); lblStatoConnessione.setLocation(lblInfo2.getLocation().x + lblInfo2.getSize().width, y); @@ -2168,7 +2173,7 @@ public class PuntoCassa extends JFrame implements ActionListener { Font f = new Font("Tahoma", Font.BOLD, hFont); bGost.setFont(f); bGost.setForeground(Color.RED); - bGost.setActionCommand("CATEGORIA[0]"); + bGost.setActionCommand("CATEGORIA[-1]"); bGost.addActionListener(this); bGost.setVisible(false); pnl.add(bGost); @@ -2488,7 +2493,7 @@ public class PuntoCassa extends JFrame implements ActionListener { utenteLoggato = txtUsername.getText(); } - lblUtenteLoggato.setText("LogIn: [" + utenteLoggato + "]"); + lblUtenteLoggato.setText("[" + utenteLoggato + "]"); this.resize(); this.caricaDati("CATEGORIE", "0"); pnlErrore.setVisible(false); @@ -3614,8 +3619,9 @@ public class PuntoCassa extends JFrame implements ActionListener { } } Boolean spiaProgressivo = false; - //Date adesso = new Date(); + LocalDateTime adesso = LocalDateTime.now(); + LocalDate oggi = LocalDate.now(); String flagPassaggioTessera = "0"; if (passaggioTessera) { flagPassaggioTessera = "1"; @@ -3774,7 +3780,7 @@ public class PuntoCassa extends JFrame implements ActionListener { + ",incasso_turno_ticket=" + progressivoTicket + ",incasso_turno_scalare=" + progressivoScalare + ",incasso_turno_differito=" + progressivoDifferito //+ " where id_Punto_cassa=" + idPuntoCassa + " and id_turno=" + idTurno + " and data=" + formattaData(adesso)); - + " where id_Punto_cassa=" + idPuntoCassa + " and id_turno=" + idTurno + " and data=" + formatLocalDateTime(adesso), + + " where id_Punto_cassa=" + idPuntoCassa + " and id_turno=" + idTurno + " and data=" + formatLocalDate(oggi), this); } @@ -4170,7 +4176,7 @@ public class PuntoCassa extends JFrame implements ActionListener { if (modoPagamento.equalsIgnoreCase("A scalare")) { //modifica 09-11-18 - if (calcolaTotale() > 0.00 && flagPrecaricaLista == false) { + if (calcolaTotale() >= 0.00 && flagPrecaricaLista == false) { verificaSaldo(numeroTessera); } //fine modifica @@ -4211,7 +4217,7 @@ public class PuntoCassa extends JFrame implements ActionListener { sommaColonne(model); //modifica 09-11-18 if (modoPagamento.equalsIgnoreCase("A scalare")) { - if (calcolaTotale() > 0.00 && flagPrecaricaLista) { + if (calcolaTotale() >= 0.00 && flagPrecaricaLista) { verificaSaldo(numeroTessera); } } @@ -4575,6 +4581,11 @@ public class PuntoCassa extends JFrame implements ActionListener { DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss"); return "to_date('" + data.format(formatter) + "','dd/mm/yyyy HH24:MI:SS')"; } + + private String formatLocalDate(LocalDate data){ + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy"); + return "to_date('" + data.format(formatter) + "','dd/mm/yyyy')"; + } private String formattaData(Date data) { SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy"); @@ -4889,7 +4900,7 @@ public class PuntoCassa extends JFrame implements ActionListener { rs = st.executeQuery(sql); while (rs.next()) { String strRiga = rs.getString("now"); - this.pc.lblStatoConnessione.setText(strRiga + " Vers. " + versione); + this.pc.lblStatoConnessione.setText(strRiga + " V. " + versione); }