|
|
@@ -15,7 +15,6 @@ import id.amigogroup.posterminal.transaksi.FormTransaksiTunaiController; |
|
|
import id.amigogroup.posterminal.util.AlertUtil; |
|
|
import id.amigogroup.posterminal.util.AlertUtil; |
|
|
import id.amigogroup.posterminal.util.Fucout; |
|
|
import id.amigogroup.posterminal.util.Fucout; |
|
|
import io.reactivex.Observable; |
|
|
import io.reactivex.Observable; |
|
|
import static io.reactivex.Observable.error; |
|
|
|
|
|
import io.reactivex.Observer; |
|
|
import io.reactivex.Observer; |
|
|
import io.reactivex.disposables.Disposable; |
|
|
import io.reactivex.disposables.Disposable; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
@@ -41,10 +40,12 @@ import javafx.scene.control.Alert; |
|
|
import javafx.scene.control.Button; |
|
|
import javafx.scene.control.Button; |
|
|
import javafx.scene.control.Label; |
|
|
import javafx.scene.control.Label; |
|
|
import javafx.scene.control.ScrollPane; |
|
|
import javafx.scene.control.ScrollPane; |
|
|
|
|
|
import javafx.scene.control.TextField; |
|
|
import javafx.scene.image.Image; |
|
|
import javafx.scene.image.Image; |
|
|
import javafx.scene.input.KeyCode; |
|
|
import javafx.scene.input.KeyCode; |
|
|
import javafx.scene.input.KeyCodeCombination; |
|
|
import javafx.scene.input.KeyCodeCombination; |
|
|
import javafx.scene.input.KeyCombination; |
|
|
import javafx.scene.input.KeyCombination; |
|
|
|
|
|
import javafx.scene.input.KeyEvent; |
|
|
import javafx.scene.layout.BorderPane; |
|
|
import javafx.scene.layout.BorderPane; |
|
|
import javafx.scene.layout.VBox; |
|
|
import javafx.scene.layout.VBox; |
|
|
import javafx.stage.Stage; |
|
|
import javafx.stage.Stage; |
|
|
@@ -76,6 +77,8 @@ public class FormUtamaController implements Initializable { |
|
|
private Label lblTglLahirPelanggan; |
|
|
private Label lblTglLahirPelanggan; |
|
|
@FXML |
|
|
@FXML |
|
|
private Label lblNoTelpPelanggan; |
|
|
private Label lblNoTelpPelanggan; |
|
|
|
|
|
@FXML |
|
|
|
|
|
private TextField tfScanMember; |
|
|
|
|
|
|
|
|
private final FormFactory formFactory = new FormFactory(); |
|
|
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_PREV = 'p'; |
|
|
private final char NOTA_NEXT = 'n'; |
|
|
private final char NOTA_NEXT = 'n'; |
|
|
private Observable<Pelanggan> pelangganObs; |
|
|
private Observable<Pelanggan> pelangganObs; |
|
|
|
|
|
AmigoPosRx posRx = new AmigoPosRx(); |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Initializes the controller class. |
|
|
* Initializes the controller class. |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public void initialize(URL url, ResourceBundle rb) { |
|
|
public void initialize(URL url, ResourceBundle rb) { |
|
|
AmigoPosRx posRx = new AmigoPosRx(); |
|
|
|
|
|
//Kode Nur Indah Suciati (00334), Kode Wuryaningsih/RT (010004) |
|
|
//Kode Nur Indah Suciati (00334), Kode Wuryaningsih/RT (010004) |
|
|
updateLabelMemberNonMember(); |
|
|
updateLabelMemberNonMember(); |
|
|
|
|
|
|
|
|
@@ -384,8 +387,7 @@ public class FormUtamaController implements Initializable { |
|
|
navigasi.add(buttonBaru); |
|
|
navigasi.add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
jumlahNota++; |
|
|
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", |
|
|
Button buttonBaru = generateButtonNota("10-0220-0000X", |
|
|
FormConstanta.TRANSAKSI_BON, |
|
|
FormConstanta.TRANSAKSI_BON, |
|
|
@@ -393,8 +395,7 @@ public class FormUtamaController implements Initializable { |
|
|
navigasi.add(buttonBaru); |
|
|
navigasi.add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
jumlahNota++; |
|
|
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", |
|
|
Button buttonBaru = generateButtonNota("10-0220-0000X", |
|
|
FormConstanta.TRANSAKSI_BAWA, |
|
|
FormConstanta.TRANSAKSI_BAWA, |
|
|
@@ -402,8 +403,7 @@ public class FormUtamaController implements Initializable { |
|
|
navigasi.add(buttonBaru); |
|
|
navigasi.add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
jumlahNota++; |
|
|
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", |
|
|
Button buttonBaru = generateButtonNota("10-0220-0000X", |
|
|
FormConstanta.TRANSAKSI_RETUR, |
|
|
FormConstanta.TRANSAKSI_RETUR, |
|
|
@@ -411,7 +411,7 @@ public class FormUtamaController implements Initializable { |
|
|
navigasi.add(buttonBaru); |
|
|
navigasi.add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
vbNavigasi.getChildren().add(buttonBaru); |
|
|
jumlahNota++; |
|
|
jumlahNota++; |
|
|
} else if(hasilReturn.isPresent() && hasilReturn.get().contains("Checkout:")){ |
|
|
|
|
|
|
|
|
} else if (hasilReturn.isPresent() && hasilReturn.get().contains("Checkout:")) { |
|
|
Button buttonBaru = generateButtonNota(hasilReturn.get().substring(9), |
|
|
Button buttonBaru = generateButtonNota(hasilReturn.get().substring(9), |
|
|
FormConstanta.TRANSAKSI_TUNAI, |
|
|
FormConstanta.TRANSAKSI_TUNAI, |
|
|
Fucout.TIPE_NOTA_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>() { |
|
|
Observer<Pelanggan> pelangganObserver = new Observer<Pelanggan>() { |
|
|
@Override |
|
|
@Override |
|
|
public void onSubscribe(Disposable dspsbl) { |
|
|
public void onSubscribe(Disposable dspsbl) { |
|
|
|