|
|
|
@ -26,8 +26,6 @@ import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.ResourceBundle;
|
|
|
|
import java.util.ResourceBundle;
|
|
|
|
import java.util.logging.Level;
|
|
|
|
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
|
|
|
|
import javafx.application.Platform;
|
|
|
|
import javafx.application.Platform;
|
|
|
|
import javafx.beans.property.ReadOnlyObjectWrapper;
|
|
|
|
import javafx.beans.property.ReadOnlyObjectWrapper;
|
|
|
|
import javafx.collections.FXCollections;
|
|
|
|
import javafx.collections.FXCollections;
|
|
|
|
@ -36,6 +34,8 @@ import javafx.fxml.FXML;
|
|
|
|
import javafx.fxml.Initializable;
|
|
|
|
import javafx.fxml.Initializable;
|
|
|
|
import javafx.scene.control.Alert;
|
|
|
|
import javafx.scene.control.Alert;
|
|
|
|
import javafx.scene.control.Button;
|
|
|
|
import javafx.scene.control.Button;
|
|
|
|
|
|
|
|
import javafx.scene.control.ButtonBar;
|
|
|
|
|
|
|
|
import javafx.scene.control.ButtonType;
|
|
|
|
import javafx.scene.control.ComboBox;
|
|
|
|
import javafx.scene.control.ComboBox;
|
|
|
|
import javafx.scene.control.Label;
|
|
|
|
import javafx.scene.control.Label;
|
|
|
|
import javafx.scene.control.TableColumn;
|
|
|
|
import javafx.scene.control.TableColumn;
|
|
|
|
@ -145,12 +145,13 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
setTanggal();
|
|
|
|
setTanggal();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void initShortcuts() {
|
|
|
|
private void initShortcuts() {
|
|
|
|
Map<KeyCombination, Runnable> listShortcuts = new HashMap<>();
|
|
|
|
Map<KeyCombination, Runnable> listShortcuts = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
|
|
KeyCombination kcTundaNota = new KeyCodeCombination(KeyCode.T, KeyCombination.CONTROL_DOWN);
|
|
|
|
KeyCombination kcTundaNota = new KeyCodeCombination(KeyCode.T, KeyCombination.CONTROL_DOWN);
|
|
|
|
Runnable rnTundaNota = () -> {
|
|
|
|
Runnable rnTundaNota = () -> {
|
|
|
|
List<DNotaTunai> daftarDNotaTunai = new ArrayList<>();
|
|
|
|
List<DNotaTunai> daftarDNotaTunai = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
if (noNota != null && !noNota.equals("")) {
|
|
|
|
if (noNota != null && !noNota.equals("")) {
|
|
|
|
for (TabelBarangTunai tbt : daftarTabelTransaksi) {
|
|
|
|
for (TabelBarangTunai tbt : daftarTabelTransaksi) {
|
|
|
|
tbt.getData().setNoNota(noNota);
|
|
|
|
tbt.getData().setNoNota(noNota);
|
|
|
|
@ -195,9 +196,7 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
listShortcuts.put(kcTundaNota, rnTundaNota);
|
|
|
|
listShortcuts.put(kcTundaNota, rnTundaNota);
|
|
|
|
|
|
|
|
|
|
|
|
Platform.runLater(() -> {
|
|
|
|
|
|
|
|
apMain.getScene().getAccelerators().putAll(listShortcuts);
|
|
|
|
apMain.getScene().getAccelerators().putAll(listShortcuts);
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setTanggal() {
|
|
|
|
public void setTanggal() {
|
|
|
|
@ -434,9 +433,6 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.show();
|
|
|
|
alert.show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
Logger.getLogger(FormTransaksiTunaiController.class.getName()).log(Level.SEVERE, null, error);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
@ -478,9 +474,6 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.show();
|
|
|
|
alert.show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
Logger.getLogger(FormTransaksiTunaiController.class.getName()).log(Level.SEVERE, null, error);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
@ -530,9 +523,6 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.show();
|
|
|
|
alert.show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
Logger.getLogger(FormTransaksiTunaiController.class.getName()).log(Level.SEVERE, null, error);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
@ -568,9 +558,6 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.initOwner(apMain.getScene().getWindow());
|
|
|
|
alert.show();
|
|
|
|
alert.show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
Logger.getLogger(FormTransaksiTunaiController.class.getName()).log(Level.SEVERE, null, error);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
AmigoPosRx.handleGenericError(error, apMain.getScene().getWindow());
|
|
|
|
@ -639,14 +626,12 @@ public class FormTransaksiTunaiController implements Initializable {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void onComplete() {
|
|
|
|
public void onComplete() {
|
|
|
|
Platform.runLater(() -> {
|
|
|
|
|
|
|
|
if (parent != null) {
|
|
|
|
if (parent != null) {
|
|
|
|
parent.notaContent.setControllerTunai(null);
|
|
|
|
parent.notaContent.setControllerTunai(null);
|
|
|
|
parent.notaContent.setNodeTunai(null);
|
|
|
|
parent.notaContent.setNodeTunai(null);
|
|
|
|
|
|
|
|
|
|
|
|
parent.removeNota(parent.notaContent.getBtnTunai());
|
|
|
|
parent.removeNota(parent.notaContent.getBtnTunai());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|