Browse Source

ui fixes and bill layout improvements

localhorst 4 days ago
parent
commit
5c9d54dabf

+ 1
- 1
pom.xml View File

@@ -4,7 +4,7 @@
4 4
 	<modelVersion>4.0.0</modelVersion>
5 5
 	<groupId>com</groupId>
6 6
 	<artifactId>jFxKasse</artifactId>
7
-	<version>0.3.0</version>
7
+	<version>0.3.1</version>
8 8
 	<name>jFxKasse</name>
9 9
 
10 10
 	<dependencies>

+ 10
- 8
src/main/java/com/jFxKasse/controller/MainWindowController.java View File

@@ -378,7 +378,7 @@ public class MainWindowController
378 378
 		// creates a dialog
379 379
 		Dialog<Pair<String, String>> dialog = new Dialog<>();
380 380
 		dialog.setTitle("Über jFxKasse");
381
-		dialog.setHeaderText("Informationen und Lizenzen - Version 0.3.0");
381
+		dialog.setHeaderText("Informationen und Lizenzen - Version 0.3.1");
382 382
 
383 383
 		dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK);
384 384
 
@@ -398,8 +398,8 @@ public class MainWindowController
398 398
 						+ " \n(c) 2018 Hendrik Schutter"),
399 399
 				0, 0);
400 400
 
401
-		dialog.getDialogPane().setContent(grid); // Setzt die GridPane auf die
402
-		dialog.setResizable(true); // DialogPane
401
+		dialog.getDialogPane().setContent(grid);
402
+		dialog.setResizable(true);
403 403
 		dialog.showAndWait();
404 404
 	}
405 405
 
@@ -837,8 +837,11 @@ public class MainWindowController
837 837
 					public void changed(ObservableValue<? extends Number> ov,
838 838
 							Number value, Number new_value)
839 839
 					{
840
-						selectedCatName = catChoise.getItems().get((int) new_value)
841
-								.toString();
840
+						try {
841
+							selectedCatName = catChoise.getItems().get((int) new_value)
842
+									.toString();
843
+						} catch (Exception e) {
844
+						}
842 845
 					}
843 846
 				});
844 847
 
@@ -964,9 +967,8 @@ public class MainWindowController
964 967
 						int selected = entryTreeTable.getSelectionModel()
965 968
 								.getSelectedIndex(); // get selected item
966 969
 
967
-						idPositionen = columnPosnumber.getCellData(selected);
968 970
 						try {
969
-
971
+							idPositionen = columnPosnumber.getCellData(selected);
970 972
 							tftNewPosition
971 973
 									.setText(dbc.getName_Positionen(idPositionen));
972 974
 							tftNewValue.setText(dbc.getValue_Positionen(idPositionen));
@@ -978,7 +980,7 @@ public class MainWindowController
978 980
 
979 981
 						} catch (Exception e) {
980 982
 							// TODO Auto-generated catch block
981
-							e.printStackTrace();
983
+							// e.printStackTrace();
982 984
 						}
983 985
 					}
984 986
 				});

+ 3
- 0
src/main/java/com/jFxKasse/datatypes/Job.java View File

@@ -1,5 +1,6 @@
1 1
 package com.jFxKasse.datatypes;
2 2
 
3
+import java.math.BigDecimal;
3 4
 import java.util.ArrayList;
4 5
 
5 6
 public class Job
@@ -109,6 +110,8 @@ public class Job
109 110
 			jobvalue = jobvalue
110 111
 					+ (positionenQuantity.get(i) * positionenValue.get(i));
111 112
 		}
113
+		//Round to two decimals
114
+		jobvalue =  BigDecimal.valueOf(jobvalue).setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
112 115
 	}
113 116
 
114 117
 	public String createPosQuantityDBString()

+ 1
- 1
src/main/java/com/jFxKasse/datatypes/PrintDataSimple.java View File

@@ -35,7 +35,7 @@ public class PrintDataSimple extends PrintData
35 35
 	protected void generatePrintString()
36 36
 	{
37 37
 		/* Header */
38
-		String header = "\n";
38
+		String header = " ";
39 39
 		for (int i = 1; i < headerSpace; i++) {
40 40
 			header = header + "\n";
41 41
 		}

+ 2
- 2
src/main/java/com/jFxKasse/datatypes/PrintDataSplitted.java View File

@@ -43,7 +43,7 @@ public class PrintDataSplitted extends PrintData
43 43
 		String firstBill;
44 44
 
45 45
 		/* Header */
46
-		String header = "\n";
46
+		String header = "-";
47 47
 		for (int i = 1; i < headerSpace; i++) {
48 48
 			header = header + "\n";
49 49
 		}
@@ -107,7 +107,7 @@ public class PrintDataSplitted extends PrintData
107 107
 			String thisBill;
108 108
 
109 109
 			/* Header */
110
-			header = "\n";
110
+			header = " ";
111 111
 			for (int o = 1; o < headerSpace; o++) {
112 112
 				header = header + "\n";
113 113
 			}

+ 7
- 7
src/main/resources/fxml/MainWindow.fxml View File

@@ -131,7 +131,7 @@
131 131
                            <content>
132 132
                               <AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="327.0" prefWidth="564.0">
133 133
                                  <children>
134
-                                    <ChoiceBox fx:id="printerChoise" layoutX="270.0" layoutY="10.0" prefHeight="25.0" prefWidth="178.0" />
134
+                                    <ChoiceBox fx:id="printerChoise" layoutX="270.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="178.0" />
135 135
                                     <Spinner fx:id="linesSpinner" layoutX="35.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="92.0" />
136 136
                                     <JFXTextField fx:id="tftheader" alignment="CENTER" layoutX="65.0" layoutY="90.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="377.0">
137 137
                                        <font>
@@ -247,13 +247,13 @@
247 247
 														<Font name="Cantarell Regular" size="18.0" />
248 248
 													</font>
249 249
 												</Label>
250
-												<ChoiceBox fx:id="colorChoise" layoutX="340.0" layoutY="90.0" prefHeight="25.0" prefWidth="169.0" />
250
+												<ChoiceBox fx:id="colorChoise" layoutX="340.0" layoutY="90.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="169.0" />
251 251
 												<Label fx:id="labelSelectCat" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="185.0" layoutY="10.0" prefHeight="34.0" prefWidth="105.0" text="Kategorie:">
252 252
 													<font>
253 253
 														<Font name="Cantarell Regular" size="18.0" />
254 254
 													</font>
255 255
 												</Label>
256
-												<ChoiceBox fx:id="catChoise" layoutX="16.0" layoutY="10.0" prefHeight="25.0" prefWidth="180.0" />
256
+												<ChoiceBox fx:id="catChoise" layoutX="16.0" layoutY="10.0" nodeOrientation="LEFT_TO_RIGHT" prefHeight="25.0" prefWidth="180.0" />
257 257
             								<Button fx:id="btnSaveEntry" layoutX="23.0" layoutY="86.0" mnemonicParsing="false" onAction="#btnSaveEntryAction" text="Ausgewählten Eintrag speichern">
258 258
             									<font>
259 259
             										<Font name="Cantarell Regular" size="17.0" />
@@ -279,11 +279,11 @@
279 279
 										<Label text="" />
280 280
 									</placeholder>
281 281
 									<columns>
282
-										<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="85.0" resizable="false" text="Nummer" />
283
-										<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="160.0" resizable="false" text="Zeit" />
282
+										<TreeTableColumn fx:id="columnJobNumber" editable="false" maxWidth="3000.0" prefWidth="85.0" resizable="false" sortable="false" text="Nummer" />
283
+										<TreeTableColumn fx:id="columnTime" editable="false" prefWidth="160.0" resizable="false" sortable="false" text="Zeit" />
284 284
 										<TreeTableColumn fx:id="columnPositions" editable="false" prefWidth="856.0" resizable="false" sortable="false" text="Positionen" />
285
-										<TreeTableColumn fx:id="columnState" editable="false" prefWidth="116.0" resizable="false" text="Zustand" />
286
-										<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="103.0" resizable="false" text="Betrag" />
285
+										<TreeTableColumn fx:id="columnState" editable="false" prefWidth="116.0" resizable="false" sortable="false" text="Zustand" />
286
+										<TreeTableColumn fx:id="columnJobValue" editable="false" prefWidth="103.0" resizable="false" sortable="false" text="Betrag" />
287 287
 									</columns>
288 288
 								</TreeTableView>
289 289
 								<Button fx:id="btnReprintJob" layoutX="378.0" layoutY="603.0" mnemonicParsing="false" onAction="#btnReprintJobAction" text="Ausgewählter Auftrag drucken">

Loading…
Cancel
Save