| @@ -15,7 +15,6 @@ import id.amigogroup.posterminal.transaksi.FormTransaksiTunaiController; | |||
| import id.amigogroup.posterminal.util.AlertUtil; | |||
| import id.amigogroup.posterminal.util.Fucout; | |||
| import io.reactivex.Observable; | |||
| import static io.reactivex.Observable.error; | |||
| import io.reactivex.Observer; | |||
| import io.reactivex.disposables.Disposable; | |||
| import java.io.IOException; | |||
| @@ -41,10 +40,12 @@ import javafx.scene.control.Alert; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.Label; | |||
| import javafx.scene.control.ScrollPane; | |||
| import javafx.scene.control.TextField; | |||
| import javafx.scene.image.Image; | |||
| import javafx.scene.input.KeyCode; | |||
| import javafx.scene.input.KeyCodeCombination; | |||
| import javafx.scene.input.KeyCombination; | |||
| import javafx.scene.input.KeyEvent; | |||
| import javafx.scene.layout.BorderPane; | |||
| import javafx.scene.layout.VBox; | |||
| import javafx.stage.Stage; | |||
| @@ -76,6 +77,8 @@ public class FormUtamaController implements Initializable { | |||
| private Label lblTglLahirPelanggan; | |||
| @FXML | |||
| private Label lblNoTelpPelanggan; | |||
| @FXML | |||
| private TextField tfScanMember; | |||
| private final FormFactory formFactory = new FormFactory(); | |||
| @@ -86,13 +89,13 @@ public class FormUtamaController implements Initializable { | |||
| private final char NOTA_PREV = 'p'; | |||
| private final char NOTA_NEXT = 'n'; | |||
| private Observable<Pelanggan> pelangganObs; | |||
| AmigoPosRx posRx = new AmigoPosRx(); | |||
| /** | |||
| * Initializes the controller class. | |||
| */ | |||
| @Override | |||
| public void initialize(URL url, ResourceBundle rb) { | |||
| AmigoPosRx posRx = new AmigoPosRx(); | |||
| //Kode Nur Indah Suciati (00334), Kode Wuryaningsih/RT (010004) | |||
| updateLabelMemberNonMember(); | |||
| @@ -384,8 +387,7 @@ public class FormUtamaController implements Initializable { | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } | |||
| else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Bon")) { | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Bon")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_BON, | |||
| @@ -393,8 +395,7 @@ public class FormUtamaController implements Initializable { | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } | |||
| else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Bawa Dulu")) { | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Bawa Dulu")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_BAWA, | |||
| @@ -402,8 +403,7 @@ public class FormUtamaController implements Initializable { | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } | |||
| else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Retur")) { | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Retur")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_RETUR, | |||
| @@ -411,7 +411,7 @@ public class FormUtamaController implements Initializable { | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } else if(hasilReturn.isPresent() && hasilReturn.get().contains("Checkout:")){ | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().contains("Checkout:")) { | |||
| Button buttonBaru = generateButtonNota(hasilReturn.get().substring(9), | |||
| FormConstanta.TRANSAKSI_TUNAI, | |||
| Fucout.TIPE_NOTA_TUNAI); | |||
| @@ -421,6 +421,14 @@ public class FormUtamaController implements Initializable { | |||
| } | |||
| } | |||
| //scan member | |||
| @FXML | |||
| void scanMemberOnPressed(KeyEvent event) { | |||
| if (event.getCode() == KeyCode.ENTER) { | |||
| posRx.getPelangganByKodeMember(tfScanMember.getText()).subscribe(pelangganObserver); | |||
| } | |||
| } | |||
| Observer<Pelanggan> pelangganObserver = new Observer<Pelanggan>() { | |||
| @Override | |||
| public void onSubscribe(Disposable dspsbl) { | |||
| @@ -41,7 +41,7 @@ public class DialogTambahNotaController extends Dialog<String> implements Initia | |||
| @FXML | |||
| private RadioButton rbAmbilDariCheckout; | |||
| @FXML | |||
| private TextField txtFieldAmbilDariCheckout; | |||
| private TextField tfAmbilDariCheckout; | |||
| public static final ButtonType btnLanjutkan = new ButtonType("Lanjutkan"); | |||
| public static final ButtonType btnBatal = new ButtonType("Batal"); | |||
| @@ -76,7 +76,7 @@ public class DialogTambahNotaController extends Dialog<String> implements Initia | |||
| if (((RadioButton) tgTipe.getSelectedToggle()) == rbBaru) { | |||
| return "Baru:" + cbxPilihNota.getValue(); | |||
| } else if (((RadioButton) tgTipe.getSelectedToggle()) == rbAmbilDariCheckout) { | |||
| return "Checkout:" + txtFieldAmbilDariCheckout.getText(); | |||
| return "Checkout:" + tfAmbilDariCheckout.getText(); | |||
| } | |||
| //baru, balikin tipe yang dipilih | |||
| //dari checkout, balikin isi nomor nota (hanya jika nota ditemukan) | |||
| @@ -92,19 +92,12 @@ public class DialogTambahNotaController extends Dialog<String> implements Initia | |||
| @FXML | |||
| void rbNotaBaruOnAction(ActionEvent event) { | |||
| cbxPilihNota.setDisable(false); | |||
| txtFieldAmbilDariCheckout.setDisable(true); | |||
| // Button buttonBaru FormConstanta= generateButtonNota("10-0220-0000X", | |||
| // FormConstanta.TRANSAKSI_TUNAI, | |||
| // Fucout.TIPE_NOTA_TUNAI); | |||
| // navigasi.add(buttonBaru); | |||
| // vbNavigasi.getChildren().add(buttonBaru); | |||
| // jumlahNota++; | |||
| tfAmbilDariCheckout.setDisable(true); | |||
| } | |||
| @FXML | |||
| void rbAmbilDariCheckoutOnAction(ActionEvent event) { | |||
| cbxPilihNota.setDisable(true); | |||
| txtFieldAmbilDariCheckout.setDisable(false); | |||
| tfAmbilDariCheckout.setDisable(false); | |||
| } | |||
| } | |||
| @@ -21,6 +21,6 @@ | |||
| </toggleGroup></RadioButton> | |||
| <RadioButton fx:id="rbAmbilDariCheckout" layoutX="4.0" layoutY="90.0" mnemonicParsing="false" onAction="#rbAmbilDariCheckoutOnAction" text="Ambil dari checkout" toggleGroup="$tgTipe" AnchorPane.leftAnchor="4.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="90.0" /> | |||
| <ComboBox fx:id="cbxPilihNota" layoutX="4.0" layoutY="52.0" prefWidth="150.0" promptText="Pilih nota" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="52.0" /> | |||
| <TextField fx:id="txtFieldAmbilDariCheckout" disable="true" layoutX="4.0" layoutY="112.0" AnchorPane.leftAnchor="4.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="112.0" /> | |||
| <TextField fx:id="tfAmbilDariCheckout" disable="true" layoutX="4.0" layoutY="112.0" AnchorPane.leftAnchor="4.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="112.0" /> | |||
| </children> | |||
| </AnchorPane> | |||
| @@ -6,6 +6,7 @@ | |||
| <?import javafx.scene.control.ScrollPane?> | |||
| <?import javafx.scene.control.Separator?> | |||
| <?import javafx.scene.control.SplitPane?> | |||
| <?import javafx.scene.control.TextField?> | |||
| <?import javafx.scene.image.Image?> | |||
| <?import javafx.scene.image.ImageView?> | |||
| <?import javafx.scene.layout.AnchorPane?> | |||
| @@ -123,12 +124,13 @@ | |||
| </ImageView> | |||
| </children> | |||
| </HBox> | |||
| <Label fx:id="lblMemberNonMember" layoutX="14.0" layoutY="85.0" text="Member / Non Member" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="85.0"> | |||
| <TextField fx:id="tfScanMember" alignment="TOP_CENTER" layoutX="4.0" layoutY="89.0" onKeyPressed="#scanMemberOnPressed" promptText="Scan Member" AnchorPane.leftAnchor="4.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="89.0" /> | |||
| <Label fx:id="lblMemberNonMember" layoutX="14.0" layoutY="128.0" text="Member / Non Member" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="128.0"> | |||
| <font> | |||
| <Font name="System Bold" size="12.0" /> | |||
| </font> | |||
| </Label> | |||
| <GridPane layoutX="14.0" layoutY="102.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="102.0"> | |||
| <GridPane layoutX="14.0" layoutY="145.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="145.0"> | |||
| <columnConstraints> | |||
| <ColumnConstraints prefWidth="60.0" /> | |||
| <ColumnConstraints hgrow="ALWAYS" maxWidth="1.7976931348623157E308" /> | |||