aggiornamento versione

visualizzazione composizioni generiche
This commit is contained in:
Francesco Di Sciascio 2025-04-04 10:42:20 +02:00
parent e0b3307584
commit b3b5fe4fca
2 changed files with 33 additions and 10 deletions

View File

@ -1156,6 +1156,9 @@
</Container> </Container>
<Component class="javax.swing.JLabel" name="lblUtenteLoggato"> <Component class="javax.swing.JLabel" name="lblUtenteLoggato">
<Properties> <Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="11" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="[Nessun utente connesso]"/> <Property name="text" type="java.lang.String" value="[Nessun utente connesso]"/>
<Property name="verticalAlignment" type="int" value="1"/> <Property name="verticalAlignment" type="int" value="1"/>
<Property name="alignmentY" type="float" value="0.0"/> <Property name="alignmentY" type="float" value="0.0"/>
@ -1174,6 +1177,9 @@
</Component> </Component>
<Component class="javax.swing.JLabel" name="lblStatoConnessione"> <Component class="javax.swing.JLabel" name="lblStatoConnessione">
<Properties> <Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="11" style="0"/>
</Property>
<Property name="horizontalAlignment" type="int" value="0"/> <Property name="horizontalAlignment" type="int" value="0"/>
<Property name="text" type="java.lang.String" value="[Nessuna connessione]"/> <Property name="text" type="java.lang.String" value="[Nessuna connessione]"/>
<Property name="verticalAlignment" type="int" value="1"/> <Property name="verticalAlignment" type="int" value="1"/>
@ -1193,6 +1199,9 @@
</Component> </Component>
<Component class="javax.swing.JLabel" name="lblInfo"> <Component class="javax.swing.JLabel" name="lblInfo">
<Properties> <Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="11" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="[Info Turno]"/> <Property name="text" type="java.lang.String" value="[Info Turno]"/>
<Property name="verticalAlignment" type="int" value="1"/> <Property name="verticalAlignment" type="int" value="1"/>
<Property name="alignmentY" type="float" value="0.0"/> <Property name="alignmentY" type="float" value="0.0"/>
@ -1211,6 +1220,9 @@
</Component> </Component>
<Component class="javax.swing.JLabel" name="lblInfo2"> <Component class="javax.swing.JLabel" name="lblInfo2">
<Properties> <Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Segoe UI" size="11" style="0"/>
</Property>
<Property name="text" type="java.lang.String" value="[Info Incassi]"/> <Property name="text" type="java.lang.String" value="[Info Incassi]"/>
<Property name="verticalAlignment" type="int" value="1"/> <Property name="verticalAlignment" type="int" value="1"/>
<Property name="alignmentY" type="float" value="0.0"/> <Property name="alignmentY" type="float" value="0.0"/>

View File

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