| @@ -36,6 +36,11 @@ import javafx.scene.input.KeyCombination; | |||||
| import javafx.scene.input.KeyEvent; | import javafx.scene.input.KeyEvent; | ||||
| import javafx.scene.text.Text; | import javafx.scene.text.Text; | ||||
| import javafx.stage.Window; | import javafx.stage.Window; | ||||
| import java.util.Date; | |||||
| import java.text.DateFormat; | |||||
| import java.text.SimpleDateFormat; | |||||
| import javafx.scene.control.Label; | |||||
| /** | /** | ||||
| * FXML Controller class | * FXML Controller class | ||||
| @@ -69,7 +74,7 @@ public class FormTransaksiTunaiController implements Initializable { | |||||
| @FXML | @FXML | ||||
| private TableColumn<TabelBarangTunai, String> tcSubtotal; | private TableColumn<TabelBarangTunai, String> tcSubtotal; | ||||
| @FXML | @FXML | ||||
| private TableColumn<TabelBarangTunai, String> tcPramuniaga; | |||||
| private TableColumn<TabelBarangTunai, TextField> tcPramuniaga; | |||||
| final ObservableList<TabelBarangTunai> daftarTabelBarang = FXCollections.observableArrayList(); | final ObservableList<TabelBarangTunai> daftarTabelBarang = FXCollections.observableArrayList(); | ||||
| @FXML | @FXML | ||||
| private Text lblGrandTotal; | private Text lblGrandTotal; | ||||
| @@ -102,7 +107,8 @@ public class FormTransaksiTunaiController implements Initializable { | |||||
| fillTable(new ArrayList<>()); | fillTable(new ArrayList<>()); | ||||
| } | } | ||||
| private void initShortcuts() { | private void initShortcuts() { | ||||
| // Map<KeyCombination, Runnable> listShortcuts = new HashMap<>(); | // Map<KeyCombination, Runnable> listShortcuts = new HashMap<>(); | ||||
| // | // | ||||
| @@ -173,16 +179,27 @@ public class FormTransaksiTunaiController implements Initializable { | |||||
| @FXML | @FXML | ||||
| void fldScanOnKeyPressed(KeyEvent event) { | void fldScanOnKeyPressed(KeyEvent event) { | ||||
| if (event.getCode() == KeyCode.ENTER) { | if (event.getCode() == KeyCode.ENTER) { | ||||
| //proses scan | //proses scan | ||||
| System.out.println("Scan"); | System.out.println("Scan"); | ||||
| } | } | ||||
| } | } | ||||
| public void fillTable(List<TabelBarangTunai> daftarBarangTunai) { | public void fillTable(List<TabelBarangTunai> daftarBarangTunai) { | ||||
| String[] tunai = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; | |||||
| ComboBox<String> cbxAction = new ComboBox<>(FXCollections.observableArrayList(tunai)); | |||||
| String[] promo = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; | |||||
| ComboBox<String> cbxAction = new ComboBox<>(FXCollections.observableArrayList(promo)); | |||||
| cbxAction.getSelectionModel().select("Ulang Tahun"); | 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, | daftarTabelBarang.add(new TabelBarangTunai("AACOBA001ABCDXL", "Barang x", "XL","1","79.900","0","0", cbxAction, | ||||
| "79.900","0001")); | |||||
| "79.900", txtScan)); | |||||
| } | } | ||||
| } | } | ||||
| @@ -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 SimpleObjectProperty<TextField>tcPramuniagaRetur; | |||||
| 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<TextField>(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); | |||||
| } | |||||
| } | |||||
| @@ -9,6 +9,7 @@ import javafx.beans.property.SimpleObjectProperty; | |||||
| import javafx.beans.property.SimpleStringProperty; | import javafx.beans.property.SimpleStringProperty; | ||||
| import javafx.scene.control.Button; | import javafx.scene.control.Button; | ||||
| import javafx.scene.control.ComboBox; | import javafx.scene.control.ComboBox; | ||||
| import javafx.scene.control.TextField; | |||||
| /** | /** | ||||
| * | * | ||||
| @@ -27,10 +28,10 @@ public class TabelBarangTunai { | |||||
| private SimpleStringProperty tcDisc2; | private SimpleStringProperty tcDisc2; | ||||
| private SimpleObjectProperty<ComboBox> tcPromo; | private SimpleObjectProperty<ComboBox> tcPromo; | ||||
| private SimpleStringProperty tcSubtotal; | private SimpleStringProperty tcSubtotal; | ||||
| private SimpleStringProperty tcPramuniaga; | |||||
| private SimpleObjectProperty<TextField>tcPramuniaga; | |||||
| public TabelBarangTunai(String tcKode, String tcNama, String tcUkur, String tcJumlah, String tcHarga, String tcDisc1, | 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.tcKode = new SimpleStringProperty(tcKode); | ||||
| this.tcNama = new SimpleStringProperty(tcNama); | this.tcNama = new SimpleStringProperty(tcNama); | ||||
| this.tcUkur = new SimpleStringProperty(tcUkur); | this.tcUkur = new SimpleStringProperty(tcUkur); | ||||
| @@ -40,8 +41,10 @@ public class TabelBarangTunai { | |||||
| this.tcDisc2 = new SimpleStringProperty(tcDisc2); | this.tcDisc2 = new SimpleStringProperty(tcDisc2); | ||||
| this.tcPromo = new SimpleObjectProperty<ComboBox>(tcPromo); | this.tcPromo = new SimpleObjectProperty<ComboBox>(tcPromo); | ||||
| this.tcSubtotal = new SimpleStringProperty(tcSubtotal); | this.tcSubtotal = new SimpleStringProperty(tcSubtotal); | ||||
| this.tcPramuniaga = new SimpleStringProperty(tcPramuniaga); | |||||
| this.tcPramuniaga = new SimpleObjectProperty<TextField>(tcPramuniaga); | |||||
| } | } | ||||
| /** | /** | ||||
| * @return the tcKode | * @return the tcKode | ||||
| */ | */ | ||||
| @@ -171,14 +174,14 @@ public class TabelBarangTunai { | |||||
| /** | /** | ||||
| * @return the tcPramuniaga | * @return the tcPramuniaga | ||||
| */ | */ | ||||
| public String getTcPramuniaga() { | |||||
| public TextField getTcPramuniaga() { | |||||
| return tcPramuniaga.get(); | return tcPramuniaga.get(); | ||||
| } | } | ||||
| /** | /** | ||||
| * @param tcPramuniaga the tcPramuniaga to set | * @param tcPramuniaga the tcPramuniaga to set | ||||
| */ | */ | ||||
| public void setTcPramuniaga(String tcPramuniaga) { | |||||
| public void setTcPramuniaga(TextField tcPramuniaga) { | |||||
| this.tcPramuniaga.set(tcPramuniaga); | this.tcPramuniaga.set(tcPramuniaga); | ||||
| } | } | ||||
| } | } | ||||
| @@ -25,10 +25,18 @@ | |||||
| <items> | <items> | ||||
| <AnchorPane> | <AnchorPane> | ||||
| <children> | <children> | ||||
| <TableView AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="65.0"> | |||||
| <TableView fx:id="tbvPenjualan" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="65.0"> | |||||
| <columns> | <columns> | ||||
| <TableColumn maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" text="No" /> | |||||
| <TableColumn prefWidth="75.0" text="Kode Barang" /> | |||||
| <TableColumn fx:id="tcNo" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" text="No" /> | |||||
| <TableColumn fx:id="tcKode" prefWidth="75.0" text="Kode Barang" /> | |||||
| <TableColumn fx:id="tcNama" prefWidth="75.0" text="Nama Barang" /> | |||||
| <TableColumn fx:id="tcUkur" prefWidth="75.0" text="Ukur" /> | |||||
| <TableColumn fx:id="tcJumlah" prefWidth="75.0" text="Jumlah" /> | |||||
| <TableColumn fx:id="tcHarga" prefWidth="75.0" text="Harga" /> | |||||
| <TableColumn fx:id="tcDisc1" prefWidth="75.0" text="Disc 1" /> | |||||
| <TableColumn fx:id="tcDisc2" prefWidth="75.0" text="Disc 2" /> | |||||
| <TableColumn fx:id="tcSubtotal" prefWidth="75.0" text="Sub Total" /> | |||||
| <TableColumn fx:id="tcPramuniaga" prefWidth="75.0" text="Pramuniaga" /> | |||||
| </columns> | </columns> | ||||
| <columnResizePolicy> | <columnResizePolicy> | ||||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | ||||
| @@ -40,15 +48,23 @@ | |||||
| </font> | </font> | ||||
| </Label> | </Label> | ||||
| <Label layoutX="14.0" layoutY="20.0" text="Nomor Nota Penjualan" /> | <Label layoutX="14.0" layoutY="20.0" text="Nomor Nota Penjualan" /> | ||||
| <TextField layoutX="14.0" layoutY="37.0" prefHeight="25.0" prefWidth="329.0" promptText="Nomor Nota Penjualan" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="37.0" /> | |||||
| <TextField fx:id="fldScanRetur" layoutX="14.0" layoutY="37.0" prefHeight="25.0" prefWidth="329.0" promptText="Nomor Nota Penjualan" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="37.0" /> | |||||
| </children> | </children> | ||||
| </AnchorPane> | </AnchorPane> | ||||
| <AnchorPane> | <AnchorPane> | ||||
| <children> | <children> | ||||
| <TableView prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0"> | |||||
| <TableView fx:id="tbvRetur" prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0"> | |||||
| <columns> | <columns> | ||||
| <TableColumn maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" text="No" /> | |||||
| <TableColumn prefWidth="75.0" text="Kode Barang" /> | |||||
| <TableColumn fx:id="tcNoRetur" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" text="No" /> | |||||
| <TableColumn fx:id="tcKodeRetur" prefWidth="75.0" text="Kode Barang" /> | |||||
| <TableColumn fx:id="tcNamaRetur" prefWidth="75.0" text="Nama Barang" /> | |||||
| <TableColumn fx:id="tcUkurRetur" prefWidth="75.0" text="Ukur" /> | |||||
| <TableColumn fx:id="tcJumlahRetur" prefWidth="75.0" text="Jumlah" /> | |||||
| <TableColumn fx:id="tcHargaRetur" prefWidth="75.0" text="Harga" /> | |||||
| <TableColumn fx:id="tcDisc1Retur" prefWidth="75.0" text="Disc 1" /> | |||||
| <TableColumn fx:id="tcDisc2Retur" prefWidth="75.0" text="Disc 2" /> | |||||
| <TableColumn fx:id="tcSubtotalRetur" prefWidth="75.0" text="Sub Total" /> | |||||
| <TableColumn fx:id="tcPramuniagaRetur" prefWidth="75.0" text="Pramuniaga" /> | |||||
| </columns> | </columns> | ||||
| <columnResizePolicy> | <columnResizePolicy> | ||||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | ||||
| @@ -36,7 +36,7 @@ | |||||
| <children> | <children> | ||||
| <HBox alignment="CENTER_LEFT" maxWidth="1.7976931348623157E308" spacing="5.0"> | <HBox alignment="CENTER_LEFT" maxWidth="1.7976931348623157E308" spacing="5.0"> | ||||
| <children> | <children> | ||||
| <Label text="Nomor Nota"> | |||||
| <Label fx:id="txtNoNota" text="Nomor Nota"> | |||||
| <font> | <font> | ||||
| <Font size="14.0" /> | <Font size="14.0" /> | ||||
| </font> | </font> | ||||
| @@ -61,7 +61,7 @@ | |||||
| <Font size="14.0" /> | <Font size="14.0" /> | ||||
| </font> | </font> | ||||
| </Label> | </Label> | ||||
| <Label text=": -"> | |||||
| <Label fx:id="txtTanggal" text=": -"> | |||||
| <HBox.margin> | <HBox.margin> | ||||
| <Insets /> | <Insets /> | ||||
| </HBox.margin> | </HBox.margin> | ||||
| @@ -76,7 +76,7 @@ | |||||
| </HBox> | </HBox> | ||||
| <HBox alignment="CENTER_LEFT" maxWidth="1.7976931348623157E308" spacing="5.0" GridPane.columnIndex="2"> | <HBox alignment="CENTER_LEFT" maxWidth="1.7976931348623157E308" spacing="5.0" GridPane.columnIndex="2"> | ||||
| <children> | <children> | ||||
| <Label text="Kasir"> | |||||
| <Label fx:id="txtKasir" text="Kasir"> | |||||
| <font> | <font> | ||||
| <Font size="14.0" /> | <Font size="14.0" /> | ||||
| </font> | </font> | ||||