Woocom (#50)
* orders * woocommerce support * working with MariaDB + Derby
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>com.unicenta</groupId>
|
<groupId>com.unicenta</groupId>
|
||||||
<artifactId>unicentaopos</artifactId>
|
<artifactId>unicentaopos</artifactId>
|
||||||
<version>5.3.2</version>
|
<version>5.3.2-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ public class DataLogicSales extends BeanFactoryDataSingle {
|
|||||||
, new SerializerWriteBasic(new Datas[]{
|
, new SerializerWriteBasic(new Datas[]{
|
||||||
Datas.STRING,
|
Datas.STRING,
|
||||||
Datas.STRING,
|
Datas.STRING,
|
||||||
Datas.BOOLEAN})
|
Datas.INT})
|
||||||
);
|
);
|
||||||
|
|
||||||
m_createSupp = new StaticSentence(s,
|
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
|
* @param id
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public class StartPOS {
|
|||||||
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
|
metrics.setUniCentaVersion(AppLocal.APP_VERSION);
|
||||||
Application application = new Application();
|
Application application = new Application();
|
||||||
application.postMetrics(metrics);
|
application.postMetrics(metrics);
|
||||||
application.startEventListener(host, jRootApp);
|
application.startEventListener(host, jRootApp, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Problem with starting the uniCenta plugin application:${}", e.getMessage());
|
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;
|
protected SaveProvider spr;
|
||||||
|
|
||||||
private String Category;
|
private String category;
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
private String categoryParentid;
|
private String categoryParentid;
|
||||||
private Integer categoryCatorder;
|
private Integer categoryCatorder;
|
||||||
@@ -374,7 +374,7 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
|
|||||||
String SellPrice = products.get((String) jComboSell.getSelectedItem());
|
String SellPrice = products.get((String) jComboSell.getSelectedItem());
|
||||||
productTax = products.get((String) jComboTax.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());
|
Supplier = products.get((String) jComboSupplier.getSelectedItem());
|
||||||
|
|
||||||
currentRecord++;
|
currentRecord++;
|
||||||
@@ -518,17 +518,17 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
|
|||||||
private String getCategory() {
|
private String getCategory() {
|
||||||
|
|
||||||
if (jComboCategory.getSelectedItem() != category_default) {
|
if (jComboCategory.getSelectedItem() != category_default) {
|
||||||
String cat = (String) cat_list.get(Category);
|
String cat = (String) cat_list.get(category);
|
||||||
|
|
||||||
if (cat != null) {
|
if (cat != null) {
|
||||||
return (cat);
|
return (cat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Category.equals("")) {
|
if (!category.equals("")) {
|
||||||
Object[] newcat = new Object[3];
|
Object[] newcat = new Object[3];
|
||||||
newcat[0] = UUID.randomUUID().toString();
|
newcat[0] = UUID.randomUUID().toString();
|
||||||
newcat[1] = Category;
|
newcat[1] = category;
|
||||||
newcat[2] = true;
|
newcat[2] = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -539,15 +539,15 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
|
|||||||
m_CategoryModel.setSelectedItem(category);
|
m_CategoryModel.setSelectedItem(category);
|
||||||
cat_list.put(category.toString(), m_CategoryModel.getSelectedKey().toString());
|
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);
|
return (cat);
|
||||||
} catch (BasicException ex) {
|
} catch (BasicException ex) {
|
||||||
log.error(ex.getMessage());
|
log.error(ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!badCategories.contains(Category)) {
|
if (!badCategories.contains(category)) {
|
||||||
badCategories.add(Category.trim()); // Save a list of the bad categories
|
badCategories.add(category.trim()); // Save a list of the bad categories
|
||||||
}
|
}
|
||||||
return ((jComboDefaultCategory.getSelectedItem()
|
return ((jComboDefaultCategory.getSelectedItem()
|
||||||
== reject_bad_category)
|
== reject_bad_category)
|
||||||
@@ -968,7 +968,7 @@ public class JPanelCSVImport extends JPanel implements JPanelView {
|
|||||||
myprod[7] = productSellPrice; // Sell price
|
myprod[7] = productSellPrice; // Sell price
|
||||||
myprod[8] = previousBuy; // Previous Buy price double
|
myprod[8] = previousBuy; // Previous Buy price double
|
||||||
myprod[9] = previousSell; // Previous Sell price double
|
myprod[9] = previousSell; // Previous Sell price double
|
||||||
myprod[10] = Category; // Category
|
myprod[10] = category; // Category
|
||||||
myprod[11] = productTax; // Tax
|
myprod[11] = productTax; // Tax
|
||||||
myprod[12] = Supplier; // Supplier
|
myprod[12] = Supplier; // Supplier
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -2221,7 +2221,7 @@ public abstract class JPanelTicket extends JPanel implements JPanelView, BeanFac
|
|||||||
|
|
||||||
if (checkProduct != null) {
|
if (checkProduct != null) {
|
||||||
|
|
||||||
if (checkProduct.getUnits() <= 0) {
|
if (checkProduct.getUnits() != null && checkProduct.getUnits() <= 0) {
|
||||||
jCheckStock.setForeground(Color.magenta);
|
jCheckStock.setForeground(Color.magenta);
|
||||||
} else {
|
} else {
|
||||||
jCheckStock.setForeground(Color.darkGray);
|
jCheckStock.setForeground(Color.darkGray);
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ package com.unicenta.pos.sales.restaurant;
|
|||||||
import com.unicenta.data.loader.Session;
|
import com.unicenta.data.loader.Session;
|
||||||
import com.unicenta.pos.forms.AppView;
|
import com.unicenta.pos.forms.AppView;
|
||||||
import com.unicenta.pos.forms.DataLogicSystem;
|
import com.unicenta.pos.forms.DataLogicSystem;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -18,7 +20,7 @@ import java.sql.Timestamp;
|
|||||||
*
|
*
|
||||||
* @author JDL
|
* @author JDL
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
public class RestaurantDBUtils {
|
public class RestaurantDBUtils {
|
||||||
private Session s;
|
private Session s;
|
||||||
private Connection con;
|
private Connection con;
|
||||||
@@ -304,11 +306,11 @@ public class RestaurantDBUtils {
|
|||||||
rs = stmt.executeQuery(SQL);
|
rs = stmt.executeQuery(SQL);
|
||||||
|
|
||||||
if (rs.next()){
|
if (rs.next()){
|
||||||
String customer =rs.getString("TICKETID");
|
return(rs.getString("TICKETID"));
|
||||||
return(customer);
|
|
||||||
}
|
}
|
||||||
}catch(SQLException e){
|
}catch(SQLException e){
|
||||||
}
|
log.error("Error running SQL: {}{}", SQL, e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
@@ -553,6 +555,21 @@ public class RestaurantDBUtils {
|
|||||||
return "";
|
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
|
* @param tableID
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class JTicketsBagShared extends JTicketsBag {
|
|||||||
log.debug("Loading Sales screen! "+this.getClass());
|
log.debug("Loading Sales screen! "+this.getClass());
|
||||||
|
|
||||||
ExecutorService customExecutor = Executors.newCachedThreadPool();
|
ExecutorService customExecutor = Executors.newCachedThreadPool();
|
||||||
SwingWorker<String, String> reloadLayaway = new SwingWorker<>() {
|
SwingWorker<String, String> reloadLayaway = new SwingWorker<String, String>() {
|
||||||
@Override
|
@Override
|
||||||
protected String doInBackground() throws Exception {
|
protected String doInBackground() throws Exception {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user