* [UI] Dialog Bayar Belum Lunas muncul jika menekan F10 tapi belum dibayar lunas * [Logic + UI] Bayar poin + menampilkan akumulasi poin menggunakan konversi 1 = 100.000 * [UI] Menampilkan biaya yang belum terbayar di layar checkout bayar, termasuk hasil gabungan berbagai pembayaranpull/2/head
| @@ -72,6 +72,8 @@ public class FormUtamaController implements Initializable { | |||||
| @FXML | @FXML | ||||
| private Label lblMemberNonMember; | private Label lblMemberNonMember; | ||||
| @FXML | @FXML | ||||
| private Label lblKodePelanggan; | |||||
| @FXML | |||||
| private Label lblNamaPelanggan; | private Label lblNamaPelanggan; | ||||
| @FXML | @FXML | ||||
| private Label lblTglLahirPelanggan; | private Label lblTglLahirPelanggan; | ||||
| @@ -96,11 +98,11 @@ public class FormUtamaController implements Initializable { | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void initialize(URL url, ResourceBundle rb) { | public void initialize(URL url, ResourceBundle rb) { | ||||
| //Kode Nur Indah Suciati (00334), Kode Wuryaningsih/RT (010004) | |||||
| //Kode Sri Sumarmi (i140411), Nur Indah Suciati (00334), Kode Wuryaningsih/RT (010004) | |||||
| updateLabelMemberNonMember(); | updateLabelMemberNonMember(); | ||||
| Platform.runLater(() -> { | Platform.runLater(() -> { | ||||
| posRx.getPelangganByKodeMember("00334").subscribe(pelangganObserver); | |||||
| posRx.getPelangganByKodeMember("i140411").subscribe(pelangganObserver); | |||||
| }); | }); | ||||
| if (SystemValue.karyawanLogin != null) { | if (SystemValue.karyawanLogin != null) { | ||||
| @@ -116,7 +118,7 @@ public class FormUtamaController implements Initializable { | |||||
| jumlahNota = 3; | jumlahNota = 3; | ||||
| btnTunai1Static.setOnAction((event) -> { | btnTunai1Static.setOnAction((event) -> { | ||||
| posRx.getPelangganByKodeMember("010004").subscribe(pelangganObserver); | |||||
| // posRx.getPelangganByKodeMember("010004").subscribe(pelangganObserver); | |||||
| setContent(loadNota("", FormConstanta.TRANSAKSI_TUNAI)); | setContent(loadNota("", FormConstanta.TRANSAKSI_TUNAI)); | ||||
| updateSelectedNota(event); | updateSelectedNota(event); | ||||
| tipeNotaState = Fucout.TIPE_NOTA_TUNAI; | tipeNotaState = Fucout.TIPE_NOTA_TUNAI; | ||||
| @@ -140,6 +142,7 @@ public class FormUtamaController implements Initializable { | |||||
| alertUltah.initOwner(bpMain.getScene().getWindow()); | alertUltah.initOwner(bpMain.getScene().getWindow()); | ||||
| alertUltah.show(); | alertUltah.show(); | ||||
| } | } | ||||
| lblKodePelanggan.setText(Fucout.getTextColon(p.getAlias())); | |||||
| lblNamaPelanggan.setText(Fucout.getTextColon(p.getNama())); | lblNamaPelanggan.setText(Fucout.getTextColon(p.getNama())); | ||||
| lblTglLahirPelanggan.setText(Fucout.getTextColon(Fucout.formatTanggal(p.getTglLahir()))); | lblTglLahirPelanggan.setText(Fucout.getTextColon(Fucout.formatTanggal(p.getTglLahir()))); | ||||
| lblNoTelpPelanggan.setText(Fucout.getTextColon( | lblNoTelpPelanggan.setText(Fucout.getTextColon( | ||||
| @@ -0,0 +1,236 @@ | |||||
| /* | |||||
| * To change this license header, choose License Headers in Project Properties. | |||||
| * To change this template file, choose Tools | Templates | |||||
| * and open the template in the editor. | |||||
| */ | |||||
| package id.amigogroup.posterminal.bayar; | |||||
| import javafx.scene.Node; | |||||
| /** | |||||
| * | |||||
| * @author ronal | |||||
| */ | |||||
| public class BayarContent { | |||||
| private Node nodeTunai; | |||||
| private int bayarTunai; | |||||
| private Node nodeKartu; | |||||
| private int bayarKartu; | |||||
| private Node nodePromo; | |||||
| private int bayarPromo; | |||||
| private Node nodeRetur; | |||||
| private int bayarRetur; | |||||
| private Node nodeGopay; | |||||
| private Node nodeOvo; | |||||
| private Node nodePoin; | |||||
| private int bayarPoin; | |||||
| private int totalPerluBayar = 178800; | |||||
| private int totalBayar = 0; | |||||
| private void hitungBayar() { | |||||
| totalBayar = bayarTunai + bayarKartu + bayarPromo + bayarRetur + bayarPoin; | |||||
| } | |||||
| /** | |||||
| * @return the nodeTunai | |||||
| */ | |||||
| public Node getNodeTunai() { | |||||
| return nodeTunai; | |||||
| } | |||||
| /** | |||||
| * @param nodeTunai the nodeTunai to set | |||||
| */ | |||||
| public void setNodeTunai(Node nodeTunai) { | |||||
| this.nodeTunai = nodeTunai; | |||||
| } | |||||
| /** | |||||
| * @return the bayarTunai | |||||
| */ | |||||
| public int getBayarTunai() { | |||||
| return bayarTunai; | |||||
| } | |||||
| /** | |||||
| * @param bayarTunai the bayarTunai to set | |||||
| */ | |||||
| public void setBayarTunai(int bayarTunai) { | |||||
| this.bayarTunai = bayarTunai; | |||||
| hitungBayar(); | |||||
| } | |||||
| /** | |||||
| * @return the nodeKartu | |||||
| */ | |||||
| public Node getNodeKartu() { | |||||
| return nodeKartu; | |||||
| } | |||||
| /** | |||||
| * @param nodeKartu the nodeKartu to set | |||||
| */ | |||||
| public void setNodeKartu(Node nodeKartu) { | |||||
| this.nodeKartu = nodeKartu; | |||||
| } | |||||
| /** | |||||
| * @return the bayarKartu | |||||
| */ | |||||
| public int getBayarKartu() { | |||||
| return bayarKartu; | |||||
| } | |||||
| /** | |||||
| * @param bayarKartu the bayarKartu to set | |||||
| */ | |||||
| public void setBayarKartu(int bayarKartu) { | |||||
| this.bayarKartu = bayarKartu; | |||||
| hitungBayar(); | |||||
| } | |||||
| /** | |||||
| * @return the nodePromo | |||||
| */ | |||||
| public Node getNodePromo() { | |||||
| return nodePromo; | |||||
| } | |||||
| /** | |||||
| * @param nodePromo the nodePromo to set | |||||
| */ | |||||
| public void setNodePromo(Node nodePromo) { | |||||
| this.nodePromo = nodePromo; | |||||
| } | |||||
| /** | |||||
| * @return the bayarPromo | |||||
| */ | |||||
| public int getBayarPromo() { | |||||
| return bayarPromo; | |||||
| } | |||||
| /** | |||||
| * @param bayarPromo the bayarPromo to set | |||||
| */ | |||||
| public void setBayarPromo(int bayarPromo) { | |||||
| this.bayarPromo = bayarPromo; | |||||
| hitungBayar(); | |||||
| } | |||||
| /** | |||||
| * @return the nodeRetur | |||||
| */ | |||||
| public Node getNodeRetur() { | |||||
| return nodeRetur; | |||||
| } | |||||
| /** | |||||
| * @param nodeRetur the nodeRetur to set | |||||
| */ | |||||
| public void setNodeRetur(Node nodeRetur) { | |||||
| this.nodeRetur = nodeRetur; | |||||
| } | |||||
| /** | |||||
| * @return the bayarRetur | |||||
| */ | |||||
| public int getBayarRetur() { | |||||
| return bayarRetur; | |||||
| } | |||||
| /** | |||||
| * @param bayarRetur the bayarRetur to set | |||||
| */ | |||||
| public void setBayarRetur(int bayarRetur) { | |||||
| this.bayarRetur = bayarRetur; | |||||
| hitungBayar(); | |||||
| } | |||||
| /** | |||||
| * @return the nodeGopay | |||||
| */ | |||||
| public Node getNodeGopay() { | |||||
| return nodeGopay; | |||||
| } | |||||
| /** | |||||
| * @param nodeGopay the nodeGopay to set | |||||
| */ | |||||
| public void setNodeGopay(Node nodeGopay) { | |||||
| this.nodeGopay = nodeGopay; | |||||
| } | |||||
| /** | |||||
| * @return the nodeOvo | |||||
| */ | |||||
| public Node getNodeOvo() { | |||||
| return nodeOvo; | |||||
| } | |||||
| /** | |||||
| * @param nodeOvo the nodeOvo to set | |||||
| */ | |||||
| public void setNodeOvo(Node nodeOvo) { | |||||
| this.nodeOvo = nodeOvo; | |||||
| } | |||||
| /** | |||||
| * @return the nodePoin | |||||
| */ | |||||
| public Node getNodePoin() { | |||||
| return nodePoin; | |||||
| } | |||||
| /** | |||||
| * @param nodePoin the nodePoin to set | |||||
| */ | |||||
| public void setNodePoin(Node nodePoin) { | |||||
| this.nodePoin = nodePoin; | |||||
| } | |||||
| /** | |||||
| * @return the bayarPoin | |||||
| */ | |||||
| public int getBayarPoin() { | |||||
| return bayarPoin; | |||||
| } | |||||
| /** | |||||
| * @param bayarPoin the bayarPoin to set | |||||
| */ | |||||
| public void setBayarPoin(int bayarPoin) { | |||||
| this.bayarPoin = bayarPoin; | |||||
| hitungBayar(); | |||||
| } | |||||
| /** | |||||
| * @return the totalPerluBayar | |||||
| */ | |||||
| public int getTotalPerluBayar() { | |||||
| return totalPerluBayar; | |||||
| } | |||||
| /** | |||||
| * @param totalPerluBayar the totalPerluBayar to set | |||||
| */ | |||||
| public void setTotalPerluBayar(int totalPerluBayar) { | |||||
| this.totalPerluBayar = totalPerluBayar; | |||||
| } | |||||
| /** | |||||
| * @return the totalBayar | |||||
| */ | |||||
| public int getTotalBayar() { | |||||
| return totalBayar; | |||||
| } | |||||
| /** | |||||
| * @param totalBayar the totalBayar to set | |||||
| */ | |||||
| public void setTotalBayar(int totalBayar) { | |||||
| this.totalBayar = totalBayar; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| /* | |||||
| * To change this license header, choose License Headers in Project Properties. | |||||
| * To change this template file, choose Tools | Templates | |||||
| * and open the template in the editor. | |||||
| */ | |||||
| package id.amigogroup.posterminal.bayar; | |||||
| import javafx.scene.Node; | |||||
| /** | |||||
| * | |||||
| * @author ronal | |||||
| */ | |||||
| public interface BayarInterface { | |||||
| final String BAYAR_TUNAI = "Tunai"; | |||||
| final String BAYAR_KARTU = "Debit/Kredit"; | |||||
| final String BAYAR_PROMO = "Voucher Promo"; | |||||
| final String BAYAR_RETUR = "Voucher Retur"; | |||||
| final String BAYAR_GOPAY = "GoPay"; | |||||
| final String BAYAR_OVO = "OVO"; | |||||
| final String BAYAR_POIN = "Poin"; | |||||
| public BayarContent getBayarContent(); | |||||
| public void updateKurangBayarView(); | |||||
| } | |||||
| @@ -0,0 +1,226 @@ | |||||
| /* | |||||
| * To change this license header, choose License Headers in Project Properties. | |||||
| * To change this template file, choose Tools | Templates | |||||
| * and open the template in the editor. | |||||
| */ | |||||
| package id.amigogroup.posterminal.bayar; | |||||
| import id.amigogroup.posterminal.pencarian.DialogCariBarangController; | |||||
| import id.amigogroup.posterminal.util.Fucout; | |||||
| import java.io.IOException; | |||||
| import java.net.URL; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | |||||
| import java.util.ResourceBundle; | |||||
| import java.util.logging.Level; | |||||
| import java.util.logging.Logger; | |||||
| import javafx.event.ActionEvent; | |||||
| import javafx.fxml.FXML; | |||||
| import javafx.fxml.FXMLLoader; | |||||
| import javafx.fxml.Initializable; | |||||
| import javafx.scene.Node; | |||||
| import javafx.scene.Parent; | |||||
| import javafx.scene.control.CheckBox; | |||||
| import javafx.scene.control.Dialog; | |||||
| import javafx.scene.control.Label; | |||||
| import javafx.scene.layout.VBox; | |||||
| import javafx.stage.Window; | |||||
| /** | |||||
| * FXML Controller class | |||||
| * | |||||
| * @author ronal | |||||
| */ | |||||
| public class DialogSelesaiBayarTidakLunasController extends Dialog implements Initializable, BayarInterface { | |||||
| @FXML | |||||
| private CheckBox chkTunai; | |||||
| @FXML | |||||
| private CheckBox chkKartu; | |||||
| @FXML | |||||
| private CheckBox chkPromo; | |||||
| @FXML | |||||
| private CheckBox chkRetur; | |||||
| @FXML | |||||
| private CheckBox chkGopay; | |||||
| @FXML | |||||
| private CheckBox chkOvo; | |||||
| @FXML | |||||
| private CheckBox chkPoin; | |||||
| @FXML | |||||
| private VBox vbContent; | |||||
| @FXML | |||||
| private Label lblPerluBayar; | |||||
| private BayarInterface parent; | |||||
| private int kurangBayar; | |||||
| private List<CheckBox> daftarChkBayarSyarat; | |||||
| private List<CheckBox> daftarChkBayarOpsional; | |||||
| public BayarContent bayarContent = new BayarContent(); | |||||
| /** | |||||
| * Initializes the controller class. | |||||
| */ | |||||
| @Override | |||||
| public void initialize(URL url, ResourceBundle rb) { | |||||
| daftarChkBayarSyarat.add(chkTunai); | |||||
| daftarChkBayarSyarat.add(chkKartu); | |||||
| daftarChkBayarOpsional.add(chkPromo); | |||||
| daftarChkBayarOpsional.add(chkRetur); | |||||
| daftarChkBayarOpsional.add(chkGopay); | |||||
| daftarChkBayarOpsional.add(chkOvo); | |||||
| daftarChkBayarOpsional.add(chkPoin); | |||||
| } | |||||
| public DialogSelesaiBayarTidakLunasController(BayarInterface parent, int kurangBayar) { | |||||
| this.daftarChkBayarSyarat = new ArrayList<>(); | |||||
| this.daftarChkBayarOpsional = new ArrayList<>(); | |||||
| this.parent = parent; | |||||
| bayarContent.setTotalPerluBayar(kurangBayar); | |||||
| try { | |||||
| Window window = getDialogPane().getScene().getWindow(); | |||||
| window.setOnCloseRequest(event -> this.close()); | |||||
| FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/DialogSelesaiBayarTidakLunas.fxml")); | |||||
| loader.setController(this); | |||||
| Parent root = loader.load(); | |||||
| getDialogPane().setContent(root); | |||||
| setTitle("Pembayaran Belum Lunas!"); | |||||
| lblPerluBayar.setText(Fucout.getTextColon(Fucout.formatRupiah( | |||||
| bayarContent.getTotalPerluBayar()))); | |||||
| } catch (IOException e) { | |||||
| Logger.getLogger(DialogCariBarangController.class | |||||
| .getName()).log(Level.SEVERE, null, e); | |||||
| } | |||||
| } | |||||
| @FXML | |||||
| void chkPilihanOnAction(ActionEvent event) { | |||||
| CheckBox chkSource = (CheckBox) event.getSource(); | |||||
| FXMLLoader loader = new FXMLLoader(); | |||||
| Node node = null; | |||||
| try { | |||||
| switch (chkSource.getText()) { | |||||
| case FormBayarController.BAYAR_TUNAI: | |||||
| if (bayarContent.getNodeTunai() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarTunai.fxml")); | |||||
| node = loader.load(); | |||||
| FormBayarTunaiController fbtc = loader.getController(); | |||||
| fbtc.initData(this); | |||||
| vbContent.getChildren().add(node); | |||||
| bayarContent.setNodeTunai(node); | |||||
| } else { | |||||
| if (bayarContent.getNodeTunai() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodeTunai()); | |||||
| bayarContent.setNodeTunai(null); | |||||
| } | |||||
| } | |||||
| break; | |||||
| case FormBayarController.BAYAR_KARTU: | |||||
| if (bayarContent.getNodeKartu() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarKartu.fxml")); | |||||
| node = loader.load(); | |||||
| vbContent.getChildren().add(node); | |||||
| bayarContent.setNodeKartu(node); | |||||
| } else { | |||||
| if (bayarContent.getNodeKartu() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodeKartu()); | |||||
| bayarContent.setNodeKartu(null); | |||||
| } | |||||
| } | |||||
| break; | |||||
| case FormBayarController.BAYAR_RETUR: | |||||
| if (bayarContent.getNodeRetur() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarRetur.fxml")); | |||||
| node = loader.load(); | |||||
| vbContent.getChildren().add(node); | |||||
| bayarContent.setNodeRetur(node); | |||||
| } else { | |||||
| if (bayarContent.getNodeRetur() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodeRetur()); | |||||
| bayarContent.setNodeRetur(null); | |||||
| } | |||||
| } | |||||
| break; | |||||
| case FormBayarController.BAYAR_PROMO: | |||||
| if (bayarContent.getNodePromo() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarVoucherPromo.fxml")); | |||||
| node = loader.load(); | |||||
| vbContent.getChildren().add(node); | |||||
| bayarContent.setNodePromo(node); | |||||
| } else { | |||||
| if (bayarContent.getNodePromo() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodePromo()); | |||||
| bayarContent.setNodePromo(null); | |||||
| } | |||||
| } | |||||
| break; | |||||
| case FormBayarController.BAYAR_GOPAY: | |||||
| break; | |||||
| case FormBayarController.BAYAR_OVO: | |||||
| break; | |||||
| case FormBayarController.BAYAR_POIN: | |||||
| if (bayarContent.getNodePoin() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarPoin.fxml")); | |||||
| node = loader.load(); | |||||
| vbContent.getChildren().add(node); | |||||
| bayarContent.setNodePoin(node); | |||||
| } else { | |||||
| if (bayarContent.getNodePoin() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodePoin()); | |||||
| bayarContent.setNodePoin(null); | |||||
| } | |||||
| } | |||||
| break; | |||||
| } | |||||
| if (daftarChkBayarSyarat.contains(chkSource)) { | |||||
| chkSyaratValueOnChanged(); | |||||
| } | |||||
| } catch (IOException ex) { | |||||
| Logger.getLogger(FormBayarController.class.getName()).log(Level.SEVERE, null, ex); | |||||
| } | |||||
| } | |||||
| private void chkSyaratValueOnChanged() { | |||||
| boolean isSyaratTerpenuhi = false; | |||||
| for (CheckBox chkSyarat : daftarChkBayarSyarat) { | |||||
| if (chkSyarat.selectedProperty().get()) { | |||||
| isSyaratTerpenuhi = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| if (isSyaratTerpenuhi) { | |||||
| for (CheckBox chk : daftarChkBayarOpsional) { | |||||
| chk.setDisable(false); | |||||
| } | |||||
| } else { | |||||
| for (CheckBox chk : daftarChkBayarOpsional) { | |||||
| if (chk.selectedProperty().get()) { | |||||
| chk.fire(); | |||||
| } | |||||
| chk.setDisable(true); | |||||
| } | |||||
| } | |||||
| } | |||||
| @Override | |||||
| public BayarContent getBayarContent() { | |||||
| return bayarContent; | |||||
| } | |||||
| @Override | |||||
| public void updateKurangBayarView() { | |||||
| lblPerluBayar.setText(Fucout.getTextColon(Fucout.formatRupiah( | |||||
| bayarContent.getTotalPerluBayar() - bayarContent.getTotalBayar()))); | |||||
| } | |||||
| } | |||||
| @@ -9,10 +9,13 @@ import id.amigogroup.posterminal.util.Fucout; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.HashMap; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.Map; | |||||
| import java.util.ResourceBundle; | import java.util.ResourceBundle; | ||||
| import java.util.logging.Level; | import java.util.logging.Level; | ||||
| import java.util.logging.Logger; | import java.util.logging.Logger; | ||||
| import javafx.application.Platform; | |||||
| import javafx.event.ActionEvent; | import javafx.event.ActionEvent; | ||||
| import javafx.fxml.FXML; | import javafx.fxml.FXML; | ||||
| import javafx.fxml.FXMLLoader; | import javafx.fxml.FXMLLoader; | ||||
| @@ -20,6 +23,10 @@ import javafx.fxml.Initializable; | |||||
| import javafx.scene.Node; | import javafx.scene.Node; | ||||
| 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.KeyCodeCombination; | |||||
| import javafx.scene.input.KeyCombination; | |||||
| import javafx.scene.layout.AnchorPane; | |||||
| import javafx.scene.layout.VBox; | import javafx.scene.layout.VBox; | ||||
| /** | /** | ||||
| @@ -27,8 +34,10 @@ import javafx.scene.layout.VBox; | |||||
| * | * | ||||
| * @author ronal | * @author ronal | ||||
| */ | */ | ||||
| public class FormBayarController implements Initializable { | |||||
| public class FormBayarController implements Initializable, BayarInterface { | |||||
| @FXML | |||||
| private AnchorPane apContent; | |||||
| @FXML | @FXML | ||||
| private CheckBox chkTunai; | private CheckBox chkTunai; | ||||
| @FXML | @FXML | ||||
| @@ -44,41 +53,19 @@ public class FormBayarController implements Initializable { | |||||
| @FXML | @FXML | ||||
| private CheckBox chkPoin; | private CheckBox chkPoin; | ||||
| @FXML | @FXML | ||||
| private Label lblKurangBayar; | |||||
| @FXML | |||||
| private VBox vbContent; | private VBox vbContent; | ||||
| @FXML | @FXML | ||||
| private Label lblGrandTotal; | private Label lblGrandTotal; | ||||
| private final String BAYAR_TUNAI = "Tunai"; | |||||
| private final String BAYAR_KARTU = "Debit/Kredit"; | |||||
| private final String BAYAR_PROMO = "Voucher Promo"; | |||||
| private final String BAYAR_RETUR = "Voucher Retur"; | |||||
| private final String BAYAR_GOPAY = "GoPay"; | |||||
| private final String BAYAR_OVO = "OVO"; | |||||
| private final String BAYAR_POIN = "Poin"; | |||||
| private List<CheckBox> daftarChkBayar; | |||||
| public int totalBayar = 178800; | |||||
| public class BayarContent { | |||||
| Node nodeTunai; | |||||
| int bayarTunai; | |||||
| Node nodeKartu; | |||||
| int bayarKartu; | |||||
| Node nodePromo; | |||||
| int bayarPromo; | |||||
| Node nodeRetur; | |||||
| int bayarRetur; | |||||
| Node nodeGopay; | |||||
| Node nodeOvo; | |||||
| Node nodePoin; | |||||
| } | |||||
| public BayarContent kumpulanContent = new BayarContent(); | |||||
| private final List<CheckBox> daftarChkBayarSyarat; | |||||
| private final List<CheckBox> daftarChkBayarOpsional; | |||||
| public BayarContent bayarContent = new BayarContent(); | |||||
| public FormBayarController() { | public FormBayarController() { | ||||
| daftarChkBayar = new ArrayList<>(); | |||||
| daftarChkBayarSyarat = new ArrayList<>(); | |||||
| daftarChkBayarOpsional = new ArrayList<>(); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -86,14 +73,40 @@ public class FormBayarController implements Initializable { | |||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void initialize(URL url, ResourceBundle rb) { | public void initialize(URL url, ResourceBundle rb) { | ||||
| lblGrandTotal.setText(Fucout.formatRupiah(totalBayar)); | |||||
| daftarChkBayar.add(chkTunai); | |||||
| daftarChkBayar.add(chkKartu); | |||||
| daftarChkBayar.add(chkPromo); | |||||
| daftarChkBayar.add(chkRetur); | |||||
| daftarChkBayar.add(chkGopay); | |||||
| daftarChkBayar.add(chkOvo); | |||||
| daftarChkBayar.add(chkPoin); | |||||
| lblGrandTotal.setText(Fucout.formatRupiah(bayarContent.getTotalPerluBayar())); | |||||
| lblKurangBayar.setText(Fucout.formatRupiah(bayarContent.getTotalPerluBayar())); | |||||
| daftarChkBayarSyarat.add(chkTunai); | |||||
| daftarChkBayarSyarat.add(chkKartu); | |||||
| daftarChkBayarOpsional.add(chkPromo); | |||||
| daftarChkBayarOpsional.add(chkRetur); | |||||
| daftarChkBayarOpsional.add(chkGopay); | |||||
| daftarChkBayarOpsional.add(chkOvo); | |||||
| daftarChkBayarOpsional.add(chkPoin); | |||||
| initShortcuts(); | |||||
| } | |||||
| private void initShortcuts() { | |||||
| Map<KeyCombination, Runnable> listShortcuts = new HashMap<>(); | |||||
| KeyCombination kcSelesaiBayar = new KeyCodeCombination(KeyCode.F10); | |||||
| Runnable rnSelesaiBayar = () -> { | |||||
| if (bayarContent.getTotalBayar() >= bayarContent.getTotalPerluBayar()) { | |||||
| } else { | |||||
| DialogSelesaiBayarTidakLunasController dsbtlc | |||||
| = new DialogSelesaiBayarTidakLunasController(this, | |||||
| bayarContent.getTotalPerluBayar() | |||||
| - bayarContent.getTotalBayar()); | |||||
| dsbtlc.initOwner(apContent.getScene().getWindow()); | |||||
| dsbtlc.show(); | |||||
| } | |||||
| }; | |||||
| listShortcuts.put(kcSelesaiBayar, rnSelesaiBayar); | |||||
| Platform.runLater(() -> { | |||||
| apContent.getScene().getAccelerators().putAll(listShortcuts); | |||||
| }); | |||||
| } | } | ||||
| @FXML | @FXML | ||||
| @@ -104,61 +117,70 @@ public class FormBayarController implements Initializable { | |||||
| try { | try { | ||||
| switch (chkSource.getText()) { | switch (chkSource.getText()) { | ||||
| case BAYAR_TUNAI: | case BAYAR_TUNAI: | ||||
| chkSyaratValueOnChanged(chkSource); | |||||
| if (kumpulanContent.nodeTunai == null && chkSource.selectedProperty().get()) { | |||||
| if (bayarContent.getNodeTunai() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarTunai.fxml")); | loader.setLocation(getClass().getResource("/fxml/FormBayarTunai.fxml")); | ||||
| node = loader.load(); | node = loader.load(); | ||||
| FormBayarTunaiController fbtc = loader.getController(); | FormBayarTunaiController fbtc = loader.getController(); | ||||
| fbtc.initData(this); | fbtc.initData(this); | ||||
| vbContent.getChildren().add(node); | vbContent.getChildren().add(node); | ||||
| kumpulanContent.nodeTunai = node; | |||||
| bayarContent.setNodeTunai(node); | |||||
| } else { | } else { | ||||
| if (kumpulanContent.nodeTunai != null) { | |||||
| vbContent.getChildren().remove(kumpulanContent.nodeTunai); | |||||
| kumpulanContent.nodeTunai = null; | |||||
| if (bayarContent.getNodeTunai() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodeTunai()); | |||||
| bayarContent.setNodeTunai(null); | |||||
| bayarContent.setBayarTunai(0); | |||||
| updateKurangBayarView(); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case BAYAR_KARTU: | case BAYAR_KARTU: | ||||
| if (kumpulanContent.nodeKartu == null && chkSource.selectedProperty().get()) { | |||||
| if (bayarContent.getNodeKartu() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarKartu.fxml")); | loader.setLocation(getClass().getResource("/fxml/FormBayarKartu.fxml")); | ||||
| node = loader.load(); | node = loader.load(); | ||||
| FormBayarKartuController fbkc = loader.getController(); | |||||
| fbkc.initData(this); | |||||
| vbContent.getChildren().add(node); | vbContent.getChildren().add(node); | ||||
| kumpulanContent.nodeKartu = node; | |||||
| bayarContent.setNodeKartu(node); | |||||
| } else { | } else { | ||||
| if (kumpulanContent.nodeKartu != null) { | |||||
| vbContent.getChildren().remove(kumpulanContent.nodeKartu); | |||||
| kumpulanContent.nodeKartu = null; | |||||
| if (bayarContent.getNodeKartu() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodeKartu()); | |||||
| bayarContent.setNodeKartu(null); | |||||
| bayarContent.setBayarKartu(0); | |||||
| updateKurangBayarView(); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case BAYAR_RETUR: | case BAYAR_RETUR: | ||||
| if (kumpulanContent.nodeRetur == null && chkSource.selectedProperty().get()) { | |||||
| if (bayarContent.getNodeRetur() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarRetur.fxml")); | loader.setLocation(getClass().getResource("/fxml/FormBayarRetur.fxml")); | ||||
| node = loader.load(); | node = loader.load(); | ||||
| vbContent.getChildren().add(node); | vbContent.getChildren().add(node); | ||||
| kumpulanContent.nodeRetur = node; | |||||
| bayarContent.setNodeRetur(node); | |||||
| } else { | } else { | ||||
| if (kumpulanContent.nodeRetur != null) { | |||||
| vbContent.getChildren().remove(kumpulanContent.nodeRetur); | |||||
| kumpulanContent.nodeRetur = null; | |||||
| if (bayarContent.getNodeRetur() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodeRetur()); | |||||
| bayarContent.setNodeRetur(null); | |||||
| bayarContent.setBayarRetur(0); | |||||
| updateKurangBayarView(); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| case BAYAR_PROMO: | case BAYAR_PROMO: | ||||
| if (kumpulanContent.nodePromo == null && chkSource.selectedProperty().get()) { | |||||
| if (bayarContent.getNodePromo() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarVoucherPromo.fxml")); | loader.setLocation(getClass().getResource("/fxml/FormBayarVoucherPromo.fxml")); | ||||
| node = loader.load(); | node = loader.load(); | ||||
| vbContent.getChildren().add(node); | vbContent.getChildren().add(node); | ||||
| kumpulanContent.nodePromo = node; | |||||
| bayarContent.setNodePromo(node); | |||||
| } else { | } else { | ||||
| if (kumpulanContent.nodePromo != null) { | |||||
| vbContent.getChildren().remove(kumpulanContent.nodePromo); | |||||
| kumpulanContent.nodePromo = null; | |||||
| if (bayarContent.getNodePromo() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodePromo()); | |||||
| bayarContent.setNodePromo(null); | |||||
| bayarContent.setBayarPromo(0); | |||||
| updateKurangBayarView(); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| @@ -167,42 +189,64 @@ public class FormBayarController implements Initializable { | |||||
| case BAYAR_OVO: | case BAYAR_OVO: | ||||
| break; | break; | ||||
| case BAYAR_POIN: | case BAYAR_POIN: | ||||
| if (kumpulanContent.nodePoin == null && chkSource.selectedProperty().get()) { | |||||
| if (bayarContent.getNodePoin() == null && chkSource.selectedProperty().get()) { | |||||
| loader.setLocation(getClass().getResource("/fxml/FormBayarPoin.fxml")); | loader.setLocation(getClass().getResource("/fxml/FormBayarPoin.fxml")); | ||||
| node = loader.load(); | node = loader.load(); | ||||
| FormBayarPoinController fbpc = loader.getController(); | |||||
| fbpc.initData(this); | |||||
| vbContent.getChildren().add(node); | vbContent.getChildren().add(node); | ||||
| kumpulanContent.nodePoin = node; | |||||
| bayarContent.setNodePoin(node); | |||||
| } else { | } else { | ||||
| if (kumpulanContent.nodePoin != null) { | |||||
| vbContent.getChildren().remove(kumpulanContent.nodePoin); | |||||
| kumpulanContent.nodePoin = null; | |||||
| if (bayarContent.getNodePoin() != null) { | |||||
| vbContent.getChildren().remove(bayarContent.getNodePoin()); | |||||
| bayarContent.setNodePoin(null); | |||||
| bayarContent.setBayarPoin(0); | |||||
| updateKurangBayarView(); | |||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| if (daftarChkBayarSyarat.contains(chkSource)) { | |||||
| chkSyaratValueOnChanged(); | |||||
| } | |||||
| } catch (IOException ex) { | } catch (IOException ex) { | ||||
| Logger.getLogger(FormBayarController.class.getName()).log(Level.SEVERE, null, ex); | Logger.getLogger(FormBayarController.class.getName()).log(Level.SEVERE, null, ex); | ||||
| } | } | ||||
| } | } | ||||
| private void chkSyaratValueOnChanged(CheckBox chkSyarat) { | |||||
| if (kumpulanContent.nodeTunai == null && chkSyarat.selectedProperty().get()) { | |||||
| for (CheckBox chk : daftarChkBayar) { | |||||
| if (chk != chkSyarat) { | |||||
| chk.setDisable(false); | |||||
| } | |||||
| private void chkSyaratValueOnChanged() { | |||||
| boolean isSyaratTerpenuhi = false; | |||||
| for (CheckBox chkSyarat : daftarChkBayarSyarat) { | |||||
| if (chkSyarat.selectedProperty().get()) { | |||||
| isSyaratTerpenuhi = true; | |||||
| break; | |||||
| } | |||||
| } | |||||
| if (isSyaratTerpenuhi) { | |||||
| for (CheckBox chk : daftarChkBayarOpsional) { | |||||
| chk.setDisable(false); | |||||
| } | } | ||||
| } else { | } else { | ||||
| for (CheckBox chk : daftarChkBayar) { | |||||
| if (chk != chkSyarat) { | |||||
| if (chk.selectedProperty().get()) { | |||||
| chk.fire(); | |||||
| } | |||||
| chk.setDisable(true); | |||||
| for (CheckBox chk : daftarChkBayarOpsional) { | |||||
| if (chk.selectedProperty().get()) { | |||||
| chk.fire(); | |||||
| } | } | ||||
| chk.setDisable(true); | |||||
| } | } | ||||
| } | } | ||||
| } | |||||
| @Override | |||||
| public BayarContent getBayarContent() { | |||||
| return bayarContent; | |||||
| } | |||||
| @Override | |||||
| public void updateKurangBayarView() { | |||||
| lblKurangBayar.setText(Fucout.formatRupiah( | |||||
| bayarContent.getTotalPerluBayar() - bayarContent.getTotalBayar())); | |||||
| } | } | ||||
| } | } | ||||
| @@ -31,6 +31,7 @@ public class FormBayarKartuController implements Initializable { | |||||
| @FXML | @FXML | ||||
| private TextField fldNoKartu4; | private TextField fldNoKartu4; | ||||
| private BayarInterface parent; | |||||
| /** | /** | ||||
| * Initializes the controller class. | * Initializes the controller class. | ||||
| */ | */ | ||||
| @@ -39,6 +40,13 @@ public class FormBayarKartuController implements Initializable { | |||||
| initComponents(); | initComponents(); | ||||
| } | } | ||||
| public void initData(BayarInterface parent) { | |||||
| this.parent = parent; | |||||
| parent.getBayarContent().setBayarKartu(50000); | |||||
| parent.updateKurangBayarView(); | |||||
| } | |||||
| private void initComponents() { | private void initComponents() { | ||||
| Fucout.forceFieldInteger(fldNoKartu1, 4); | Fucout.forceFieldInteger(fldNoKartu1, 4); | ||||
| Fucout.forceFieldInteger(fldNoKartu2, 4); | Fucout.forceFieldInteger(fldNoKartu2, 4); | ||||
| @@ -5,9 +5,15 @@ | |||||
| */ | */ | ||||
| package id.amigogroup.posterminal.bayar; | package id.amigogroup.posterminal.bayar; | ||||
| import id.amigogroup.posterminal.SystemValue; | |||||
| import id.amigogroup.posterminal.util.Fucout; | |||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.util.ResourceBundle; | import java.util.ResourceBundle; | ||||
| import javafx.fxml.FXML; | |||||
| import javafx.fxml.Initializable; | import javafx.fxml.Initializable; | ||||
| import javafx.scene.control.Label; | |||||
| import javafx.scene.control.TextField; | |||||
| import javafx.scene.input.KeyEvent; | |||||
| /** | /** | ||||
| * FXML Controller class | * FXML Controller class | ||||
| @@ -16,12 +22,45 @@ import javafx.fxml.Initializable; | |||||
| */ | */ | ||||
| public class FormBayarPoinController implements Initializable { | public class FormBayarPoinController implements Initializable { | ||||
| @FXML | |||||
| private TextField fldPoin; | |||||
| @FXML | |||||
| private Label lblPoin; | |||||
| private BayarInterface parent; | |||||
| /** | /** | ||||
| * Initializes the controller class. | * Initializes the controller class. | ||||
| */ | */ | ||||
| @Override | @Override | ||||
| public void initialize(URL url, ResourceBundle rb) { | public void initialize(URL url, ResourceBundle rb) { | ||||
| // TODO | |||||
| } | |||||
| int poin = 0; | |||||
| if (SystemValue.member != null) { | |||||
| lblPoin.setText(Fucout.getTextColon( | |||||
| String.valueOf(SystemValue.member.getPoin()))); | |||||
| poin = SystemValue.member.getPoin(); | |||||
| } | |||||
| Fucout.forceFieldInteger(fldPoin, poin); | |||||
| } | |||||
| public void initData(BayarInterface parent) { | |||||
| this.parent = parent; | |||||
| } | |||||
| @FXML | |||||
| void fldPoinOnKeyReleased(KeyEvent event) { | |||||
| int poin = 0; | |||||
| if (!fldPoin.getText().equals("")) { | |||||
| try { | |||||
| poin = Integer.parseInt(fldPoin.getText()); | |||||
| } catch (NumberFormatException nfe) { | |||||
| } | |||||
| } | |||||
| if (parent != null && parent.getBayarContent().getNodePoin() != null) { | |||||
| parent.getBayarContent().setBayarPoin(poin * Fucout.KONVERSI_POIN); | |||||
| parent.updateKurangBayarView(); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -26,7 +26,7 @@ public class FormBayarTunaiController implements Initializable { | |||||
| @FXML | @FXML | ||||
| private Label lblKembalian; | private Label lblKembalian; | ||||
| private FormBayarController parent; | |||||
| private BayarInterface parent; | |||||
| /** | /** | ||||
| * Initializes the controller class. | * Initializes the controller class. | ||||
| @@ -36,24 +36,31 @@ public class FormBayarTunaiController implements Initializable { | |||||
| Fucout.forceFieldInteger(fldBayar, Integer.MAX_VALUE); | Fucout.forceFieldInteger(fldBayar, Integer.MAX_VALUE); | ||||
| } | } | ||||
| public void initData(FormBayarController parent) { | |||||
| public void initData(BayarInterface parent) { | |||||
| this.parent = parent; | this.parent = parent; | ||||
| } | } | ||||
| @FXML | @FXML | ||||
| void fldBayarOnKeyReleased(KeyEvent event) { | void fldBayarOnKeyReleased(KeyEvent event) { | ||||
| if (parent != null && parent.kumpulanContent.nodeTunai != null | |||||
| && !fldBayar.getText().equals("")) { | |||||
| int bayar = 0; | |||||
| if (!fldBayar.getText().equals("")) { | |||||
| try { | try { | ||||
| int bayar = Integer.parseInt(fldBayar.getText()); | |||||
| if (parent.totalBayar < bayar) { | |||||
| int kembali = bayar - parent.totalBayar; | |||||
| lblKembalian.setText(Fucout.formatRibuan(kembali)); | |||||
| } else { | |||||
| lblKembalian.setText("-"); | |||||
| } | |||||
| bayar = Integer.parseInt(fldBayar.getText()); | |||||
| } catch (NumberFormatException nfe) { | } catch (NumberFormatException nfe) { | ||||
| } | |||||
| } | |||||
| if (parent != null && parent.getBayarContent().getNodeTunai() != null) { | |||||
| parent.getBayarContent().setBayarTunai(bayar); | |||||
| parent.updateKurangBayarView(); | |||||
| if (parent.getBayarContent().getTotalPerluBayar() < | |||||
| parent.getBayarContent().getTotalBayar()) { | |||||
| int kembali = parent.getBayarContent().getTotalBayar() | |||||
| - parent.getBayarContent().getTotalPerluBayar(); | |||||
| lblKembalian.setText(Fucout.formatRibuan(kembali)); | |||||
| } else { | |||||
| lblKembalian.setText("-"); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -113,7 +113,7 @@ public class Pelanggan { | |||||
| @JsonProperty("saldonetbon") | @JsonProperty("saldonetbon") | ||||
| private Integer saldonetbon; | private Integer saldonetbon; | ||||
| @JsonProperty("poin") | @JsonProperty("poin") | ||||
| private Integer poin; | |||||
| private int poin; | |||||
| @JsonProperty("gambar") | @JsonProperty("gambar") | ||||
| private String gambar; | private String gambar; | ||||
| @JsonProperty("firebase_uid") | @JsonProperty("firebase_uid") | ||||
| @@ -430,12 +430,12 @@ public class Pelanggan { | |||||
| } | } | ||||
| @JsonProperty("poin") | @JsonProperty("poin") | ||||
| public Integer getPoin() { | |||||
| public int getPoin() { | |||||
| return poin; | return poin; | ||||
| } | } | ||||
| @JsonProperty("poin") | @JsonProperty("poin") | ||||
| public void setPoin(Integer poin) { | |||||
| public void setPoin(int poin) { | |||||
| this.poin = poin; | this.poin = poin; | ||||
| } | } | ||||
| @@ -32,6 +32,9 @@ public class Fucout { | |||||
| public static final String TIPE_NOTA_BAWA = "Bawa Dulu"; | public static final String TIPE_NOTA_BAWA = "Bawa Dulu"; | ||||
| public static final String TIPE_NOTA_RETUR = "Retur"; | public static final String TIPE_NOTA_RETUR = "Retur"; | ||||
| //VALUES | |||||
| public static final int KONVERSI_POIN = 100000; | |||||
| //IMAGES URL | //IMAGES URL | ||||
| public static final String APP_ICON = "/assets/logo-mini-squared.png"; | public static final String APP_ICON = "/assets/logo-mini-squared.png"; | ||||
| @@ -123,17 +126,18 @@ public class Fucout { | |||||
| return nf.format(price); | return nf.format(price); | ||||
| } | } | ||||
| public static boolean checkBirthday(Date tanggal) { | public static boolean checkBirthday(Date tanggal) { | ||||
| return checkBirthday(toLocalDate(tanggal)); | return checkBirthday(toLocalDate(tanggal)); | ||||
| } | } | ||||
| public static boolean checkBirthday(LocalDate tanggal) { | public static boolean checkBirthday(LocalDate tanggal) { | ||||
| if (tanggal == null) { | if (tanggal == null) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| LocalDate now = LocalDate.now(); | LocalDate now = LocalDate.now(); | ||||
| return tanggal.getMonthValue() == now.getMonthValue() && | |||||
| tanggal.getDayOfMonth() == now.getDayOfMonth(); | |||||
| return tanggal.getMonthValue() == now.getMonthValue() | |||||
| && tanggal.getDayOfMonth() == now.getDayOfMonth(); | |||||
| } | } | ||||
| public static LocalDate toLocalDate(Date date) { | public static LocalDate toLocalDate(Date date) { | ||||
| @@ -0,0 +1,81 @@ | |||||
| <?xml version="1.0" encoding="UTF-8"?> | |||||
| <?import javafx.geometry.Insets?> | |||||
| <?import javafx.scene.control.CheckBox?> | |||||
| <?import javafx.scene.control.Label?> | |||||
| <?import javafx.scene.control.ScrollPane?> | |||||
| <?import javafx.scene.layout.AnchorPane?> | |||||
| <?import javafx.scene.layout.HBox?> | |||||
| <?import javafx.scene.layout.VBox?> | |||||
| <?import javafx.scene.text.Font?> | |||||
| <AnchorPane id="AnchorPane" prefHeight="400.0" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/11.0.1"> | |||||
| <children> | |||||
| <Label layoutX="14.0" layoutY="14.0" text="Bayar" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="4.0"> | |||||
| <font> | |||||
| <Font name="System Bold" size="16.0" /> | |||||
| </font> | |||||
| </Label> | |||||
| <HBox layoutX="4.0" layoutY="29.0" AnchorPane.leftAnchor="4.0" AnchorPane.rightAnchor="4.0" AnchorPane.topAnchor="29.0"> | |||||
| <children> | |||||
| <Label text="Sisa yang kurang dibayarkan"> | |||||
| <font> | |||||
| <Font size="14.0" /> | |||||
| </font> | |||||
| </Label> | |||||
| <Label fx:id="lblPerluBayar" text=": -"> | |||||
| <font> | |||||
| <Font size="14.0" /> | |||||
| </font> | |||||
| <HBox.margin> | |||||
| <Insets left="5.0" /> | |||||
| </HBox.margin> | |||||
| </Label> | |||||
| </children> | |||||
| </HBox> | |||||
| <ScrollPane fitToHeight="true" layoutX="-10.0" layoutY="29.0" minHeight="0.0" minWidth="0.0" prefHeight="40.0" style="-fx-background-color: transparent;" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="59.0"> | |||||
| <content> | |||||
| <HBox spacing="5.0"> | |||||
| <children> | |||||
| <CheckBox fx:id="chkTunai" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Tunai"> | |||||
| <HBox.margin> | |||||
| <Insets right="10.0" /> | |||||
| </HBox.margin> | |||||
| </CheckBox> | |||||
| <CheckBox fx:id="chkKartu" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Debit/Kredit"> | |||||
| <HBox.margin> | |||||
| <Insets right="10.0" /> | |||||
| </HBox.margin> | |||||
| </CheckBox> | |||||
| <CheckBox fx:id="chkPromo" disable="true" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Voucher Promo" /> | |||||
| <CheckBox fx:id="chkRetur" disable="true" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Voucher Retur" /> | |||||
| <CheckBox fx:id="chkGopay" disable="true" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Gopay"> | |||||
| <HBox.margin> | |||||
| <Insets right="10.0" /> | |||||
| </HBox.margin> | |||||
| </CheckBox> | |||||
| <CheckBox fx:id="chkOvo" disable="true" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="OVO"> | |||||
| <HBox.margin> | |||||
| <Insets right="10.0" /> | |||||
| </HBox.margin> | |||||
| </CheckBox> | |||||
| <CheckBox fx:id="chkPoin" disable="true" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Poin"> | |||||
| <HBox.margin> | |||||
| <Insets right="10.0" /> | |||||
| </HBox.margin> | |||||
| </CheckBox> | |||||
| </children> | |||||
| </HBox> | |||||
| </content> | |||||
| <padding> | |||||
| <Insets bottom="5.0" left="14.0" right="14.0" top="5.0" /> | |||||
| </padding> | |||||
| </ScrollPane> | |||||
| <ScrollPane fitToWidth="true" layoutX="8.0" layoutY="69.0" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="99.0"> | |||||
| <content> | |||||
| <VBox fx:id="vbContent" /> | |||||
| </content> | |||||
| </ScrollPane> | |||||
| </children> | |||||
| </AnchorPane> | |||||
| @@ -10,7 +10,7 @@ | |||||
| <?import javafx.scene.layout.VBox?> | <?import javafx.scene.layout.VBox?> | ||||
| <?import javafx.scene.text.Font?> | <?import javafx.scene.text.Font?> | ||||
| <AnchorPane id="AnchorPane" minHeight="-Infinity" minWidth="-Infinity" prefHeight="300.0" prefWidth="450.0" stylesheets="@../styles/pos_styles.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarController"> | |||||
| <AnchorPane id="AnchorPane" fx:id="apContent" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="450.0" stylesheets="@../styles/pos_styles.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarController"> | |||||
| <children> | <children> | ||||
| <Label layoutX="14.0" layoutY="14.0" text="Bayar" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | <Label layoutX="14.0" layoutY="14.0" text="Bayar" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | ||||
| <font> | <font> | ||||
| @@ -26,7 +26,7 @@ | |||||
| <Insets right="10.0" /> | <Insets right="10.0" /> | ||||
| </HBox.margin> | </HBox.margin> | ||||
| </CheckBox> | </CheckBox> | ||||
| <CheckBox fx:id="chkKartu" disable="true" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Debit/Kredit"> | |||||
| <CheckBox fx:id="chkKartu" mnemonicParsing="false" onAction="#chkPilihanOnAction" text="Debit/Kredit"> | |||||
| <HBox.margin> | <HBox.margin> | ||||
| <Insets right="10.0" /> | <Insets right="10.0" /> | ||||
| </HBox.margin> | </HBox.margin> | ||||
| @@ -55,14 +55,19 @@ | |||||
| <Insets bottom="5.0" left="14.0" right="14.0" top="5.0" /> | <Insets bottom="5.0" left="14.0" right="14.0" top="5.0" /> | ||||
| </padding> | </padding> | ||||
| </ScrollPane> | </ScrollPane> | ||||
| <ScrollPane fitToWidth="true" layoutY="73.0" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="55.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="73.0"> | |||||
| <ScrollPane fitToWidth="true" layoutY="73.0" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="105.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="73.0"> | |||||
| <content> | <content> | ||||
| <VBox fx:id="vbContent" /> | <VBox fx:id="vbContent" /> | ||||
| </content> | </content> | ||||
| </ScrollPane> | </ScrollPane> | ||||
| <Label fx:id="lblKurangBayar" alignment="CENTER_RIGHT" layoutX="153.0" layoutY="242.0" maxWidth="1.7976931348623157E308" text="Rp99.999.999,00" textAlignment="RIGHT" textFill="#7c7c7c" AnchorPane.bottomAnchor="55.0" AnchorPane.leftAnchor="153.0" AnchorPane.rightAnchor="14.0"> | |||||
| <font> | |||||
| <Font name="System Bold" size="36.0" /> | |||||
| </font> | |||||
| </Label> | |||||
| <StackPane id="price-background" alignment="CENTER_RIGHT" layoutX="77.0" layoutY="245.0" maxHeight="1.7976931348623157E308" prefHeight="55.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> | <StackPane id="price-background" alignment="CENTER_RIGHT" layoutX="77.0" layoutY="245.0" maxHeight="1.7976931348623157E308" prefHeight="55.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0"> | ||||
| <children> | <children> | ||||
| <Label fx:id="lblGrandTotal" text="Rp99.999.999,00" textAlignment="RIGHT" textFill="YELLOW"> | |||||
| <Label fx:id="lblGrandTotal" alignment="CENTER_RIGHT" maxWidth="1.7976931348623157E308" text="Rp99.999.999,00" textAlignment="RIGHT" textFill="YELLOW"> | |||||
| <font> | <font> | ||||
| <Font name="System Bold" size="36.0" /> | <Font name="System Bold" size="36.0" /> | ||||
| </font> | </font> | ||||
| @@ -15,7 +15,7 @@ | |||||
| <AnchorPane id="AnchorPane" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarKartuController"> | <AnchorPane id="AnchorPane" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarKartuController"> | ||||
| <children> | <children> | ||||
| <Separator layoutX="30.0" layoutY="13.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="5.0" /> | <Separator layoutX="30.0" layoutY="13.0" prefWidth="200.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="5.0" /> | ||||
| <Label layoutX="15.0" layoutY="14.0" text="Non Tunai" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | |||||
| <Label layoutX="15.0" layoutY="14.0" text="Non Tunai - diset statis bayar 50rb" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | |||||
| <font> | <font> | ||||
| <Font size="16.0" /> | <Font size="16.0" /> | ||||
| </font> | </font> | ||||
| @@ -11,8 +11,7 @@ | |||||
| <?import javafx.scene.layout.RowConstraints?> | <?import javafx.scene.layout.RowConstraints?> | ||||
| <?import javafx.scene.text.Font?> | <?import javafx.scene.text.Font?> | ||||
| <AnchorPane id="AnchorPane" prefWidth="600.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/11.0.1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarPoinController"> | |||||
| <AnchorPane id="AnchorPane" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="id.amigogroup.posterminal.bayar.FormBayarPoinController"> | |||||
| <children> | <children> | ||||
| <Label layoutX="14.0" layoutY="14.0" text="Poin" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | <Label layoutX="14.0" layoutY="14.0" text="Poin" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | ||||
| <font> | <font> | ||||
| @@ -46,12 +45,12 @@ | |||||
| <Insets right="2.5" top="2.5" /> | <Insets right="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| </Label> | </Label> | ||||
| <TextField alignment="CENTER_RIGHT" GridPane.columnIndex="3" GridPane.rowIndex="1"> | |||||
| <TextField fx:id="fldPoin" alignment="CENTER_RIGHT" onKeyReleased="#fldPoinOnKeyReleased" GridPane.columnIndex="3" GridPane.rowIndex="1"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets left="5.0" top="2.5" /> | <Insets left="5.0" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| </TextField> | </TextField> | ||||
| <Label text=": -" GridPane.columnIndex="3"> | |||||
| <Label fx:id="lblPoin" text=": -" GridPane.columnIndex="3"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" left="5.0" /> | <Insets bottom="2.5" left="5.0" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| @@ -47,6 +47,9 @@ | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets left="5.0" right="2.5" top="2.5" /> | <Insets left="5.0" right="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| <font> | |||||
| <Font name="System Bold" size="12.0" /> | |||||
| </font> | |||||
| </Label> | </Label> | ||||
| </children> | </children> | ||||
| </GridPane> | </GridPane> | ||||
| @@ -81,7 +81,7 @@ | |||||
| </GridPane> | </GridPane> | ||||
| </bottom> | </bottom> | ||||
| <left> | <left> | ||||
| <SplitPane dividerPositions="0.6" orientation="VERTICAL" prefWidth="200.0"> | |||||
| <SplitPane dividerPositions="0.45" orientation="VERTICAL" prefWidth="200.0"> | |||||
| <items> | <items> | ||||
| <ScrollPane fx:id="spNavigasi" fitToHeight="true" fitToWidth="true" style="-fx-background-color: transparent;"> | <ScrollPane fx:id="spNavigasi" fitToHeight="true" fitToWidth="true" style="-fx-background-color: transparent;"> | ||||
| <content> | <content> | ||||
| @@ -139,33 +139,44 @@ | |||||
| <RowConstraints valignment="TOP" vgrow="SOMETIMES" /> | <RowConstraints valignment="TOP" vgrow="SOMETIMES" /> | ||||
| <RowConstraints valignment="TOP" vgrow="SOMETIMES" /> | <RowConstraints valignment="TOP" vgrow="SOMETIMES" /> | ||||
| <RowConstraints valignment="TOP" vgrow="SOMETIMES" /> | <RowConstraints valignment="TOP" vgrow="SOMETIMES" /> | ||||
| <RowConstraints minHeight="10.0" prefHeight="30.0" valignment="TOP" vgrow="SOMETIMES" /> | |||||
| </rowConstraints> | </rowConstraints> | ||||
| <children> | <children> | ||||
| <Label text="Nama"> | |||||
| <Label text="Nama" GridPane.rowIndex="1"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" top="2.5" /> | <Insets bottom="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| </Label> | </Label> | ||||
| <Label fx:id="lblNamaPelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1"> | |||||
| <Label fx:id="lblNamaPelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="1"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" top="2.5" /> | <Insets bottom="2.5" top="2.5" /> | ||||
| </GridPane.margin></Label> | </GridPane.margin></Label> | ||||
| <Label text="Tgl Lahir" GridPane.rowIndex="1"> | |||||
| <Label text="Tgl Lahir" GridPane.rowIndex="2"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" top="2.5" /> | <Insets bottom="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| </Label> | </Label> | ||||
| <Label fx:id="lblTglLahirPelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="1"> | |||||
| <Label fx:id="lblTglLahirPelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" top="2.5" /> | <Insets bottom="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| </Label> | </Label> | ||||
| <Label text="No Telp" GridPane.rowIndex="2"> | |||||
| <Label text="No Telp" GridPane.rowIndex="3"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" top="2.5" /> | <Insets bottom="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||
| </Label> | </Label> | ||||
| <Label fx:id="lblNoTelpPelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="2"> | |||||
| <Label fx:id="lblNoTelpPelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1" GridPane.rowIndex="3"> | |||||
| <GridPane.margin> | |||||
| <Insets bottom="2.5" top="2.5" /> | |||||
| </GridPane.margin> | |||||
| </Label> | |||||
| <Label text="Kode"> | |||||
| <GridPane.margin> | |||||
| <Insets bottom="2.5" top="2.5" /> | |||||
| </GridPane.margin> | |||||
| </Label> | |||||
| <Label fx:id="lblKodePelanggan" maxWidth="110.0" text=": -" wrapText="true" GridPane.columnIndex="1"> | |||||
| <GridPane.margin> | <GridPane.margin> | ||||
| <Insets bottom="2.5" top="2.5" /> | <Insets bottom="2.5" top="2.5" /> | ||||
| </GridPane.margin> | </GridPane.margin> | ||||