add clear all positions in order draft
This commit is contained in:
@ -211,6 +211,9 @@ public class MainWindowController {
|
||||
@FXML
|
||||
public Button btnDeleteSelectedPosition;
|
||||
|
||||
@FXML
|
||||
public Button btnDeleteAllPositions;
|
||||
|
||||
@FXML
|
||||
public Button btnPrintBill;
|
||||
|
||||
@ -581,6 +584,7 @@ public class MainWindowController {
|
||||
isPrintBtnDisabled = true;
|
||||
tapPosEdit.setDisable(false);
|
||||
btnDeleteSelectedPosition.setDisable(true);
|
||||
btnDeleteAllPositions.setDisable(true);
|
||||
}
|
||||
|
||||
if (!currentJob.existsPosName(currentOrderPosName)) {
|
||||
@ -588,6 +592,21 @@ public class MainWindowController {
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void btnDeleteAllPositionsAction(ActionEvent event) {
|
||||
// Clear all positions from current job
|
||||
rootCurrentJob.getChildren().remove(0, rootCurrentJob.getChildren().size());
|
||||
currentJob.clearAllPositions();
|
||||
|
||||
// Reset UI state
|
||||
setJobPrizeLabel(0);
|
||||
btnPrintBill.setDisable(true);
|
||||
isPrintBtnDisabled = true;
|
||||
tapPosEdit.setDisable(false);
|
||||
btnDeleteSelectedPosition.setDisable(true);
|
||||
btnDeleteAllPositions.setDisable(true);
|
||||
}
|
||||
|
||||
@FXML
|
||||
public void btnPrintBillAction(ActionEvent event) {
|
||||
btnPrintBill.setDisable(true);
|
||||
@ -783,6 +802,7 @@ public class MainWindowController {
|
||||
btnReprintJob.setDisable(true);
|
||||
btnCancelJob.setDisable(true);
|
||||
btnDeleteSelectedPosition.setDisable(true);
|
||||
btnDeleteAllPositions.setDisable(true);
|
||||
tapJobs.setDisable(true);
|
||||
btnOpenFolder.setFocusTraversable(false);
|
||||
ueberbtn.setFocusTraversable(false);
|
||||
@ -1077,12 +1097,14 @@ public class MainWindowController {
|
||||
// Print was not disabled and will be enabled again
|
||||
btnPrintBill.setDisable(pState);
|
||||
btnDeleteSelectedPosition.setDisable(pState);
|
||||
btnDeleteAllPositions.setDisable(pState);
|
||||
}
|
||||
|
||||
if (pState) {
|
||||
// Always disable
|
||||
btnPrintBill.setDisable(pState);
|
||||
btnDeleteSelectedPosition.setDisable(pState);
|
||||
btnDeleteAllPositions.setDisable(pState);
|
||||
}
|
||||
|
||||
btnReprintJob.setDisable(pState);
|
||||
@ -1209,6 +1231,7 @@ public class MainWindowController {
|
||||
btnPrintBill.setDisable(false);
|
||||
isPrintBtnDisabled = false;
|
||||
tapPosEdit.setDisable(true);
|
||||
btnDeleteAllPositions.setDisable(false);
|
||||
|
||||
rootCurrentJob.getChildren().remove(0, rootCurrentJob.getChildren().size());
|
||||
|
||||
|
||||
@ -161,6 +161,14 @@ public class Job {
|
||||
|
||||
}
|
||||
|
||||
public void clearAllPositions() {
|
||||
positionenQuantity.clear();
|
||||
positionenName.clear();
|
||||
positionenValue.clear();
|
||||
positionenCat.clear();
|
||||
jobvalue = 0;
|
||||
}
|
||||
|
||||
public boolean existsPosName(String pPosName) {
|
||||
for (int i = 0; i < positionenName.size(); i++) {
|
||||
if (positionenName.get(i).equals(pPosName)) {
|
||||
|
||||
@ -511,7 +511,12 @@
|
||||
<Font name="Cantarell Bold" size="48.0"/>
|
||||
</font>
|
||||
</Button>
|
||||
<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">
|
||||
<Button fx:id="btnDeleteSelectedPosition" layoutX="43.0" layoutY="438.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>
|
||||
<Button fx:id="btnDeleteAllPositions" layoutX="43.0" layoutY="473.0" mnemonicParsing="false" onAction="#btnDeleteAllPositionsAction" prefHeight="17.0" prefWidth="332.0" text="Alle Positionen löschen" textAlignment="CENTER">
|
||||
<font>
|
||||
<Font name="Cantarell Regular" size="20.0"/>
|
||||
</font>
|
||||
|
||||
Reference in New Issue
Block a user