|
|
|
@@ -8,6 +8,7 @@ package id.amigogroup.posterminal.bayar; |
|
|
|
import id.amigogroup.posterminal.FormUtamaController; |
|
|
|
import id.amigogroup.posterminal.pencarian.DialogCetakNotaController; |
|
|
|
import id.amigogroup.posterminal.transaksi.TabelBarangRetur; |
|
|
|
import id.amigogroup.posterminal.util.AlertUtil; |
|
|
|
import id.amigogroup.posterminal.util.Fucout; |
|
|
|
import java.io.IOException; |
|
|
|
import java.net.URL; |
|
|
|
@@ -25,6 +26,7 @@ import javafx.fxml.FXML; |
|
|
|
import javafx.fxml.FXMLLoader; |
|
|
|
import javafx.fxml.Initializable; |
|
|
|
import javafx.scene.Node; |
|
|
|
import javafx.scene.control.Alert; |
|
|
|
import javafx.scene.control.CheckBox; |
|
|
|
import javafx.scene.control.Label; |
|
|
|
import javafx.scene.input.KeyCode; |
|
|
|
@@ -99,8 +101,8 @@ public class FormBayarController implements Initializable, BayarInterface { |
|
|
|
if (parent.notaContent.getControllerRetur() != null |
|
|
|
&& parent.notaContent.getControllerRetur().tipeRetur.equals( |
|
|
|
Fucout.TEKS_TIPE_NOTA_TUNAI)) { |
|
|
|
for(TabelBarangRetur tbr : parent.notaContent.getControllerRetur().daftarTabelRetur){ |
|
|
|
switch(tbr.getData().getNoNotaTunai().charAt(0)){ |
|
|
|
for (TabelBarangRetur tbr : parent.notaContent.getControllerRetur().daftarTabelRetur) { |
|
|
|
switch (tbr.getData().getNoNotaTunai().charAt(0)) { |
|
|
|
case Fucout.KODE_NOTA_BON: |
|
|
|
break; |
|
|
|
default: |
|
|
|
@@ -125,21 +127,37 @@ public class FormBayarController implements Initializable, BayarInterface { |
|
|
|
DialogCetakNotaController dialogCetakNotaController = new DialogCetakNotaController(); |
|
|
|
dialogCetakNotaController.initOwner(apContent.getScene().getWindow()); |
|
|
|
dialogCetakNotaController.initData( |
|
|
|
parent.notaContent.getControllerTunai() != null ? |
|
|
|
parent.notaContent.getControllerTunai().daftarTabelTransaksi : null, |
|
|
|
parent.notaContent.getControllerRetur() != null ? |
|
|
|
parent.notaContent.getControllerRetur().daftarTabelRetur : null, |
|
|
|
parent.notaContent.getControllerTunai() != null |
|
|
|
? parent.notaContent.getControllerTunai().daftarTabelTransaksi : null, |
|
|
|
parent.notaContent.getControllerRetur() != null |
|
|
|
? parent.notaContent.getControllerRetur().daftarTabelRetur : null, |
|
|
|
this); |
|
|
|
Optional<String> result = dialogCetakNotaController.showAndWait(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
DialogSelesaiBayarTidakLunasController dsbtlc |
|
|
|
= new DialogSelesaiBayarTidakLunasController(this, |
|
|
|
bayarContent.getTotalPerluBayar() |
|
|
|
- bayarContent.getTotalBayar()); |
|
|
|
dsbtlc.initData(parent); |
|
|
|
dsbtlc.initOwner(apContent.getScene().getWindow()); |
|
|
|
dsbtlc.show(); |
|
|
|
//Jika ingin menampilkan dialog belum selesai bayar |
|
|
|
// DialogSelesaiBayarTidakLunasController dsbtlc |
|
|
|
// = new DialogSelesaiBayarTidakLunasController(this, |
|
|
|
// bayarContent.getTotalPerluBayar() |
|
|
|
// - bayarContent.getTotalBayar()); |
|
|
|
// dsbtlc.initData(parent); |
|
|
|
// 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); |
|
|
|
|