* orders

* woocommerce support

* working with MariaDB + Derby
This commit is contained in:
hugh-unicenta
2025-07-31 16:03:08 +01:00
committed by GitHub
parent 27fae06809
commit da06d3ed76
7 changed files with 51 additions and 18 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<groupId>com.unicenta</groupId>
<artifactId>unicentaopos</artifactId>
<version>5.3.2</version>
<version>5.3.2-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -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,7 +2221,7 @@ 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);
@@ -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
@@ -82,7 +82,7 @@ public class JTicketsBagShared extends JTicketsBag {
log.debug("Loading Sales screen! "+this.getClass());
ExecutorService customExecutor = Executors.newCachedThreadPool();
SwingWorker<String, String> reloadLayaway = new SwingWorker<>() {
SwingWorker<String, String> reloadLayaway = new SwingWorker<String, String>() {
@Override
protected String doInBackground() throws Exception {
while (true) {