| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
837f109692 | Merge Agnes-MenambahkanButtonBataldiRetur | 5 years ago |
|
|
4edd64b16e | Menambahkan button batal di Retur | 5 years ago |
| @@ -21,6 +21,7 @@ import java.util.logging.Logger; | |||
| import javafx.beans.property.ReadOnlyObjectWrapper; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.event.ActionEvent; | |||
| import javafx.fxml.FXML; | |||
| import javafx.fxml.FXMLLoader; | |||
| import javafx.fxml.Initializable; | |||
| @@ -33,6 +34,7 @@ import javafx.scene.control.Dialog; | |||
| import javafx.scene.control.TableColumn; | |||
| import javafx.scene.control.TableView; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.input.KeyCode; | |||
| import javafx.scene.input.KeyEvent; | |||
| import javafx.scene.layout.AnchorPane; | |||
| import javafx.stage.Window; | |||
| @@ -107,7 +109,11 @@ public class DialogCariNotaTundaController extends Dialog<String> implements Ini | |||
| .getName()).log(Level.SEVERE, null, e); | |||
| } | |||
| } | |||
| @FXML | |||
| void cbxNotaTundaOnAction(ActionEvent event) { | |||
| } | |||
| public Observer<Pagination<MNotaTunai>> getNotaTunaiTundaObserver = new Observer<Pagination<MNotaTunai>>() { | |||
| @Override | |||
| @@ -136,7 +136,7 @@ public class FormTransaksiReturController implements Initializable { | |||
| tcDisc2.setCellValueFactory(new PropertyValueFactory<>("disc2")); | |||
| tcSubTotal.setCellValueFactory(new PropertyValueFactory<>("subTotal")); | |||
| tcPramuniaga.setCellValueFactory(new PropertyValueFactory<>("fldPramuniaga")); | |||
| // tcBtnBatal.setCellValueFactory(new PropertyValueFactory<>("btnBatal")); | |||
| // tcBtnBatal.setCellValueFactory(new PropertyValueFactory<>("btnBatal")); | |||
| tbvPenjualan.setItems(daftarTabelPenjualan); | |||
| tcNoRetur.setCellValueFactory((TableColumn.CellDataFeatures<TabelBarangRetur, Integer> cell) -> { | |||
| @@ -151,6 +151,7 @@ public class FormTransaksiReturController implements Initializable { | |||
| tcDisc2Retur.setCellValueFactory(new PropertyValueFactory<>("disc2")); | |||
| tcSubTotalRetur.setCellValueFactory(new PropertyValueFactory<>("subTotal")); | |||
| tcPramuniagaRetur.setCellValueFactory(new PropertyValueFactory<>("fldPramuniaga")); | |||
| tcBtnBatal.setCellValueFactory(new PropertyValueFactory<>("btnBatal")); | |||
| tbvRetur.setItems(daftarTabelRetur); | |||
| Platform.runLater(() -> { | |||
| @@ -220,9 +221,18 @@ public class FormTransaksiReturController implements Initializable { | |||
| private void refreshDataRetur(List<DNotaRetur> daftarDNotaRetur) { | |||
| daftarTabelRetur.clear(); | |||
| for(DNotaRetur dNotaRetur : daftarDNotaRetur){ | |||
| //Button | |||
| for (DNotaRetur dNotaRetur : daftarDNotaRetur) { | |||
| //Button | |||
| Button btnBatal = ButtonUtility.generateButton(ButtonUtility.CLOSE_ICON); | |||
| btnBatal.setOnAction((t) -> { | |||
| Alert alert = AlertUtil.getAlertDialogKonfirmasi( | |||
| AlertUtil.DIALOG_KONFIRMASI_MESSAGE, | |||
| "Yakin ingin menghapus barang?"); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| }); | |||
| TextField fldPramuniaga = new TextField(dNotaRetur.getKodePram()); | |||
| String namaBarang = "..."; | |||
| @@ -244,7 +254,8 @@ public class FormTransaksiReturController implements Initializable { | |||
| Fucout.getText(Fucout.formatRibuan( | |||
| dNotaRetur.getHargaJual() * dNotaRetur.getJumlah() | |||
| )), | |||
| fldPramuniaga); | |||
| fldPramuniaga, | |||
| btnBatal); | |||
| tbr.setData(dNotaRetur); | |||
| daftarTabelRetur.add(tbr); | |||
| @@ -383,6 +394,15 @@ public class FormTransaksiReturController implements Initializable { | |||
| success = true; | |||
| if (!ada) { | |||
| Button btnBatal = ButtonUtility.generateButton(ButtonUtility.CLOSE_ICON); | |||
| btnBatal.setOnAction((t) -> { | |||
| Alert alert = AlertUtil.getAlertDialogKonfirmasi( | |||
| AlertUtil.DIALOG_KONFIRMASI_MESSAGE, | |||
| "Yakin ingin menghapus barang?"); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| }); | |||
| TextField fldPramuniaga = new TextField(); | |||
| DNotaRetur dNotaRetur = new DNotaRetur(noNota, draggedTabelBarangTunai.getData()); | |||
| @@ -397,7 +417,9 @@ public class FormTransaksiReturController implements Initializable { | |||
| Fucout.getText(Fucout.formatRibuan( | |||
| dNotaRetur.getJumlah() * dNotaRetur.getHargaJual() | |||
| )), | |||
| fldPramuniaga); | |||
| fldPramuniaga, | |||
| btnBatal); | |||
| tbr.setData(dNotaRetur); | |||
| daftarTabelRetur.add(tbr); | |||
| @@ -97,7 +97,6 @@ public class FormTransaksiTunaiController implements Initializable { | |||
| private Text lblGrandTotal; | |||
| public final ObservableList<TabelBarangTunai> daftarTabelTransaksi = FXCollections.observableArrayList(); | |||
| public static final ButtonType btnAction = new ButtonType("BATAL", ButtonBar.ButtonData.YES); | |||
| private String noNota = ""; | |||
| private AmigoPosRx posRx = new AmigoPosRx(); | |||
| public int total = 0; | |||
| @@ -8,6 +8,7 @@ package id.amigogroup.posterminal.transaksi; | |||
| import id.amigogroup.posterminal.model.DNotaRetur; | |||
| import javafx.beans.property.SimpleObjectProperty; | |||
| import javafx.beans.property.SimpleStringProperty; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.TextField; | |||
| /** | |||
| @@ -25,11 +26,11 @@ public class TabelBarangRetur { | |||
| private SimpleStringProperty disc2; | |||
| private SimpleStringProperty subTotal; | |||
| private SimpleObjectProperty<TextField> fldPramuniaga; | |||
| private SimpleObjectProperty<Button> btnBatal; | |||
| private DNotaRetur data; | |||
| public TabelBarangRetur(String kode, String nama, String ukur, String jumlah, String harga, String disc1, | |||
| String disc2, String subTotal, TextField fldPramuniaga) { | |||
| String disc2, String subTotal, TextField fldPramuniaga, Button btnBatal) { | |||
| this.kode = new SimpleStringProperty(kode); | |||
| this.nama = new SimpleStringProperty(nama); | |||
| this.ukur = new SimpleStringProperty(ukur); | |||
| @@ -39,6 +40,7 @@ public class TabelBarangRetur { | |||
| this.disc2 = new SimpleStringProperty(disc2); | |||
| this.subTotal = new SimpleStringProperty(subTotal); | |||
| this.fldPramuniaga = new SimpleObjectProperty<TextField>(fldPramuniaga); | |||
| this.btnBatal = new SimpleObjectProperty<>(btnBatal); | |||
| } | |||
| /** | |||
| @@ -180,4 +182,18 @@ public class TabelBarangRetur { | |||
| public void setData(DNotaRetur data) { | |||
| this.data = data; | |||
| } | |||
| /** | |||
| * @return the action | |||
| */ | |||
| public Button getBtnBatal() { | |||
| return btnBatal.get(); | |||
| } | |||
| /** | |||
| * @param action the action to set | |||
| */ | |||
| public void setBtnBatal(Button btnBatal) { | |||
| this.btnBatal.set(btnBatal); | |||
| } | |||
| } | |||
| @@ -14,7 +14,7 @@ | |||
| <Font size="16.0" /> | |||
| </font> | |||
| </Label> | |||
| <ComboBox fx:id="cbxCariNotaTunda" layoutX="4.0" layoutY="46.0" prefWidth="281.0" promptText="Nomor Nota" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="46.0" /> | |||
| <ComboBox fx:id="cbxCariNotaTunda" layoutX="4.0" layoutY="46.0" onAction="#cbxNotaTundaOnAction" prefWidth="281.0" promptText="Nomor Nota" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="46.0" /> | |||
| <Label layoutY="29.0" text="Nomor Nota Tunda" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="29.0" /> | |||
| <Label layoutX="14.0" layoutY="76.0" text="Pelanggan" AnchorPane.leftAnchor="4.0" AnchorPane.topAnchor="76.0"> | |||
| <font> | |||