Conflicts: src/main/java/id/amigogroup/posterminal/api/AmigoPosRx.java src/main/java/id/amigogroup/posterminal/api/ServiceApiBarang.javapull/3/head
| @@ -88,8 +88,8 @@ public class FormUtamaController implements Initializable { | |||
| private int jumlahNota = 0; | |||
| private final char NOTA_PREV = 'p'; | |||
| private final char NOTA_NEXT = 'n'; | |||
| private Observable<Pelanggan> pelangganObs; | |||
| AmigoPosRx posRx = new AmigoPosRx(); | |||
| private NotaContent notaContent = new NotaContent(); | |||
| private AmigoPosRx posRx = new AmigoPosRx(); | |||
| /** | |||
| * Initializes the controller class. | |||
| @@ -154,7 +154,7 @@ public class FormUtamaController implements Initializable { | |||
| button.getStyleClass().add("button-navigasi-transaksi"); | |||
| button.setMaxWidth(Double.MAX_VALUE); | |||
| button.setOnAction((event) -> { | |||
| setContent(loadNota("", tipeNota)); | |||
| setContent(loadNota(noNota, tipeNota)); | |||
| tipeNotaState = tipeNota; | |||
| updateSelectedNota(event); | |||
| }); | |||
| @@ -171,13 +171,13 @@ public class FormUtamaController implements Initializable { | |||
| loader.setLocation(getClass().getResource("/fxml/FormTransaksiTunai.fxml")); | |||
| node = loader.load(); | |||
| FormTransaksiTunaiController fttc = loader.getController(); | |||
| // fetc.initData(noNota); | |||
| fttc.initData(noNota); | |||
| break; | |||
| case FormConstanta.TRANSAKSI_RETUR: | |||
| loader.setLocation(getClass().getResource("/fxml/FormTransaksiRetur.fxml")); | |||
| node = loader.load(); | |||
| FormTransaksiReturController ftrc = loader.getController(); | |||
| // fetc.initData(noNota); | |||
| // ftrc.initData(noNota); | |||
| break; | |||
| } | |||
| } catch (IOException ex) { | |||
| @@ -245,7 +245,7 @@ public class FormUtamaController implements Initializable { | |||
| dialogCariPelanggan.initOwner(bpMain.getScene().getWindow()); | |||
| Optional<Pelanggan> result = dialogCariPelanggan.showAndWait(); | |||
| if(result.isPresent() && result.get() !=null){ | |||
| if (result.isPresent() && result.get() != null) { | |||
| SystemValue.member = result.get(); | |||
| SystemValue.isMember = true; | |||
| updateLabelPelanggan(result.get()); | |||
| @@ -333,65 +333,102 @@ public class FormUtamaController implements Initializable { | |||
| dialogTambahNota.initOwner(bpMain.getScene().getWindow()); | |||
| Optional<String> hasilReturn = dialogTambahNota.showAndWait(); | |||
| if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Tunai")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_TUNAI, | |||
| Fucout.TEKS_TIPE_NOTA_TUNAI); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Bon")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_BON, | |||
| Fucout.TEKS_TIPE_NOTA_BON); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Bawa Dulu")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_BAWA, | |||
| Fucout.TEKS_TIPE_NOTA_BAWA); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().equals("Baru:Retur")) { | |||
| Button buttonBaru = generateButtonNota("10-0220-0000X", | |||
| FormConstanta.TRANSAKSI_RETUR, | |||
| Fucout.TEKS_TIPE_NOTA_RETUR); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } else if (hasilReturn.isPresent() && hasilReturn.get().contains("Checkout:")) { | |||
| String noNota = hasilReturn.get().substring(9); | |||
| Button buttonBaru = null; | |||
| switch (noNota.charAt(0)) { | |||
| case Fucout.KODE_NOTA_BON: | |||
| break; | |||
| case Fucout.KODE_NOTA_BAWA: | |||
| break; | |||
| case Fucout.KODE_NOTA_RETUR: | |||
| buttonBaru = generateButtonNota(noNota, | |||
| FormConstanta.TRANSAKSI_RETUR, | |||
| Fucout.TEKS_TIPE_NOTA_RETUR); | |||
| break; | |||
| default: | |||
| buttonBaru = generateButtonNota(noNota, | |||
| FormConstanta.TRANSAKSI_TUNAI, | |||
| Fucout.TEKS_TIPE_NOTA_TUNAI); | |||
| break; | |||
| } | |||
| if (buttonBaru != null) { | |||
| if (hasilReturn.isPresent()) { | |||
| if (hasilReturn.get().equals("Baru:Tunai")) { | |||
| if (notaContent.btnTunai != null) { | |||
| navigasi.remove(notaContent.btnTunai); | |||
| vbNavigasi.getChildren().remove(notaContent.btnTunai); | |||
| } | |||
| Button buttonBaru = generateButtonNota(Fucout.getNoNotaTemporary(), | |||
| FormConstanta.TRANSAKSI_TUNAI, | |||
| Fucout.TEKS_TIPE_NOTA_TUNAI); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| notaContent.btnTunai = buttonBaru; | |||
| jumlahNota++; | |||
| } else if (hasilReturn.get().equals("Baru:Bon")) { | |||
| if (notaContent.btnBon != null) { | |||
| navigasi.remove(notaContent.btnBon); | |||
| vbNavigasi.getChildren().remove(notaContent.btnBon); | |||
| } | |||
| Button buttonBaru = generateButtonNota("B-" + Fucout.getNoNotaTemporary(), | |||
| FormConstanta.TRANSAKSI_BON, | |||
| Fucout.TEKS_TIPE_NOTA_BON); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| notaContent.btnBon = buttonBaru; | |||
| jumlahNota++; | |||
| } else if (hasilReturn.get().equals("Baru:Bawa Dulu")) { | |||
| if (notaContent.btnBawa != null) { | |||
| navigasi.remove(notaContent.btnBawa); | |||
| vbNavigasi.getChildren().remove(notaContent.btnBawa); | |||
| } | |||
| Button buttonBaru = generateButtonNota("W-" + Fucout.getNoNotaTemporary(), | |||
| FormConstanta.TRANSAKSI_BAWA, | |||
| Fucout.TEKS_TIPE_NOTA_BAWA); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| notaContent.btnBawa = buttonBaru; | |||
| jumlahNota++; | |||
| } else if (hasilReturn.get().equals("Baru:Retur")) { | |||
| if (notaContent.btnRetur != null) { | |||
| navigasi.remove(notaContent.btnRetur); | |||
| vbNavigasi.getChildren().remove(notaContent.btnRetur); | |||
| } | |||
| Button buttonBaru = generateButtonNota("R-" + Fucout.getNoNotaTemporary(), | |||
| FormConstanta.TRANSAKSI_RETUR, | |||
| Fucout.TEKS_TIPE_NOTA_RETUR); | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| notaContent.btnRetur = buttonBaru; | |||
| jumlahNota++; | |||
| } else if (hasilReturn.get().contains("Checkout:")) { | |||
| String noNota = hasilReturn.get().substring(9); | |||
| Button buttonBaru = null; | |||
| switch (noNota.charAt(0)) { | |||
| case Fucout.KODE_NOTA_BON: | |||
| break; | |||
| case Fucout.KODE_NOTA_BAWA: | |||
| break; | |||
| case Fucout.KODE_NOTA_RETUR: | |||
| if (notaContent.btnRetur != null) { | |||
| navigasi.remove(notaContent.btnRetur); | |||
| vbNavigasi.getChildren().remove(notaContent.btnRetur); | |||
| } | |||
| buttonBaru = generateButtonNota(noNota, | |||
| FormConstanta.TRANSAKSI_RETUR, | |||
| Fucout.TEKS_TIPE_NOTA_RETUR); | |||
| notaContent.btnRetur = buttonBaru; | |||
| break; | |||
| default: | |||
| if (notaContent.btnTunai != null) { | |||
| navigasi.remove(notaContent.btnTunai); | |||
| vbNavigasi.getChildren().remove(notaContent.btnTunai); | |||
| } | |||
| buttonBaru = generateButtonNota(noNota, | |||
| FormConstanta.TRANSAKSI_TUNAI, | |||
| Fucout.TEKS_TIPE_NOTA_TUNAI); | |||
| notaContent.btnTunai = buttonBaru; | |||
| break; | |||
| } | |||
| if (buttonBaru != null) { | |||
| navigasi.add(buttonBaru); | |||
| vbNavigasi.getChildren().add(buttonBaru); | |||
| jumlahNota++; | |||
| } | |||
| } | |||
| } | |||
| } | |||
| //scan member | |||
| @FXML | |||
| void scanMemberOnPressed(KeyEvent event | |||
| ) { | |||
| void scanMemberOnPressed(KeyEvent event) { | |||
| if (event.getCode() == KeyCode.ENTER) { | |||
| posRx.getPelangganByKodeMember(tfScanMember.getText()).subscribe(pelangganObserver); | |||
| } | |||
| @@ -443,4 +480,12 @@ public class FormUtamaController implements Initializable { | |||
| public void onComplete() { | |||
| } | |||
| }; | |||
| private class NotaContent { | |||
| Button btnTunai; | |||
| Button btnBawa; | |||
| Button btnBon; | |||
| Button btnRetur; | |||
| } | |||
| } | |||
| @@ -6,6 +6,7 @@ | |||
| package id.amigogroup.posterminal.api; | |||
| import id.amigogroup.posterminal.model.Barang; | |||
| import id.amigogroup.posterminal.model.DNotaTunai; | |||
| import id.amigogroup.posterminal.model.Karyawan; | |||
| import id.amigogroup.posterminal.model.Pagination; | |||
| import id.amigogroup.posterminal.model.MNotaRetur; | |||
| @@ -13,6 +14,7 @@ import id.amigogroup.posterminal.model.MNotaTunai; | |||
| import id.amigogroup.posterminal.model.Pelanggan; | |||
| import id.amigogroup.posterminal.model.Tas; | |||
| import io.reactivex.Observable; | |||
| import io.reactivex.schedulers.Schedulers; | |||
| import java.util.List; | |||
| /** | |||
| @@ -20,43 +22,49 @@ import java.util.List; | |||
| * @author ronal | |||
| */ | |||
| public class AmigoPosRx { | |||
| //Barang API | |||
| public Observable<MNotaTunai> getMNotaTunaiByNoNota(String noNota){ | |||
| return UtilsApi.getServiceApiBarang().getMNotaTunaiByNoNota(noNota); | |||
| } | |||
| public Observable<MNotaRetur> getMNotaReturByNoNota(String noNota){ | |||
| return UtilsApi.getServiceApiBarang().getMNotaReturByNoNota(noNota); | |||
| } | |||
| public Observable<Barang> getBarangByKodeBarang(String kode){ | |||
| return UtilsApi.getServiceApiBarang().getBarangByKodeBarang(kode); | |||
| public Observable<Barang> getBarangByKodeBarang(String kodeBarang) { | |||
| return UtilsApi.getServiceApiBarang().getBarangByKodeBarang(kodeBarang); | |||
| } | |||
| public Observable<Pagination<Barang>> getBarangByNamaBarang(String namaBarang){ | |||
| return UtilsApi.getServiceApiBarang().getBarangByNamaBarang(namaBarang); | |||
| } | |||
| public Observable<MNotaTunai> getMNotaTunaiByNoNota(String noNota) { | |||
| return UtilsApi.getServiceApiBarang().getMNotaTunaiByNoNota(noNota); | |||
| } | |||
| public Observable<List<DNotaTunai>> getDNotaTunaiByNoNota(String noNota) { | |||
| return UtilsApi.getServiceApiBarang().getDNotaTunaiByNoNota(noNota) | |||
| .subscribeOn(Schedulers.io()); | |||
| } | |||
| public Observable<MNotaRetur> getMNotaReturByNoNota(String noNota) { | |||
| return UtilsApi.getServiceApiBarang().getMNotaReturByNoNota(noNota); | |||
| } | |||
| //Checkin API | |||
| public Observable<List<Tas>> getAllTas(){ | |||
| public Observable<List<Tas>> getAllTas() { | |||
| return UtilsApi.getServiceApiCheckin().getAllTas(); | |||
| } | |||
| //Karyawan API | |||
| public Observable<Karyawan> getKaryawanByNik(String nik){ | |||
| public Observable<Karyawan> getKaryawanByNik(String nik) { | |||
| return UtilsApi.getServiceApiKaryawan().getKaryawanByNik(nik); | |||
| } | |||
| //Pelanggan API | |||
| public Observable<Pelanggan> getPelangganByKodeMember(String kodeMember){ | |||
| public Observable<Pelanggan> getPelangganByKodeMember(String kodeMember) { | |||
| return UtilsApi.getServiceApiPelanggan().getPelangganByKodeMember(kodeMember); | |||
| } | |||
| public Observable<Pagination<Pelanggan>> getPelangganByNama(String nama){ | |||
| public Observable<Pagination<Pelanggan>> getPelangganByNama(String nama) { | |||
| return UtilsApi.getServiceApiPelanggan().getPelangganByNama(nama); | |||
| } | |||
| public Observable<Pagination<Pelanggan>> getPelangganByNoTelpNoHp(String no){ | |||
| public Observable<Pagination<Pelanggan>> getPelangganByNoTelpNoHp(String no) { | |||
| return UtilsApi.getServiceApiPelanggan().getPelangganByNoTelpNoHp(no); | |||
| } | |||
| } | |||
| @@ -6,10 +6,12 @@ | |||
| package id.amigogroup.posterminal.api; | |||
| import id.amigogroup.posterminal.model.Barang; | |||
| import id.amigogroup.posterminal.model.DNotaTunai; | |||
| import id.amigogroup.posterminal.model.MNotaRetur; | |||
| import id.amigogroup.posterminal.model.MNotaTunai; | |||
| import id.amigogroup.posterminal.model.Pagination; | |||
| import io.reactivex.Observable; | |||
| import java.util.List; | |||
| import retrofit2.http.GET; | |||
| import retrofit2.http.Path; | |||
| @@ -18,10 +20,22 @@ import retrofit2.http.Path; | |||
| * @author ronal | |||
| */ | |||
| public interface ServiceApiBarang { | |||
| //BARANG | |||
| //Mengambil Barang by Kode Barang | |||
| @GET("barangs/kode/{kode}") | |||
| Observable<Barang> getBarangByKodeBarang(@Path("kode") String kode); | |||
| //M-NOTA-TUNAI | |||
| //Mengambil Master Nota Tunai by No Nota | |||
| @GET("m-nota-tunai/no-nota/{noNota}") | |||
| Observable<MNotaTunai> getMNotaTunaiByNoNota(@Path("noNota") String noNota); | |||
| //D-NOTA-TUNAI | |||
| //Mengambil Detail Nota Tunai by No Nota | |||
| @GET("d-nota-tunai/no-nota/{noNota}") | |||
| Observable<List<DNotaTunai>> getDNotaTunaiByNoNota(@Path("noNota") String noNota); | |||
| //M-NOTA-BAWA | |||
| // //Mengambil Master Nota Bawa Dulu by No Nota | |||
| // @GET("m-nota-bawa/no-nota/{noNota}") | |||
| // Observable<MNotaTunai> getMNotaBawaByNoNota(@Path("noNota") String noNota); | |||
| @@ -30,14 +44,11 @@ public interface ServiceApiBarang { | |||
| // @GET("m-nota-bon/no-nota/{noNota}") | |||
| // Observable<MNotaTunai> getMNotaBonByNoNota(@Path("noNota") String noNota); | |||
| //M-NOTA-RETUR | |||
| //Mengambil Master Nota Retur by No Nota | |||
| @GET("m-nota-retur/no-nota/{noNota}") | |||
| Observable<MNotaRetur> getMNotaReturByNoNota(@Path("noNota") String noNota); | |||
| //Mengambil Barang Berdasarkan Kode Barang | |||
| @GET("barangs/kode/{kode}") | |||
| Observable<Barang> getBarangByKodeBarang(@Path("kode") String kode); | |||
| //Mengambil Barang Berdasarkan Nama Barang | |||
| @GET("barangs/nama/{namaBarang}") | |||
| Observable<Pagination<Barang>> getBarangByNamaBarang(@Path("namaBarang") String namaBarang); | |||
| @@ -12,10 +12,10 @@ package id.amigogroup.posterminal.api; | |||
| public class UtilsApi { | |||
| // public static final String API_BASE_URL_BARANG = "http://192.168.0.230:8081/api/"; | |||
| // public static final String API_BASE_URL_CHECKIN = "http://192.168.0.230:8082/api/"; | |||
| public static final String API_BASE_URL_BARANG = "https://barang.amigogroup.id/api/"; | |||
| public static final String API_BASE_URL_CHECKIN = "https://checkin.amigogroup.id/api/"; | |||
| public static final String API_BASE_URL_KARYAWAN = "https://karyawan.amigogroup.id/api/"; | |||
| public static final String API_BASE_URL_PELANGGAN = "https://pelanggan.amigogroup.id/api/"; | |||
| private static final String API_BASE_URL_BARANG = "https://barang.amigogroup.id/api/"; | |||
| private static final String API_BASE_URL_CHECKIN = "https://checkin.amigogroup.id/api/"; | |||
| private static final String API_BASE_URL_KARYAWAN = "https://karyawan.amigogroup.id/api/"; | |||
| private static final String API_BASE_URL_PELANGGAN = "https://pelanggan.amigogroup.id/api/"; | |||
| public static ServiceApiBarang getServiceApiBarang() { | |||
| return ServiceGenerator.createService(API_BASE_URL_BARANG, ServiceApiBarang.class); | |||
| @@ -51,6 +51,9 @@ public class Barang { | |||
| private String kedProduk; | |||
| @JsonProperty("kode_merk") | |||
| private String kodeMerk; | |||
| private String nomor; | |||
| private String noBarang; | |||
| @JsonProperty("kode_barang") | |||
| public String getKodeBarang() { | |||
| @@ -0,0 +1,32 @@ | |||
| /* | |||
| * 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.pencarian; | |||
| import id.amigogroup.posterminal.model.Barang; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| /** | |||
| * | |||
| * @author ronal | |||
| */ | |||
| public class BarangCache { | |||
| private static BarangCache instance; | |||
| private Map<String, Barang> daftarBarang; | |||
| private BarangCache(){ | |||
| daftarBarang = new HashMap<>(); | |||
| } | |||
| public static BarangCache getInstance(){ | |||
| if(instance == null) instance = new BarangCache(); | |||
| return instance; | |||
| } | |||
| public Map<String, Barang> getDaftarBarang(){ | |||
| return daftarBarang; | |||
| } | |||
| } | |||
| @@ -5,9 +5,42 @@ | |||
| */ | |||
| package id.amigogroup.posterminal.transaksi; | |||
| import id.amigogroup.posterminal.FormUtamaController; | |||
| import id.amigogroup.posterminal.api.AmigoPosRx; | |||
| import id.amigogroup.posterminal.model.Barang; | |||
| import id.amigogroup.posterminal.model.DNotaTunai; | |||
| import id.amigogroup.posterminal.pencarian.BarangCache; | |||
| import id.amigogroup.posterminal.util.AlertUtil; | |||
| import id.amigogroup.posterminal.util.Fucout; | |||
| import io.reactivex.Observer; | |||
| import io.reactivex.disposables.Disposable; | |||
| import java.net.HttpURLConnection; | |||
| import java.net.SocketTimeoutException; | |||
| import java.net.URL; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.ResourceBundle; | |||
| import java.util.logging.Level; | |||
| import java.util.logging.Logger; | |||
| import javafx.application.Platform; | |||
| import javafx.beans.property.ReadOnlyObjectWrapper; | |||
| import javafx.collections.FXCollections; | |||
| import javafx.collections.ObservableList; | |||
| import javafx.concurrent.Task; | |||
| import javafx.fxml.FXML; | |||
| import javafx.fxml.Initializable; | |||
| import javafx.scene.control.Alert; | |||
| import javafx.scene.control.Label; | |||
| import javafx.scene.control.TableColumn; | |||
| import javafx.scene.control.TableView; | |||
| import javafx.scene.control.TextField; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.input.KeyCode; | |||
| import javafx.scene.input.KeyEvent; | |||
| import javafx.scene.layout.AnchorPane; | |||
| import retrofit2.HttpException; | |||
| /** | |||
| * FXML Controller class | |||
| @@ -16,12 +49,234 @@ import javafx.fxml.Initializable; | |||
| */ | |||
| public class FormTransaksiReturController implements Initializable { | |||
| @FXML | |||
| private AnchorPane apMain; | |||
| @FXML | |||
| private TextField fldNotaPenjualan; | |||
| @FXML | |||
| private TableView<TabelBarangTunai> tbvPenjualan; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, Integer> tcNo; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcKode; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcNama; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcUkur; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcJumlah; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcHarga; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcDisc1; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcDisc2; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, String> tcSubTotal; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, TextField> tcPramuniaga; | |||
| // @FXML | |||
| // private TableView<?> tbvRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcNoRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcKodeRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcNamaRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcUkurRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcJumlahRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcHargaRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcDisc1Retur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcDisc2Retur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcSubtotalRetur; | |||
| // @FXML | |||
| // private TableColumn<?, ?> tcPramuniagaRetur; | |||
| private final AmigoPosRx posRx = new AmigoPosRx(); | |||
| private final ObservableList<TabelBarangTunai> daftarTabelPenjualan = FXCollections.observableArrayList(); | |||
| private List<DetailTransaksi> daftarDetailTransaksi = new ArrayList<>(); | |||
| /** | |||
| * Initializes the controller class. | |||
| */ | |||
| @Override | |||
| public void initialize(URL url, ResourceBundle rb) { | |||
| // TODO | |||
| } | |||
| tcNo.setCellValueFactory((TableColumn.CellDataFeatures<TabelBarangTunai, Integer> cell) -> { | |||
| return new ReadOnlyObjectWrapper(tbvPenjualan.getItems().indexOf(cell.getValue()) + 1); | |||
| }); | |||
| tcKode.setCellValueFactory(new PropertyValueFactory<>("kode")); | |||
| tcNama.setCellValueFactory(new PropertyValueFactory<>("nama")); | |||
| tcUkur.setCellValueFactory(new PropertyValueFactory<>("ukur")); | |||
| tcJumlah.setCellValueFactory(new PropertyValueFactory<>("jumlah")); | |||
| tcHarga.setCellValueFactory(new PropertyValueFactory<>("harga")); | |||
| tcDisc1.setCellValueFactory(new PropertyValueFactory<>("disc1")); | |||
| tcDisc2.setCellValueFactory(new PropertyValueFactory<>("disc2")); | |||
| tcSubTotal.setCellValueFactory(new PropertyValueFactory<>("subTotal")); | |||
| tcPramuniaga.setCellValueFactory(new PropertyValueFactory<>("fldPramuniaga")); | |||
| tbvPenjualan.setItems(daftarTabelPenjualan); | |||
| Platform.runLater(() -> { | |||
| fldNotaPenjualan.requestFocus(); | |||
| }); | |||
| } | |||
| private void mapCurrentDataToDetailTransaksi() { | |||
| } | |||
| int count = 0; | |||
| @FXML | |||
| Label lbl; | |||
| private void refreshData(List<DNotaTunai> daftarNotaTunai) { | |||
| daftarTabelPenjualan.clear(); | |||
| for (DNotaTunai dNotaTunai : daftarNotaTunai) { | |||
| TextField fldPramuniaga = new TextField(dNotaTunai.getKodePram()); | |||
| String namaBarang = "..."; | |||
| if (BarangCache.getInstance().getDaftarBarang().containsKey(dNotaTunai.getKdBarang())) { | |||
| namaBarang = Fucout.getText(BarangCache.getInstance().getDaftarBarang() | |||
| .get(dNotaTunai.getKdBarang()).getNamaBarang()); | |||
| } | |||
| daftarTabelPenjualan.add(new TabelBarangTunai( | |||
| Fucout.getText(dNotaTunai.getKdBarang()), | |||
| namaBarang, | |||
| Fucout.getText(dNotaTunai.getNoBarang()), | |||
| Fucout.getText(String.valueOf(dNotaTunai.getJumlah())), | |||
| Fucout.getText(Fucout.formatRibuan(dNotaTunai.getHargaJual())), | |||
| Fucout.getText(Fucout.formatPersentase(dNotaTunai.getDiskon())), | |||
| Fucout.getText(Fucout.formatPersentase(dNotaTunai.getDiskon2())), | |||
| null, | |||
| Fucout.getText(Fucout.formatRibuan( | |||
| dNotaTunai.getHargaJual() * dNotaTunai.getJumlah() | |||
| )), | |||
| fldPramuniaga)); | |||
| if (!BarangCache.getInstance().getDaftarBarang().containsKey(dNotaTunai.getKdBarang())) { | |||
| posRx.getBarangByKodeBarang(dNotaTunai.getKdBarang()).subscribe(getBarangObserver); | |||
| } | |||
| } | |||
| } | |||
| @FXML | |||
| void fldNotaPenjualanOnKeyPressed(KeyEvent event) { | |||
| if (event.getCode() == KeyCode.ENTER) { | |||
| posRx.getDNotaTunaiByNoNota(fldNotaPenjualan.getText()).subscribe(getDNotaTunaiObserver); | |||
| } | |||
| } | |||
| Observer<List<DNotaTunai>> getDNotaTunaiObserver = new Observer<>() { | |||
| @Override | |||
| public void onSubscribe(Disposable dspsbl) { | |||
| } | |||
| @Override | |||
| public void onNext(List<DNotaTunai> daftarDNotaTunai) { | |||
| refreshData(daftarDNotaTunai); | |||
| } | |||
| @Override | |||
| public void onError(Throwable error) { | |||
| if (error instanceof HttpException) { | |||
| switch (((HttpException) error).code()) { | |||
| case HttpURLConnection.HTTP_NOT_FOUND: | |||
| Platform.runLater(() -> { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_DITEMUKAN_TITLE, | |||
| "Data nota tidak ditemukan."); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| }); | |||
| } | |||
| } else if (error instanceof SocketTimeoutException) { | |||
| Platform.runLater(() -> { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_TITLE, | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| }); | |||
| } else { | |||
| Platform.runLater(() -> { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_TITLE, | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| Logger.getLogger(FormUtamaController.class | |||
| .getName()).log(Level.SEVERE, null, error); | |||
| }); | |||
| } | |||
| } | |||
| @Override | |||
| public void onComplete() { | |||
| } | |||
| }; | |||
| Observer<Barang> getBarangObserver = new Observer<>() { | |||
| @Override | |||
| public void onSubscribe(Disposable dspsbl) { | |||
| } | |||
| @Override | |||
| public void onNext(Barang b) { | |||
| BarangCache.getInstance().getDaftarBarang().put(b.getKodeBarang(), b); | |||
| for (TabelBarangTunai tbt : tbvPenjualan.getItems()) { | |||
| if (tbt.getKode().equals(b.getKodeBarang())) { | |||
| tbt.setNama(b.getNamaBarang()); | |||
| tbvPenjualan.refresh(); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void onError(Throwable error) { | |||
| if (error instanceof HttpException) { | |||
| switch (((HttpException) error).code()) { | |||
| case HttpURLConnection.HTTP_NOT_FOUND: | |||
| Platform.runLater(() -> { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_DITEMUKAN_TITLE, | |||
| "Barang dengan kode tersebut tidak ditemukan."); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| }); | |||
| } | |||
| } else if (error instanceof SocketTimeoutException) { | |||
| Platform.runLater(() -> { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_TITLE, | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| }); | |||
| } else { | |||
| Platform.runLater(() -> { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_TITLE, | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| Logger.getLogger(FormUtamaController.class | |||
| .getName()).log(Level.SEVERE, null, error); | |||
| }); | |||
| } | |||
| } | |||
| @Override | |||
| public void onComplete() { | |||
| } | |||
| }; | |||
| } | |||
| @@ -5,42 +5,41 @@ | |||
| */ | |||
| package id.amigogroup.posterminal.transaksi; | |||
| import id.amigogroup.posterminal.pencarian.DialogCariBarangController; | |||
| import java.io.IOException; | |||
| import id.amigogroup.posterminal.FormUtamaController; | |||
| import id.amigogroup.posterminal.api.AmigoPosRx; | |||
| import id.amigogroup.posterminal.model.Barang; | |||
| import id.amigogroup.posterminal.model.DNotaTunai; | |||
| import id.amigogroup.posterminal.pencarian.BarangCache; | |||
| import id.amigogroup.posterminal.util.AlertUtil; | |||
| import id.amigogroup.posterminal.util.Fucout; | |||
| import io.reactivex.Observer; | |||
| import io.reactivex.disposables.Disposable; | |||
| import java.net.HttpURLConnection; | |||
| import java.net.SocketTimeoutException; | |||
| import java.net.URL; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| import java.util.ResourceBundle; | |||
| import java.util.logging.Level; | |||
| import java.util.logging.Logger; | |||
| import javafx.application.Platform; | |||
| 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; | |||
| import javafx.scene.Parent; | |||
| import javafx.scene.control.Button; | |||
| import javafx.scene.control.Alert; | |||
| import javafx.scene.control.ComboBox; | |||
| import javafx.scene.control.Label; | |||
| import javafx.scene.control.TableColumn; | |||
| import javafx.scene.control.TableView; | |||
| import javafx.scene.control.TextField; | |||
| import javafx.scene.control.cell.PropertyValueFactory; | |||
| import javafx.scene.input.KeyCode; | |||
| import javafx.scene.input.KeyCodeCombination; | |||
| import javafx.scene.input.KeyCombination; | |||
| import javafx.scene.input.KeyEvent; | |||
| import javafx.scene.layout.AnchorPane; | |||
| 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; | |||
| import retrofit2.HttpException; | |||
| /** | |||
| * FXML Controller class | |||
| @@ -49,10 +48,14 @@ import javafx.scene.control.Label; | |||
| */ | |||
| public class FormTransaksiTunaiController implements Initializable { | |||
| @FXML | |||
| private AnchorPane apMain; | |||
| @FXML | |||
| private TextField fldScan; | |||
| @FXML | |||
| private TableView<TabelBarangTunai> tbvTranstunai; | |||
| private Label lblNoNota; | |||
| @FXML | |||
| private TableView<TabelBarangTunai> tbvTransaksi; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, Integer> tcNo; | |||
| @FXML | |||
| @@ -75,131 +78,194 @@ public class FormTransaksiTunaiController implements Initializable { | |||
| private TableColumn<TabelBarangTunai, String> tcSubtotal; | |||
| @FXML | |||
| private TableColumn<TabelBarangTunai, TextField> tcPramuniaga; | |||
| final ObservableList<TabelBarangTunai> daftarTabelBarang = FXCollections.observableArrayList(); | |||
| final ObservableList<TabelBarangTunai> daftarTabelTransaksi = FXCollections.observableArrayList(); | |||
| @FXML | |||
| private Text lblGrandTotal; | |||
| { | |||
| } | |||
| // private String tableState = BTN_TUNAI; | |||
| private AmigoPosRx posRx = new AmigoPosRx(); | |||
| /** | |||
| * Initializes the controller class. | |||
| */ | |||
| @Override | |||
| public void initialize(URL url, ResourceBundle rb) { | |||
| tcNo.setCellValueFactory((TableColumn.CellDataFeatures<TabelBarangTunai, Integer> cell) -> { | |||
| return new ReadOnlyObjectWrapper(tbvTranstunai.getItems().indexOf(cell.getValue()) + 1); | |||
| return new ReadOnlyObjectWrapper(tbvTransaksi.getItems().indexOf(cell.getValue()) + 1); | |||
| }); | |||
| tcKode.setCellValueFactory(new PropertyValueFactory<>("tcKode")); | |||
| tcNama.setCellValueFactory(new PropertyValueFactory<>("tcNama")); | |||
| tcUkur.setCellValueFactory(new PropertyValueFactory<>("tcUkur")); | |||
| tcJumlah.setCellValueFactory(new PropertyValueFactory<>("tcJumlah")); | |||
| tcHarga.setCellValueFactory(new PropertyValueFactory<>("tcHarga")); | |||
| tcDisc1.setCellValueFactory(new PropertyValueFactory<>("tcDisc1")); | |||
| tcDisc2.setCellValueFactory(new PropertyValueFactory<>("tcDisc2")); | |||
| tcPromo.setCellValueFactory(new PropertyValueFactory<>("tcPromo")); | |||
| tcSubtotal.setCellValueFactory(new PropertyValueFactory<>("tcSubtotal")); | |||
| tcPramuniaga.setCellValueFactory(new PropertyValueFactory<>("tcPramuniaga")); | |||
| tbvTranstunai.setItems(daftarTabelBarang); | |||
| fillTable(new ArrayList<>()); | |||
| tcKode.setCellValueFactory(new PropertyValueFactory<>("kode")); | |||
| tcNama.setCellValueFactory(new PropertyValueFactory<>("nama")); | |||
| tcUkur.setCellValueFactory(new PropertyValueFactory<>("ukur")); | |||
| tcJumlah.setCellValueFactory(new PropertyValueFactory<>("jumlah")); | |||
| tcHarga.setCellValueFactory(new PropertyValueFactory<>("harga")); | |||
| tcDisc1.setCellValueFactory(new PropertyValueFactory<>("disc1")); | |||
| tcDisc2.setCellValueFactory(new PropertyValueFactory<>("disc2")); | |||
| tcPromo.setCellValueFactory(new PropertyValueFactory<>("cbxPromo")); | |||
| tcSubtotal.setCellValueFactory(new PropertyValueFactory<>("subTotal")); | |||
| tcPramuniaga.setCellValueFactory(new PropertyValueFactory<>("fldPramuniaga")); | |||
| tbvTransaksi.setItems(daftarTabelTransaksi); | |||
| // fillTable(new ArrayList<>()); | |||
| } | |||
| private void initShortcuts() { | |||
| // Map<KeyCombination, Runnable> listShortcuts = new HashMap<>(); | |||
| // | |||
| // KeyCombination kcBtnTunai = new KeyCodeCombination(KeyCode.F1); | |||
| // Runnable rnBtnTunai = () -> btnTunai.fire(); | |||
| // listShortcuts.put(kcBtnTunai, rnBtnTunai); | |||
| // | |||
| // KeyCombination kcBtnBawa = new KeyCodeCombination(KeyCode.F2); | |||
| // Runnable rnBtnBawa = () -> btnBawaDulu.fire(); | |||
| // listShortcuts.put(kcBtnBawa, rnBtnBawa); | |||
| // | |||
| // KeyCombination kcBon = new KeyCodeCombination(KeyCode.F3); | |||
| // Runnable rnBon = () -> btnBon.fire(); | |||
| // listShortcuts.put(kcBon, rnBon); | |||
| // | |||
| // KeyCombination kcRetur = new KeyCodeCombination(KeyCode.F4); | |||
| // Runnable rnRetur = () -> btnRetur.fire(); | |||
| // listShortcuts.put(kcRetur, rnRetur); | |||
| // | |||
| // Platform.runLater(() -> { | |||
| // fldScan.getScene().getAccelerators().putAll(listShortcuts); | |||
| // }); | |||
| public void initData(String noNota) { | |||
| posRx.getDNotaTunaiByNoNota(noNota).subscribe(getDNotaTunaiObserver); | |||
| lblNoNota.setText(Fucout.getTextColon(noNota)); | |||
| } | |||
| @FXML | |||
| void btnNavigasiOnAction(ActionEvent event) { | |||
| // Button buttonSource = (Button) event.getSource(); | |||
| // if (!tableState.equals(buttonSource.getText().toLowerCase())) { | |||
| // switch (buttonSource.getText().toLowerCase()) { | |||
| // case BTN_TUNAI: | |||
| // //ambil data tunai | |||
| // tableState = BTN_TUNAI; | |||
| // System.out.println("ambil data tunai"); | |||
| // break; | |||
| // case BTN_BAWA_DULU: | |||
| // //ambil data bawa dulu | |||
| // tableState = BTN_BAWA_DULU; | |||
| // System.out.println("ambil data bawa dulu"); | |||
| // break; | |||
| // case BTN_BON: | |||
| // //ambil data bon | |||
| // tableState = BTN_BON; | |||
| // System.out.println("ambil data bon"); | |||
| // break; | |||
| // case BTN_RETUR: | |||
| // //ambil data retur | |||
| // tableState = BTN_RETUR; | |||
| // System.out.println("ambil data retur"); | |||
| // break; | |||
| // } | |||
| // } | |||
| // | |||
| // for (Button button : navigasi) { | |||
| // if (button.equals(buttonSource)) { | |||
| // if (!button.getStyleClass().contains("button-navigasi-transaksi-selected")) { | |||
| // button.getStyleClass().add("button-navigasi-transaksi-selected"); | |||
| // } | |||
| // } else { | |||
| // if (button.getStyleClass().contains("button-navigasi-transaksi-selected")) { | |||
| // button.getStyleClass().remove("button-navigasi-transaksi-selected"); | |||
| // } | |||
| // } | |||
| // } | |||
| // | |||
| // fldScan.requestFocus(); | |||
| private void refreshData(List<DNotaTunai> daftarNotaTunai) { | |||
| daftarTabelTransaksi.clear(); | |||
| String[] promo = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; | |||
| for (DNotaTunai dNotaTunai : daftarNotaTunai) { | |||
| ComboBox<String> cbxPromo = new ComboBox<>(FXCollections.observableArrayList(promo)); | |||
| cbxPromo.getSelectionModel().select("Ulang Tahun"); | |||
| TextField fldPramuniaga = new TextField(dNotaTunai.getKodePram()); | |||
| fldPramuniaga.setOnKeyPressed((t) -> { | |||
| if (t.getCode() == KeyCode.ENTER) { | |||
| fldScan.requestFocus(); | |||
| } | |||
| }); | |||
| String namaBarang = "..."; | |||
| if (BarangCache.getInstance().getDaftarBarang().containsKey(dNotaTunai.getKdBarang())) { | |||
| namaBarang = Fucout.getText(BarangCache.getInstance().getDaftarBarang() | |||
| .get(dNotaTunai.getKdBarang()).getNamaBarang()); | |||
| } | |||
| daftarTabelTransaksi.add(new TabelBarangTunai( | |||
| Fucout.getText(dNotaTunai.getKdBarang()), | |||
| namaBarang, | |||
| Fucout.getText(dNotaTunai.getNoBarang()), | |||
| Fucout.getText(String.valueOf(dNotaTunai.getJumlah())), | |||
| Fucout.getText(Fucout.formatRibuan(dNotaTunai.getHargaJual())), | |||
| Fucout.getText(Fucout.formatPersentase(dNotaTunai.getDiskon())), | |||
| Fucout.getText(Fucout.formatPersentase(dNotaTunai.getDiskon2())), | |||
| cbxPromo, | |||
| Fucout.getText(Fucout.formatRibuan( | |||
| dNotaTunai.getHargaJual() * dNotaTunai.getJumlah() | |||
| )), | |||
| fldPramuniaga)); | |||
| if (!BarangCache.getInstance().getDaftarBarang().containsKey(dNotaTunai.getKdBarang())) { | |||
| posRx.getBarangByKodeBarang(dNotaTunai.getKdBarang()).subscribe(getBarangObserver); | |||
| } | |||
| } | |||
| } | |||
| // public void fillTable(List<TabelBarangTunai> daftarBarangTunai) { | |||
| // String[] promo = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; | |||
| // ComboBox<String> 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(); | |||
| // } | |||
| // }); | |||
| // daftarTabelTransaksi.add(new TabelBarangTunai("AACOBA001ABCDXL", "Barang x", "XL", "1", "79.900", "0", "0", cbxAction, | |||
| // "79.900", txtScan)); | |||
| // } | |||
| @FXML | |||
| void fldScanOnKeyPressed(KeyEvent event) { | |||
| if (event.getCode() == KeyCode.ENTER) { | |||
| //proses scan | |||
| System.out.println("Scan"); | |||
| } | |||
| } | |||
| public void fillTable(List<TabelBarangTunai> daftarBarangTunai) { | |||
| String[] promo = {"Ulang Tahun", "Harbolnas", "Ultah Amigo"}; | |||
| ComboBox<String> 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", txtScan)); | |||
| } | |||
| Observer<List<DNotaTunai>> getDNotaTunaiObserver = new Observer<>() { | |||
| @Override | |||
| public void onSubscribe(Disposable dspsbl) { | |||
| } | |||
| @Override | |||
| public void onNext(List<DNotaTunai> daftarDNotaTunai) { | |||
| refreshData(daftarDNotaTunai); | |||
| } | |||
| @Override | |||
| public void onError(Throwable error) { | |||
| if (error instanceof HttpException) { | |||
| switch (((HttpException) error).code()) { | |||
| case HttpURLConnection.HTTP_NOT_FOUND: | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_DITEMUKAN_TITLE, | |||
| "Data nota tidak ditemukan."); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| } | |||
| } else if (error instanceof SocketTimeoutException) { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_TITLE, | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| } else { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_TITLE, | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| Logger.getLogger(FormUtamaController.class | |||
| .getName()).log(Level.SEVERE, null, error); | |||
| } | |||
| } | |||
| @Override | |||
| public void onComplete() { | |||
| } | |||
| }; | |||
| Observer<Barang> getBarangObserver = new Observer<>() { | |||
| @Override | |||
| public void onSubscribe(Disposable dspsbl) { | |||
| } | |||
| @Override | |||
| public void onNext(Barang b) { | |||
| BarangCache.getInstance().getDaftarBarang().put(b.getKodeBarang(), b); | |||
| for (TabelBarangTunai tbt : daftarTabelTransaksi) { | |||
| if (tbt.getKode().equals(b.getKodeBarang())) { | |||
| tbt.setNama(b.getNamaBarang()); | |||
| tbvTransaksi.refresh(); | |||
| } | |||
| } | |||
| } | |||
| @Override | |||
| public void onError(Throwable error) { | |||
| if (error instanceof HttpException) { | |||
| switch (((HttpException) error).code()) { | |||
| case HttpURLConnection.HTTP_NOT_FOUND: | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_DITEMUKAN_TITLE, | |||
| "Barang dengan kode tersebut tidak ditemukan."); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| } | |||
| } else if (error instanceof SocketTimeoutException) { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_TITLE, | |||
| AlertUtil.ERROR_KONEKSI_TIMEOUT_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| } else { | |||
| Alert alert = AlertUtil.getAlertError( | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_TITLE, | |||
| AlertUtil.ERROR_TIDAK_TERDUGA_MESSAGE); | |||
| alert.initOwner(apMain.getScene().getWindow()); | |||
| alert.show(); | |||
| Logger.getLogger(FormUtamaController.class | |||
| .getName()).log(Level.SEVERE, null, error); | |||
| } | |||
| } | |||
| @Override | |||
| public void onComplete() { | |||
| } | |||
| }; | |||
| } | |||
| @@ -1,169 +1,166 @@ | |||
| /* | |||
| * 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); | |||
| } | |||
| } | |||
| /* | |||
| * 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); | |||
| } | |||
| } | |||
| @@ -1,187 +1,184 @@ | |||
| /* | |||
| * 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 TabelBarangTunai { | |||
| private SimpleStringProperty tcKode; | |||
| private SimpleStringProperty tcNama; | |||
| private SimpleStringProperty tcUkur; | |||
| private SimpleStringProperty tcJumlah; | |||
| private SimpleStringProperty tcHarga; | |||
| private SimpleStringProperty tcDisc1; | |||
| private SimpleStringProperty tcDisc2; | |||
| private SimpleObjectProperty<ComboBox> tcPromo; | |||
| private SimpleStringProperty tcSubtotal; | |||
| private SimpleObjectProperty<TextField>tcPramuniaga; | |||
| public TabelBarangTunai(String tcKode, String tcNama, String tcUkur, String tcJumlah, String tcHarga, String tcDisc1, | |||
| String tcDisc2, ComboBox tcPromo, String tcSubtotal, TextField tcPramuniaga) { | |||
| this.tcKode = new SimpleStringProperty(tcKode); | |||
| this.tcNama = new SimpleStringProperty(tcNama); | |||
| this.tcUkur = new SimpleStringProperty(tcUkur); | |||
| this.tcJumlah = new SimpleStringProperty(tcJumlah); | |||
| this.tcHarga = new SimpleStringProperty(tcHarga); | |||
| this.tcDisc1 = new SimpleStringProperty(tcDisc1); | |||
| this.tcDisc2 = new SimpleStringProperty(tcDisc2); | |||
| this.tcPromo = new SimpleObjectProperty<ComboBox>(tcPromo); | |||
| this.tcSubtotal = new SimpleStringProperty(tcSubtotal); | |||
| this.tcPramuniaga = new SimpleObjectProperty<TextField>(tcPramuniaga); | |||
| } | |||
| /** | |||
| * @return the tcKode | |||
| */ | |||
| public String getTcKode() { | |||
| return tcKode.get(); | |||
| } | |||
| /** | |||
| * @param tcKode the tcKode to set | |||
| */ | |||
| public void setTcKode(String tcKode) { | |||
| this.tcKode.set(tcKode); | |||
| } | |||
| /** | |||
| * @return the tcNama | |||
| */ | |||
| public String getTcNama() { | |||
| return tcNama.get(); | |||
| } | |||
| /** | |||
| * @param tcNama the tcNama to set | |||
| */ | |||
| public void setTcNama(String tcNama) { | |||
| this.tcNama.set(tcNama); | |||
| } | |||
| /** | |||
| * @return the tcUkur | |||
| */ | |||
| public String getTcUkur() { | |||
| return tcUkur.get(); | |||
| } | |||
| /** | |||
| * @param tcUkur the tcUkur to set | |||
| */ | |||
| public void setTcUkur(String tcUkur) { | |||
| this.tcUkur.set(tcUkur); | |||
| } | |||
| /** | |||
| * @return the tcJumlah | |||
| */ | |||
| public String getTcJumlah() { | |||
| return tcJumlah.get(); | |||
| } | |||
| /** | |||
| * @param tcJumlah the tcJumlah to set | |||
| */ | |||
| public void setTcJumlah(String tcJumlah) { | |||
| this.tcJumlah.set(tcJumlah); | |||
| } | |||
| /** | |||
| * @return the tcHarga | |||
| */ | |||
| public String getTcHarga() { | |||
| return tcHarga.get(); | |||
| } | |||
| /** | |||
| * @param tcHarga the tcHarga to set | |||
| */ | |||
| public void setTcHarga(String tcHarga) { | |||
| this.tcHarga.set(tcHarga); | |||
| } | |||
| /** | |||
| * @return the tcDisc1 | |||
| */ | |||
| public String getTcDisc1() { | |||
| return tcDisc1.get(); | |||
| } | |||
| /** | |||
| * @param tcDisc1 the tcDisc1 to set | |||
| */ | |||
| public void setTcDisc1(String tcDisc1) { | |||
| this.tcDisc1.set(tcDisc1); | |||
| } | |||
| /** | |||
| * @return the tcDisc2 | |||
| */ | |||
| public String getTcDisc2() { | |||
| return tcDisc2.get(); | |||
| } | |||
| /** | |||
| * @param tcDisc2 the tcDisc2 to set | |||
| */ | |||
| public void setTcDisc2(String tcDisc2) { | |||
| this.tcDisc2.set(tcDisc2); | |||
| } | |||
| /** | |||
| * @return the tcPromo | |||
| */ | |||
| public ComboBox getTcPromo() { | |||
| return tcPromo.get(); | |||
| } | |||
| /** | |||
| * @param tcPromo the tcPromo to set | |||
| */ | |||
| public void setTcPromo(ComboBox tcPromo) { | |||
| this.tcPromo.set(tcPromo); | |||
| } | |||
| /** | |||
| * @return the tcSubtotal | |||
| */ | |||
| public String getTcSubtotal() { | |||
| return tcSubtotal.get(); | |||
| } | |||
| /** | |||
| * @param tcSubtotal the tcSubtotal to set | |||
| */ | |||
| public void setTcSubtotal(String tcSubtotal) { | |||
| this.tcSubtotal.set(tcSubtotal); | |||
| } | |||
| /** | |||
| * @return the tcPramuniaga | |||
| */ | |||
| public TextField getTcPramuniaga() { | |||
| return tcPramuniaga.get(); | |||
| } | |||
| /** | |||
| * @param tcPramuniaga the tcPramuniaga to set | |||
| */ | |||
| public void setTcPramuniaga(TextField tcPramuniaga) { | |||
| this.tcPramuniaga.set(tcPramuniaga); | |||
| } | |||
| } | |||
| /* | |||
| * 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 TabelBarangTunai { | |||
| private SimpleStringProperty kode; | |||
| private SimpleStringProperty nama; | |||
| private SimpleStringProperty ukur; | |||
| private SimpleStringProperty jumlah; | |||
| private SimpleStringProperty harga; | |||
| private SimpleStringProperty disc1; | |||
| private SimpleStringProperty disc2; | |||
| private SimpleObjectProperty<ComboBox> cbxPromo; | |||
| private SimpleStringProperty subTotal; | |||
| private SimpleObjectProperty<TextField> fldPramuniaga; | |||
| public TabelBarangTunai(String kode, String nama, String ukur, String jumlah, String harga, String disc1, | |||
| String disc2, ComboBox cbxPromo, String subTotal, TextField fldPramuniaga) { | |||
| this.kode = new SimpleStringProperty(kode); | |||
| this.nama = new SimpleStringProperty(nama); | |||
| this.ukur = new SimpleStringProperty(ukur); | |||
| this.jumlah = new SimpleStringProperty(jumlah); | |||
| this.harga = new SimpleStringProperty(harga); | |||
| this.disc1 = new SimpleStringProperty(disc1); | |||
| this.disc2 = new SimpleStringProperty(disc2); | |||
| this.cbxPromo = new SimpleObjectProperty<ComboBox>(cbxPromo); | |||
| this.subTotal = new SimpleStringProperty(subTotal); | |||
| this.fldPramuniaga = new SimpleObjectProperty<TextField>(fldPramuniaga); | |||
| } | |||
| /** | |||
| * @return the kode | |||
| */ | |||
| public String getKode() { | |||
| return kode.get(); | |||
| } | |||
| /** | |||
| * @param kode the kode to set | |||
| */ | |||
| public void setKode(String kode) { | |||
| this.kode.set(kode); | |||
| } | |||
| /** | |||
| * @return the tcNama | |||
| */ | |||
| public String getNama() { | |||
| return nama.get(); | |||
| } | |||
| /** | |||
| * @param nama the tcNama to set | |||
| */ | |||
| public void setNama(String nama) { | |||
| this.nama.set(nama); | |||
| } | |||
| /** | |||
| * @return the tcUkur | |||
| */ | |||
| public String getUkur() { | |||
| return ukur.get(); | |||
| } | |||
| /** | |||
| * @param ukur the tcUkur to set | |||
| */ | |||
| public void setUkur(String ukur) { | |||
| this.ukur.set(ukur); | |||
| } | |||
| /** | |||
| * @return the tcJumlah | |||
| */ | |||
| public String getJumlah() { | |||
| return jumlah.get(); | |||
| } | |||
| /** | |||
| * @param jumlah the tcJumlah to set | |||
| */ | |||
| public void setJumlah(String jumlah) { | |||
| this.jumlah.set(jumlah); | |||
| } | |||
| /** | |||
| * @return the tcHarga | |||
| */ | |||
| public String getHarga() { | |||
| return harga.get(); | |||
| } | |||
| /** | |||
| * @param harga the tcHarga to set | |||
| */ | |||
| public void setHarga(String harga) { | |||
| this.harga.set(harga); | |||
| } | |||
| /** | |||
| * @return the tcDisc1 | |||
| */ | |||
| public String getDisc1() { | |||
| return disc1.get(); | |||
| } | |||
| /** | |||
| * @param disc1 the tcDisc1 to set | |||
| */ | |||
| public void setDisc1(String disc1) { | |||
| this.disc1.set(disc1); | |||
| } | |||
| /** | |||
| * @return the tcDisc2 | |||
| */ | |||
| public String getDisc2() { | |||
| return disc2.get(); | |||
| } | |||
| /** | |||
| * @param disc2 the tcDisc2 to set | |||
| */ | |||
| public void setDisc2(String disc2) { | |||
| this.disc2.set(disc2); | |||
| } | |||
| /** | |||
| * @return the tcPromo | |||
| */ | |||
| public ComboBox getCbxPromo() { | |||
| return cbxPromo.get(); | |||
| } | |||
| /** | |||
| * @param cbxPromo the tcPromo to set | |||
| */ | |||
| public void setCbxPromo(ComboBox cbxPromo) { | |||
| this.cbxPromo.set(cbxPromo); | |||
| } | |||
| /** | |||
| * @return the tcSubtotal | |||
| */ | |||
| public String getSubTotal() { | |||
| return subTotal.get(); | |||
| } | |||
| /** | |||
| * @param subTotal the tcSubtotal to set | |||
| */ | |||
| public void setSubTotal(String subTotal) { | |||
| this.subTotal.set(subTotal); | |||
| } | |||
| /** | |||
| * @return the tcPramuniaga | |||
| */ | |||
| public TextField getFldPramuniaga() { | |||
| return fldPramuniaga.get(); | |||
| } | |||
| /** | |||
| * @param fldPramuniaga the tcPramuniaga to set | |||
| */ | |||
| public void setFldPramuniaga(TextField fldPramuniaga) { | |||
| this.fldPramuniaga.set(fldPramuniaga); | |||
| } | |||
| } | |||
| @@ -53,6 +53,13 @@ public class Fucout { | |||
| || pekerjaan.toLowerCase().equals("pemimpin toko")); | |||
| } | |||
| public static String getText(String text) { | |||
| if (text == null || text.equals("")) { | |||
| return "-"; | |||
| } | |||
| return text; | |||
| } | |||
| public static String getTextColon(String text) { | |||
| if (text == null || text.equals("")) { | |||
| return ": -"; | |||
| @@ -104,6 +111,10 @@ public class Fucout { | |||
| localDateTime.getSecond(), | |||
| ms); | |||
| } | |||
| public static String formatPersentase(int persentase) { | |||
| return persentase + "%"; | |||
| } | |||
| public static String formatTanggal(Date tanggal) { | |||
| if (tanggal == null) { | |||
| @@ -13,63 +13,45 @@ | |||
| <?import javafx.scene.layout.RowConstraints?> | |||
| <?import javafx.scene.text.Font?> | |||
| <AnchorPane id="AnchorPane" minHeight="-Infinity" minWidth="-Infinity" prefHeight="450.0" prefWidth="750.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.transaksi.FormTransaksiReturController"> | |||
| <AnchorPane id="AnchorPane" fx:id="apMain" minHeight="-Infinity" minWidth="-Infinity" prefHeight="450.0" prefWidth="750.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.transaksi.FormTransaksiReturController"> | |||
| <children> | |||
| <Label text="Transaksi Retur" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | |||
| <font> | |||
| <Font size="16.0" /> | |||
| </font> | |||
| </Label> | |||
| <HBox alignment="CENTER" layoutX="14.0" layoutY="144.0" prefHeight="80.0" prefWidth="80.0" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="144.0" /> | |||
| <SplitPane dividerPositions="0.5" layoutY="45.0" orientation="VERTICAL" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="39.0"> | |||
| <items> | |||
| <AnchorPane> | |||
| <children> | |||
| <Label fx:id="lbl" layoutX="14.0" layoutY="6.0" text="Histori Penjualan" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="0.0"> | |||
| <font> | |||
| <Font size="14.0" /> | |||
| </font> | |||
| </Label> | |||
| <Label layoutX="14.0" layoutY="20.0" text="Nomor Nota Penjualan" /> | |||
| <TextField fx:id="fldNotaPenjualan" layoutX="14.0" layoutY="37.0" onKeyPressed="#fldNotaPenjualanOnKeyPressed" prefHeight="25.0" prefWidth="329.0" promptText="Nomor Nota Penjualan" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="37.0" /> | |||
| <TableView fx:id="tbvPenjualan" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="65.0"> | |||
| <columns> | |||
| <TableColumn fx:id="tcNo" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" text="No" /> | |||
| <TableColumn fx:id="tcNo" editable="false" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" sortable="false" 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="tcUkur" maxWidth="40.0" minWidth="40.0" prefWidth="40.0" resizable="false" text="Ukur" /> | |||
| <TableColumn fx:id="tcJumlah" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" text="Jml" /> | |||
| <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" /> | |||
| <TableColumn fx:id="tcDisc1" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" resizable="false" text="Disc 1" /> | |||
| <TableColumn fx:id="tcDisc2" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" resizable="false" text="Disc 2" /> | |||
| <TableColumn fx:id="tcSubTotal" prefWidth="75.0" text="Sub Total" /> | |||
| <TableColumn fx:id="tcPramuniaga" editable="false" prefWidth="75.0" sortable="false" text="Pramuniaga" /> | |||
| </columns> | |||
| <columnResizePolicy> | |||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | |||
| </columnResizePolicy> | |||
| </TableView> | |||
| <Label layoutX="14.0" layoutY="6.0" text="Histori Penjualan" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="0.0"> | |||
| <font> | |||
| <Font size="14.0" /> | |||
| </font> | |||
| </Label> | |||
| <Label layoutX="14.0" layoutY="20.0" text="Nomor Nota Penjualan" /> | |||
| <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> | |||
| </AnchorPane> | |||
| <AnchorPane> | |||
| <children> | |||
| <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> | |||
| <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> | |||
| <columnResizePolicy> | |||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | |||
| </columnResizePolicy> | |||
| </TableView> | |||
| <Label layoutX="14.0" text="Retur Penjualan" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="0.0"> | |||
| <font> | |||
| <Font size="14.0" /> | |||
| @@ -122,6 +104,23 @@ | |||
| </HBox> | |||
| </children> | |||
| </GridPane> | |||
| <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> | |||
| <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> | |||
| <columnResizePolicy> | |||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | |||
| </columnResizePolicy> | |||
| </TableView> | |||
| </children> | |||
| </AnchorPane> | |||
| </items> | |||
| @@ -15,7 +15,7 @@ | |||
| <?import javafx.scene.text.Font?> | |||
| <?import javafx.scene.text.Text?> | |||
| <AnchorPane id="AnchorPane" minHeight="-Infinity" minWidth="-Infinity" prefHeight="450.0" prefWidth="750.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.transaksi.FormTransaksiTunaiController"> | |||
| <AnchorPane id="AnchorPane" fx:id="apMain" minHeight="-Infinity" minWidth="-Infinity" prefHeight="450.0" prefWidth="750.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.transaksi.FormTransaksiTunaiController"> | |||
| <children> | |||
| <Label text="Transaksi Tunai" AnchorPane.leftAnchor="14.0" AnchorPane.topAnchor="14.0"> | |||
| <font> | |||
| @@ -41,7 +41,7 @@ | |||
| <Font size="14.0" /> | |||
| </font> | |||
| </Label> | |||
| <Label text=": -"> | |||
| <Label fx:id="lblNoNota" text=": -"> | |||
| <HBox.margin> | |||
| <Insets /> | |||
| </HBox.margin> | |||
| @@ -94,19 +94,19 @@ | |||
| </children> | |||
| </GridPane> | |||
| <Separator layoutY="116.0" prefHeight="0.0" prefWidth="800.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="116.0" /> | |||
| <TableView fx:id="tbvTranstunai" layoutY="150.0" prefHeight="245.0" prefWidth="800.0" AnchorPane.bottomAnchor="55.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="150.0"> | |||
| <TableView fx:id="tbvTransaksi" layoutY="150.0" prefHeight="245.0" prefWidth="800.0" AnchorPane.bottomAnchor="55.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="130.0"> | |||
| <columns> | |||
| <TableColumn fx:id="tcNo" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" text="No" /> | |||
| <TableColumn fx:id="tcNo" editable="false" maxWidth="30.0" minWidth="30.0" prefWidth="30.0" resizable="false" sortable="false" text="No" /> | |||
| <TableColumn fx:id="tcKode" prefWidth="-1.0" text="Kode Barang" /> | |||
| <TableColumn fx:id="tcNama" minWidth="0.0" prefWidth="-1.0" text="Nama Barang" /> | |||
| <TableColumn fx:id="tcUkur" minWidth="0.0" prefWidth="61.5999755859375" text="Ukur" /> | |||
| <TableColumn fx:id="tcJumlah" minWidth="52.0" prefWidth="-1.0" text="Jumlah" /> | |||
| <TableColumn fx:id="tcUkur" maxWidth="40.0" minWidth="40.0" prefWidth="40.0" resizable="false" text="Ukur" /> | |||
| <TableColumn fx:id="tcJumlah" maxWidth="40.0" minWidth="40.0" prefWidth="40.0" resizable="false" text="Jml" /> | |||
| <TableColumn fx:id="tcHarga" prefWidth="-1.0" text="Harga" /> | |||
| <TableColumn fx:id="tcDisc1" prefWidth="-1.0" text="Disc1" /> | |||
| <TableColumn fx:id="tcDisc2" prefWidth="-1.0" text="Disc2" /> | |||
| <TableColumn fx:id="tcPromo" prefWidth="-1.0" text="Promo" /> | |||
| <TableColumn fx:id="tcDisc1" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" resizable="false" text="Disc1" /> | |||
| <TableColumn fx:id="tcDisc2" maxWidth="50.0" minWidth="50.0" prefWidth="50.0" resizable="false" text="Disc2" /> | |||
| <TableColumn fx:id="tcPromo" prefWidth="-1.0" sortable="false" text="Promo" /> | |||
| <TableColumn fx:id="tcSubtotal" prefWidth="-1.0" text="Sub Total" /> | |||
| <TableColumn fx:id="tcPramuniaga" prefWidth="-1.0" text="Pramuniaga" /> | |||
| <TableColumn fx:id="tcPramuniaga" prefWidth="-1.0" sortable="false" text="Pramuniaga" /> | |||
| </columns> | |||
| <columnResizePolicy> | |||
| <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> | |||