merge main

This commit is contained in:
2025-08-06 17:39:16 +01:00
9 changed files with 58 additions and 24 deletions
+2 -2
View File
@@ -4,7 +4,7 @@
<groupId>com.unicenta</groupId>
<artifactId>unicentaopos</artifactId>
<version>5.3.2</version>
<version>5.4.0</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -361,7 +361,7 @@
<dependency>
<groupId>com.unicenta</groupId>
<artifactId>unicenta-plugins</artifactId>
<version>1.3.0-SNAPSHOT</version>
<version>1.2.9-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.gluonhq</groupId>
@@ -30,7 +30,7 @@ public class AppLocal {
public static final String APP_NAME = "uniCenta oPOS";
public static final String APP_ID = "unicentaopos";
public static final String APP_VERSION = "5.3.2";
public static final String APP_VERSION = "5.4.0";
private static final LocaleResources m_resources;
@@ -197,7 +197,7 @@ public class DataLogicSales extends BeanFactoryDataSingle {
, new SerializerWriteBasic(new Datas[]{
Datas.STRING,
Datas.STRING,
Datas.BOOLEAN})
Datas.INT})
);
m_createSupp = new StaticSentence(s,
@@ -635,6 +635,22 @@ public class DataLogicSales extends BeanFactoryDataSingle {
}
public final CategoryInfo getCategoryInfoByName(String name) throws BasicException {
return (CategoryInfo) new PreparedSentence(s
, "SELECT "
+ "ID, "
+ "NAME, "
+ "IMAGE, "
+ "TEXTTIP, "
+ "CATSHOWNAME, "
+ "CATORDER "
+ "FROM categories "
+ "WHERE NAME = ? "
+ "ORDER BY CATORDER, NAME"
, SerializerWriteString.INSTANCE
, CategoryInfo.getSerializerRead()).find(name);
}
/**
*
* @param id
@@ -129,7 +129,7 @@ public class StartPOS {
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
Application application = new Application();
application.postMetrics(metrics);
application.startEventListener(host, jRootApp);
application.startEventListener(host, jRootApp, null);
} catch (Exception e) {
log.error("Problem with starting the uniCenta plugin application:${}", e.getMessage());
}
@@ -82,7 +82,7 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
protected SaveProvider spr;
private String Category;
private String category;
private String categoryName;
private String categoryParentid;
private Integer categoryCatorder;
@@ -374,7 +374,7 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
String SellPrice = products.get((String) jComboSell.getSelectedItem());
productTax = products.get((String) jComboTax.getSelectedItem());
Category = products.get((String) jComboCategory.getSelectedItem());
category = products.get((String) jComboCategory.getSelectedItem());
Supplier = products.get((String) jComboSupplier.getSelectedItem());
currentRecord++;
@@ -518,17 +518,17 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
private String getCategory() {
if (jComboCategory.getSelectedItem() != category_default) {
String cat = (String) cat_list.get(Category);
String cat = (String) cat_list.get(category);
if (cat != null) {
return (cat);
}
}
if (!Category.equals("")) {
if (!category.equals("")) {
Object[] newcat = new Object[3];
newcat[0] = UUID.randomUUID().toString();
newcat[1] = Category;
newcat[1] = category;
newcat[2] = true;
try {
@@ -539,15 +539,15 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
m_CategoryModel.setSelectedItem(category);
cat_list.put(category.toString(), m_CategoryModel.getSelectedKey().toString());
}
String cat = (String) cat_list.get(Category);
String cat = (String) cat_list.get(category);
return (cat);
} catch (BasicException ex) {
log.error(ex.getMessage());
}
}
if (!badCategories.contains(Category)) {
badCategories.add(Category.trim()); // Save a list of the bad categories
if (!badCategories.contains(category)) {
badCategories.add(category.trim()); // Save a list of the bad categories
}
return ((jComboDefaultCategory.getSelectedItem()
== reject_bad_category)
@@ -968,7 +968,7 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
myprod[7] = productSellPrice; // Sell price
myprod[8] = previousBuy; // Previous Buy price double
myprod[9] = previousSell; // Previous Sell price double
myprod[10] = Category; // Category
myprod[10] = category; // Category
myprod[11] = productTax; // Tax
myprod[12] = Supplier; // Supplier
try {
@@ -2221,13 +2221,14 @@ public abstract class JPanelTicket extends JPanel implements JPanelView, BeanFac
if (checkProduct != null) {
if (checkProduct.getUnits() <= 0) {
if (checkProduct.getUnits() != null && checkProduct.getUnits() <= 0) {
jCheckStock.setForeground(Color.magenta);
} else {
jCheckStock.setForeground(Color.darkGray);
}
double dUnits = checkProduct.getUnits();
double dUnits = checkProduct.getUnits() == null ? 0.0 : checkProduct.getUnits();
int iUnits;
iUnits = (int) dUnits;
jCheckStock.setText(Integer.toString(iUnits));
@@ -7,6 +7,8 @@ package com.unicenta.pos.sales.restaurant;
import com.unicenta.data.loader.Session;
import com.unicenta.pos.forms.AppView;
import com.unicenta.pos.forms.DataLogicSystem;
import lombok.extern.slf4j.Slf4j;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -18,7 +20,7 @@ import java.sql.Timestamp;
*
* @author JDL
*/
@Slf4j
public class RestaurantDBUtils {
private Session s;
private Connection con;
@@ -304,11 +306,11 @@ public class RestaurantDBUtils {
rs = stmt.executeQuery(SQL);
if (rs.next()){
String customer =rs.getString("TICKETID");
return(customer);
return(rs.getString("TICKETID"));
}
}catch(SQLException e){
}
log.error("Error running SQL: {}{}", SQL, e.getMessage());
}
return "";
}
@@ -553,6 +555,21 @@ public class RestaurantDBUtils {
return "";
}
public String getTableId (String nameOfTable){
try{
SQL = "SELECT ID FROM places WHERE NAME='"+ nameOfTable + "'";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
if (rs.next()){
return(rs.getString("ID"));
}
}catch(SQLException e){
log.error("Error running SQL: {}{}", SQL, e.getMessage());
}
return "";
}
/**
*
* @param tableID
@@ -133,7 +133,7 @@ public class JTicketsBagShared extends JTicketsBag {
m_App.getAppUserView().getUser().getName(),
"Void",
"Ticket Deleted",
(Object) 0.0
0.0
});
m_sCurrentTicket = null;
@@ -245,7 +245,7 @@ public class JTicketsBagShared extends JTicketsBag {
m_jListTickets.setText("");
newTicket();
} else {
showList = (Boolean) m_App.getAppUserView().getUser().hasPermission("sales.ShowList");
showList = m_App.getAppUserView().getUser().hasPermission("sales.ShowList");
if (showList) {
m_jListTickets.doClick();
}
@@ -500,7 +500,7 @@ public class JTicketsBagShared extends JTicketsBag {
if (m_sCurrentTicket != null) {
if (m_App.getProperties().getProperty("override.check").equals("true")) {
Integer secret = (Integer) Integer.parseInt(m_App.getProperties().getProperty("override.pin"));
Integer secret = Integer.parseInt(m_App.getProperties().getProperty("override.pin"));
Integer iValue = JNumberPop.showEditNumber(this, AppLocal.getIntString("title.override.enterpin"));
if (iValue == null ? secret == null : iValue.equals(secret)) {
+1 -1
View File
@@ -881,7 +881,7 @@ message.email=Desktop email app' not found
message.emptycustomer=Customer cannot be empty
message.emptynumber=Number cannot be empty
message.enterbuyprice=Enter new Buy Price
message.eolupdate=<html><center><h2>Version 5.3.2 Upgrade!</h2></br><h3>Your current database version is {0}</h3><br>For version 5.3 click <b>YES</b><br/><br/>For any other version click <b>NO</b> and get to 5.3 first<br><br/>
message.eolupdate=<html><center><h2>Version 5.4.0 Upgrade!</h2></br><h3>Your current database version is {0}</h3><br>For version 5.3 and above click <b>YES</b><br/><br/>For any other version click <b>NO</b> and get to 5.3 first<br><br/>
message.ibuttonassign=<html><center>Get the iButton ID<br>Place iButton onto the reader then click OK
message.ibuttonnotassign=<html><center>The iButton used is not yet assigned to anyone
message.ibuttonnotfound=No iButton adapter found. Key fobs will be disabled.