|
|
|
@ -8,6 +8,7 @@ package id.amigogroup.posterminal.bayar;
|
|
|
|
import id.amigogroup.posterminal.FormUtamaController;
|
|
|
|
import id.amigogroup.posterminal.FormUtamaController;
|
|
|
|
import id.amigogroup.posterminal.pencarian.DialogCetakNotaController;
|
|
|
|
import id.amigogroup.posterminal.pencarian.DialogCetakNotaController;
|
|
|
|
import id.amigogroup.posterminal.transaksi.TabelBarangRetur;
|
|
|
|
import id.amigogroup.posterminal.transaksi.TabelBarangRetur;
|
|
|
|
|
|
|
|
import id.amigogroup.posterminal.util.AlertUtil;
|
|
|
|
import id.amigogroup.posterminal.util.Fucout;
|
|
|
|
import id.amigogroup.posterminal.util.Fucout;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.net.URL;
|
|
|
|
import java.net.URL;
|
|
|
|
@ -25,6 +26,7 @@ import javafx.fxml.FXML;
|
|
|
|
import javafx.fxml.FXMLLoader;
|
|
|
|
import javafx.fxml.FXMLLoader;
|
|
|
|
import javafx.fxml.Initializable;
|
|
|
|
import javafx.fxml.Initializable;
|
|
|
|
import javafx.scene.Node;
|
|
|
|
import javafx.scene.Node;
|
|
|
|
|
|
|
|
import javafx.scene.control.Alert;
|
|
|
|
import javafx.scene.control.CheckBox;
|
|
|
|
import javafx.scene.control.CheckBox;
|
|
|
|
import javafx.scene.control.Label;
|
|
|
|
import javafx.scene.control.Label;
|
|
|
|
import javafx.scene.input.KeyCode;
|
|
|
|
import javafx.scene.input.KeyCode;
|
|
|
|
@ -99,8 +101,8 @@ public class FormBayarController implements Initializable, BayarInterface {
|
|
|
|
if (parent.notaContent.getControllerRetur() != null
|
|
|
|
if (parent.notaContent.getControllerRetur() != null
|
|
|
|
&& parent.notaContent.getControllerRetur().tipeRetur.equals(
|
|
|
|
&& parent.notaContent.getControllerRetur().tipeRetur.equals(
|
|
|
|
Fucout.TEKS_TIPE_NOTA_TUNAI)) {
|
|
|
|
Fucout.TEKS_TIPE_NOTA_TUNAI)) {
|
|
|
|
for(TabelBarangRetur tbr : parent.notaContent.getControllerRetur().daftarTabelRetur){
|
|
|
|
for (TabelBarangRetur tbr : parent.notaContent.getControllerRetur().daftarTabelRetur) {
|
|
|
|
switch(tbr.getData().getNoNotaTunai().charAt(0)){
|
|
|
|
switch (tbr.getData().getNoNotaTunai().charAt(0)) {
|
|
|
|
case Fucout.KODE_NOTA_BON:
|
|
|
|
case Fucout.KODE_NOTA_BON:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
@ -125,21 +127,37 @@ public class FormBayarController implements Initializable, BayarInterface {
|
|
|
|
DialogCetakNotaController dialogCetakNotaController = new DialogCetakNotaController();
|
|
|
|
DialogCetakNotaController dialogCetakNotaController = new DialogCetakNotaController();
|
|
|
|
dialogCetakNotaController.initOwner(apContent.getScene().getWindow());
|
|
|
|
dialogCetakNotaController.initOwner(apContent.getScene().getWindow());
|
|
|
|
dialogCetakNotaController.initData(
|
|
|
|
dialogCetakNotaController.initData(
|
|
|
|
parent.notaContent.getControllerTunai() != null ?
|
|
|
|
parent.notaContent.getControllerTunai() != null
|
|
|
|
parent.notaContent.getControllerTunai().daftarTabelTransaksi : null,
|
|
|
|
? parent.notaContent.getControllerTunai().daftarTabelTransaksi : null,
|
|
|
|
parent.notaContent.getControllerRetur() != null ?
|
|
|
|
parent.notaContent.getControllerRetur() != null
|
|
|
|
parent.notaContent.getControllerRetur().daftarTabelRetur : null,
|
|
|
|
? parent.notaContent.getControllerRetur().daftarTabelRetur : null,
|
|
|
|
this);
|
|
|
|
this);
|
|
|
|
Optional<String> result = dialogCetakNotaController.showAndWait();
|
|
|
|
Optional<String> result = dialogCetakNotaController.showAndWait();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
DialogSelesaiBayarTidakLunasController dsbtlc
|
|
|
|
//Jika ingin menampilkan dialog belum selesai bayar
|
|
|
|
= new DialogSelesaiBayarTidakLunasController(this,
|
|
|
|
// DialogSelesaiBayarTidakLunasController dsbtlc
|
|
|
|
bayarContent.getTotalPerluBayar()
|
|
|
|
// = new DialogSelesaiBayarTidakLunasController(this,
|
|
|
|
- bayarContent.getTotalBayar());
|
|
|
|
// bayarContent.getTotalPerluBayar()
|
|
|
|
dsbtlc.initData(parent);
|
|
|
|
// - bayarContent.getTotalBayar());
|
|
|
|
dsbtlc.initOwner(apContent.getScene().getWindow());
|
|
|
|
// dsbtlc.initData(parent);
|
|
|
|
dsbtlc.show();
|
|
|
|
// dsbtlc.initOwner(apContent.getScene().getWindow());
|
|
|
|
|
|
|
|
// dsbtlc.show();
|
|
|
|
|
|
|
|
//Pengecekan pilih jenis pembayaran
|
|
|
|
|
|
|
|
if (chkTunai.isSelected() || chkRetur.isSelected() || chkPromo.isSelected()
|
|
|
|
|
|
|
|
|| chkPoin.isSelected() || chkOvo.isSelected() || chkKartu.isSelected()
|
|
|
|
|
|
|
|
|| chkGopay.isSelected()) {
|
|
|
|
|
|
|
|
//Menampilkan notifikasi jika pembayaran kurang
|
|
|
|
|
|
|
|
Alert alert = AlertUtil.getAlertWarning(
|
|
|
|
|
|
|
|
AlertUtil.DIALOG_UANG_BELUM_CUKUP,
|
|
|
|
|
|
|
|
"Nominal yang anda masukan masih kurang");
|
|
|
|
|
|
|
|
alert.show();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
Alert alert = AlertUtil.getAlertWarning(
|
|
|
|
|
|
|
|
AlertUtil.DIALOG_PILIH_JENIS_TRANSAKSI,
|
|
|
|
|
|
|
|
"Silahkan pilih jenis pembayaran anda!");
|
|
|
|
|
|
|
|
alert.show();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
listShortcuts.put(kcSelesaiBayar, rnSelesaiBayar);
|
|
|
|
listShortcuts.put(kcSelesaiBayar, rnSelesaiBayar);
|
|
|
|
|