11 Commits

Author SHA1 Message Date
8650177d86 Completed jobs TreeTable and Stats 2018-10-07 00:50:59 +02:00
2a59156b0b Fixed LockBTN when no DB is loaded 2018-10-05 23:01:30 +02:00
786586c382 Finished the current Order Table and the DB saving 2018-10-05 22:53:40 +02:00
1c640de416 job in DB 2018-10-05 13:01:42 +02:00
5f1b0d9ae1 first steps for currentOrder Tree Table 2018-10-04 23:46:42 +02:00
105c168157 Finished the categories, Again 2018-10-03 22:19:29 +02:00
606b879fb9 Finished the categories 2018-10-03 21:53:26 +02:00
748f08abfd Added titeldPaneEntry to blockUI 2018-10-02 22:03:52 +02:00
a24023ac66 gdgfgfg 2018-10-02 21:41:50 +02:00
a79a90a678 test 2018-10-02 21:37:49 +02:00
830f1576a6 added caChoise to blockUI 2018-10-01 13:53:44 +02:00
9 changed files with 1315 additions and 407 deletions

View File

@ -76,7 +76,41 @@ class DBController
} }
} }
// table Position section public String getCategoryNameFromPositionen(int pID)
{
// System.out.println("getCategoryName: " + pID);
int catInPos = 0;
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT posid, cat FROM positionen "
+ "WHERE posid = " + pID + ";");
catInPos = rs.getInt("cat");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
if (catInPos == 6) {
return "Standard";
}
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT catid, catname FROM category "
+ "WHERE catid = " + catInPos + ";");
return rs.getString("catname");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "keine Kategorie";
}
}
// table Position section //
public void createTablePositionen() public void createTablePositionen()
{ // create table position { // create table position
System.out.println("Erstelle Tabelle Positionen"); System.out.println("Erstelle Tabelle Positionen");
@ -92,79 +126,11 @@ class DBController
// create 25 demo/default data entries // create 25 demo/default data entries
for (int i = 0; i < 25; i++) { for (int i = 0; i < 25; i++) {
fillPositionen_Positionen(i + 1, "Noch frei", (float) 0.00, fillPositionen_Positionen(i + 1, "Noch frei", (float) 0.00, 6,
((int) (i / 5)) + 1, "#ad0000"); "#ad0000");
} }
} }
public void createTableCategory()
{ // create table position
System.out.println("Erstelle Tabelle Kategorie");
try {
Statement stmt = connection.createStatement();
stmt.executeUpdate("DROP TABLE IF EXISTS category;");
stmt.executeUpdate("CREATE TABLE category (catid, catname);");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
for (int i = 1; i < 6; i++) {
fillCategory_Category(i, "Cat: " + (i));
}
}
public String getCategoryNameFromPositionen(int pID)
{
//System.out.println("getCategoryName: " + pID);
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT posid, cat, catid, catname FROM positionen, category "
+ "WHERE posid = " + pID + " AND cat = catid;");
return rs.getString("catname");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "Error 404";
}
}
public void setName_Category(int pID, String pName)
{ // Setzte den Namen
try {
Statement stmt = connection.createStatement();
stmt.executeUpdate("UPDATE category SET catname = '" + pName
+ "'WHERE catid =" + pID + ";");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
public void fillCategory_Category(int pID, String pName)
{
System.out.println("Erstelle neuen Kategorie Eintrag");
try {
PreparedStatement ps = connection
.prepareStatement("INSERT INTO category VALUES (?, ?);");
ps.setInt(1, pID); // primary
ps.setString(2, pName);
ps.addBatch();
connection.setAutoCommit(false);
ps.executeBatch(); // SQL execution
connection.setAutoCommit(true);
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
public void fillPositionen_Positionen(int pID, String pName, float pValue, public void fillPositionen_Positionen(int pID, String pName, float pValue,
int pCat, String pColor) int pCat, String pColor)
{ // create new data in table { // create new data in table
@ -202,21 +168,6 @@ class DBController
} }
} }
public String getName_Category(int pID)
{ // Gibt das Datum zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT catid, catname FROM category WHERE catid = " + pID
+ ";");
return rs.getString("catname");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "Error 404";
}
}
public String getValue_Positionen(int pID) public String getValue_Positionen(int pID)
{ // Gibt das Konto zurück { // Gibt das Konto zurück
try { try {
@ -291,7 +242,7 @@ class DBController
try { try {
Statement stmt = connection.createStatement(); Statement stmt = connection.createStatement();
stmt.executeUpdate("UPDATE positionen SET cat = '" + pCat stmt.executeUpdate("UPDATE positionen SET cat = '" + pCat
+ "'WHERE catid =" + pID + ";"); + "'WHERE posid =" + pID + ";");
} catch (SQLException e) { } catch (SQLException e) {
System.err.println("Couldn't handle DB-Query"); System.err.println("Couldn't handle DB-Query");
e.printStackTrace(); e.printStackTrace();
@ -354,7 +305,75 @@ class DBController
} }
} }
// table Jobs section // table Category section //
public void createTableCategory()
{ // create table position
System.out.println("Erstelle Tabelle Kategorie");
try {
Statement stmt = connection.createStatement();
stmt.executeUpdate("DROP TABLE IF EXISTS category;");
stmt.executeUpdate("CREATE TABLE category (catid, catname);");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
fillCategory_Category(1, "Essen");
fillCategory_Category(2, "alkoholische Getränke");
fillCategory_Category(3, "alkoholfreie Getränke");
fillCategory_Category(4, "Kuchen");
fillCategory_Category(5, "Standard");
}
public void setName_Category(int pID, String pName)
{ // Setzte den Namen
try {
Statement stmt = connection.createStatement();
stmt.executeUpdate("UPDATE category SET catname = '" + pName
+ "'WHERE catid =" + pID + ";");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
public void fillCategory_Category(int pID, String pName)
{
System.out.println("Erstelle neuen Kategorie Eintrag");
try {
PreparedStatement ps = connection
.prepareStatement("INSERT INTO category VALUES (?, ?);");
ps.setInt(1, pID); // primary
ps.setString(2, pName);
ps.addBatch();
connection.setAutoCommit(false);
ps.executeBatch(); // SQL execution
connection.setAutoCommit(true);
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
public String getName_Category(int pID)
{ // Gibt das Datum zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT catid, catname FROM category WHERE catid = " + pID
+ ";");
return rs.getString("catname");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "Error 404";
}
}
// table Jobs section //
public void erstelleTabelleJobs() public void erstelleTabelleJobs()
{ // Erstelle Tabelle mit Reihen { // Erstelle Tabelle mit Reihen
System.out.println("Erstelle Tabelle Jobs"); System.out.println("Erstelle Tabelle Jobs");
@ -362,11 +381,217 @@ class DBController
Statement stmt = connection.createStatement(); Statement stmt = connection.createStatement();
stmt.executeUpdate("DROP TABLE IF EXISTS jobs;"); stmt.executeUpdate("DROP TABLE IF EXISTS jobs;");
stmt.executeUpdate( stmt.executeUpdate(
"CREATE TABLE jobs (id, time, positionen, state, value);"); "CREATE TABLE jobs (jobid, time, positionen_quantity, positionen_name, positionen_value, positionen_cat, state, jobvalue);");
} catch (SQLException e) { } catch (SQLException e) {
System.err.println("Couldn't handle DB-Query"); System.err.println("Couldn't handle DB-Query");
e.printStackTrace(); e.printStackTrace();
} }
} }
public int getLatestJobNumber_Job()
{
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid from jobs ORDER BY jobid DESC LIMIT 1;");
return rs.getInt("jobid");
} catch (SQLException e) {
// System.err.println("Couldn't handle DB-Query");
// e.printStackTrace();
}
return 0;
}
public String getTime_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, time FROM jobs WHERE jobid = " + pID + ";");
return rs.getString("time");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getQuantity_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, positionen_quantity FROM jobs WHERE jobid = "
+ pID + ";");
return rs.getString("positionen_quantity");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getName_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, positionen_name FROM jobs WHERE jobid = " + pID
+ ";");
return rs.getString("positionen_name");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getValue_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, positionen_value FROM jobs WHERE jobid = " + pID
+ ";");
return rs.getString("positionen_value");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getCategory_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, positionen_cat FROM jobs WHERE jobid = " + pID
+ ";");
return rs.getString("positionen_cat");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getState_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, state FROM jobs WHERE jobid = " + pID + ";");
return rs.getString("state");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getJobValue_Job(int pID)
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, jobvalue FROM jobs WHERE jobid = " + pID + ";");
return rs.getString("jobvalue");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "404";
}
}
public String getAllJobValue_Job()
{ // Gibt den Nutzernamen zurück
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT state, jobvalue, SUM(jobvalue) AS ALLVALUE FROM jobs WHERE state = "
+ '"' + "verbucht" + '"' + ";");
return rs.getString("ALLVALUE");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
return "0";
}
}
public void setStatus_Jobs(int pID, String pStatus)
{ // Setzt das Konto
try {
Statement stmt = connection.createStatement();
stmt.executeUpdate("UPDATE jobs SET state = '" + pStatus
+ "'WHERE jobid =" + pID + ";");
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
public ArrayList<tableDataJob> loadTableJobs_Job()
{ // Gibt den Nutzernamen zurück
ArrayList<tableDataJob> tmp = new ArrayList<tableDataJob>();
try {
Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery(
"SELECT jobid, time, positionen_quantity, positionen_name, positionen_value, positionen_cat, state, jobvalue FROM jobs;");
while (rs.next()) {
try {
// return rs.getString("jobvalue");
String tablePosition = rs.getString("positionen_name");
tableDataJob data = new tableDataJob(rs.getInt("jobid"),
rs.getString("time"), tablePosition, rs.getString("state"),
rs.getString("jobvalue"));
tmp.add(data);
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
return tmp;
}
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");
try {
PreparedStatement ps = connection.prepareStatement(
"INSERT INTO jobs VALUES (?, ?, ?, ?, ?, ?, ?, ?);");
ps.setInt(1, pID); // primary
ps.setString(2, pTime);
ps.setString(3, pPositionen_quantity);
ps.setString(4, pPositionen_name);
ps.setString(5, pPositionen_value);
ps.setString(6, pPositionen_cat);
ps.setString(7, pState);
ps.setString(8, pJobvalue);
ps.addBatch();
connection.setAutoCommit(false);
ps.executeBatch(); // SQL execution
connection.setAutoCommit(true);
} catch (SQLException e) {
System.err.println("Couldn't handle DB-Query");
e.printStackTrace();
}
}
} }

208
src/application/Job.java Normal file
View File

@ -0,0 +1,208 @@
package application;
import java.util.ArrayList;
public class Job
{
private int jobnumber;
private float jobvalue;
private String jobtime;
private ArrayList<Integer> positionenQuantity;
private ArrayList<String> positionenName;
private ArrayList<Float> positionenValue;
private ArrayList<String> positionenCat;
public Job(int pJobnumber, String pTime)
{
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()
{
return this.jobnumber;
}
public String getJobtime()
{
return this.jobtime;
}
public float getJobValue()
{
calcJobValue();
return this.jobvalue;
}
public void addPosition(String pPositionenName, float pPositionenValue,
String pPositionenCat)
{
// System.out.println("addName");
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;
}
}
positionenName.add(pPositionenName);
positionenValue.add(pPositionenValue);
positionenCat.add(pPositionenCat);
positionenQuantity.add(1);
calcJobValue();
}
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()
{
ArrayList<tableDataCurrentOrder> jobitems = new ArrayList<tableDataCurrentOrder>();
for (int i = 0; i < positionenName.size(); i++) {
tableDataCurrentOrder tmp = new tableDataCurrentOrder(
positionenName.get(i), positionenQuantity.get(i));
jobitems.add(tmp);
}
return jobitems;
}
private void calcJobValue()
{
jobvalue = 0;
for (int i = 0; i < positionenValue.size(); i++) {
jobvalue = jobvalue
+ (positionenQuantity.get(i) * positionenValue.get(i));
}
}
public String createPosQuantityDBString()
{
String tmp = String.valueOf(positionenQuantity.get(0));
for (int i = 1; i < positionenName.size(); i++) {
tmp = tmp + ";" + positionenQuantity.get(i);
}
return tmp;
}
public String createPosNameDBString()
{
String tmp = positionenName.get(0);
for (int i = 1; i < positionenName.size(); i++) {
tmp = tmp + ";" + positionenName.get(i);
}
return tmp;
}
public String createPosValueDBString()
{
String tmp = String.valueOf(positionenValue.get(0));
for (int i = 1; i < positionenName.size(); i++) {
tmp = tmp + ";" + positionenValue.get(i);
}
return tmp;
}
public String createPosCatDBString()
{
String tmp = positionenCat.get(0);
for (int i = 1; i < positionenName.size(); i++) {
tmp = tmp + ";" + positionenCat.get(i);
}
return tmp;
}
public void deletePosName(String pPosName)
{
for (int i = 0; i < positionenName.size(); i++) {
if (positionenName.get(i).equals(pPosName)) {
if (positionenQuantity.get(i) > 1) {
positionenQuantity.set(i, positionenQuantity.get(i) - 1);
} else {
positionenQuantity.remove(i);
positionenName.remove(i);
positionenValue.remove(i);
positionenCat.remove(i);
}
}
}
}
public boolean existsPosName(String pPosName)
{
for (int i = 0; i < positionenName.size(); i++) {
if (positionenName.get(i).equals(pPosName)) {
return true;
}
}
return false;
}
}

View File

@ -77,12 +77,15 @@ public class Main extends Application
dbc.connectDatabase(); // estabishing DB conection dbc.connectDatabase(); // estabishing DB conection
mwc.fillTablePositionen(); // fill TreeTable 'Positionen' mwc.fillTablePositionen(); // fill TreeTable 'Positionen'
mwc.fillCategory(); mwc.fillCategory();
mwc.fillTableJobs();
mwc.loadGridButtons(); mwc.loadGridButtons();
mwc.getSelectedCat(); //Load DB entries in Chois Box mwc.getSelectedCat(); //Load DB entries in Chois Box
mwc.createNewJob();
} else { } else {
// config.xml NOT found, first start of app // config.xml NOT found, first start of app
System.out.println("keine XML gefunden!"); System.out.println("keine XML gefunden!");
mwc.blockUI(true); // disable UI elements that need DB mwc.blockUI(true); // disable UI elements that need DB
mwc.blockUnlock();
File dir = new File(System.getProperty("user.home") + "/bin/jFxKasse"); File dir = new File(System.getProperty("user.home") + "/bin/jFxKasse");
dir.mkdir(); // Create new Subfolder dir.mkdir(); // Create new Subfolder
} }

View File

@ -26,156 +26,162 @@
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children> <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="84.0" layoutY="79.0" mnemonicParsing="false" onAction="#ueberbtnAction" prefHeight="0.0" prefWidth="46.0" text="Über" />
<TitledPane alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="790.0" layoutY="10.0" prefHeight="270.0" prefWidth="566.0" text="Datenbank Einstellungen"> <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> <content>
<AnchorPane fx:id="paneDB" minHeight="0.0" minWidth="0.0" prefHeight="238.0" prefWidth="564.0"> <AnchorPane fx:id="paneDB" minHeight="0.0" minWidth="0.0" prefHeight="238.0" prefWidth="564.0">
<children> <children>
<Label fx:id="labelDBName" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="329.0" layoutY="10.0" prefHeight="34.0" prefWidth="229.0" text="Datenbankname:"> <Label fx:id="labelDBName" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="329.0" layoutY="10.0" prefHeight="34.0" prefWidth="229.0" text="Datenbankname:">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </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" />
<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!"> <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>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Button fx:id="btnCreateNewDatabase" layoutX="317.0" layoutY="126.0" mnemonicParsing="false" onAction="#btnCreateNewDatabaseAction" text="Neue Datenbank anlegen"> <Button fx:id="btnCreateNewDatabase" layoutX="317.0" layoutY="126.0" mnemonicParsing="false" onAction="#btnCreateNewDatabaseAction" text="Neue Datenbank anlegen">
<font> <font>
<Font name="Cantarell Regular" size="13.0" /> <Font name="Cantarell Regular" size="13.0" />
</font> </font>
</Button> </Button>
<Button fx:id="btnOpenFolder" layoutX="99.0" layoutY="126.0" mnemonicParsing="false" onAction="#btnOpenFolderAction" text="Speicherort öffnen"> <Button fx:id="btnOpenFolder" layoutX="99.0" layoutY="126.0" mnemonicParsing="false" onAction="#btnOpenFolderAction" text="Speicherort öffnen">
<font> <font>
<Font name="Cantarell Regular" size="13.0" /> <Font name="Cantarell Regular" size="13.0" />
</font> </font>
</Button> </Button>
</children> </children>
</AnchorPane> </AnchorPane>
</content> </content>
<font> <font>
<Font name="Cantarell Regular" size="13.0" /> <Font name="Cantarell Regular" size="13.0" />
</font> </font>
</TitledPane> </TitledPane>
<TitledPane fx:id="titlePaneCat" alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="170.0" layoutY="10.0" prefHeight="270.0" prefWidth="566.0" text="Kategorien (z.B. Getränke, Essen oder Kuchen)" textAlignment="CENTER"> <TitledPane fx:id="titlePaneCat" alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="170.0" layoutY="10.0" prefHeight="270.0" prefWidth="566.0" text="Kategorien (z.B. Getränke, Essen oder Kuchen)" textAlignment="CENTER">
<content> <content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="260.0" prefWidth="564.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="260.0" prefWidth="564.0">
<children> <children>
<Label fx:id="labelCat01" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="434.0" layoutY="10.0" prefHeight="34.0" prefWidth="124.0" text="Kategorie 1:"> <Label fx:id="labelCat01" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="434.0" layoutY="10.0" prefHeight="34.0" prefWidth="124.0" text="Kategorie 1:">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Label fx:id="labelCat02" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="442.0" layoutY="50.0" prefHeight="34.0" prefWidth="116.0" text="Kategorie 2:"> <Label fx:id="labelCat02" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="442.0" layoutY="50.0" prefHeight="34.0" prefWidth="116.0" text="Kategorie 2:">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Label fx:id="labelCat05" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="448.0" layoutY="170.0" prefHeight="34.0" prefWidth="110.0" text="Kategorie 5:"> <Label fx:id="labelCat05" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="448.0" layoutY="170.0" prefHeight="34.0" prefWidth="110.0" text="Kategorie 5:">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Label fx:id="labelCat04" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="454.0" layoutY="130.0" prefHeight="34.0" prefWidth="104.0" text="Kategorie 4:"> <Label fx:id="labelCat04" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="454.0" layoutY="130.0" prefHeight="34.0" prefWidth="104.0" text="Kategorie 4:">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Label fx:id="labelCat03" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="451.0" layoutY="90.0" prefHeight="34.0" prefWidth="107.0" text="Kategorie 3:"> <Label fx:id="labelCat03" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="451.0" layoutY="90.0" prefHeight="34.0" prefWidth="107.0" text="Kategorie 3:">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<JFXTextField fx:id="tftKat01" alignment="CENTER" layoutX="50.0" layoutY="5.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" />
<JFXTextField fx:id="tftKat02" alignment="CENTER" layoutX="50.0" layoutY="45.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="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="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="tftKat05" alignment="CENTER" layoutX="50.0" layoutY="165.0" prefHeight="25.0" prefWidth="376.0" />
<Button fx:id="btnSaveCat" layoutX="200.0" layoutY="204.0" mnemonicParsing="false" onAction="#btnSaveCatAction" text="Kategorien speichern"> <Button fx:id="btnSaveCat" layoutX="200.0" layoutY="204.0" mnemonicParsing="false" onAction="#btnSaveCatAction" text="Kategorien speichern">
<font> <font>
<Font name="Cantarell Regular" size="13.0" /> <Font name="Cantarell Regular" size="13.0" />
</font> </font>
</Button> </Button>
</children> </children>
</AnchorPane> </AnchorPane>
</content> </content>
<font> <font>
<Font name="Cantarell Regular" size="13.0" /> <Font name="Cantarell Regular" size="13.0" />
</font> </font>
</TitledPane> </TitledPane>
</children> </children>
</AnchorPane> </AnchorPane>
</content> </content>
</Tab> </Tab>
<Tab text="Positionen bearbeiten"> <Tab fx:id="tapPosEdit" text="Positionen bearbeiten">
<content> <content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children> <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" prefHeight="502.0" prefWidth="1346.0">
<columns> <placeholder>
<TreeTableColumn fx:id="columnColor" editable="false" maxWidth="237.3333740234375" minWidth="164.0" prefWidth="164.0" resizable="false" sortable="false" text="Farbe" /> <Label text="" />
<TreeTableColumn fx:id="columnCat" editable="false" maxWidth="800.0" minWidth="176.33331298828125" prefWidth="370.0" resizable="false" sortable="false" text="Kategorie" /> </placeholder>
<TreeTableColumn fx:id="columnPrize" editable="false" maxWidth="693.3333129882812" minWidth="44.33331298828125" prefWidth="126.66668701171875" resizable="false" sortable="false" text="Preis" /> <columns>
<TreeTableColumn fx:id="columnPositionsEdit" editable="false" maxWidth="1581.6666870117188" minWidth="38.0" prefWidth="543.3333129882812" resizable="false" sortable="false" text="Positionen" /> <TreeTableColumn fx:id="columnColor" editable="false" maxWidth="428.0" minWidth="119.333251953125" prefWidth="119.333251953125" resizable="false" sortable="false" text="Farbe" />
<TreeTableColumn fx:id="columnPosnumber" editable="false" maxWidth="1218.0" minWidth="60.666748046875" prefWidth="148.6666259765625" resizable="false" sortable="false" text="Nummer" /> <TreeTableColumn fx:id="columnCat" editable="false" maxWidth="800.0" minWidth="94.0" prefWidth="300.0" resizable="false" sortable="false" text="Kategorie" />
</columns> <TreeTableColumn fx:id="columnPrize" editable="false" maxWidth="693.3333129882812" minWidth="44.33331298828125" prefWidth="140.33331298828125" resizable="false" sortable="false" text="Preis" />
<columnResizePolicy> <TreeTableColumn fx:id="columnPositionsEdit" editable="false" maxWidth="1581.6666870117188" minWidth="38.0" prefWidth="596.333251953125" resizable="false" sortable="false" text="Positionen" />
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> <TreeTableColumn fx:id="columnPosnumber" editable="false" maxWidth="1218.0" minWidth="59.0" prefWidth="181.6666259765625" resizable="false" sortable="false" text="Nummer" />
</columnResizePolicy> </columns>
</TreeTableView> <columnResizePolicy>
<Button fx:id="btnSaveEntry" layoutX="494.0" layoutY="631.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern"> <TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
<font> </columnResizePolicy>
<Font name="Cantarell Regular" size="17.0" /> </TreeTableView>
</font> <Button fx:id="btnSaveEntry" layoutX="494.0" layoutY="631.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern">
</Button> <font>
<Button fx:id="btnClearEntry" layoutX="462.0" layoutY="525.0" mnemonicParsing="false" onAction="#btnClearEntryAction" text="Ausgewählten Eintrag zurücksetzten"> <Font name="Cantarell Regular" size="17.0" />
<font> </font>
<Font name="Cantarell Regular" size="17.0" /> </Button>
</font> <Button fx:id="btnClearEntry" layoutX="462.0" layoutY="525.0" mnemonicParsing="false" onAction="#btnClearEntryAction" text="Ausgewählten Eintrag zurücksetzten">
</Button> <font>
<TitledPane alignment="CENTER" animated="false" collapsible="false" contentDisplay="CENTER" layoutX="792.0" layoutY="525.0" prefHeight="163.0" prefWidth="565.0" text="Eintrag editieren"> <Font name="Cantarell Regular" size="17.0" />
<content> </font>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"> </Button>
<children> <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">
<Label fx:id="lableNewPosition" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Position:"> <content>
<font> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<Font name="Cantarell Regular" size="18.0" /> <children>
</font> <Label fx:id="labelNewPosition" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Position:">
</Label> <font>
<JFXTextField fx:id="tftNewPosition" alignment="CENTER" layoutX="160.0" layoutY="10.0" prefHeight="25.0" prefWidth="279.0"> <Font name="Cantarell Regular" size="18.0" />
<font> </font>
<Font name="Cantarell Regular" size="13.0" /> </Label>
</font></JFXTextField> <JFXTextField fx:id="tftNewPosition" alignment="CENTER" layoutX="160.0" layoutY="10.0" prefHeight="25.0" prefWidth="279.0">
<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:"> <font>
<font> <Font name="Cantarell Regular" size="13.0" />
<Font name="Cantarell Regular" size="18.0" /> </font>
</font> </JFXTextField>
</Label> <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:">
<JFXTextField fx:id="tftNewValue" alignment="CENTER" layoutX="380.0" layoutY="50.0" prefHeight="25.0" prefWidth="58.0"> <font>
<font> <Font name="Cantarell Regular" size="18.0" />
<Font name="Cantarell Regular" size="13.0" /> </font>
</font></JFXTextField> </Label>
<Label fx:id="lableNewColor" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="455.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Farbe:"> <JFXTextField fx:id="tftNewValue" alignment="CENTER" labelFloat="true" layoutX="380.0" layoutY="50.0" prefHeight="25.0" prefWidth="58.0">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="13.0" />
</font> </font>
</Label> </JFXTextField>
<ChoiceBox fx:id="colorChoise" layoutX="346.0" layoutY="90.0" prefHeight="25.0" prefWidth="96.0" /> <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="lableSelectCat" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="204.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Kategorie:"> <font>
<font> <Font name="Cantarell Regular" size="18.0" />
<Font name="Cantarell Regular" size="18.0" /> </font>
</font> </Label>
</Label> <ChoiceBox fx:id="colorChoise" layoutX="346.0" layoutY="90.0" prefHeight="25.0" prefWidth="96.0" />
<ChoiceBox fx:id="catChoise" layoutX="25.0" layoutY="90.0" prefHeight="25.0" prefWidth="180.0" /> <Label fx:id="labelSelectCat" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="204.0" layoutY="90.0" prefHeight="34.0" prefWidth="105.0" text="Kategorie:">
</children> <font>
</AnchorPane> <Font name="Cantarell Regular" size="18.0" />
</content> </font>
<font> </Label>
<Font name="Cantarell Regular" size="13.0" /> <ChoiceBox fx:id="catChoise" layoutX="25.0" layoutY="90.0" prefHeight="25.0" prefWidth="180.0" />
</font> </children>
</TitledPane> </AnchorPane>
</children></AnchorPane> </content>
<font>
<Font name="Cantarell Regular" size="13.0" />
</font>
</TitledPane>
</children>
</AnchorPane>
</content> </content>
</Tab> </Tab>
<Tab text="Aufträge"> <Tab text="Aufträge">
@ -183,12 +189,15 @@
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0">
<children> <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" prefHeight="541.0" prefWidth="1346.0">
<placeholder>
<Label text="" />
</placeholder>
<columns> <columns>
<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="90.6666259765625" resizable="false" text="Betrag" /> <TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="111.0" resizable="false" text="Betrag" />
<TreeTableColumn fx:id="columnState" editable="false" prefWidth="91.0" resizable="false" text="Zustand" /> <TreeTableColumn fx:id="columnState" editable="false" prefWidth="101.0" resizable="false" text="Zustand" />
<TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="981.333251953125" resizable="false" sortable="false" text="Positionen" /> <TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="861.0" resizable="false" sortable="false" text="Positionen" />
<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="99.666748046875" resizable="false" text="Zeit" /> <TreeTableColumn fx:id="columnTime" editable="false" prefWidth="159.0" resizable="false" text="Zeit" />
<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="83.6666259765625" resizable="false" text="Nummer" /> <TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="110.666748046875" resizable="false" text="Nummer" />
</columns> </columns>
</TreeTableView> </TreeTableView>
<Button fx:id="btnReprintJob" layoutX="378.0" layoutY="603.0" mnemonicParsing="false" onAction="#btnReprintJobAction" text="Ausgewählter Auftrag drucken"> <Button fx:id="btnReprintJob" layoutX="378.0" layoutY="603.0" mnemonicParsing="false" onAction="#btnReprintJobAction" text="Ausgewählter Auftrag drucken">
@ -196,21 +205,21 @@
<Font name="Cantarell Regular" size="17.0" /> <Font name="Cantarell Regular" size="17.0" />
</font> </font>
</Button> </Button>
<TitledPane fx:id="titlePaneStats" alignment="CENTER" collapsible="false" contentDisplay="CENTER" layoutX="992.0" layoutY="561.0" prefHeight="118.0" prefWidth="365.0" text="Statistik - 30.03.2018 15:15 Uhr"> <TitledPane fx:id="titlePaneStats" alignment="CENTER" collapsible="false" contentDisplay="CENTER" layoutX="957.0" layoutY="561.0" prefHeight="118.0" prefWidth="400.0" text="Statistik - 30.03.2018 15:15 Uhr">
<content> <content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="59.0" prefWidth="483.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="92.0" prefWidth="414.0">
<children> <children>
<Label fx:id="lableJobCount" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="17.0" layoutY="2.0" prefHeight="34.0" prefWidth="340.0" text="Anzahl Aufträge: 2781"> <Label fx:id="labelJobCount" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="41.0" layoutY="2.0" prefHeight="34.0" prefWidth="340.0" text="Anzahl Aufträge: 2781">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Label fx:id="labelAvgJob" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="17.0" layoutY="30.0" prefHeight="34.0" prefWidth="340.0" text="Durchschnittlicher Auftragswert: 12,90€"> <Label fx:id="labelAvgJob" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="41.0" layoutY="30.0" prefHeight="34.0" prefWidth="340.0" text="Durchschnittlicher Auftragswert: 12,90€">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
</Label> </Label>
<Label fx:id="lableAllValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="17.0" layoutY="60.0" prefHeight="34.0" prefWidth="340.0" text="Gesamt: 1088,48€"> <Label fx:id="labelAllValue" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="41.0" layoutY="60.0" prefHeight="34.0" prefWidth="340.0" text="Gesamt: 1088,48€">
<font> <font>
<Font name="Cantarell Regular" size="18.0" /> <Font name="Cantarell Regular" size="18.0" />
</font> </font>
@ -238,10 +247,16 @@
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0"> <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="850.0" prefWidth="1536.0">
<children> <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" prefHeight="379.0" prefWidth="382.0">
<placeholder>
<Label text="" />
</placeholder>
<columns> <columns>
<TreeTableColumn fx:id="columnPosition" editable="false" prefWidth="304.3333740234375" resizable="false" sortable="false" text="Position" /> <TreeTableColumn fx:id="columnPosition" editable="false" prefWidth="320.0" resizable="false" sortable="false" text="Position" />
<TreeTableColumn fx:id="columnQuantity" editable="false" prefWidth="80.6666259765625" resizable="false" sortable="false" text="Anzahl" /> <TreeTableColumn fx:id="columnQuantity" editable="false" prefWidth="60.0" resizable="false" sortable="false" text="Anzahl" />
</columns> </columns>
<columnResizePolicy>
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TreeTableView> </TreeTableView>
<GridPane gridLinesVisible="true" layoutX="430.0" layoutY="15.0" prefHeight="670.0" prefWidth="920.0"> <GridPane gridLinesVisible="true" layoutX="430.0" layoutY="15.0" prefHeight="670.0" prefWidth="920.0">
<columnConstraints> <columnConstraints>
@ -386,7 +401,7 @@
</JFXButton> </JFXButton>
</children> </children>
</GridPane> </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" wrapText="true"> <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">
<font> <font>
<Font name="Cantarell Bold" size="48.0" /> <Font name="Cantarell Bold" size="48.0" />
</font> </font>
@ -396,9 +411,9 @@
<Font name="Cantarell Regular" size="20.0" /> <Font name="Cantarell Regular" size="20.0" />
</font> </font>
</Button> </Button>
<Label fx:id="labelAllPrize" alignment="CENTER" contentDisplay="CENTER" layoutX="10.0" layoutY="505.0" prefHeight="15.0" prefWidth="386.0" text="0,00 €" textAlignment="CENTER"> <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">
<font> <font>
<Font name="Open Sans" size="70.0" /> <Font name="Cantarell Regular" size="70.0" />
</font> </font>
</Label> </Label>
<Label fx:id="labelJobCounter" alignment="TOP_RIGHT" contentDisplay="CENTER" layoutX="5.0" layoutY="45.0" prefHeight="34.0" prefWidth="392.0" text="Auftragsnummer: 0" textAlignment="CENTER"> <Label fx:id="labelJobCounter" alignment="TOP_RIGHT" contentDisplay="CENTER" layoutX="5.0" layoutY="45.0" prefHeight="34.0" prefWidth="392.0" text="Auftragsnummer: 0" textAlignment="CENTER">

View File

@ -24,6 +24,8 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.Properties; import java.util.Properties;
import com.jfoenix.controls.JFXTextField; import com.jfoenix.controls.JFXTextField;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
@ -32,10 +34,12 @@ import javafx.collections.FXCollections;
import javafx.collections.ObservableList; import javafx.collections.ObservableList;
import javafx.event.ActionEvent; import javafx.event.ActionEvent;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.Tab;
import javafx.scene.layout.AnchorPane; import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.util.Pair; import javafx.util.Pair;
public class MainWindowController public class MainWindowController
{ {
@ -50,38 +54,41 @@ public class MainWindowController
private AnchorPane paneDB; private AnchorPane paneDB;
@FXML @FXML
private TreeTableView<tableData> tableCurrentOrder; private Tab tapPosEdit;
@FXML @FXML
private TreeTableColumn<tableData, String> columnQuantity; private TreeTableView<tableDataCurrentOrder> tableCurrentOrder;
@FXML @FXML
private TreeTableColumn<tableData, String> columnPosition; private TreeTableColumn<tableDataCurrentOrder, Integer> columnQuantity;
@FXML @FXML
private TreeTableColumn<tableData, Integer> idSpalte01 = new TreeTableColumn<>( private TreeTableColumn<tableDataCurrentOrder, String> columnPosition;
@FXML
private TreeTableColumn<tableDataCurrentOrder, Integer> idSpalte01 = new TreeTableColumn<>(
"tableCurrentOrder"); "tableCurrentOrder");
@FXML @FXML
private TreeTableView<tableData> jobsTreeTable; private TreeTableView<tableDataJob> jobsTreeTable;
@FXML @FXML
private TreeTableColumn<tableData, String> columnJobValue; private TreeTableColumn<tableDataJob, String> columnJobValue;
@FXML @FXML
private TreeTableColumn<tableData, String> columnState; private TreeTableColumn<tableDataJob, String> columnState;
@FXML @FXML
private TreeTableColumn<tableData, String> columnPositions; private TreeTableColumn<tableDataJob, String> columnPositions;
@FXML @FXML
private TreeTableColumn<tableData, String> columnTime; private TreeTableColumn<tableDataJob, String> columnTime;
@FXML @FXML
private TreeTableColumn<tableData, String> columnJobNumber; private TreeTableColumn<tableDataJob, Integer> columnJobNumber;
@FXML @FXML
private TreeTableColumn<tableData, Integer> idSpalte02 = new TreeTableColumn<>( private TreeTableColumn<tableDataJob, Integer> idSpalte02 = new TreeTableColumn<>(
"jobsTreeTable"); "jobsTreeTable");
@FXML @FXML
@ -259,25 +266,25 @@ public class MainWindowController
private Label labelTime; private Label labelTime;
@FXML @FXML
private Label lableJobCount; private Label labelJobCount;
@FXML @FXML
private Label labelAvgJob; private Label labelAvgJob;
@FXML @FXML
private Label lableAllValue; private Label labelAllValue;
@FXML @FXML
private Label lableSelectCat; private Label labelSelectCat;
@FXML @FXML
private Label lableNewPosition; private Label labelNewPosition;
@FXML @FXML
private Label labelNewValue; private Label labelNewValue;
@FXML @FXML
private Label lableNewColor; private Label labelNewColor;
@FXML @FXML
private Label labelDBStatus; private Label labelDBStatus;
@ -291,6 +298,9 @@ public class MainWindowController
@FXML @FXML
private TitledPane titlePaneCat; private TitledPane titlePaneCat;
@FXML
private TitledPane titledPaneEntry;
@FXML @FXML
private TextField tftNewPosition; private TextField tftNewPosition;
@ -318,12 +328,21 @@ public class MainWindowController
private boolean lockState = false; private boolean lockState = false;
@FXML private boolean isPrintBtnDisabled = true;
TreeItem<tableData> rootCurrentJob = new TreeItem<>(
new tableData(0, "0", "0")); private Job currentJob = null;
private String currentOrderPosName;
private int selectedJobId;
@FXML @FXML
TreeItem<tableData> rootJobs = new TreeItem<>(new tableData(0, "0", "0")); TreeItem<tableDataCurrentOrder> rootCurrentJob = new TreeItem<>(
new tableDataCurrentOrder("0", 0));
@FXML
TreeItem<tableDataJob> rootJobs = new TreeItem<>(
new tableDataJob(0, "0", "0", "0", "0"));
@FXML @FXML
TreeItem<tableDataPositionen> rootPositionen = new TreeItem<>( TreeItem<tableDataPositionen> rootPositionen = new TreeItem<>(
@ -339,7 +358,7 @@ public class MainWindowController
Dialog<Pair<String, String>> dialog = new Dialog<>(); Dialog<Pair<String, String>> dialog = new Dialog<>();
dialog.setTitle("Über jFxKasse"); dialog.setTitle("Über jFxKasse");
dialog.setHeaderText( dialog.setHeaderText(
"Informationen und Lizenzen - Version 0.9.1 - Techdemo"); "Informationen und Lizenzen - Version 0.1 - Without Printer");
dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK); dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
@ -350,7 +369,7 @@ public class MainWindowController
grid.add(new Label( grid.add(new Label(
"Einfaches Kassensystem für kleine bis mittel große Veranstaltungen mit Bon-Drucker\n" "Einfaches Kassensystem für kleine bis mittel große Veranstaltungen mit Bon-Drucker\n"
+ "\nUnter Lizenz GPL-3.0 abrufbar auf https://github.com/Windoofs/jFxKasse\n" + "\nUnter Lizenz GPL-3.0 abrufbar auf https://git.mosad.xyz/localhorst/jFxKasse\n"
+ "\nDatenbank: sqlite.org - Public Domain" + "\nDatenbank: sqlite.org - Public Domain"
+ " \nUI Design01: eclipse.org/efxclipse/install.html - Eclipse Public License 1.0" + " \nUI Design01: eclipse.org/efxclipse/install.html - Eclipse Public License 1.0"
+ " \nUI Design02: http://www.jfoenix.com/ - Apache License 2.0" + " \nUI Design02: http://www.jfoenix.com/ - Apache License 2.0"
@ -375,6 +394,13 @@ public class MainWindowController
@FXML @FXML
public void btnCreateNewDatabaseAction(ActionEvent event) throws Exception public void btnCreateNewDatabaseAction(ActionEvent event) throws Exception
{ {
if(!(tftNewDBName.getText().equals(""))) {
setDatabaseName(tftNewDBName.getText()); setDatabaseName(tftNewDBName.getText());
dbc.dbname = getDatabaseName(); dbc.dbname = getDatabaseName();
dbc.connectDatabase(); // establish DB connection dbc.connectDatabase(); // establish DB connection
@ -392,19 +418,22 @@ public class MainWindowController
fillTablePositionen(); // fill TreeTable 'Positionen' fillTablePositionen(); // fill TreeTable 'Positionen'
fillCategory(); fillCategory();
initUI(); // Starting the UI elements initUI(); // Starting the UI elements
getSelectedCat();
createNewJob();
btnLock.setDisable(false);
}
} }
@FXML @FXML
public void btnSaveEntryAction(ActionEvent event) public void btnSaveEntryAction(ActionEvent event)
{ {
System.out.println("Speichere Eintrag!");
dbc.setName_Positionen(idPositionen, tftNewPosition.getText()); dbc.setName_Positionen(idPositionen, tftNewPosition.getText());
dbc.setValue_Positionen(idPositionen, tftNewValue.getText()); dbc.setValue_Positionen(idPositionen, tftNewValue.getText());
dbc.setColor_Positionen(idPositionen, getColorCodes(selectedColorName)); dbc.setColor_Positionen(idPositionen, getColorCodes(selectedColorName));
System.out.println("refill pos"); dbc.setCat_Positionen(idPositionen, getSelectedCat());
fillTablePositionen(); // fill TreeTable 'Positionen' fillTablePositionen(); // fill TreeTable 'Positionen'
loadGridButtons(); loadGridButtons();
@ -417,6 +446,7 @@ public class MainWindowController
dbc.setName_Positionen(idPositionen, "Noch frei"); dbc.setName_Positionen(idPositionen, "Noch frei");
dbc.setValue_Positionen(idPositionen, "0.00"); dbc.setValue_Positionen(idPositionen, "0.00");
dbc.setColor_Positionen(idPositionen, "#FAF0E6"); dbc.setColor_Positionen(idPositionen, "#FAF0E6");
dbc.setCat_Positionen(idPositionen, 6);
fillTablePositionen(); // fill TreeTable 'Positionen' fillTablePositionen(); // fill TreeTable 'Positionen'
} }
@ -424,7 +454,27 @@ public class MainWindowController
@FXML @FXML
public void btnCalcStatsAction(ActionEvent event) public void btnCalcStatsAction(ActionEvent event)
{ {
System.out.println("Button!");
System.out.println(dbc.getAllJobValue_Job());
if(dbc.getAllJobValue_Job() != null) {
float allValue = Float.valueOf(dbc.getAllJobValue_Job());
float avgJobValue = ((float) allValue / dbc.getLatestJobNumber_Job());
setJobStatLabel(dbc.getLatestJobNumber_Job(), avgJobValue, allValue);
}else {
setJobStatLabel(dbc.getLatestJobNumber_Job(), 0, 0);
}
titlePaneStats.setVisible(true);
} }
@FXML @FXML
@ -436,7 +486,8 @@ public class MainWindowController
@FXML @FXML
public void btnCancelJobAction(ActionEvent event) public void btnCancelJobAction(ActionEvent event)
{ {
System.out.println("Button!"); dbc.setStatus_Jobs(selectedJobId + 1, "storniert");
fillTableJobs();
} }
@FXML @FXML
@ -457,8 +508,6 @@ public class MainWindowController
@FXML @FXML
public void btnSaveCatAction(ActionEvent event) public void btnSaveCatAction(ActionEvent event)
{ {
System.out.println("Cat´s speichern");
dbc.setName_Category(1, tftKat01.getText()); dbc.setName_Category(1, tftKat01.getText());
dbc.setName_Category(2, tftKat02.getText()); dbc.setName_Category(2, tftKat02.getText());
dbc.setName_Category(3, tftKat03.getText()); dbc.setName_Category(3, tftKat03.getText());
@ -474,164 +523,210 @@ public class MainWindowController
@FXML @FXML
public void btnDeleteSelectedPositionAction(ActionEvent event) public void btnDeleteSelectedPositionAction(ActionEvent event)
{ {
System.out.println("Button!"); currentJob.deletePosName(currentOrderPosName);
rootCurrentJob.getChildren().remove(0,
rootCurrentJob.getChildren().size());
for (int i = 0; i < currentJob.getCurrentJobPositionen().size(); i++) {
rootCurrentJob.getChildren().add(new TreeItem<tableDataCurrentOrder>(
currentJob.getCurrentJobPositionen().get(i)));
}
setJobPrizeLabel(currentJob.getJobValue());
// currentJob.printJobOnConsole();
if (rootCurrentJob.getChildren().size() == 0) {
btnPrintBill.setDisable(true);
isPrintBtnDisabled = true;
tapPosEdit.setDisable(false);
btnDeleteSelectedPosition.setDisable(true);
}
if (!currentJob.existsPosName(currentOrderPosName)) {
btnDeleteSelectedPosition.setDisable(true);
}
} }
@FXML @FXML
public void btnPrintBillAction(ActionEvent event) public void btnPrintBillAction(ActionEvent event)
{ {
System.out.println("Button!"); // currentJob.printJobOnConsole();
btnPrintBill.setDisable(true);
tapPosEdit.setDisable(false);
btnDeleteSelectedPosition.setDisable(true);
isPrintBtnDisabled = true;
setJobPrizeLabel(0);
rootCurrentJob.getChildren().remove(0,
rootCurrentJob.getChildren().size());
dbc.fillJobs_Jobs(currentJob.getJobnumber(), currentJob.getJobtime(),
currentJob.createPosQuantityDBString(),
currentJob.createPosNameDBString(),
currentJob.createPosValueDBString(),
currentJob.createPosCatDBString(), "verbucht",
String.valueOf(currentJob.getJobValue()));
fillTableJobs();
currentJob = null;
createNewJob();
} }
@FXML @FXML
public void gridButton01Action(ActionEvent event) public void gridButton01Action(ActionEvent event)
{ {
System.out.println("Test Button!"); handelGridButtons(1);
} }
@FXML @FXML
public void gridButton02Action(ActionEvent event) public void gridButton02Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(2);
} }
@FXML @FXML
public void gridButton03Action(ActionEvent event) public void gridButton03Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(3);
} }
@FXML @FXML
public void gridButton04Action(ActionEvent event) public void gridButton04Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(4);
} }
@FXML @FXML
public void gridButton05Action(ActionEvent event) public void gridButton05Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(5);
} }
@FXML @FXML
public void gridButton06Action(ActionEvent event) public void gridButton06Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(6);
} }
@FXML @FXML
public void gridButton07Action(ActionEvent event) public void gridButton07Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(7);
} }
@FXML @FXML
public void gridButton08Action(ActionEvent event) public void gridButton08Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(8);
} }
@FXML @FXML
public void gridButton09Action(ActionEvent event) public void gridButton09Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(9);
} }
@FXML @FXML
public void gridButton10Action(ActionEvent event) public void gridButton10Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(10);
} }
@FXML @FXML
public void gridButton11Action(ActionEvent event) public void gridButton11Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(11);
} }
@FXML @FXML
public void gridButton12Action(ActionEvent event) public void gridButton12Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(12);
} }
@FXML @FXML
public void gridButton13Action(ActionEvent event) public void gridButton13Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(13);
} }
@FXML @FXML
public void gridButton14Action(ActionEvent event) public void gridButton14Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(14);
} }
@FXML @FXML
public void gridButton15Action(ActionEvent event) public void gridButton15Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(15);
} }
@FXML @FXML
public void gridButton16Action(ActionEvent event) public void gridButton16Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(16);
} }
@FXML @FXML
public void gridButton17Action(ActionEvent event) public void gridButton17Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(17);
} }
@FXML @FXML
public void gridButton18Action(ActionEvent event) public void gridButton18Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(18);
} }
@FXML @FXML
public void gridButton19Action(ActionEvent event) public void gridButton19Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(19);
} }
@FXML @FXML
public void gridButton20Action(ActionEvent event) public void gridButton20Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(20);
} }
@FXML @FXML
public void gridButton21Action(ActionEvent event) public void gridButton21Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(21);
} }
@FXML @FXML
public void gridButton22Action(ActionEvent event) public void gridButton22Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(22);
} }
@FXML @FXML
public void gridButton23Action(ActionEvent event) public void gridButton23Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(23);
} }
@FXML @FXML
public void gridButton24Action(ActionEvent event) public void gridButton24Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(24);
} }
@FXML @FXML
public void gridButton25Action(ActionEvent event) public void gridButton25Action(ActionEvent event)
{ {
System.out.println("Button!"); handelGridButtons(25);
} }
@FXML @FXML
@ -642,28 +737,50 @@ public class MainWindowController
rootPositionen.getChildren().size()); rootPositionen.getChildren().size());
for (int i = 0; i < dbc.ladeTabellePositionen().size(); i++) { for (int i = 0; i < dbc.ladeTabellePositionen().size(); i++) {
float fValue = Float.valueOf(dbc.ladeTabellePositionen().get(i).getValue());
String strValue = String.format("%.02f", fValue);
strValue.replace('.', ',');
tableDataPositionen helpTableData = new tableDataPositionen( tableDataPositionen helpTableData = new tableDataPositionen(
dbc.ladeTabellePositionen().get(i).getID(), dbc.ladeTabellePositionen().get(i).getID(),
dbc.ladeTabellePositionen().get(i).getName(), dbc.ladeTabellePositionen().get(i).getName(),
dbc.ladeTabellePositionen().get(i).getValue() + "",
(strValue + "")
// dbc.ladeTabellePositionen().get(i).getCat(),
// dbc.getCategoryName(dbc.ladeTabellePositionen().get(i).getCat())) ,
dbc.getCategoryNameFromPositionen(i + 1), dbc.getCategoryNameFromPositionen(i + 1),
getColorNames(dbc.ladeTabellePositionen().get(i).getColor())); getColorNames(dbc.ladeTabellePositionen().get(i).getColor()));
rootPositionen.getChildren() rootPositionen.getChildren()
.add(new TreeItem<tableDataPositionen>(helpTableData)); .add(new TreeItem<tableDataPositionen>(helpTableData));
} }
} }
public void initUI() public void initUI()
{ {
System.out.println("initUI"); System.out.println("initUI");
for (int i = 0; i < 25; i++) {
getButtonByID(i).setVisible(false);
}
tftNewDBName.setText(getDatabaseName()); tftNewDBName.setText(getDatabaseName());
tftKat05.setDisable(true);
titlePaneStats.setVisible(false);
btnPrintBill.setDisable(true);
btnDeleteSelectedPosition.setDisable(true);
isPrintBtnDisabled = true;
initPositionen(); initPositionen();
initCurrentOrderTreeTableView();
initJobTreeTableView();
} }
@ -672,10 +789,22 @@ public class MainWindowController
ObservableList<String> cats = FXCollections.observableArrayList(); ObservableList<String> cats = FXCollections.observableArrayList();
cats.add(dbc.getName_Category(1)); for (int i = 1; i < 5; i++) {
cats.add(dbc.getName_Category(2));
cats.add(dbc.getName_Category(3)); if (dbc.getName_Category(i).equals("Standard")) {
cats.add(dbc.getName_Category(4));
} else {
cats.add(dbc.getName_Category(i));
}
}
/*
* cats.add(dbc.getName_Category(1));
*
* cats.add(dbc.getName_Category(2)); cats.add(dbc.getName_Category(3));
* cats.add(dbc.getName_Category(4));
*/
cats.add(dbc.getName_Category(5)); cats.add(dbc.getName_Category(5));
catChoise.setItems(cats); catChoise.setItems(cats);
@ -688,17 +817,17 @@ public class MainWindowController
selectedCatName = catChoise.getItems().get((int) new_value) selectedCatName = catChoise.getItems().get((int) new_value)
.toString(); .toString();
System.out.println("Ausgewählte Cat: " + selectedCatName);
} }
}); });
for (int i = 1; i < 5; i++) { for (int i = 1; i < 6; i++) {
if (selectedCatName == dbc.getName_Category(i)) {
if (dbc.getName_Category(i).equals(selectedCatName)) {
return i; return i;
} }
} }
return -1; return 5;
} }
public void fillCategory() public void fillCategory()
@ -715,6 +844,13 @@ public class MainWindowController
entryTreeTable.setRoot(rootPositionen); entryTreeTable.setRoot(rootPositionen);
entryTreeTable.setShowRoot(false); entryTreeTable.setShowRoot(false);
entryTreeTable.setEditable(false); entryTreeTable.setEditable(false);
columnPosnumber.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnPositionsEdit.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnPrize.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnCat.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnColor.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
ObservableList<String> color = FXCollections.observableArrayList("Rot", ObservableList<String> color = FXCollections.observableArrayList("Rot",
"Orange", "Braun", "Weiß", "Gelb", "Gr\u00fcn", "Blau", "Indigo"); "Orange", "Braun", "Weiß", "Gelb", "Gr\u00fcn", "Blau", "Indigo");
@ -727,7 +863,6 @@ public class MainWindowController
{ {
selectedColorName = colorChoise.getItems() selectedColorName = colorChoise.getItems()
.get((int) new_value).toString(); .get((int) new_value).toString();
System.out.println("Ausgewählte Farbe: " + selectedColorName);
} }
}); });
@ -756,13 +891,8 @@ public class MainWindowController
int selected = entryTreeTable.getSelectionModel() int selected = entryTreeTable.getSelectionModel()
.getSelectedIndex(); // get selected item .getSelectedIndex(); // get selected item
idPositionen = columnPosnumber.getCellData(selected); // Ausgewählte idPositionen = columnPosnumber.getCellData(selected);
// Spalte try {
System.out.println(
"Positionen - Ausgewaehlte Spalte: " + idPositionen);
try { // Setzt den Inhalt in die Textfelder
tftNewPosition tftNewPosition
.setText(dbc.getName_Positionen(idPositionen)); .setText(dbc.getName_Positionen(idPositionen));
@ -770,6 +900,9 @@ public class MainWindowController
colorChoise.getSelectionModel().select( colorChoise.getSelectionModel().select(
getColorID(dbc.getColor_Positionen(idPositionen))); getColorID(dbc.getColor_Positionen(idPositionen)));
catChoise.getSelectionModel().select(
dbc.getCategoryNameFromPositionen(idPositionen));
} catch (Exception e) { } catch (Exception e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
@ -777,11 +910,7 @@ public class MainWindowController
} }
}); });
columnPosnumber.setStyle("-fx-alignment: CENTER;");
columnPositionsEdit.setStyle("-fx-alignment: CENTER;");
columnPrize.setStyle("-fx-alignment: CENTER;");
columnCat.setStyle("-fx-alignment: CENTER;");
columnColor.setStyle("-fx-alignment: CENTER;");
tftNewValue.textProperty().addListener(new ChangeListener<String>() { tftNewValue.textProperty().addListener(new ChangeListener<String>() {
@Override @Override
@ -820,8 +949,16 @@ public class MainWindowController
{ {
DateFormat dateFormat = new SimpleDateFormat("HH:mm"); DateFormat dateFormat = new SimpleDateFormat("HH:mm");
Date date = new Date(); Date date = new Date();
String heutigesDatum = dateFormat.format(date); String time = dateFormat.format(date);
return heutigesDatum; return time;
}
public String getSystemDate()
{
DateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy");
Date date = new Date();
String dateStr = dateFormat.format(date);
return dateStr;
} }
public void saveSettings(String databasename) throws Exception public void saveSettings(String databasename) throws Exception
@ -960,8 +1097,20 @@ public class MainWindowController
{ {
btnCalcStats.setDisable(pState); btnCalcStats.setDisable(pState);
btnClearEntry.setDisable(pState); btnClearEntry.setDisable(pState);
btnDeleteSelectedPosition.setDisable(pState);
btnPrintBill.setDisable(pState); if ((!isPrintBtnDisabled) && (!pState)) {
// print was not disabled and will be enabled again
btnPrintBill.setDisable(pState);
btnDeleteSelectedPosition.setDisable(pState);
}
if (pState) {
// disable allways
btnPrintBill.setDisable(pState);
btnDeleteSelectedPosition.setDisable(pState);
}
btnReprintJob.setDisable(pState); btnReprintJob.setDisable(pState);
btnSaveEntry.setDisable(pState); btnSaveEntry.setDisable(pState);
btnCancelJob.setDisable(pState); btnCancelJob.setDisable(pState);
@ -973,6 +1122,7 @@ public class MainWindowController
tftNewPosition.setDisable(pState); tftNewPosition.setDisable(pState);
tftNewValue.setDisable(pState); tftNewValue.setDisable(pState);
colorChoise.setDisable(pState); colorChoise.setDisable(pState);
catChoise.setDisable(pState);
tableCurrentOrder.setDisable(pState); tableCurrentOrder.setDisable(pState);
jobsTreeTable.setDisable(pState); jobsTreeTable.setDisable(pState);
@ -981,8 +1131,11 @@ public class MainWindowController
labelAllPrize.setVisible(!pState); labelAllPrize.setVisible(!pState);
labelJobCounter.setVisible(!pState); labelJobCounter.setVisible(!pState);
titlePaneStats.setVisible(!pState); if(pState) {
titlePaneStats.setVisible(!pState);
}
titledPaneEntry.setDisable(pState);
titlePaneCat.setDisable(pState); titlePaneCat.setDisable(pState);
} }
@ -1016,6 +1169,7 @@ public class MainWindowController
} }
} }
public Button getButtonByID(int pID) public Button getButtonByID(int pID)
{ {
@ -1074,11 +1228,224 @@ public class MainWindowController
return gridButton01; return gridButton01;
} }
} }
private void handelGridButtons(int pID)
{
currentJob.addPosition(dbc.getName_Positionen(pID),
Float.parseFloat(dbc.getValue_Positionen(pID)),
dbc.getCategoryNameFromPositionen(pID));
btnPrintBill.setDisable(false);
isPrintBtnDisabled = false;
tapPosEdit.setDisable(true);
rootCurrentJob.getChildren().remove(0,
rootCurrentJob.getChildren().size());
for (int i = 0; i < currentJob.getCurrentJobPositionen().size(); i++) {
rootCurrentJob.getChildren().add(new TreeItem<tableDataCurrentOrder>(
currentJob.getCurrentJobPositionen().get(i)));
}
setJobPrizeLabel(currentJob.getJobValue());
}
private void initCurrentOrderTreeTableView()
{
columnQuantity
.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnPosition
.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
tableCurrentOrder.setRoot(rootCurrentJob);
tableCurrentOrder.setShowRoot(false);
tableCurrentOrder.setEditable(false);
columnQuantity.setCellValueFactory(cellData -> cellData.getValue()
.getValue().quantityProperty().asObject());
columnPosition.setCellValueFactory(
cellData -> cellData.getValue().getValue().positionProperty());
tableCurrentOrder.getSelectionModel().selectedItemProperty()
.addListener(new ChangeListener<Object>() {
@Override
public void changed(ObservableValue<?> observable, Object oldVal,
Object newVal)
{
// last = selected; //for auto-play
int selected = tableCurrentOrder.getSelectionModel()
.getSelectedIndex(); // get selected item
if (columnPosition.getCellData(selected) != null) {
currentOrderPosName = columnPosition.getCellData(selected); // Ausgewählte
btnDeleteSelectedPosition.setDisable(false);
}
}
});
}
private void initJobTreeTableView()
{
columnJobNumber
.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnTime.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnPositions
.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnState.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
columnJobValue
.setStyle("-fx-alignment: CENTER; -fx-font: 17px Cantarell;");
jobsTreeTable.setRoot(rootJobs);
jobsTreeTable.setShowRoot(false);
jobsTreeTable.setEditable(false);
columnJobNumber.setCellValueFactory(cellData -> cellData.getValue()
.getValue().numberProperty().asObject());
columnTime.setCellValueFactory(
cellData -> cellData.getValue().getValue().timeProperty());
columnPositions.setCellValueFactory(
cellData -> cellData.getValue().getValue().positionProperty());
columnState.setCellValueFactory(
cellData -> cellData.getValue().getValue().statusProperty());
columnJobValue.setCellValueFactory(
cellData -> cellData.getValue().getValue().valueProperty());
jobsTreeTable.getSelectionModel().selectedItemProperty()
.addListener(new ChangeListener<Object>() {
@Override
public void changed(ObservableValue<?> observable, Object oldVal,
Object newVal)
{
selectedJobId = jobsTreeTable.getSelectionModel()
.getSelectedIndex(); // get selected item
if(dbc.getState_Job(selectedJobId+1).equals("storniert")) {
btnCancelJob.setDisable(true);
}else {
btnCancelJob.setDisable(false);
}
}
});
}
@FXML
public void fillTableJobs()
{ // loads the table in the TreeTableView
rootJobs.getChildren().remove(0, rootJobs.getChildren().size());
for (int i = 0; i < dbc.loadTableJobs_Job().size(); i++) {
float fValue = Float
.valueOf(dbc.loadTableJobs_Job().get(i).getValue());
String strValue = String.format("%.02f", fValue);
strValue.replace('.', ',');
strValue = (strValue + "");
String strJobDescription = createJobDescription(
dbc.loadTableJobs_Job().get(i).getPosition(),
dbc.getQuantity_Job(dbc.loadTableJobs_Job().get(i).getNumber()));
tableDataJob tmp = new tableDataJob(
dbc.loadTableJobs_Job().get(i).getNumber(),
dbc.loadTableJobs_Job().get(i).getTime(), strJobDescription,
dbc.loadTableJobs_Job().get(i).getStatus(), strValue);
rootJobs.getChildren().add(new TreeItem<tableDataJob>(tmp));
}
}
public void createNewJob()
{
currentJob = new Job(dbc.getLatestJobNumber_Job() + 1,
getSystemTime() + " " + getSystemDate());
labelJobCounter.setText("Auftragsnummer: "
+ String.valueOf(dbc.getLatestJobNumber_Job() + 1));
}
private static String createJobDescription(String pNames, String pQuantities)
{
String line = pQuantities;
int size = line.length() - line.replace(";", "").length() + 1;
String[] namesArray = new String[size];
String[] quantitiesArray = new String[size];
namesArray = pNames.split(";");
quantitiesArray = pQuantities.split(";");
String tmp = quantitiesArray[0] + "x " + namesArray[0];
for (int i = 1; i < namesArray.length; i++) {
tmp = tmp + ", " + quantitiesArray[i] + "x " + namesArray[i];
}
return tmp;
}
private void setJobPrizeLabel(float pPrize)
{
String str = String.format("%.02f", pPrize);
str.replace('.', ',');
labelAllPrize.setText(str + "");
}
private void setJobStatLabel(int pCounter, float pAvgValue, float pAllValue)
{
labelJobCount.setText("Anzahl Aufträge: " + pCounter);
String str = String.format("%.02f", pAvgValue);
str.replace('.', ',');
labelAvgJob.setText("Durchschnittlicher Auftragswert: " + str + "");
str = String.format("%.02f", pAllValue);
str.replace('.', ',');
labelAllValue.setText("Gesamt: " + str + "");
titlePaneStats.setText("Statistik - " + getSystemTime() + " " + getSystemDate());
}
public void updateTimeLabel() public void updateTimeLabel()
{ {
// System.out.println(getSystemTime());
labelTime.setText("Uhrzeit: " + getSystemTime()); labelTime.setText("Uhrzeit: " + getSystemTime());
}
public void blockUnlock()
{
btnLock.setDisable(true);
} }
} }

View File

@ -1,68 +0,0 @@
package application;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class tableData
{ // Datenobjekt mit der ID, Datum und Konto
private final IntegerProperty id = new SimpleIntegerProperty();
private final StringProperty datum = new SimpleStringProperty();
private final StringProperty konto = new SimpleStringProperty();
public tableData(final int id, final String datum, final String konto)
{
this.id.set(id);
this.datum.set(datum);
this.konto.set(konto);
}
public IntegerProperty idProperty()
{
return id;
}
public StringProperty datumProperty()
{
return datum;
}
public StringProperty kontoProperty()
{
return konto;
}
public int getID()
{
return idProperty().get();
}
public String getDatum()
{
return datumProperty().get();
}
public String getKonto()
{
return kontoProperty().get();
}
public final void setID(int id)
{
idProperty().set(id);
}
public final void setdatum(String datum)
{
datumProperty().set(datum);
}
public final void setkonto(String konto)
{
kontoProperty().set(konto);
}
}

View File

@ -0,0 +1,51 @@
package application;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class tableDataCurrentOrder
{
private final StringProperty position = new SimpleStringProperty();
private final IntegerProperty quantity = new SimpleIntegerProperty();
public tableDataCurrentOrder(final String pPosition, final Integer pQuantity)
{
this.position.set(pPosition);
this.quantity.set(pQuantity);
}
public StringProperty positionProperty()
{
return position;
}
public IntegerProperty quantityProperty()
{
return quantity;
}
public String getPosition()
{
return positionProperty().get();
}
public Integer getQuantity()
{
return quantityProperty().get();
}
public final void setPosition(String pPosition)
{
positionProperty().set(pPosition);
}
public final void setQuantity(int pQuantity)
{
quantityProperty().set(pQuantity);
}
}

View File

@ -0,0 +1,107 @@
package application;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
public class tableDataJob
{
private final IntegerProperty number = new SimpleIntegerProperty();
private final StringProperty time = new SimpleStringProperty();
private final StringProperty positionen = new SimpleStringProperty();
private final StringProperty status = new SimpleStringProperty();
private final StringProperty value = new SimpleStringProperty();
public tableDataJob(final Integer pNumber, final String pTime,
final String pPositionen, final String pStatus, final String pValue)
{
this.number.set(pNumber);
this.time.set(pTime);
this.positionen.set(pPositionen);
this.status.set(pStatus);
this.value.set(pValue);
}
public IntegerProperty numberProperty()
{
return number;
}
public StringProperty timeProperty()
{
return time;
}
public StringProperty positionProperty()
{
return positionen;
}
public StringProperty statusProperty()
{
return status;
}
public StringProperty valueProperty()
{
return value;
}
public Integer getNumber()
{
return numberProperty().get();
}
public String getTime()
{
return timeProperty().get();
}
public String getPosition()
{
return positionProperty().get();
}
public String getStatus()
{
return statusProperty().get();
}
public String getValue()
{
return valueProperty().get();
}
public final void setNumber(int pNumber)
{
numberProperty().set(pNumber);
}
public final void setTime(String pTime)
{
timeProperty().set(pTime);
}
public final void setPosition(String pPosition)
{
positionProperty().set(pPosition);
}
public final void setStatus(String pStatus)
{
statusProperty().set(pStatus);
}
public final void setValue(String pValue)
{
valueProperty().set(pValue);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 B