diff --git a/src/main/java/id/amigogroup/posterminal/transaksi/FormTransaksiTunaiController.java b/src/main/java/id/amigogroup/posterminal/transaksi/FormTransaksiTunaiController.java index 726ae04..b3595b3 100644 --- a/src/main/java/id/amigogroup/posterminal/transaksi/FormTransaksiTunaiController.java +++ b/src/main/java/id/amigogroup/posterminal/transaksi/FormTransaksiTunaiController.java @@ -36,6 +36,11 @@ import javafx.scene.input.KeyCombination; import javafx.scene.input.KeyEvent; import javafx.scene.text.Text; import javafx.stage.Window; +import java.util.Date; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import javafx.scene.control.Label; + /** * FXML Controller class @@ -69,7 +74,7 @@ public class FormTransaksiTunaiController implements Initializable { @FXML private TableColumn tcSubtotal; @FXML - private TableColumn tcPramuniaga; + private TableColumn tcPramuniaga; final ObservableList daftarTabelBarang = FXCollections.observableArrayList(); @FXML private Text lblGrandTotal; @@ -102,7 +107,8 @@ public class FormTransaksiTunaiController implements Initializable { fillTable(new ArrayList<>()); } - + + private void initShortcuts() { // Map listShortcuts = new HashMap<>(); // @@ -173,16 +179,27 @@ public class FormTransaksiTunaiController implements Initializable { @FXML void fldScanOnKeyPressed(KeyEvent event) { if (event.getCode() == KeyCode.ENTER) { + //proses scan System.out.println("Scan"); } } + + public void fillTable(List daftarBarangTunai) { - String[] tunai = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; - ComboBox cbxAction = new ComboBox<>(FXCollections.observableArrayList(tunai)); + String[] promo = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; + ComboBox cbxAction = new ComboBox<>(FXCollections.observableArrayList(promo)); cbxAction.getSelectionModel().select("Ulang Tahun"); + TextField txtScan = new TextField(); + txtScan.setOnKeyPressed((t) -> { + if (t.getCode() == KeyCode.ENTER){ + fldScan.requestFocus(); + } + }); daftarTabelBarang.add(new TabelBarangTunai("AACOBA001ABCDXL", "Barang x", "XL","1","79.900","0","0", cbxAction, - "79.900","0001")); + "79.900", txtScan)); } + + } diff --git a/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangRetur.java b/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangRetur.java new file mode 100644 index 0000000..ba70d45 --- /dev/null +++ b/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangRetur.java @@ -0,0 +1,169 @@ +/* + * 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.transaksi; + +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.scene.control.Button; +import javafx.scene.control.ComboBox; +import javafx.scene.control.TextField; + +/** + * + * @author AGNES + */ +public class TabelBarangRetur { + + + + private SimpleStringProperty tcKodeRetur; + private SimpleStringProperty tcNamaRetur; + private SimpleStringProperty tcUkurRetur; + private SimpleStringProperty tcJumlahRetur; + private SimpleStringProperty tcHargaRetur; + private SimpleStringProperty tcDisc1Retur; + private SimpleStringProperty tcDisc2Retur; + private SimpleStringProperty tcSubtotalRetur; + private SimpleObjectPropertytcPramuniagaRetur; + + public TabelBarangRetur(String tcKodeRetur, String tcNamaRetur, String tcUkurRetur, String tcJumlahRetur, String tcHargaRetur, String tcDisc1Retur, + String tcDisc2Retur, String tcSubtotalRetur, TextField tcPramuniagaRetur) { + this.tcKodeRetur = new SimpleStringProperty(tcKodeRetur); + this.tcNamaRetur = new SimpleStringProperty(tcNamaRetur); + this.tcUkurRetur = new SimpleStringProperty(tcUkurRetur); + this.tcJumlahRetur = new SimpleStringProperty(tcJumlahRetur); + this.tcHargaRetur = new SimpleStringProperty(tcHargaRetur); + this.tcDisc1Retur = new SimpleStringProperty(tcDisc1Retur); + this.tcDisc2Retur = new SimpleStringProperty(tcDisc2Retur); + this.tcSubtotalRetur = new SimpleStringProperty(tcSubtotalRetur); + this.tcPramuniagaRetur = new SimpleObjectProperty(tcPramuniagaRetur); + } + /** + * @return the tcKode + */ + public String getTcKodeRetur() { + return tcKodeRetur.get(); + } + + /** + * @param tcKode the tcKode to set + */ + public void setTcKodeRetur(String tcKodeRetur) { + this.tcKodeRetur.set(tcKodeRetur); + } + + /** + * @return the tcNama + */ + public String getTcNamaRetur() { + return tcNamaRetur.get(); + } + + /** + * @param tcNama the tcNama to set + */ + public void setTcNamaRetur(String tcNamaRetur) { + this.tcNamaRetur.set(tcNamaRetur); + } + + /** + * @return the tcUkur + */ + public String getTcUkurRetur() { + return tcUkurRetur.get(); + } + + /** + * @param tcUkur the tcUkur to set + */ + public void setTcUkurRetur(String tcUkurRetur) { + this.tcUkurRetur.set(tcUkurRetur); + } + + /** + * @return the tcJumlah + */ + public String getTcJumlahRetur() { + return tcJumlahRetur.get(); + } + + /** + * @param tcJumlah the tcJumlah to set + */ + public void setTcJumlahRetur(String tcJumlahRetur) { + this.tcJumlahRetur.set(tcJumlahRetur); + } + + /** + * @return the tcHarga + */ + public String getTcHargaRetur() { + return tcHargaRetur.get(); + } + + /** + * @param tcHarga the tcHarga to set + */ + public void setTcHargaRetur(String tcHargaRetur) { + this.tcHargaRetur.set(tcHargaRetur); + } + + /** + * @return the tcDisc1 + */ + public String getTcDisc1Retur() { + return tcDisc1Retur.get(); + } + + /** + * @param tcDisc1 the tcDisc1 to set + */ + public void setTcDisc1Retur(String tcDisc1Retur) { + this.tcDisc1Retur.set(tcDisc1Retur); + } + + /** + * @return the tcDisc2 + */ + public String getTcDisc2Retur() { + return tcDisc2Retur.get(); + } + + /** + * @param tcDisc2 the tcDisc2 to set + */ + public void setTcDisc2Retur(String tcDisc2Retur) { + this.tcDisc2Retur.set(tcDisc2Retur); + } + + /** + * @return the tcSubtotal + */ + public String getTcSubtotalRetur() { + return tcSubtotalRetur.get(); + } + + /** + * @param tcSubtotal the tcSubtotal to set + */ + public void setTcSubtotalRetur(String tcSubtotalRetur) { + this.tcSubtotalRetur.set(tcSubtotalRetur); + } + + /** + * @return the tcPramuniaga + */ + public TextField getTcPramuniagaRetur() { + return tcPramuniagaRetur.get(); + } + + /** + * @param tcPramuniaga the tcPramuniaga to set + */ + public void setTcPramuniagaRetur(TextField tcPramuniagaRetur) { + this.tcPramuniagaRetur.set(tcPramuniagaRetur); + } + } diff --git a/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangTunai.java b/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangTunai.java index 76b231e..7d5c411 100644 --- a/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangTunai.java +++ b/src/main/java/id/amigogroup/posterminal/transaksi/TabelBarangTunai.java @@ -9,6 +9,7 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.beans.property.SimpleStringProperty; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; +import javafx.scene.control.TextField; /** * @@ -27,10 +28,10 @@ public class TabelBarangTunai { private SimpleStringProperty tcDisc2; private SimpleObjectProperty tcPromo; private SimpleStringProperty tcSubtotal; - private SimpleStringProperty tcPramuniaga; + private SimpleObjectPropertytcPramuniaga; public TabelBarangTunai(String tcKode, String tcNama, String tcUkur, String tcJumlah, String tcHarga, String tcDisc1, - String tcDisc2, ComboBox tcPromo, String tcSubtotal, String tcPramuniaga) { + String tcDisc2, ComboBox tcPromo, String tcSubtotal, TextField tcPramuniaga) { this.tcKode = new SimpleStringProperty(tcKode); this.tcNama = new SimpleStringProperty(tcNama); this.tcUkur = new SimpleStringProperty(tcUkur); @@ -40,8 +41,10 @@ public class TabelBarangTunai { this.tcDisc2 = new SimpleStringProperty(tcDisc2); this.tcPromo = new SimpleObjectProperty(tcPromo); this.tcSubtotal = new SimpleStringProperty(tcSubtotal); - this.tcPramuniaga = new SimpleStringProperty(tcPramuniaga); + this.tcPramuniaga = new SimpleObjectProperty(tcPramuniaga); } + + /** * @return the tcKode */ @@ -171,14 +174,14 @@ public class TabelBarangTunai { /** * @return the tcPramuniaga */ - public String getTcPramuniaga() { + public TextField getTcPramuniaga() { return tcPramuniaga.get(); } /** * @param tcPramuniaga the tcPramuniaga to set */ - public void setTcPramuniaga(String tcPramuniaga) { + public void setTcPramuniaga(TextField tcPramuniaga) { this.tcPramuniaga.set(tcPramuniaga); } } diff --git a/src/main/resources/fxml/FormTransaksiRetur.fxml b/src/main/resources/fxml/FormTransaksiRetur.fxml index 9b94039..8eb27e1 100644 --- a/src/main/resources/fxml/FormTransaksiRetur.fxml +++ b/src/main/resources/fxml/FormTransaksiRetur.fxml @@ -25,10 +25,18 @@ - + - - + + + + + + + + + + @@ -40,15 +48,23 @@ - + - - + + + + + + + + + + diff --git a/src/main/resources/fxml/FormTransaksiTunai.fxml b/src/main/resources/fxml/FormTransaksiTunai.fxml index 92dcb3c..17e08fe 100644 --- a/src/main/resources/fxml/FormTransaksiTunai.fxml +++ b/src/main/resources/fxml/FormTransaksiTunai.fxml @@ -36,7 +36,7 @@ - -