17 Commits

Author SHA1 Message Date
hugh b8f22b9ae2 order api 2023-12-21 17:27:24 +00:00
hugh cefebc3882 wip 2023-12-11 18:52:25 +00:00
hugh bfaeedfa34 Orders POC 2023-12-10 14:41:24 +00:00
hugh 492990848b 5.1 release / latest adapter 2023-11-21 14:45:46 +00:00
hugh 3637f8a352 5.1 release 2023-11-14 11:05:15 +00:00
hugh 160cd189c8 5.1 release 2023-11-14 10:34:57 +00:00
hugh 33c4c39082 5.1 release 2023-11-14 10:33:33 +00:00
hugh f5930ee93d fixing slow build 2023-11-13 14:14:04 +00:00
hugh 83b5c421c2 fixing slow build 2023-11-13 14:05:00 +00:00
hugh 5fed36a86c adding gh action maven build 2023-11-13 13:49:39 +00:00
hugh 6f026636eb adding gh action maven build 2023-11-13 13:47:15 +00:00
hugh 9095f02baf adding gh action maven build 2023-11-13 13:42:40 +00:00
hugh e81ef4244a adding gh action maven build 2023-11-13 13:40:41 +00:00
hugh bdeb625570 payment window fix 2023-11-11 15:17:54 +00:00
hugh d40880a7c2 payment window fix 2023-11-11 15:15:36 +00:00
hugh e136c11f27 5.2 release 2023-11-11 15:10:31 +00:00
hugh-unicenta c8855c2a57 Merge pull request #23 from uniCenta/teya-integration
Teya integration
2023-11-10 18:00:59 +00:00
13 changed files with 83 additions and 179 deletions
+18
View File
@@ -0,0 +1,18 @@
name: Java CI with Maven
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
+12 -19
View File
@@ -4,7 +4,7 @@
<groupId>com.unicenta</groupId>
<artifactId>unicentaopos</artifactId>
<version>5.0.2-SNAPSHOT</version>
<version>5.1</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -325,7 +325,7 @@
<dependency>
<groupId>com.unicenta</groupId>
<artifactId>unicenta-plugins</artifactId>
<version>1.2</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.gluonhq</groupId>
@@ -549,34 +549,27 @@
<finalName>unicentaopos</finalName>
</build>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>charm-glisten</id>
<name>charm-glisten Repository</name>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>unicenta-repo</id>
<url>https://repo.unicenta.org/maven2/</url>
<layout>default</layout>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
<layout>default</layout>
</repository>
<!--These are needed for Swing/Netbeans
<repository>
<id>netbeans</id>
<name>NetBeans</name>
<url>https://netbeans.apidesign.org/maven2/</url>
</repository>-->
<!--These are needed for Swing/Netbeans -->
<repository>
<id>flatlaf</id>
<name>flatlaf</name>
<url>https://dev.webswing.org/public/nexus/repository/webswing-3rd-parties//</url>
</repository>
<repository>
<id>unicenta-repo</id>
<url>https://repo.unicenta.org/maven2/</url>
<layout>default</layout>
</repository>
</repositories>
<distributionManagement>
<repository>
@@ -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.0.1";
public static final String APP_VERSION = "5.1";
private static final LocaleResources m_resources;
@@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j;
import javax.swing.*;
import java.awt.*;
import java.util.ArrayList;
@Slf4j
public class PaymentGatewayPaymentSense implements PaymentGateway {
@@ -34,13 +35,26 @@ public class PaymentGatewayPaymentSense implements PaymentGateway {
public PaymentGatewayPaymentSense() {
}
Window getPaymentWindow() {
for (Window window : Window.getWindows()) {
if (window.isActive()) {
return window;
Window getPaymentWindow(double amount) {
if (amount > 0) {
ArrayList<JPaymentSelectReceipt> paymentWindows = new ArrayList<>();
for (Window window : Window.getWindows()) {
if (window instanceof JPaymentSelectReceipt) {
paymentWindows.add((JPaymentSelectReceipt) window);
}
}
return paymentWindows.get(paymentWindows.size()-1);
}
return null;
else {
ArrayList<JPaymentSelectRefund> paymentWindows = new ArrayList<>();
for (Window window : Window.getWindows()) {
if (window instanceof JPaymentSelectRefund) {
paymentWindows.add((JPaymentSelectRefund) window);
}
}
return paymentWindows.get(paymentWindows.size()-1);
}
}
/**
@@ -53,7 +67,8 @@ public class PaymentGatewayPaymentSense implements PaymentGateway {
int timer = 0;
int timeout = 180;
new Application().paymentSenseTransaction(RoundUtils.round(payinfo.getTotal()), getPaymentWindow());
double roundedValue = RoundUtils.round(payinfo.getTotal());
new Application().paymentSenseTransaction(roundedValue, getPaymentWindow(roundedValue));
while (AppContext.getIsProcessing() == null || AppContext.getIsProcessing()) {
try {
@@ -33,17 +33,17 @@ import com.unicenta.pos.sales.ReprintTicketInfo;
import com.unicenta.pos.sales.SharedTicketInfo;
import com.unicenta.pos.sales.TicketsEditor;
import com.unicenta.pos.ticket.TicketInfo;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import java.util.UUID;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.*;
/**
*
* @author JG uniCenta
*/
@Slf4j
public class JTicketsBagShared extends JTicketsBag {
private String m_sCurrentTicket = null;
@@ -75,6 +75,24 @@ public class JTicketsBagShared extends JTicketsBag {
*/
@Override
public void activate() {
log.debug("Loading Sales screen! "+this.getClass());
SwingWorker<String, String> reloadLayaway = new SwingWorker<>() {
@Override
protected String doInBackground() throws Exception {
while (true) {
log.debug("refresh screen");
updateCount();
Thread.sleep(5000);
}
//return null;
}
};
reloadLayaway.execute();
m_sCurrentTicket = null;
selectValidTicket();
@@ -362,9 +380,9 @@ public class JTicketsBagShared extends JTicketsBag {
|| m_App.getAppUserView().getUser().hasPermission("sales.ViewSharedTicket")
|| m_App.getAppUserView().getUser().hasPermission("sales.Override"))
{
List<SharedTicketInfo> l = dlReceipts.getSharedTicketList();
List<SharedTicketInfo> sharedTicketList = dlReceipts.getSharedTicketList();
JTicketsBagSharedList listDialog = JTicketsBagSharedList.newJDialog(JTicketsBagShared.this);
String id = listDialog.showTicketsList(l, dlReceipts);
String id = listDialog.showTicketsList(sharedTicketList, dlReceipts);
if (id != null) {
saveCurrentTicket();
@@ -1,7 +1,2 @@
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.Linediscount.txt} WHERE name = 'script.Linediscount';
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.Totaldiscount.txt} WHERE name = 'script.Totaldiscount';
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.multibuy.txt} WHERE name = 'script.multibuy';
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Printer.Ticket.xml} WHERE name = 'Printer.Ticket';
UPDATE applications SET version = $APP_VERSION{} WHERE id = $APP_ID{};
@@ -1,70 +1,3 @@
-- CLEAR THE DECKS
DELETE FROM sharedtickets;
-- Switch OFF table foreign key relationships
set foreign_key_checks = 0;
-- RECREATE applications table
DROP TABLE `applications`;
CREATE TABLE IF NOT EXISTS `applications` (
`id` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`version` varchar(255) NOT NULL,
`instdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Compact;
-- SYSTEM
DELETE FROM resources WHERE name = 'script.posapps';
DELETE FROM resources WHERE id = '0';
DELETE FROM resources WHERE id = '00';
INSERT INTO resources(id, name, restype, content) VALUES('00', 'Menu.Root', 0, $FILE{/com/unicenta/pos/templates/Menu.Root.txt});
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Ticket.Buttons.xml} WHERE name = 'Ticket.Buttons';
COMMIT;
UPDATE applications SET version = $APP_VERSION{} WHERE id = $APP_ID{};
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Printer.Ticket.xml} WHERE name = 'Printer.Ticket';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Ticket.Close.xml} WHERE name = 'Ticket.Close';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Cash.Close.xml} WHERE name = 'Cash.Close';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/customer.created.xml} WHERE name = 'Customer.Created';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/customer.deleted.xml} WHERE name = 'Customer.Deleted';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/customer.updated.xml} WHERE name = 'Customer.Updated';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.Linediscount.txt} WHERE name = 'script.Linediscount';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.Totaldiscount.txt} WHERE name = 'script.Totaldiscount';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.multibuy.txt} WHERE name = 'script.multibuy';
COMMIT;
-- ROLES
DELETE FROM roles WHERE id = '0';
INSERT INTO roles(id, name, permissions) VALUES('0', 'Administrator role', $FILE{/com/unicenta/pos/templates/Role.Administrator.xml} );
DELETE FROM roles WHERE id = '1';
INSERT INTO roles(id, name, permissions) VALUES('1', 'Manager role', $FILE{/com/unicenta/pos/templates/Role.Manager.xml} );
DELETE FROM roles WHERE id = '2';
INSERT INTO roles(id, name, permissions) VALUES('2', 'Employee role', $FILE{/com/unicenta/pos/templates/Role.Employee.xml} );
-- Switch ON table foreign key relationships
set foreign_key_checks = 1;
INSERT INTO applications(id, name, version) VALUES($APP_ID{}, $APP_NAME{}, $APP_VERSION{});
COMMIT;
@@ -1,70 +1,3 @@
-- CLEAR THE DECKS
DELETE FROM sharedtickets;
-- Switch OFF table foreign key relationships
set foreign_key_checks = 0;
-- RECREATE applications table
DROP TABLE `applications`;
CREATE TABLE IF NOT EXISTS `applications` (
`id` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`version` varchar(255) NOT NULL,
`instdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY ( `id` )
) ENGINE = InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT = Compact;
-- SYSTEM
DELETE FROM resources WHERE name = 'script.posapps';
DELETE FROM resources WHERE id = '0';
DELETE FROM resources WHERE id = '00';
INSERT INTO resources(id, name, restype, content) VALUES('00', 'Menu.Root', 0, $FILE{/com/unicenta/pos/templates/Menu.Root.txt});
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Ticket.Buttons.xml} WHERE name = 'Ticket.Buttons';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Printer.Ticket.xml} WHERE name = 'Printer.Ticket';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Ticket.Close.xml} WHERE name = 'Ticket.Close';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/Cash.Close.xml} WHERE name = 'Cash.Close';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/customer.created.xml} WHERE name = 'Customer.Created';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/customer.deleted.xml} WHERE name = 'Customer.Deleted';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/customer.updated.xml} WHERE name = 'Customer.Updated';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.Linediscount.txt} WHERE name = 'script.Linediscount';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.Totaldiscount.txt} WHERE name = 'script.Totaldiscount';
COMMIT;
UPDATE resources SET content = $FILE{/com/unicenta/pos/templates/script.multibuy.txt} WHERE name = 'script.multibuy';
COMMIT;
-- ROLES
DELETE FROM roles WHERE id = '0';
INSERT INTO roles(id, name, permissions) VALUES('0', 'Administrator role', $FILE{/com/unicenta/pos/templates/Role.Administrator.xml} );
DELETE FROM roles WHERE id = '1';
INSERT INTO roles(id, name, permissions) VALUES('1', 'Manager role', $FILE{/com/unicenta/pos/templates/Role.Manager.xml} );
DELETE FROM roles WHERE id = '2';
INSERT INTO roles(id, name, permissions) VALUES('2', 'Employee role', $FILE{/com/unicenta/pos/templates/Role.Employee.xml} );
-- Switch ON table foreign key relationships
set foreign_key_checks = 1;
INSERT INTO applications(id, name, version) VALUES($APP_ID{}, $APP_NAME{}, $APP_VERSION{});
UPDATE applications SET version = $APP_VERSION{} WHERE id = $APP_ID{};
COMMIT;
@@ -218,7 +218,6 @@
<line><text>Tranx ID : </text><text>${paymentline.printTransactionID()}</text></line>
<line><text>Auth Code : </text><text>${paymentline.printAuthorization()}</text></line>
<line><text>Verified By : </text><text>${paymentline.printVerification()}</text></line>
<line><text>Card # (last 4) : </text><text>${paymentline.printLastFourDigits()}</text></line>
#end
#if (!$paymentline.chipAndPin)
<line size="1"><text align="center" length="42" bold="true">CARD SALE</text></line>
+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.0.1 Upgrade!</h2></br><h3>Your current database version is {0}</h3><br>For version 5.0 click <b>YES</b><br/><br/>For any other version click <b>NO</b> and get to 5.0 first<br><br/>
message.eolupdate=<html><center><h2>Version 5.1 Upgrade!</h2></br><h3>Your current database version is {0}</h3><br>For version 5.0.1 click <b>YES</b><br/><br/>For any other version click <b>NO</b> and get to 5.0.1 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.
@@ -1190,4 +1190,4 @@ cboption.find=Buscar
button.prodhtmldisplayFont=Tipo de fuente
button.prodhtmldisplayImage=Imagen
label.csvclear=Diario de importaci\u00f3n
message.eolupdate=<html><center><h3>uniCenta oPOS Versi\u00f3n {0} detectada!</h3><h4>\u00a1Las actualizaciones de la versi\u00f3n est\u00e1n cambiando!</h4> Si su versi\u00f3n es 4.5 o posterior, elija <b>S\u00cd</b> para continuar.<br/><br/> Para versiones anteriores, haga clic en <b>NO</b> para abrir Opciones de configuraci\u00f3n ahora.<br/></br>Lea la Gu\u00eda de transferencia de datos de uniCenta oPOS
message.eolupdate=<html><center><h3>uniCenta oPOS Versi\u00f3n {0} detectada!</h3><h4>\u00a1Las actualizaciones de la versi\u00f3n est\u00e1n cambiando!</h4> Si su versi\u00f3n es 5.0.1 o posterior, elija <b>S\u00cd</b> para continuar.<br/><br/> Para versiones anteriores, haga clic en <b>NO</b> para abrir Opciones de configuraci\u00f3n ahora.<br/></br>Lea la Gu\u00eda de transferencia de datos de uniCenta oPOS
@@ -468,4 +468,4 @@ transpayment.ticket=Ticket
transpayment.voucherin=Vales cobrados
transpayment.voucherout=Vales emitidos
Visor.Title=uniCenta oPOS
message.eolupdate=<html><center><h3>uniCenta oPOS Versi\u00f3n {0} detectada!</h3><h4>\u00a1Las actualizaciones de la versi\u00f3n est\u00e1n cambiando!</h4> Si su versi\u00f3n es 4.5 o posterior, elija <b>S\u00cd</b> para continuar.<br/><br/> Para versiones anteriores, haga clic en <b>NO</b> para abrir Opciones de configuraci\u00f3n ahora.<br/></br>Lea la Gu\u00eda de transferencia de datos de uniCenta oPOS
message.eolupdate=<html><center><h3>uniCenta oPOS Versi\u00f3n {0} detectada!</h3><h4>\u00a1Las actualizaciones de la versi\u00f3n est\u00e1n cambiando!</h4> Si su versi\u00f3n es 5.0.1 o posterior, elija <b>S\u00cd</b> para continuar.<br/><br/> Para versiones anteriores, haga clic en <b>NO</b> para abrir Opciones de configuraci\u00f3n ahora.<br/></br>Lea la Gu\u00eda de transferencia de datos de uniCenta oPOS
@@ -911,7 +911,7 @@ message.transfermessage=Database overdracht
message.transfernotsupported=Database overdrachtstype wordt niet ondersteund
message.transfertitle=Database overdracht
message.updatedatabase=<html><center><h3>uniCenta oPOS Version {0} database gedetecteerd!</h3> De database wordt automatisch geüpgraded.<br>GEGEVENS KUNNEN VERLOREN GAAN. MAAK EERST EEN BACKUP.<br><br>Wilt u doorgaan?
message.eolupdate=<html><center><h3>uniCenta oPOS Version {0} gedetecteerd!</h3><h4>Versie-upgrades veranderen!</h4>Als je versie 4.5 of hoger is kies<b>YES</b>om door te gaan<br/><br/>Voor oudere versies kies<b>NO</b> Om nu de configuratie opties te openen!<br>Lees alstublieft de uniCenta oPOS Data Transfer Guide<br/><br/>
message.eolupdate=<html><center><h3>uniCenta oPOS Version {0} gedetecteerd!</h3><h4>Versie-upgrades veranderen!</h4>Als je versie 5.0.1 of hoger is kies<b>YES</b>om door te gaan<br/><br/>Voor oudere versies kies<b>NO</b> Om nu de configuratie opties te openen!<br>Lees alstublieft de uniCenta oPOS Data Transfer Guide<br/><br/>
message.URL=<html>Een webpagina laten zien in het hoofdscherm . vereist de volledige URL<br />Voor een lokaal bestand begin met - <b>file://</b><br/>Voor een extern bestand gebruik <b>http://</b><br/>
message.uuidcopy=<html><center><h4>UUID is gekopieerd naar het klembord
message.vipno=Klant is geen VIP