|
|
|
|
@ -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,
|
|
|
|
|
@ -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) {
|
|
|
|
|
|