Compare commits
16 Commits
Kaeseschor
...
feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
| 02026633ed | |||
| c4297a4be2 | |||
| fd52d3df6d | |||
| c320ef615d | |||
| 2a20ea7bdb | |||
| a56ad43852 | |||
| 188214dfbe | |||
| cdbe2cccc0 | |||
| 5152846478 | |||
| f5c5d546c5 | |||
| 5c9d54dabf | |||
| 96d5968fef | |||
| 88b39820ca | |||
| 25bedae873 | |||
| 1ec02d74a3 | |||
| 783d9f9bc0 |
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
target/
|
||||
7
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"vscjava.vscode-java-pack",
|
||||
"vscjava.vscode-maven",
|
||||
"redhat.java"
|
||||
]
|
||||
}
|
||||
20
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Run jFxKasse",
|
||||
"request": "launch",
|
||||
"mainClass": "com.jFxKasse.application.JavaFX11Main",
|
||||
"projectName": "jFxKasse",
|
||||
"vmArgs": "--module-path ${env:PATH_TO_FX} --add-modules javafx.controls,javafx.fxml --add-opens javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED"
|
||||
},
|
||||
{
|
||||
"type": "java",
|
||||
"name": "Run jFxKasse (Maven)",
|
||||
"request": "launch",
|
||||
"mainClass": "com.jFxKasse.application.JavaFX11Main",
|
||||
"projectName": "jFxKasse"
|
||||
}
|
||||
]
|
||||
}
|
||||
11
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"java.project.sourcePaths": [
|
||||
"src/main/java"
|
||||
],
|
||||
"java.project.outputPath": "target/classes",
|
||||
"java.project.referencedLibraries": [],
|
||||
"java.configuration.updateBuildConfiguration": "automatic",
|
||||
"java.compile.nullAnalysis.mode": "automatic",
|
||||
"editor.formatOnSave": true,
|
||||
"files.encoding": "utf8"
|
||||
}
|
||||
51
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "mvn compile",
|
||||
"type": "shell",
|
||||
"command": "mvn compile",
|
||||
"group": "build",
|
||||
"problemMatcher": [
|
||||
"$javac"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "mvn package",
|
||||
"type": "shell",
|
||||
"command": "mvn package -DskipTests",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$javac"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "mvn clean",
|
||||
"type": "shell",
|
||||
"command": "mvn clean",
|
||||
"group": "build",
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "mvn javafx:run",
|
||||
"type": "shell",
|
||||
"command": "mvn javafx:run",
|
||||
"group": "build",
|
||||
"problemMatcher": [
|
||||
"$javac"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "mvn test",
|
||||
"type": "shell",
|
||||
"command": "mvn test",
|
||||
"group": "test",
|
||||
"problemMatcher": [
|
||||
"$javac"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
60
README.md
@ -1,2 +1,60 @@
|
||||
# jFxKasse
|
||||
easy payment system for small to middel sized events with a sales slip printer
|
||||
|
||||
Simple POS (Point of Sale) system for small to medium-sized events with receipt printer support.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Java JDK 17+
|
||||
- Maven 3.6+
|
||||
- Display >= 1366x768
|
||||
|
||||
## Video Tutorials (German | Deutsch)
|
||||
[YouTube Video: jFxKasse - Kassensystem - Kurzanleitung](https://www.youtube.com/watch?v=DV9DDESw40I)
|
||||
|
||||
[YouTube Video: jFxKasse - Kassensystem - Installieren](https://www.youtube.com/watch?v=IY1bqRjwh0Q)
|
||||
|
||||
## Setup (VSCode on openSUSE Tumbleweed)
|
||||
|
||||
### 1. Install dependencies
|
||||
|
||||
```bash
|
||||
sudo zypper install java-17-openjdk-devel maven
|
||||
```
|
||||
|
||||
### 2. Install VSCode extensions
|
||||
|
||||
Open the project in VSCode. You will be prompted to install the recommended extensions:
|
||||
|
||||
- **Extension Pack for Java** (`vscjava.vscode-java-pack`)
|
||||
- **Maven for Java** (`vscjava.vscode-maven`)
|
||||
- **Language Support for Java** (`redhat.java`)
|
||||
|
||||
### 3. Build & Run
|
||||
|
||||
```bash
|
||||
# Compile
|
||||
mvn compile
|
||||
|
||||
# Run via Maven
|
||||
mvn javafx:run
|
||||
|
||||
# Package as fat JAR
|
||||
mvn package
|
||||
java -jar target/jFxKasse-shaded.jar
|
||||
```
|
||||
|
||||
Or use the preconfigured VSCode tasks (`Ctrl+Shift+B`) and launch configurations (`F5`).
|
||||
|
||||
## Screenshots
|
||||
|
||||
| Main View | Jobs | Positions | Settings |
|
||||
|-----------|------|-----------|----------|
|
||||
|  |  |  |  |
|
||||
|
||||
## Hardware
|
||||
|
||||
Tested with: [Epson TM T20II](https://www.epson.de/products/sd/pos-printer/epson-tm-t20ii). Other receipt printers should work as well.
|
||||
|
||||
## License
|
||||
|
||||
GPL-3.0
|
||||
49
pom.xml
@ -1,42 +1,48 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com</groupId>
|
||||
<artifactId>jFxKasse</artifactId>
|
||||
<version>0.2.0</version>
|
||||
<version>0.4.0</version>
|
||||
<name>jFxKasse</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<javafx.version>21.0.5</javafx.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.11.4</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-controls</artifactId>
|
||||
<version>11</version>
|
||||
<version>${javafx.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-fxml</artifactId>
|
||||
<version>11</version>
|
||||
<version>${javafx.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.jfoenix</groupId>
|
||||
<artifactId>jfoenix</artifactId>
|
||||
<version>9.0.8</version>
|
||||
<version>9.0.10</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.23.1</version>
|
||||
<version>3.47.1.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -46,11 +52,10 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.13.0</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
<!--<release>11</release> -->
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<showWarnings>true</showWarnings>
|
||||
<showDeprecation>true</showDeprecation>
|
||||
</configuration>
|
||||
@ -59,7 +64,7 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.6.0</version>
|
||||
<version>3.5.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@ -75,13 +80,12 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<version>3.6.0</version>
|
||||
<configuration>
|
||||
<finalName>jFxKasse</finalName>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<transformers>
|
||||
<transformer
|
||||
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>com.jFxKasse.application.JavaFX11Main</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
@ -96,6 +100,15 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.openjfx</groupId>
|
||||
<artifactId>javafx-maven-plugin</artifactId>
|
||||
<version>0.0.8</version>
|
||||
<configuration>
|
||||
<mainClass>com.jFxKasse.application.JavaFX11Main</mainClass>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
BIN
screenshots/jobs
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
screenshots/newjob
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
screenshots/positions
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
screenshots/settings
Normal file
|
After Width: | Height: | Size: 83 KiB |
@ -1,6 +1,8 @@
|
||||
package com.jFxKasse.application;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.event.EventHandler;
|
||||
|
||||
import java.io.File;
|
||||
import javafx.animation.Animation;
|
||||
import javafx.animation.KeyFrame;
|
||||
@ -12,12 +14,14 @@ import com.jFxKasse.controller.MainWindowController;
|
||||
import com.jFxKasse.controller.PrinterController;
|
||||
import com.jFxKasse.controller.XMLController;
|
||||
import com.jFxKasse.controller.DBController;
|
||||
import com.jFxKasse.controller.KeyController;
|
||||
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
|
||||
public class Main extends Application
|
||||
{
|
||||
// path to config.xml and the database
|
||||
public class Main extends Application {
|
||||
// Path to config.xml and the database
|
||||
public static String filepath;
|
||||
|
||||
private static String osName = System.getProperty("os.name");
|
||||
@ -32,42 +36,43 @@ public class Main extends Application
|
||||
|
||||
private PrinterController pc = new PrinterController();
|
||||
|
||||
private KeyController kc;
|
||||
|
||||
private Stage primaryStage;
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage)
|
||||
{
|
||||
public void start(Stage primaryStage) {
|
||||
this.primaryStage = primaryStage;
|
||||
System.out.println("\nstarting jFxKasse\n");
|
||||
mainWindow();
|
||||
}
|
||||
|
||||
private void mainWindow()
|
||||
{
|
||||
private void mainWindow() {
|
||||
try {
|
||||
FXMLLoader loader = new FXMLLoader(
|
||||
getClass().getResource("/fxml/MainWindow.fxml"));
|
||||
|
||||
AnchorPane pane = loader.load();
|
||||
primaryStage.setTitle("jFxKasse"); // Title of window
|
||||
primaryStage.setTitle("jFxKasse"); // Window title
|
||||
|
||||
mwc = loader.getController(); // set the mwc as the JavaFx
|
||||
// MainWindowController
|
||||
pc.searchPrinters(); // search for available printers
|
||||
mwc.setMain(this, dbc, xmlc, pc); // set the created instances to the
|
||||
// mwc
|
||||
mwc = loader.getController(); // Set the MainWindowController
|
||||
pc.searchPrinters(); // Search for available printers
|
||||
mwc.setMain(this, dbc, xmlc, pc); // Pass instances to the controller
|
||||
|
||||
firstStart(); // test if this is the first run
|
||||
firstStart(); // Check if this is the first run
|
||||
|
||||
Scene scene = new Scene(pane);
|
||||
scene.getStylesheets().add(
|
||||
Main.class.getResource("/css/application.css").toExternalForm());
|
||||
primaryStage.setScene(scene);
|
||||
primaryStage.show(); // shows the stage
|
||||
primaryStage.show(); // Show the stage
|
||||
|
||||
// Attach the KeyController
|
||||
kc = new KeyController(scene, mwc);
|
||||
|
||||
Timeline timeline = new Timeline(
|
||||
new KeyFrame(Duration.seconds(1), ev -> {
|
||||
mwc.updateTimeLabel(); // update time label on UI
|
||||
mwc.updateTimeLabel(); // Update time label on UI
|
||||
}));
|
||||
timeline.setCycleCount(Animation.INDEFINITE);
|
||||
timeline.play();
|
||||
@ -76,8 +81,7 @@ public class Main extends Application
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
if (osName.contains("Windows")) {
|
||||
System.out.println("FCK Windows");
|
||||
filepath = userHome + "/Documents/jFxKasse/";
|
||||
@ -90,30 +94,29 @@ public class Main extends Application
|
||||
/**
|
||||
* Checks if the config.xml is preset.
|
||||
*/
|
||||
private void firstStart() throws Exception
|
||||
{
|
||||
private void firstStart() throws Exception {
|
||||
if (xmlc.loadSettings()) {
|
||||
// config.xml found, app starting normal
|
||||
System.out.println("XML found!");
|
||||
mwc.initUI(); // Starting the UI elements
|
||||
mwc.setDBLabel(); // Set databese labels
|
||||
dbc.setDbname(xmlc.getDatabaseName()); // handover database name
|
||||
dbc.connectDatabase(); // estabishing DB conection
|
||||
mwc.fillTablePositionen(); // fill TreeTable 'Positionen'
|
||||
mwc.initUI(); // Initialize the UI elements
|
||||
mwc.setDBLabel(); // Set database labels
|
||||
dbc.setDbname(xmlc.getDatabaseName()); // Pass database name
|
||||
dbc.connectDatabase(); // Establish DB connection
|
||||
mwc.fillTablePositionen(); // Fill TreeTable 'Positions'
|
||||
mwc.fillCategory();
|
||||
mwc.fillPrinterSettings();
|
||||
mwc.fillTableJobs();
|
||||
mwc.loadGridButtons();
|
||||
mwc.getSelectedCat(); // Load DB entries in Chois Box
|
||||
mwc.getSelectedCat(); // Load DB entries in ChoiceBox
|
||||
mwc.createNewJob();
|
||||
} else {
|
||||
// config.xml NOT found, first start of app
|
||||
System.out.println("no XML found!");
|
||||
xmlc.initXML(); // set default values
|
||||
mwc.blockUI(true); // disable UI elements that need DB
|
||||
xmlc.initXML(); // Set default values
|
||||
mwc.blockUI(true); // Disable UI elements that need DB
|
||||
mwc.blockUnlock();
|
||||
File dir = new File(filepath);
|
||||
dir.mkdir(); // Create new Subfolder
|
||||
dir.mkdir(); // Create new subfolder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,13 @@
|
||||
package com.jFxKasse.application;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.jFxKasse.controller.DBController;
|
||||
import com.jFxKasse.controller.PrinterController;
|
||||
import com.jFxKasse.controller.XMLController;
|
||||
|
||||
import com.jFxKasse.datatypes.PrintDataSimple;
|
||||
import com.jFxKasse.datatypes.PrintDataSplitted;
|
||||
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.scene.control.ButtonType;
|
||||
@ -13,19 +16,17 @@ import javafx.scene.control.Label;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.util.Pair;
|
||||
|
||||
public class PrintJob
|
||||
{
|
||||
public class PrintJob {
|
||||
|
||||
private TimeDate timedate = new TimeDate();
|
||||
|
||||
public void printJob(int jobID, XMLController xmlc, DBController dbc,
|
||||
PrinterController pc)
|
||||
{
|
||||
PrinterController pc) {
|
||||
|
||||
if ((xmlc.getPrintername().equals("Drucker auswählen")
|
||||
|| xmlc.getPrintername() == null)) {
|
||||
// no printer selected
|
||||
System.out.println("Kein Drucker eingestellt!!!");
|
||||
// No printer selected
|
||||
System.out.println("No printer configured!");
|
||||
|
||||
// creates a dialog
|
||||
Dialog<Pair<String, String>> dialog = new Dialog<>();
|
||||
@ -49,15 +50,33 @@ public class PrintJob
|
||||
dialog.showAndWait();
|
||||
|
||||
} else {
|
||||
// printer selected
|
||||
// Printer selected
|
||||
pc.selectPrinter(xmlc.getPrintername());
|
||||
/* Single bill or split by category */
|
||||
if (xmlc.getCategorySplitted()) {
|
||||
// split the bills
|
||||
// Split the bills
|
||||
|
||||
// TODO
|
||||
PrintDataSplitted pdsplitted = new PrintDataSplitted(
|
||||
xmlc.getLinebreak(), xmlc.getOffsetHeader(),
|
||||
xmlc.getOffsetFooter(),
|
||||
timedate.getSystemTime() + " " + timedate.getSystemDate(),
|
||||
xmlc.getHeader(), xmlc.getFooter());
|
||||
|
||||
pdsplitted.setData(Integer.toString(jobID), dbc.getTime_Job(jobID),
|
||||
dbc.getQuantity_Job(jobID), dbc.getName_Job(jobID),
|
||||
dbc.getValue_Job(jobID), dbc.getCategory_Job(jobID),
|
||||
dbc.getJobValue_Job(jobID));
|
||||
|
||||
System.out.println("Printing job ...");
|
||||
|
||||
ArrayList<String> printString = pdsplitted.getPrintStrings();
|
||||
|
||||
for (int i = 0; i < printString.size(); i++) {
|
||||
pc.printString(printString.get(i));
|
||||
}
|
||||
|
||||
} else {
|
||||
// one single bills
|
||||
// Single bill
|
||||
PrintDataSimple pds = new PrintDataSimple(xmlc.getLinebreak(),
|
||||
xmlc.getOffsetHeader(), xmlc.getOffsetFooter(),
|
||||
timedate.getSystemTime() + " " + timedate.getSystemDate(),
|
||||
|
||||
@ -6,7 +6,6 @@ import java.util.Date;
|
||||
|
||||
public class TimeDate
|
||||
{
|
||||
|
||||
public String getSystemTime()
|
||||
{
|
||||
DateFormat dateFormat = new SimpleDateFormat("HH:mm");
|
||||
@ -22,5 +21,4 @@ public class TimeDate
|
||||
String dateStr = dateFormat.format(date);
|
||||
return dateStr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,16 +11,14 @@ import com.jFxKasse.datatypes.tableDataJob;
|
||||
import com.jFxKasse.datatypes.tableDataPositionen;
|
||||
import java.io.File;
|
||||
|
||||
public class DBController
|
||||
{
|
||||
public class DBController {
|
||||
private Connection connection;
|
||||
|
||||
private String DB_PATH;
|
||||
|
||||
private String dbname;
|
||||
|
||||
public void main()
|
||||
{
|
||||
public void main() {
|
||||
try {
|
||||
connection = DriverManager
|
||||
.getConnection("jdbc:sqlite:" + DB_PATH + dbname + ".db");
|
||||
@ -30,18 +28,15 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public DBController(String path)
|
||||
{
|
||||
public DBController(String path) {
|
||||
this.DB_PATH = path;
|
||||
}
|
||||
|
||||
public void setDbname(String dbname)
|
||||
{
|
||||
public void setDbname(String dbname) {
|
||||
this.dbname = dbname;
|
||||
}
|
||||
|
||||
public void connectDatabase()
|
||||
{ // connect to database
|
||||
public void connectDatabase() { // Connect to database
|
||||
System.out.println("Connecting... DB name: " + dbname);
|
||||
try {
|
||||
if (connection != null)
|
||||
@ -54,8 +49,7 @@ public class DBController
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
public void run()
|
||||
{
|
||||
public void run() {
|
||||
try {
|
||||
if (!connection.isClosed() && connection != null) {
|
||||
connection.close();
|
||||
@ -69,8 +63,7 @@ public class DBController
|
||||
});
|
||||
}
|
||||
|
||||
public boolean existDB(String pPfad)
|
||||
{ // does the DB exists?
|
||||
public boolean existDB(String pPfad) { // Check if the DB exists
|
||||
File varTmpDir = new File(pPfad);
|
||||
if (!varTmpDir.exists()) {
|
||||
return false;
|
||||
@ -79,8 +72,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getCategoryNameFromPositionen(int pID)
|
||||
{
|
||||
public String getCategoryNameFromPositionen(int pID) {
|
||||
int catInPos = 0;
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
@ -108,9 +100,8 @@ public class DBController
|
||||
|
||||
}
|
||||
|
||||
// table Position section //
|
||||
public void createTablePositionen()
|
||||
{ // create table position
|
||||
// Table 'Positionen' section //
|
||||
public void createTablePositionen() { // Create table 'positionen'
|
||||
System.out.println("Creating table Positionen");
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
@ -122,7 +113,7 @@ public class DBController
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// create 25 demo/default data entries
|
||||
// Create 25 demo/default data entries
|
||||
for (int i = 0; i < 25; i++) {
|
||||
fillPositionen_Positionen(i + 1, "Noch frei", (float) 0.00, 6,
|
||||
"#ad0000");
|
||||
@ -130,8 +121,7 @@ public class DBController
|
||||
}
|
||||
|
||||
public void fillPositionen_Positionen(int pID, String pName, float pValue,
|
||||
int pCat, String pColor)
|
||||
{ // create new data in table
|
||||
int pCat, String pColor) { // Create new entry in table
|
||||
System.out.println("Creating new positionen entry");
|
||||
try {
|
||||
PreparedStatement ps = connection.prepareStatement(
|
||||
@ -152,8 +142,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getName_Positionen(int pID)
|
||||
{
|
||||
public String getName_Positionen(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -166,8 +155,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getValue_Positionen(int pID)
|
||||
{
|
||||
public String getValue_Positionen(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -181,8 +169,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public int getCat_Positionen(int pID)
|
||||
{
|
||||
public int getCat_Positionen(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -196,8 +183,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getColor_Positionen(int pID)
|
||||
{
|
||||
public String getColor_Positionen(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -211,8 +197,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void setName_Positionen(int pID, String pName)
|
||||
{
|
||||
public void setName_Positionen(int pID, String pName) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET name = '" + pName
|
||||
@ -223,8 +208,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void setValue_Positionen(int pID, String pValue)
|
||||
{
|
||||
public void setValue_Positionen(int pID, String pValue) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET value = '" + pValue
|
||||
@ -235,8 +219,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void setCat_Positionen(int pID, int pCat)
|
||||
{
|
||||
public void setCat_Positionen(int pID, int pCat) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET cat = '" + pCat
|
||||
@ -247,8 +230,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void setColor_Positionen(int pID, String pColor)
|
||||
{
|
||||
public void setColor_Positionen(int pID, String pColor) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE positionen SET color = '" + pColor
|
||||
@ -259,8 +241,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<tableDataPositionen> ladeTabellePositionen()
|
||||
{
|
||||
public ArrayList<tableDataPositionen> ladeTabellePositionen() {
|
||||
ArrayList<tableDataPositionen> daten = new ArrayList<>();
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
@ -282,8 +263,7 @@ public class DBController
|
||||
return daten;
|
||||
}
|
||||
|
||||
public void ausgebenSysoPositionen()
|
||||
{
|
||||
public void ausgebenSysoPositionen() {
|
||||
System.out.println("Print positionen");
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
@ -302,10 +282,9 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
// table Category section //
|
||||
public void createTableCategory()
|
||||
{ // create table position
|
||||
System.out.println("Erstelle Tabelle Kategorie");
|
||||
// Table 'Category' section //
|
||||
public void createTableCategory() { // Create table 'category'
|
||||
System.out.println("Creating table Category");
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("DROP TABLE IF EXISTS category;");
|
||||
@ -323,8 +302,7 @@ public class DBController
|
||||
|
||||
}
|
||||
|
||||
public void setName_Category(int pID, String pName)
|
||||
{
|
||||
public void setName_Category(int pID, String pName) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE category SET catname = '" + pName
|
||||
@ -335,10 +313,9 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void fillCategory_Category(int pID, String pName)
|
||||
{
|
||||
public void fillCategory_Category(int pID, String pName) {
|
||||
|
||||
System.out.println("Erstelle neuen Kategorie Eintrag");
|
||||
System.out.println("Creating new category entry");
|
||||
try {
|
||||
PreparedStatement ps = connection
|
||||
.prepareStatement("INSERT INTO category VALUES (?, ?);");
|
||||
@ -355,8 +332,7 @@ public class DBController
|
||||
|
||||
}
|
||||
|
||||
public String getName_Category(int pID)
|
||||
{
|
||||
public String getName_Category(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -370,9 +346,8 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
// table Jobs section //
|
||||
public void erstelleTabelleJobs()
|
||||
{ // create table jobs
|
||||
// Table 'Jobs' section //
|
||||
public void erstelleTabelleJobs() { // Create table 'jobs'
|
||||
System.out.println("Creating table Jobs");
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
@ -385,8 +360,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public int getLatestJobNumber_Job()
|
||||
{
|
||||
public int getLatestJobNumber_Job() {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -400,8 +374,7 @@ public class DBController
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getTime_Job(int pID)
|
||||
{
|
||||
public String getTime_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -414,8 +387,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getQuantity_Job(int pID)
|
||||
{
|
||||
public String getQuantity_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -429,8 +401,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getName_Job(int pID)
|
||||
{
|
||||
public String getName_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -444,8 +415,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getValue_Job(int pID)
|
||||
{
|
||||
public String getValue_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -459,8 +429,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getCategory_Job(int pID)
|
||||
{
|
||||
public String getCategory_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -474,8 +443,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getState_Job(int pID)
|
||||
{
|
||||
public String getState_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -488,8 +456,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getJobValue_Job(int pID)
|
||||
{
|
||||
public String getJobValue_Job(int pID) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -502,8 +469,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getAllJobValue_Job()
|
||||
{
|
||||
public String getAllJobValue_Job() {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -517,8 +483,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public String getJobCount()
|
||||
{
|
||||
public String getJobCount() {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = stmt.executeQuery(
|
||||
@ -532,8 +497,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public void setStatus_Jobs(int pID, String pStatus)
|
||||
{
|
||||
public void setStatus_Jobs(int pID, String pStatus) {
|
||||
try {
|
||||
Statement stmt = connection.createStatement();
|
||||
stmt.executeUpdate("UPDATE jobs SET state = '" + pStatus
|
||||
@ -544,8 +508,7 @@ public class DBController
|
||||
}
|
||||
}
|
||||
|
||||
public ArrayList<tableDataJob> loadTableJobs_Job()
|
||||
{
|
||||
public ArrayList<tableDataJob> loadTableJobs_Job() {
|
||||
|
||||
ArrayList<tableDataJob> tmp = new ArrayList<tableDataJob>();
|
||||
try {
|
||||
@ -576,9 +539,8 @@ public class DBController
|
||||
|
||||
public void fillJobs_Jobs(int pID, String pTime, String pPositionen_quantity,
|
||||
String pPositionen_name, String pPositionen_value,
|
||||
String pPositionen_cat, String pState, String pJobvalue)
|
||||
{
|
||||
System.out.println("Create new Job Entry");
|
||||
String pPositionen_cat, String pState, String pJobvalue) {
|
||||
System.out.println("Creating new job entry");
|
||||
try {
|
||||
PreparedStatement ps = connection.prepareStatement(
|
||||
"INSERT INTO jobs VALUES (?, ?, ?, ?, ?, ?, ?, ?);");
|
||||
|
||||
227
src/main/java/com/jFxKasse/controller/KeyController.java
Normal file
@ -0,0 +1,227 @@
|
||||
package com.jFxKasse.controller;
|
||||
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.input.KeyCode;
|
||||
import javafx.scene.input.KeyEvent;
|
||||
|
||||
public class KeyController
|
||||
{
|
||||
private MainWindowController mwc;
|
||||
|
||||
public KeyController(Scene scene, MainWindowController mwc)
|
||||
{
|
||||
this.mwc = mwc;
|
||||
|
||||
scene.setOnKeyPressed(new EventHandler<KeyEvent>() {
|
||||
@Override
|
||||
public void handle(KeyEvent keyEvent)
|
||||
{
|
||||
switch (mwc.getActiveTab()) {
|
||||
case 0:
|
||||
handleTabNewJob(keyEvent);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
handleTabJobs(keyEvent);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
handleTabPosEdit(keyEvent);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
handleTabSettings(keyEvent);
|
||||
break;
|
||||
default:
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void handleTabNewJob(KeyEvent key)
|
||||
{
|
||||
if ((key.getCode() == KeyCode.ENTER)
|
||||
&& (!mwc.btnPrintBill.isDisabled())) {
|
||||
mwc.btnPrintBillAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.ESCAPE) && (!mwc.btnLock.isDisabled())) {
|
||||
mwc.btnLockAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.DELETE)
|
||||
&& (!mwc.btnDeleteSelectedPosition.isDisabled())) {
|
||||
mwc.btnDeleteSelectedPositionAction(null);
|
||||
}
|
||||
|
||||
handelGridButtons(key);
|
||||
|
||||
}
|
||||
|
||||
private void handleTabJobs(KeyEvent key)
|
||||
{
|
||||
if ((key.getCode() == KeyCode.ENTER)
|
||||
&& (!mwc.btnReprintJob.isDisabled())) {
|
||||
mwc.btnReprintJobAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.DELETE)
|
||||
&& (!mwc.btnCancelJob.isDisabled())) {
|
||||
mwc.btnCancelJobAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.S) && (!mwc.btnCalcStats.isDisabled())) {
|
||||
mwc.btnCalcStatsAction(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTabPosEdit(KeyEvent key)
|
||||
{
|
||||
if ((key.getCode() == KeyCode.ENTER)
|
||||
&& (!mwc.btnSaveEntry.isDisabled())) {
|
||||
mwc.btnSaveEntryAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.DELETE)
|
||||
&& (!mwc.btnClearEntry.isDisabled())) {
|
||||
mwc.btnClearEntryAction(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleTabSettings(KeyEvent key)
|
||||
{
|
||||
if ((key.getCode() == KeyCode.ENTER)
|
||||
&& (!mwc.btnSavePrinter.isDisabled())) {
|
||||
mwc.btnSavePrinterAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.ENTER) && (!mwc.btnSaveCat.isDisabled())) {
|
||||
mwc.btnSaveCatAction(null);
|
||||
}
|
||||
|
||||
if ((key.getCode() == KeyCode.ENTER)
|
||||
&& (!mwc.btnCreateNewDatabase.isDisabled())) {
|
||||
try {
|
||||
mwc.btnCreateNewDatabaseAction(null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void handelGridButtons(KeyEvent key)
|
||||
{
|
||||
|
||||
switch (key.getCode()) {
|
||||
case Q:
|
||||
mwc.gridButton01Action(null);
|
||||
break;
|
||||
|
||||
case W:
|
||||
mwc.gridButton02Action(null);
|
||||
break;
|
||||
|
||||
case E:
|
||||
mwc.gridButton03Action(null);
|
||||
break;
|
||||
|
||||
case R:
|
||||
mwc.gridButton04Action(null);
|
||||
break;
|
||||
|
||||
case T:
|
||||
mwc.gridButton05Action(null);
|
||||
break;
|
||||
|
||||
case Z:
|
||||
mwc.gridButton06Action(null);
|
||||
break;
|
||||
|
||||
case U:
|
||||
mwc.gridButton07Action(null);
|
||||
break;
|
||||
|
||||
case I:
|
||||
mwc.gridButton08Action(null);
|
||||
break;
|
||||
|
||||
case O:
|
||||
mwc.gridButton09Action(null);
|
||||
break;
|
||||
|
||||
case P:
|
||||
mwc.gridButton10Action(null);
|
||||
break;
|
||||
|
||||
case A:
|
||||
mwc.gridButton11Action(null);
|
||||
break;
|
||||
|
||||
case S:
|
||||
mwc.gridButton12Action(null);
|
||||
break;
|
||||
|
||||
case D:
|
||||
mwc.gridButton13Action(null);
|
||||
break;
|
||||
|
||||
case F:
|
||||
mwc.gridButton14Action(null);
|
||||
break;
|
||||
|
||||
case G:
|
||||
mwc.gridButton15Action(null);
|
||||
break;
|
||||
|
||||
case H:
|
||||
mwc.gridButton16Action(null);
|
||||
break;
|
||||
|
||||
case J:
|
||||
mwc.gridButton17Action(null);
|
||||
break;
|
||||
|
||||
case K:
|
||||
mwc.gridButton18Action(null);
|
||||
break;
|
||||
|
||||
case L:
|
||||
mwc.gridButton19Action(null);
|
||||
break;
|
||||
|
||||
case Y:
|
||||
mwc.gridButton20Action(null);
|
||||
break;
|
||||
|
||||
case X:
|
||||
mwc.gridButton21Action(null);
|
||||
break;
|
||||
|
||||
case C:
|
||||
mwc.gridButton22Action(null);
|
||||
break;
|
||||
|
||||
case V:
|
||||
mwc.gridButton23Action(null);
|
||||
break;
|
||||
|
||||
case B:
|
||||
mwc.gridButton24Action(null);
|
||||
break;
|
||||
|
||||
case N:
|
||||
mwc.gridButton25Action(null);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* some parts are from http://www.mets-blog.com/java-pos-thermal-printer-example/
|
||||
* Some parts are from http://www.mets-blog.com/java-pos-thermal-printer-example/
|
||||
*/
|
||||
|
||||
package com.jFxKasse.controller;
|
||||
@ -21,26 +21,23 @@ import javax.print.SimpleDoc;
|
||||
import javax.print.attribute.HashPrintRequestAttributeSet;
|
||||
import javax.print.attribute.PrintRequestAttributeSet;
|
||||
|
||||
public class PrinterController implements Printable
|
||||
{
|
||||
// All available Printers on this system
|
||||
public class PrinterController implements Printable {
|
||||
// All available printers on this system
|
||||
private PrintService[] printService;
|
||||
|
||||
// selected printer
|
||||
// Selected printer
|
||||
private PrintService selectedPrinter;
|
||||
|
||||
private DocFlavor flavor;
|
||||
|
||||
public PrinterController()
|
||||
{
|
||||
public PrinterController() {
|
||||
flavor = DocFlavor.BYTE_ARRAY.AUTOSENSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A String array with all available printers
|
||||
*/
|
||||
public String[] getAvailablePrinters()
|
||||
{
|
||||
public String[] getAvailablePrinters() {
|
||||
int printerSize = PrinterJob.lookupPrintServices().length;
|
||||
String printers[] = new String[printerSize];
|
||||
|
||||
@ -51,10 +48,9 @@ public class PrinterController implements Printable
|
||||
}
|
||||
|
||||
/**
|
||||
* searchs connected printers on the system
|
||||
* Searches for connected printers on the system
|
||||
*/
|
||||
public void searchPrinters()
|
||||
{
|
||||
public void searchPrinters() {
|
||||
PrintRequestAttributeSet pras = new HashPrintRequestAttributeSet();
|
||||
this.printService = PrintServiceLookup.lookupPrintServices(flavor, pras);
|
||||
String printers[] = getAvailablePrinters();
|
||||
@ -67,11 +63,11 @@ public class PrinterController implements Printable
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects the printer via its name
|
||||
* Selects the printer by its name
|
||||
*
|
||||
* @param printerName
|
||||
*/
|
||||
public void selectPrinter(String printerName)
|
||||
{
|
||||
public void selectPrinter(String printerName) {
|
||||
String printers[] = getAvailablePrinters();
|
||||
|
||||
for (int i = 0; i < printers.length; i++) {
|
||||
@ -83,13 +79,12 @@ public class PrinterController implements Printable
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints a string to the selected printer
|
||||
*
|
||||
* @param input data as String
|
||||
* @param text data as String
|
||||
*/
|
||||
public void printString(String text)
|
||||
{
|
||||
public void printString(String text) {
|
||||
PrintService service = selectedPrinter;
|
||||
DocPrintJob job = service.createPrintJob();
|
||||
|
||||
@ -104,8 +99,7 @@ public class PrinterController implements Printable
|
||||
}
|
||||
}
|
||||
|
||||
public int print(Graphics g, PageFormat pf, int page) throws PrinterException
|
||||
{
|
||||
public int print(Graphics g, PageFormat pf, int page) throws PrinterException {
|
||||
if (page > 0) { /* We have only one page, and 'page' is zero-based */
|
||||
return NO_SUCH_PAGE;
|
||||
}
|
||||
@ -120,8 +114,7 @@ public class PrinterController implements Printable
|
||||
return PAGE_EXISTS;
|
||||
}
|
||||
|
||||
public void printBytes(byte[] bytes)
|
||||
{
|
||||
public void printBytes(byte[] bytes) {
|
||||
PrintService service = selectedPrinter;
|
||||
DocPrintJob job = service.createPrintJob();
|
||||
|
||||
@ -133,8 +126,7 @@ public class PrinterController implements Printable
|
||||
}
|
||||
}
|
||||
|
||||
public void cutPaper()
|
||||
{
|
||||
public void cutPaper() {
|
||||
byte[] cutP = new byte[] { 0x1d, 'V', 1 };
|
||||
printBytes(cutP);
|
||||
}
|
||||
|
||||
@ -7,9 +7,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.Properties;
|
||||
|
||||
public class XMLController
|
||||
{
|
||||
|
||||
public class XMLController {
|
||||
private String databaseName = null;
|
||||
|
||||
private String printername = null;
|
||||
@ -30,14 +28,12 @@ public class XMLController
|
||||
|
||||
private Properties props = null;
|
||||
|
||||
public XMLController(String filePath)
|
||||
{
|
||||
public XMLController(String filePath) {
|
||||
this.filePath = filePath + "config.xml";
|
||||
props = new Properties();
|
||||
}
|
||||
|
||||
public void saveSettings() throws Exception
|
||||
{ // Save settings to config.xml
|
||||
public void saveSettings() throws Exception { // Save settings to config.xml
|
||||
|
||||
System.out.println("Saving XML");
|
||||
|
||||
@ -72,8 +68,7 @@ public class XMLController
|
||||
}
|
||||
}
|
||||
|
||||
public boolean loadSettings() throws Exception
|
||||
{ // reads the settings from config.xml
|
||||
public boolean loadSettings() throws Exception { // Read settings from config.xml
|
||||
InputStream inputStream;
|
||||
try {
|
||||
inputStream = new FileInputStream(filePath);
|
||||
@ -122,8 +117,7 @@ public class XMLController
|
||||
}
|
||||
}
|
||||
|
||||
public void initXML()
|
||||
{
|
||||
public void initXML() {
|
||||
this.printername = "Drucker auswählen";
|
||||
|
||||
this.offsetHeader = 1;
|
||||
@ -137,83 +131,67 @@ public class XMLController
|
||||
this.footer = "Vielen Dank für den Einkauf";
|
||||
}
|
||||
|
||||
public String getDatabaseName()
|
||||
{
|
||||
public String getDatabaseName() {
|
||||
return databaseName;
|
||||
}
|
||||
|
||||
public void setDatabaseName(String databaseName)
|
||||
{
|
||||
public void setDatabaseName(String databaseName) {
|
||||
this.databaseName = databaseName;
|
||||
}
|
||||
|
||||
public String getPrintername()
|
||||
{
|
||||
public String getPrintername() {
|
||||
return printername;
|
||||
}
|
||||
|
||||
public void setPrintername(String printername)
|
||||
{
|
||||
public void setPrintername(String printername) {
|
||||
this.printername = printername;
|
||||
}
|
||||
|
||||
public int getLinebreak()
|
||||
{
|
||||
public int getLinebreak() {
|
||||
return linebreak;
|
||||
}
|
||||
|
||||
public void setLinebreak(int linebreak)
|
||||
{
|
||||
public void setLinebreak(int linebreak) {
|
||||
this.linebreak = linebreak;
|
||||
}
|
||||
|
||||
public int getOffsetHeader()
|
||||
{
|
||||
public int getOffsetHeader() {
|
||||
return offsetHeader;
|
||||
}
|
||||
|
||||
public void setOffsetHeader(int offsetHeader)
|
||||
{
|
||||
public void setOffsetHeader(int offsetHeader) {
|
||||
this.offsetHeader = offsetHeader;
|
||||
}
|
||||
|
||||
public int getOffsetFooter()
|
||||
{
|
||||
public int getOffsetFooter() {
|
||||
return offsetFooter;
|
||||
}
|
||||
|
||||
public void setOffsetFooter(int offsetFooter)
|
||||
{
|
||||
public void setOffsetFooter(int offsetFooter) {
|
||||
this.offsetFooter = offsetFooter;
|
||||
}
|
||||
|
||||
public String getHeader()
|
||||
{
|
||||
public String getHeader() {
|
||||
return header;
|
||||
}
|
||||
|
||||
public void setHeader(String header)
|
||||
{
|
||||
public void setHeader(String header) {
|
||||
this.header = header;
|
||||
}
|
||||
|
||||
public String getFooter()
|
||||
{
|
||||
public String getFooter() {
|
||||
return footer;
|
||||
}
|
||||
|
||||
public void setFooter(String footer)
|
||||
{
|
||||
public void setFooter(String footer) {
|
||||
this.footer = footer;
|
||||
}
|
||||
|
||||
public boolean getCategorySplitted()
|
||||
{
|
||||
public boolean getCategorySplitted() {
|
||||
return categorySplitted;
|
||||
}
|
||||
|
||||
public void setCategorySplitted(boolean categorySplitted)
|
||||
{
|
||||
public void setCategorySplitted(boolean categorySplitted) {
|
||||
this.categorySplitted = categorySplitted;
|
||||
}
|
||||
|
||||
|
||||
32
src/main/java/com/jFxKasse/datatypes/Category.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.jFxKasse.datatypes;
|
||||
|
||||
public class Category
|
||||
{
|
||||
private String categoryName;
|
||||
|
||||
private String positionsString = "\n";
|
||||
|
||||
public Category(String categoryName)
|
||||
{
|
||||
this.categoryName = categoryName;
|
||||
}
|
||||
|
||||
public String getCategoryName()
|
||||
{
|
||||
return categoryName;
|
||||
}
|
||||
|
||||
public void addPosition(int quantity, String name, String value,
|
||||
PrintData pd)
|
||||
{
|
||||
for (int i = 0; i < quantity; i++) {
|
||||
positionsString = positionsString
|
||||
+ pd.setRight(pd.breakLines(name), value + " €") + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
public String getPositionsString()
|
||||
{
|
||||
return positionsString;
|
||||
}
|
||||
}
|
||||
@ -1,10 +1,9 @@
|
||||
package com.jFxKasse.datatypes;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Job
|
||||
{
|
||||
|
||||
public class Job {
|
||||
private int jobnumber;
|
||||
|
||||
private float jobvalue;
|
||||
@ -19,32 +18,28 @@ public class Job
|
||||
|
||||
private ArrayList<String> positionenCat;
|
||||
|
||||
public Job(int pJobnumber, String pTime)
|
||||
{
|
||||
public Job(int pJobnumber) {
|
||||
this.jobnumber = pJobnumber;
|
||||
this.jobtime = pTime;
|
||||
|
||||
positionenQuantity = new ArrayList<Integer>();
|
||||
positionenName = new ArrayList<String>();
|
||||
positionenValue = new ArrayList<Float>();
|
||||
positionenCat = new ArrayList<String>();
|
||||
|
||||
// System.out.println("Größe: " + positionenName.size());
|
||||
|
||||
}
|
||||
|
||||
public int getJobnumber()
|
||||
{
|
||||
public void setJobtime(String jobtime) {
|
||||
this.jobtime = jobtime;
|
||||
}
|
||||
|
||||
public int getJobnumber() {
|
||||
return this.jobnumber;
|
||||
}
|
||||
|
||||
public String getJobtime()
|
||||
{
|
||||
public String getJobtime() {
|
||||
return this.jobtime;
|
||||
}
|
||||
|
||||
public float getJobValue()
|
||||
{
|
||||
public float getJobValue() {
|
||||
|
||||
calcJobValue();
|
||||
|
||||
@ -52,15 +47,11 @@ public class Job
|
||||
}
|
||||
|
||||
public void addPosition(String pPositionenName, float pPositionenValue,
|
||||
String pPositionenCat)
|
||||
{
|
||||
// System.out.println("addName");
|
||||
|
||||
String pPositionenCat) {
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
if (positionenName.get(i).equals(pPositionenName)) {
|
||||
// Item is already in list, increase quantity
|
||||
positionenQuantity.set(i, positionenQuantity.get(i) + 1);
|
||||
// System.out.println("Item exists, increasing quantity");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -73,35 +64,23 @@ public class Job
|
||||
calcJobValue();
|
||||
}
|
||||
|
||||
public void printJobOnConsole()
|
||||
{
|
||||
|
||||
public void printJobOnConsole() {
|
||||
System.out.println("---------------------------------------------");
|
||||
System.out.println("JobNummer: " + jobnumber);
|
||||
System.out.println("---------------------------------------------");
|
||||
|
||||
// System.out.println("Größe: " + positionenName.size());
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
|
||||
System.out.println(
|
||||
positionenQuantity.get(i) + " " + positionenName.get(i) + " "
|
||||
+ positionenValue.get(i) + " " + positionenCat.get(i));
|
||||
/*
|
||||
* System.out.println("i is: " + i);
|
||||
* System.out.println(positionenName.get(i));
|
||||
* System.out.println(positionenQuantity.get(i));
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
System.out.println("---------------------------------------------");
|
||||
|
||||
}
|
||||
|
||||
public ArrayList<tableDataCurrentOrder> getCurrentJobPositionen()
|
||||
{
|
||||
|
||||
public ArrayList<tableDataCurrentOrder> getCurrentJobPositionen() {
|
||||
ArrayList<tableDataCurrentOrder> jobitems = new ArrayList<tableDataCurrentOrder>();
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
@ -110,28 +89,22 @@ public class Job
|
||||
positionenName.get(i), positionenQuantity.get(i));
|
||||
|
||||
jobitems.add(tmp);
|
||||
|
||||
}
|
||||
|
||||
return jobitems;
|
||||
}
|
||||
|
||||
private void calcJobValue()
|
||||
{
|
||||
|
||||
private void calcJobValue() {
|
||||
jobvalue = 0;
|
||||
|
||||
for (int i = 0; i < positionenValue.size(); i++) {
|
||||
|
||||
jobvalue = jobvalue
|
||||
+ (positionenQuantity.get(i) * positionenValue.get(i));
|
||||
|
||||
}
|
||||
|
||||
// Round to two decimal places
|
||||
jobvalue = BigDecimal.valueOf(jobvalue).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
|
||||
}
|
||||
|
||||
public String createPosQuantityDBString()
|
||||
{
|
||||
public String createPosQuantityDBString() {
|
||||
String tmp = String.valueOf(positionenQuantity.get(0));
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
@ -140,8 +113,7 @@ public class Job
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public String createPosNameDBString()
|
||||
{
|
||||
public String createPosNameDBString() {
|
||||
String tmp = positionenName.get(0);
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
@ -150,8 +122,7 @@ public class Job
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public String createPosValueDBString()
|
||||
{
|
||||
public String createPosValueDBString() {
|
||||
String tmp = String.valueOf(positionenValue.get(0));
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
@ -160,8 +131,7 @@ public class Job
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public String createPosCatDBString()
|
||||
{
|
||||
public String createPosCatDBString() {
|
||||
String tmp = positionenCat.get(0);
|
||||
for (int i = 1; i < positionenName.size(); i++) {
|
||||
|
||||
@ -170,8 +140,7 @@ public class Job
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void deletePosName(String pPosName)
|
||||
{
|
||||
public void deletePosName(String pPosName) {
|
||||
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
|
||||
@ -194,8 +163,7 @@ public class Job
|
||||
|
||||
}
|
||||
|
||||
public boolean existsPosName(String pPosName)
|
||||
{
|
||||
public boolean existsPosName(String pPosName) {
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
if (positionenName.get(i).equals(pPosName)) {
|
||||
return true;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.jFxKasse.datatypes;
|
||||
|
||||
public abstract class PrintData
|
||||
{
|
||||
public abstract class PrintData {
|
||||
|
||||
protected int headerSpace;
|
||||
|
||||
@ -13,13 +12,13 @@ public abstract class PrintData
|
||||
|
||||
protected String footer;
|
||||
|
||||
protected String positionenQuantity;
|
||||
protected String positionsQuantity;
|
||||
|
||||
protected String positionenName;
|
||||
protected String positionsName;
|
||||
|
||||
protected String positionenValue;
|
||||
protected String positionsValue;
|
||||
|
||||
protected String positionenCategory;
|
||||
protected String positionsCategory;
|
||||
|
||||
protected String jobID;
|
||||
|
||||
@ -30,7 +29,8 @@ public abstract class PrintData
|
||||
protected String jobValue;
|
||||
|
||||
/**
|
||||
* Constructor with all data that is not in the DB
|
||||
* Constructor with all data that is not stored in the DB
|
||||
*
|
||||
* @param lineBreak
|
||||
* @param headerSpace
|
||||
* @param footerSpace
|
||||
@ -39,8 +39,7 @@ public abstract class PrintData
|
||||
* @param footer
|
||||
*/
|
||||
public PrintData(int lineBreak, int headerSpace, int footerSpace,
|
||||
String timeAndDatePrint, String header, String footer)
|
||||
{
|
||||
String timeAndDatePrint, String header, String footer) {
|
||||
this.lineBreak = lineBreak;
|
||||
this.headerSpace = headerSpace;
|
||||
this.footerSpace = footerSpace;
|
||||
@ -50,7 +49,8 @@ public abstract class PrintData
|
||||
}
|
||||
|
||||
/**
|
||||
* set all Data that is in the DB
|
||||
* Set all data that is stored in the DB
|
||||
*
|
||||
* @param jobID
|
||||
* @param timeAndDateOrder
|
||||
* @param positionenQuantity
|
||||
@ -60,39 +60,37 @@ public abstract class PrintData
|
||||
* @param jobValue
|
||||
*/
|
||||
public void setData(String jobID, String timeAndDateOrder,
|
||||
String positionenQuantity, String positionenName,
|
||||
String positionenValue, String positionenCategory, String jobValue)
|
||||
{
|
||||
String positionsQuantity, String positionsName,
|
||||
String positionsValue, String positionsCategory, String jobValue) {
|
||||
this.jobID = jobID;
|
||||
this.timeAndDateOrder = timeAndDateOrder;
|
||||
this.positionenQuantity = positionenQuantity;
|
||||
this.positionenName = positionenName;
|
||||
this.positionenValue = positionenValue;
|
||||
this.positionenCategory = positionenCategory;
|
||||
this.positionsQuantity = positionsQuantity;
|
||||
this.positionsName = positionsName;
|
||||
this.positionsValue = positionsValue;
|
||||
this.positionsCategory = positionsCategory;
|
||||
this.jobValue = jobValue;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Breaks a string with newlines after the max line length
|
||||
*
|
||||
* @param data String
|
||||
* @return same String splitted with \n after the max. line lenght
|
||||
* @return the same String split with \n after max line length
|
||||
*/
|
||||
protected String breakLines(String data)
|
||||
{
|
||||
protected String breakLines(String data) {
|
||||
boolean next = false;
|
||||
|
||||
int count = lineBreak;
|
||||
|
||||
if (data.length() > lineBreak) {
|
||||
// Needs to be splitted
|
||||
// Needs to be split
|
||||
next = true;
|
||||
} else {
|
||||
// No need to be splitted
|
||||
// No need to split
|
||||
return data;
|
||||
}
|
||||
|
||||
// first part
|
||||
// First part
|
||||
String tmp = data.substring(0, lineBreak);
|
||||
|
||||
while (next) {
|
||||
@ -101,21 +99,20 @@ public abstract class PrintData
|
||||
tmp = tmp + "\n" + data.substring(count, lineBreak + count);
|
||||
count = count + lineBreak;
|
||||
} catch (Exception e) {
|
||||
// data string not long enough
|
||||
// Data string not long enough
|
||||
next = false;
|
||||
}
|
||||
|
||||
}
|
||||
// add the last part
|
||||
// Add the last part
|
||||
return tmp + "\n" + data.substring(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* prints a line of '--------'
|
||||
* @return
|
||||
* Prints a line of dashes '--------'
|
||||
*
|
||||
* @return separator line
|
||||
*/
|
||||
protected String getSeparator()
|
||||
{
|
||||
protected String getSeparator() {
|
||||
String tmp = "-";
|
||||
|
||||
for (int i = 1; i < lineBreak; i++) {
|
||||
@ -125,12 +122,12 @@ public abstract class PrintData
|
||||
}
|
||||
|
||||
/**
|
||||
* sets a String into the center
|
||||
* Centers a string within the line width
|
||||
*
|
||||
* @param data
|
||||
* @return the centered String
|
||||
* @return the centered string
|
||||
*/
|
||||
protected String setCenter(String data)
|
||||
{
|
||||
protected String setCenter(String data) {
|
||||
int dataLenght = data.length();
|
||||
int prefix = ((lineBreak - dataLenght) / 2);
|
||||
String tmp = " ";
|
||||
@ -144,13 +141,13 @@ public abstract class PrintData
|
||||
}
|
||||
|
||||
/**
|
||||
* sets a String right-justified after an prefix
|
||||
* Right-justifies a string after a prefix
|
||||
*
|
||||
* @param prefix
|
||||
* @param data
|
||||
* @return the right-justified String
|
||||
* @return the right-justified string
|
||||
*/
|
||||
protected String setRight(String prefix, String data)
|
||||
{
|
||||
protected String setRight(String prefix, String data) {
|
||||
|
||||
int prefixLenght = prefix.length();
|
||||
|
||||
@ -175,7 +172,7 @@ public abstract class PrintData
|
||||
}
|
||||
|
||||
/**
|
||||
* How the print String or Strings are made
|
||||
* Defines how the print string(s) are generated
|
||||
*/
|
||||
abstract protected void generatePrintString();
|
||||
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package com.jFxKasse.datatypes;
|
||||
|
||||
public class PrintDataSimple extends PrintData
|
||||
{
|
||||
public class PrintDataSimple extends PrintData {
|
||||
|
||||
private String printString;
|
||||
|
||||
/**
|
||||
* Constructor with all data that is not in the DB
|
||||
* Constructor with all data that is not stored in the DB
|
||||
*
|
||||
* @param lineBreak
|
||||
* @param headerSpace
|
||||
* @param footerSpace
|
||||
@ -15,27 +15,25 @@ public class PrintDataSimple extends PrintData
|
||||
* @param footer
|
||||
*/
|
||||
public PrintDataSimple(int lineBreak, int headerSpace, int footerSpace,
|
||||
String timeAndDatePrint, String header, String footer)
|
||||
{
|
||||
String timeAndDatePrint, String header, String footer) {
|
||||
super(lineBreak, headerSpace, footerSpace, timeAndDatePrint, header,
|
||||
footer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the String
|
||||
* @return the final Print String
|
||||
* Generates the print string
|
||||
*
|
||||
* @return the final print string
|
||||
*/
|
||||
public String getPrintString()
|
||||
{
|
||||
public String getPrintString() {
|
||||
generatePrintString();
|
||||
return this.printString;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generatePrintString()
|
||||
{
|
||||
protected void generatePrintString() {
|
||||
/* Header */
|
||||
String header = "\n";
|
||||
String header = " ";
|
||||
for (int i = 1; i < headerSpace; i++) {
|
||||
header = header + "\n";
|
||||
}
|
||||
@ -53,18 +51,18 @@ public class PrintDataSimple extends PrintData
|
||||
|
||||
String positionen = "\n";
|
||||
|
||||
int posCount = positionenQuantity.length()
|
||||
- positionenQuantity.replace(";", "").length() + 1;
|
||||
int posCount = positionsQuantity.length()
|
||||
- positionsQuantity.replace(";", "").length() + 1;
|
||||
|
||||
String[] positionQuantity = positionenQuantity.split(";");
|
||||
String[] positionQuantity = positionsQuantity.split(";");
|
||||
|
||||
String[] positionName = positionenName.split(";");
|
||||
String[] positionName = positionsName.split(";");
|
||||
|
||||
String[] positionValue = positionenValue.split(";");
|
||||
String[] positionValue = positionsValue.split(";");
|
||||
|
||||
for (int i = 0; i < posCount; i++) { //All different posNames
|
||||
for (int i = 0; i < posCount; i++) { // All different posNames
|
||||
int quantity = Integer.parseInt(positionQuantity[i]);
|
||||
for (int j = 0; j < quantity; j++) { //quantities
|
||||
for (int j = 0; j < quantity; j++) { // quantities
|
||||
positionen = positionen + setRight(breakLines(positionName[i]),
|
||||
positionValue[i] + " €") + "\n";
|
||||
}
|
||||
|
||||
166
src/main/java/com/jFxKasse/datatypes/PrintDataSplitted.java
Normal file
@ -0,0 +1,166 @@
|
||||
package com.jFxKasse.datatypes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class PrintDataSplitted extends PrintData {
|
||||
private ArrayList<String> printString = new ArrayList<String>();
|
||||
|
||||
private ArrayList<Category> categories = new ArrayList<Category>();
|
||||
|
||||
private int categoryCount = 0;
|
||||
|
||||
/**
|
||||
* Constructor with all data that is not stored in the DB
|
||||
*
|
||||
* @param lineBreak
|
||||
* @param headerSpace
|
||||
* @param footerSpace
|
||||
* @param timeAndDatePrint
|
||||
* @param header
|
||||
* @param footer
|
||||
*/
|
||||
public PrintDataSplitted(int lineBreak, int headerSpace, int footerSpace,
|
||||
String timeAndDatePrint, String header, String footer) {
|
||||
super(lineBreak, headerSpace, footerSpace, timeAndDatePrint, header,
|
||||
footer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the print strings
|
||||
*
|
||||
* @return the final array of print strings
|
||||
*/
|
||||
public ArrayList<String> getPrintStrings() {
|
||||
generatePrintString();
|
||||
return printString;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generatePrintString() {
|
||||
|
||||
String firstBill;
|
||||
|
||||
/* Header */
|
||||
String header = "-";
|
||||
for (int i = 1; i < headerSpace; i++) {
|
||||
header = header + "\n";
|
||||
}
|
||||
|
||||
// This is the final header
|
||||
header = header + setCenter(this.header);
|
||||
|
||||
/* Info */
|
||||
|
||||
String info = setRight("Bestellung: ", timeAndDateOrder) + "\n"
|
||||
+ setRight("Druck: ", timeAndDatePrint) + "\n"
|
||||
+ setRight("Bestellnummer: ", jobID);
|
||||
|
||||
/* Splitted Bills by Category */
|
||||
|
||||
/* Price */
|
||||
|
||||
String price = setRight("Gesamt: ", (jobValue + " €"));
|
||||
|
||||
/* Footer */
|
||||
|
||||
String footer = setCenter(this.footer);
|
||||
|
||||
for (int i = 1; i < footerSpace; i++) {
|
||||
footer = footer + "\n";
|
||||
}
|
||||
footer = footer + "_";
|
||||
|
||||
/* Build first Print String */
|
||||
|
||||
firstBill = header + "\n" + getSeparator() + "\n" + info + "\n"
|
||||
+ getSeparator() + "\n" + setCenter("Bon wurde aufgeteilt") + "\n"
|
||||
+ getSeparator() + "\n" + price + "\n" + getSeparator() + "\n"
|
||||
+ footer;
|
||||
|
||||
printString.add(firstBill);
|
||||
|
||||
/* First bill ends here */
|
||||
|
||||
/* Category-specific extra bills */
|
||||
|
||||
String positions = null;
|
||||
|
||||
int posCount = positionsQuantity.length()
|
||||
- positionsQuantity.replace(";", "").length() + 1;
|
||||
|
||||
String[] positionQuantity = positionsQuantity.split(";");
|
||||
String[] positionName = positionsName.split(";");
|
||||
String[] positionValue = positionsValue.split(";");
|
||||
String[] positionCategory = positionsCategory.split(";");
|
||||
|
||||
for (int i = 0; i < posCount; i++) { // All different posNames
|
||||
int quantity = Integer.parseInt(positionQuantity[i]);
|
||||
insertToCategory(quantity, positionName[i], positionValue[i],
|
||||
positionCategory[i]);
|
||||
}
|
||||
|
||||
// Loops through all categories
|
||||
for (int i = 0; i < categories.size(); i++) {
|
||||
|
||||
String thisBill;
|
||||
|
||||
/* Header */
|
||||
header = " ";
|
||||
for (int o = 1; o < headerSpace; o++) {
|
||||
header = header + "\n";
|
||||
}
|
||||
|
||||
// This is the final header
|
||||
header = header + setCenter(this.header);
|
||||
|
||||
/* Info */
|
||||
|
||||
info = setRight("Bestellung: ", timeAndDateOrder) + "\n"
|
||||
+ setRight("Druck: ", timeAndDatePrint) + "\n"
|
||||
+ setRight("Bestellnummer: ", jobID);
|
||||
|
||||
/* Positions */
|
||||
|
||||
positions = categories.get(i).getPositionsString();
|
||||
|
||||
/* Footer */
|
||||
|
||||
footer = "\n";
|
||||
|
||||
for (int o = 2; o < footerSpace; o++) {
|
||||
footer = footer + "\n";
|
||||
}
|
||||
footer = footer + "_";
|
||||
|
||||
thisBill = header + "\n" + getSeparator() + "\n" + info + "\n"
|
||||
+ getSeparator() + "\n"
|
||||
+ setCenter(categories.get(i).getCategoryName()) + "\n"
|
||||
+ getSeparator() + positions + "\n" + getSeparator() + "\n"
|
||||
+ footer;
|
||||
|
||||
printString.add(thisBill);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void insertToCategory(int quantity, String name, String value,
|
||||
String category) {
|
||||
boolean createNewCategorie = true;
|
||||
for (int i = 0; i < categoryCount; i++) {
|
||||
if (category.equals(categories.get(i).getCategoryName())) {
|
||||
categories.get(i).addPosition(quantity, name, value, this);
|
||||
createNewCategorie = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (createNewCategorie) {
|
||||
// Position has a new category
|
||||
categories.add(new Category(category));
|
||||
categories.get(categoryCount).addPosition(quantity, name, value, this);
|
||||
categoryCount++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -16,7 +16,6 @@ public class tableDataCurrentOrder
|
||||
{
|
||||
this.position.set(pPosition);
|
||||
this.quantity.set(pQuantity);
|
||||
|
||||
}
|
||||
|
||||
public StringProperty positionProperty()
|
||||
|
||||
@ -5,8 +5,7 @@ import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleStringProperty;
|
||||
import javafx.beans.property.StringProperty;
|
||||
|
||||
public class tableDataPositionen
|
||||
{ // data-object with id, name, value, color
|
||||
public class tableDataPositionen { // Data object with id, name, value, color
|
||||
|
||||
private final IntegerProperty id = new SimpleIntegerProperty();
|
||||
|
||||
@ -18,8 +17,8 @@ public class tableDataPositionen
|
||||
|
||||
private final StringProperty color = new SimpleStringProperty();
|
||||
|
||||
public tableDataPositionen(final int id, final String name, final String value, final String cat, final String color)
|
||||
{
|
||||
public tableDataPositionen(final int id, final String name, final String value, final String cat,
|
||||
final String color) {
|
||||
this.id.set(id);
|
||||
this.name.set(name);
|
||||
this.value.set(value);
|
||||
@ -27,18 +26,15 @@ public class tableDataPositionen
|
||||
this.color.set(color);
|
||||
}
|
||||
|
||||
public IntegerProperty idProperty()
|
||||
{
|
||||
public IntegerProperty idProperty() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public StringProperty nameProperty()
|
||||
{
|
||||
public StringProperty nameProperty() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public StringProperty valueProperty()
|
||||
{
|
||||
public StringProperty valueProperty() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -46,23 +42,19 @@ public class tableDataPositionen
|
||||
return cat;
|
||||
}
|
||||
|
||||
public StringProperty colorProperty()
|
||||
{
|
||||
public StringProperty colorProperty() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public int getID()
|
||||
{
|
||||
public int getID() {
|
||||
return idProperty().get();
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
public String getName() {
|
||||
return nameProperty().get();
|
||||
}
|
||||
|
||||
public String getValue()
|
||||
{
|
||||
public String getValue() {
|
||||
return valueProperty().get();
|
||||
}
|
||||
|
||||
@ -70,23 +62,19 @@ public class tableDataPositionen
|
||||
return catProperty().get();
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
public String getColor() {
|
||||
return colorProperty().get();
|
||||
}
|
||||
|
||||
public final void setID(int id)
|
||||
{
|
||||
public final void setID(int id) {
|
||||
idProperty().set(id);
|
||||
}
|
||||
|
||||
public final void setName(String name)
|
||||
{
|
||||
public final void setName(String name) {
|
||||
nameProperty().set(name);
|
||||
}
|
||||
|
||||
public final void setValue(String value)
|
||||
{
|
||||
public final void setValue(String value) {
|
||||
valueProperty().set(value);
|
||||
}
|
||||
|
||||
@ -94,8 +82,7 @@ public class tableDataPositionen
|
||||
catProperty().set(cat);
|
||||
}
|
||||
|
||||
public final void setColor(String color)
|
||||
{
|
||||
public final void setColor(String color) {
|
||||
colorProperty().set(color);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
/* JavaFX CSS - Leave this comment until you have at least create one rule which uses -fx-Property */
|
||||
/* JavaFX CSS - Leave this comment until you have at least one rule which uses -fx-Property */
|
||||
@ -23,11 +23,14 @@
|
||||
<children>
|
||||
<TabPane layoutX="4.0" layoutY="5.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="924.0" prefWidth="1536.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<tabs>
|
||||
<Tab text="Einstellungen">
|
||||
<Tab fx:id="tapSettings" text="Einstellungen">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<Button fx:id="ueberbtn" layoutX="84.0" layoutY="79.0" mnemonicParsing="false" onAction="#ueberbtnAction" prefHeight="0.0" prefWidth="46.0" text="Über" />
|
||||
<Button fx:id="ueberbtn" layoutX="273.0" layoutY="448.0" mnemonicParsing="false" onAction="#ueberbtnAction" prefHeight="35.0" prefWidth="324.0" text="Informationen über jFxKasse">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></Button>
|
||||
<TitledPane alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="790.0" layoutY="10.0" prefHeight="270.0" prefWidth="566.0" text="Datenbank Einstellungen">
|
||||
<content>
|
||||
<AnchorPane fx:id="paneDB" minHeight="0.0" minWidth="0.0" prefHeight="238.0" prefWidth="564.0">
|
||||
@ -37,7 +40,10 @@
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewDBName" alignment="CENTER" layoutX="25.0" layoutY="10.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftNewDBName" alignment="CENTER" layoutX="25.0" layoutY="10.0" prefHeight="25.0" prefWidth="376.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<Label fx:id="labelDBStatus" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="1.0" layoutY="75.0" prefHeight="34.0" prefWidth="551.0" text="Keine Datenbank gefunden!">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
@ -89,11 +95,26 @@
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftKat01" alignment="CENTER" layoutX="50.0" layoutY="5.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat02" alignment="CENTER" layoutX="50.0" layoutY="45.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat03" alignment="CENTER" layoutX="50.0" layoutY="85.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat04" alignment="CENTER" layoutX="50.0" layoutY="125.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat05" alignment="CENTER" layoutX="50.0" layoutY="165.0" prefHeight="25.0" prefWidth="376.0" />
|
||||
<JFXTextField fx:id="tftKat01" alignment="CENTER" layoutX="50.0" layoutY="5.0" prefHeight="25.0" prefWidth="376.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<JFXTextField fx:id="tftKat02" alignment="CENTER" layoutX="50.0" layoutY="45.0" prefHeight="25.0" prefWidth="376.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<JFXTextField fx:id="tftKat03" alignment="CENTER" layoutX="50.0" layoutY="85.0" prefHeight="25.0" prefWidth="376.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<JFXTextField fx:id="tftKat04" alignment="CENTER" layoutX="50.0" layoutY="125.0" prefHeight="25.0" prefWidth="376.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<JFXTextField fx:id="tftKat05" alignment="CENTER" layoutX="50.0" layoutY="165.0" prefHeight="25.0" prefWidth="376.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<Button fx:id="btnSaveCat" layoutX="200.0" layoutY="204.0" mnemonicParsing="false" onAction="#btnSaveCatAction" text="Kategorien speichern">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
@ -110,9 +131,12 @@
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="327.0" prefWidth="564.0">
|
||||
<children>
|
||||
<ChoiceBox fx:id="printerChoise" layoutX="298.0" layoutY="10.0" prefWidth="150.0" />
|
||||
<ChoiceBox fx:id="printerChoise" layoutX="270.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="178.0" />
|
||||
<Spinner fx:id="linesSpinner" layoutX="35.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="92.0" />
|
||||
<JFXTextField fx:id="tftheader" alignment="CENTER" layoutX="65.0" layoutY="90.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="377.0" />
|
||||
<JFXTextField fx:id="tftheader" alignment="CENTER" layoutX="65.0" layoutY="90.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="377.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
<JFXToggleButton fx:id="switchSeparate" layoutX="270.0" layoutY="170.0" text="Kategorien separat drucken">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
@ -155,7 +179,10 @@
|
||||
</Button>
|
||||
<Spinner fx:id="offsetHeaderSpinner" layoutX="324.0" layoutY="48.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="92.0" />
|
||||
<Spinner fx:id="offsetFooterSpinner" layoutX="35.0" layoutY="48.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="92.0" />
|
||||
<JFXTextField fx:id="tftfooter" alignment="CENTER" layoutX="65.0" layoutY="130.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="377.0" />
|
||||
<JFXTextField fx:id="tftfooter" alignment="CENTER" layoutX="65.0" layoutY="130.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="377.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font></JFXTextField>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
@ -171,67 +198,67 @@
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<children>
|
||||
<TreeTableView fx:id="entryTreeTable" layoutX="11.0" layoutY="10.0" prefHeight="502.0" prefWidth="1346.0">
|
||||
<TreeTableView fx:id="entryTreeTable" layoutX="11.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="502.0" prefWidth="1346.0">
|
||||
<placeholder>
|
||||
<Label text="" />
|
||||
</placeholder>
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnColor" editable="false" maxWidth="428.0" minWidth="119.333251953125" prefWidth="119.333251953125" resizable="false" sortable="false" text="Farbe" />
|
||||
<TreeTableColumn fx:id="columnCat" editable="false" maxWidth="800.0" minWidth="94.0" prefWidth="300.0" resizable="false" sortable="false" text="Kategorie" />
|
||||
<TreeTableColumn fx:id="columnPrize" editable="false" maxWidth="693.3333129882812" minWidth="44.33331298828125" prefWidth="140.33331298828125" resizable="false" sortable="false" text="Preis" />
|
||||
<TreeTableColumn fx:id="columnPositionsEdit" editable="false" maxWidth="1581.6666870117188" minWidth="38.0" prefWidth="596.333251953125" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnPosnumber" editable="false" maxWidth="1218.0" minWidth="59.0" prefWidth="165.0" resizable="false" sortable="false" text="Nummer" />
|
||||
<TreeTableColumn fx:id="columnPositionsEdit" editable="false" maxWidth="1581.6666870117188" minWidth="38.0" prefWidth="596.333251953125" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnPrize" editable="false" maxWidth="693.3333129882812" minWidth="44.33331298828125" prefWidth="140.33331298828125" resizable="false" sortable="false" text="Preis" />
|
||||
<TreeTableColumn fx:id="columnCat" editable="false" maxWidth="800.0" minWidth="94.0" prefWidth="300.0" resizable="false" sortable="false" text="Kategorie" />
|
||||
<TreeTableColumn fx:id="columnColor" editable="false" maxWidth="428.0" minWidth="119.333251953125" prefWidth="119.333251953125" resizable="false" sortable="false" text="Farbe" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
</columnResizePolicy>
|
||||
</TreeTableView>
|
||||
<Button fx:id="btnSaveEntry" layoutX="494.0" layoutY="631.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern">
|
||||
<Button fx:id="btnClearEntry" layoutX="232.0" layoutY="590.0" mnemonicParsing="false" onAction="#btnClearEntryAction" text="Ausgewählten Eintrag zurücksetzten">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button fx:id="btnClearEntry" layoutX="462.0" layoutY="525.0" mnemonicParsing="false" onAction="#btnClearEntryAction" text="Ausgewählten Eintrag zurücksetzten">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<TitledPane fx:id="titledPaneEntry" alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="792.0" layoutY="525.0" prefHeight="163.0" prefWidth="565.0" text="Eintrag editieren">
|
||||
<TitledPane fx:id="titledPaneEntry" alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="724.0" layoutY="525.0" prefHeight="163.0" prefWidth="633.0" text="Eintrag editieren">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="135.0" prefWidth="640.0">
|
||||
<children>
|
||||
<Label fx:id="labelNewPosition" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Position:">
|
||||
<Label fx:id="labelNewPosition" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="516.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Position:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewPosition" alignment="CENTER" layoutX="160.0" layoutY="10.0" prefHeight="25.0" prefWidth="279.0">
|
||||
<JFXTextField fx:id="tftNewPosition" alignment="CENTER" layoutX="307.0" layoutY="8.0" prefHeight="27.0" prefWidth="203.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
</font>
|
||||
</JFXTextField>
|
||||
<Label fx:id="labelNewValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="442.0" layoutY="50.0" prefHeight="34.0" prefWidth="118.0" text="Preis in Euro:">
|
||||
<Label fx:id="labelNewValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="504.0" layoutY="50.0" prefHeight="34.0" prefWidth="118.0" text="Preis in Euro:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXTextField fx:id="tftNewValue" alignment="CENTER" labelFloat="true" layoutX="380.0" layoutY="50.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="58.0">
|
||||
<JFXTextField fx:id="tftNewValue" alignment="CENTER" labelFloat="true" layoutX="442.0" layoutY="42.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="27.0" prefWidth="66.0">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="13.0" />
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</JFXTextField>
|
||||
<Label fx:id="labelNewColor" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Farbe:">
|
||||
<Label fx:id="labelNewColor" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="517.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Farbe:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ChoiceBox fx:id="colorChoise" layoutX="346.0" layoutY="90.0" prefHeight="25.0" prefWidth="96.0" />
|
||||
<Label fx:id="labelSelectCat" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="204.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Kategorie:">
|
||||
<ChoiceBox fx:id="colorChoise" layoutX="340.0" layoutY="90.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="169.0" />
|
||||
<Label fx:id="labelSelectCat" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="185.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Kategorie:">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ChoiceBox fx:id="catChoise" layoutX="25.0" layoutY="90.0" prefHeight="25.0" prefWidth="180.0" />
|
||||
<ChoiceBox fx:id="catChoise" layoutX="16.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="180.0" />
|
||||
<Button fx:id="btnSaveEntry" layoutX="23.0" layoutY="86.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="17.0" />
|
||||
</font>
|
||||
</Button>
|
||||
</children>
|
||||
</AnchorPane>
|
||||
</content>
|
||||
@ -243,20 +270,20 @@
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="Aufträge">
|
||||
<Tab fx:id="tapJobs" text="Aufträge">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0">
|
||||
<children>
|
||||
<TreeTableView fx:id="jobsTreeTable" layoutX="11.0" layoutY="10.0" prefHeight="541.0" prefWidth="1346.0">
|
||||
<TreeTableView fx:id="jobsTreeTable" layoutX="11.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="541.0" prefWidth="1346.0">
|
||||
<placeholder>
|
||||
<Label text="" />
|
||||
</placeholder>
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="111.0" resizable="false" text="Betrag" />
|
||||
<TreeTableColumn fx:id="columnState" editable="false" prefWidth="101.0" resizable="false" text="Zustand" />
|
||||
<TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="861.0" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="159.0" resizable="false" text="Zeit" />
|
||||
<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="110.666748046875" resizable="false" text="Nummer" />
|
||||
<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="85.0" resizable="false" sortable="false" text="Nummer" />
|
||||
<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="160.0" resizable="false" sortable="false" text="Zeit" />
|
||||
<TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="856.0" resizable="false" sortable="false" text="Positionen" />
|
||||
<TreeTableColumn fx:id="columnState" editable="false" prefWidth="116.0" resizable="false" sortable="false" text="Zustand" />
|
||||
<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="103.0" resizable="false" sortable="false" text="Betrag" />
|
||||
</columns>
|
||||
</TreeTableView>
|
||||
<Button fx:id="btnReprintJob" layoutX="378.0" layoutY="603.0" mnemonicParsing="false" onAction="#btnReprintJobAction" text="Ausgewählter Auftrag drucken">
|
||||
@ -301,17 +328,17 @@
|
||||
</AnchorPane>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="Neuer Auftrag">
|
||||
<Tab fx:id="tapNewJob" text="Neuer Auftrag">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0">
|
||||
<children>
|
||||
<TreeTableView fx:id="tableCurrentOrder" layoutX="15.0" layoutY="85.0" prefHeight="379.0" prefWidth="382.0">
|
||||
<TreeTableView fx:id="tableCurrentOrder" layoutX="15.0" layoutY="85.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="358.0" prefWidth="382.0">
|
||||
<placeholder>
|
||||
<Label text="" />
|
||||
</placeholder>
|
||||
<columns>
|
||||
<TreeTableColumn fx:id="columnPosition" editable="false" prefWidth="320.0" resizable="false" sortable="false" text="Position" />
|
||||
<TreeTableColumn fx:id="columnQuantity" editable="false" prefWidth="60.0" resizable="false" sortable="false" text="Anzahl" />
|
||||
<TreeTableColumn fx:id="columnPosition" editable="false" prefWidth="320.0" resizable="false" sortable="false" text="Position" />
|
||||
</columns>
|
||||
<columnResizePolicy>
|
||||
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
|
||||
@ -460,17 +487,17 @@
|
||||
</JFXButton>
|
||||
</children>
|
||||
</GridPane>
|
||||
<Button fx:id="btnPrintBill" contentDisplay="CENTER" defaultButton="true" graphicTextGap="1.0" layoutX="75.0" layoutY="599.0" maxHeight="88.0" minHeight="75.0" mnemonicParsing="false" onAction="#btnPrintBillAction" prefHeight="88.0" prefWidth="258.0" text="Drucken" textAlignment="CENTER" wrapText="true">
|
||||
<Button fx:id="btnPrintBill" contentDisplay="CENTER" focusTraversable="false" graphicTextGap="1.0" layoutX="75.0" layoutY="588.0" maxHeight="88.0" minHeight="75.0" mnemonicParsing="false" onAction="#btnPrintBillAction" prefHeight="88.0" prefWidth="258.0" text="Drucken" textAlignment="CENTER" wrapText="true">
|
||||
<font>
|
||||
<Font name="Cantarell Bold" size="48.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Button fx:id="btnDeleteSelectedPosition" layoutX="43.0" layoutY="475.0" mnemonicParsing="false" onAction="#btnDeleteSelectedPositionAction" prefHeight="17.0" prefWidth="332.0" text="Ausgewählte Position löschen" textAlignment="CENTER">
|
||||
<Button fx:id="btnDeleteSelectedPosition" layoutX="43.0" layoutY="458.0" mnemonicParsing="false" onAction="#btnDeleteSelectedPositionAction" prefHeight="17.0" prefWidth="332.0" text="Ausgewählte Position löschen" textAlignment="CENTER">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="20.0" />
|
||||
</font>
|
||||
</Button>
|
||||
<Label fx:id="labelAllPrize" alignment="CENTER" contentDisplay="CENTER" layoutX="10.0" layoutY="511.0" prefHeight="15.0" prefWidth="386.0" text="0,00 €" textAlignment="CENTER">
|
||||
<Label fx:id="labelAllPrize" alignment="CENTER" contentDisplay="CENTER" layoutX="10.0" layoutY="496.0" prefHeight="15.0" prefWidth="386.0" text="0,00 €" textAlignment="CENTER">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="70.0" />
|
||||
</font>
|
||||
@ -485,7 +512,7 @@
|
||||
<Font name="Cantarell Regular" size="26.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<JFXButton fx:id="btnLock" buttonType="RAISED" cancelButton="true" layoutX="1.0" layoutY="6.0" lineSpacing="2.0" onAction="#btnLockAction" prefHeight="42.0" prefWidth="180.0" ripplerFill="BLACK" text="Kasse sperren" textAlignment="CENTER" textFill="#c91c1c" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||
<JFXButton fx:id="btnLock" buttonType="RAISED" layoutX="1.0" layoutY="6.0" lineSpacing="2.0" onAction="#btnLockAction" prefHeight="42.0" prefWidth="180.0" ripplerFill="BLACK" text="Kasse sperren" textAlignment="CENTER" textFill="#c91c1c" textOverrun="LEADING_WORD_ELLIPSIS">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="19.0" />
|
||||
</font>
|
||||
|
||||