Menampilkan Button Nota Berdasarkan Nota yang Sudah Ada dari Checkout
* [Logic] Membuat ServiceApiBarang * [Logic + UI] Fungsi menambahkan nota dengan ambil dari checkout * Menghilangkan fungsi static menampilkan nota di form utama * Login mengecek apakah user name kosongpull/3/head
parent
ca0f8fd37a
commit
5c6522bb9d
@ -0,0 +1,195 @@
|
||||
|
||||
package id.amigogroup.posterminal.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"kode_barang",
|
||||
"kode_lama",
|
||||
"nama_barang",
|
||||
"kode_toko",
|
||||
"kelompok",
|
||||
"tahun",
|
||||
"bulan",
|
||||
"id_gabungan",
|
||||
"kode_strip",
|
||||
"kode_supplier",
|
||||
"ked_produk",
|
||||
"kode_merk"
|
||||
})
|
||||
public class Barang {
|
||||
|
||||
@JsonProperty("kode_barang")
|
||||
private String kodeBarang;
|
||||
@JsonProperty("kode_lama")
|
||||
private String kodeLama;
|
||||
@JsonProperty("nama_barang")
|
||||
private String namaBarang;
|
||||
@JsonProperty("kode_toko")
|
||||
private String kodeToko;
|
||||
@JsonProperty("kelompok")
|
||||
private String kelompok;
|
||||
@JsonProperty("tahun")
|
||||
private int tahun;
|
||||
@JsonProperty("bulan")
|
||||
private int bulan;
|
||||
@JsonProperty("id_gabungan")
|
||||
private String idGabungan;
|
||||
@JsonProperty("kode_strip")
|
||||
private String kodeStrip;
|
||||
@JsonProperty("kode_supplier")
|
||||
private String kodeSupplier;
|
||||
@JsonProperty("ked_produk")
|
||||
private String kedProduk;
|
||||
@JsonProperty("kode_merk")
|
||||
private String kodeMerk;
|
||||
|
||||
@JsonProperty("kode_barang")
|
||||
public String getKodeBarang() {
|
||||
return kodeBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_barang")
|
||||
public void setKodeBarang(String kodeBarang) {
|
||||
this.kodeBarang = kodeBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_lama")
|
||||
public String getKodeLama() {
|
||||
return kodeLama;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_lama")
|
||||
public void setKodeLama(String kodeLama) {
|
||||
this.kodeLama = kodeLama;
|
||||
}
|
||||
|
||||
@JsonProperty("nama_barang")
|
||||
public String getNamaBarang() {
|
||||
return namaBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("nama_barang")
|
||||
public void setNamaBarang(String namaBarang) {
|
||||
this.namaBarang = namaBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_toko")
|
||||
public String getKodeToko() {
|
||||
return kodeToko;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_toko")
|
||||
public void setKodeToko(String kodeToko) {
|
||||
this.kodeToko = kodeToko;
|
||||
}
|
||||
|
||||
@JsonProperty("kelompok")
|
||||
public String getKelompok() {
|
||||
return kelompok;
|
||||
}
|
||||
|
||||
@JsonProperty("kelompok")
|
||||
public void setKelompok(String kelompok) {
|
||||
this.kelompok = kelompok;
|
||||
}
|
||||
|
||||
@JsonProperty("tahun")
|
||||
public int getTahun() {
|
||||
return tahun;
|
||||
}
|
||||
|
||||
@JsonProperty("tahun")
|
||||
public void setTahun(int tahun) {
|
||||
this.tahun = tahun;
|
||||
}
|
||||
|
||||
@JsonProperty("bulan")
|
||||
public int getBulan() {
|
||||
return bulan;
|
||||
}
|
||||
|
||||
@JsonProperty("bulan")
|
||||
public void setBulan(int bulan) {
|
||||
this.bulan = bulan;
|
||||
}
|
||||
|
||||
@JsonProperty("id_gabungan")
|
||||
public String getIdGabungan() {
|
||||
return idGabungan;
|
||||
}
|
||||
|
||||
@JsonProperty("id_gabungan")
|
||||
public void setIdGabungan(String idGabungan) {
|
||||
this.idGabungan = idGabungan;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_strip")
|
||||
public String getKodeStrip() {
|
||||
return kodeStrip;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_strip")
|
||||
public void setKodeStrip(String kodeStrip) {
|
||||
this.kodeStrip = kodeStrip;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_supplier")
|
||||
public String getKodeSupplier() {
|
||||
return kodeSupplier;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_supplier")
|
||||
public void setKodeSupplier(String kodeSupplier) {
|
||||
this.kodeSupplier = kodeSupplier;
|
||||
}
|
||||
|
||||
@JsonProperty("ked_produk")
|
||||
public String getKedProduk() {
|
||||
return kedProduk;
|
||||
}
|
||||
|
||||
@JsonProperty("ked_produk")
|
||||
public void setKedProduk(String kedProduk) {
|
||||
this.kedProduk = kedProduk;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_merk")
|
||||
public String getKodeMerk() {
|
||||
return kodeMerk;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_merk")
|
||||
public void setKodeMerk(String kodeMerk) {
|
||||
this.kodeMerk = kodeMerk;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this).append("kodeBarang", kodeBarang).append("kodeLama", kodeLama).append("namaBarang", namaBarang).append("kodeToko", kodeToko).append("kelompok", kelompok).append("tahun", tahun).append("bulan", bulan).append("idGabungan", idGabungan).append("kodeStrip", kodeStrip).append("kodeSupplier", kodeSupplier).append("kedProduk", kedProduk).append("kodeMerk", kodeMerk).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder().append(tahun).append(kodeLama).append(idGabungan).append(kodeToko).append(kedProduk).append(namaBarang).append(kelompok).append(kodeBarang).append(bulan).append(kodeStrip).append(kodeSupplier).append(kodeMerk).toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if ((other instanceof Barang) == false) {
|
||||
return false;
|
||||
}
|
||||
Barang rhs = ((Barang) other);
|
||||
return new EqualsBuilder().append(tahun, rhs.tahun).append(kodeLama, rhs.kodeLama).append(idGabungan, rhs.idGabungan).append(kodeToko, rhs.kodeToko).append(kedProduk, rhs.kedProduk).append(namaBarang, rhs.namaBarang).append(kelompok, rhs.kelompok).append(kodeBarang, rhs.kodeBarang).append(bulan, rhs.bulan).append(kodeStrip, rhs.kodeStrip).append(kodeSupplier, rhs.kodeSupplier).append(kodeMerk, rhs.kodeMerk).isEquals();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,182 @@
|
||||
|
||||
package id.amigogroup.posterminal.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"id",
|
||||
"no_nota",
|
||||
"kd_barang",
|
||||
"no_barang",
|
||||
"jumlah",
|
||||
"diskon",
|
||||
"diskon2",
|
||||
"harga_jual",
|
||||
"harga_pokok",
|
||||
"kode_pram",
|
||||
"bonus"
|
||||
})
|
||||
public class DNotaTunai {
|
||||
|
||||
@JsonProperty("id")
|
||||
private int id;
|
||||
@JsonProperty("no_nota")
|
||||
private String noNota;
|
||||
@JsonProperty("kd_barang")
|
||||
private String kdBarang;
|
||||
@JsonProperty("no_barang")
|
||||
private String noBarang;
|
||||
@JsonProperty("jumlah")
|
||||
private int jumlah;
|
||||
@JsonProperty("diskon")
|
||||
private int diskon;
|
||||
@JsonProperty("diskon2")
|
||||
private int diskon2;
|
||||
@JsonProperty("harga_jual")
|
||||
private int hargaJual;
|
||||
@JsonProperty("harga_pokok")
|
||||
private String hargaPokok;
|
||||
@JsonProperty("kode_pram")
|
||||
private String kodePram;
|
||||
@JsonProperty("bonus")
|
||||
private int bonus;
|
||||
|
||||
@JsonProperty("id")
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JsonProperty("id")
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
public String getNoNota() {
|
||||
return noNota;
|
||||
}
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
public void setNoNota(String noNota) {
|
||||
this.noNota = noNota;
|
||||
}
|
||||
|
||||
@JsonProperty("kd_barang")
|
||||
public String getKdBarang() {
|
||||
return kdBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("kd_barang")
|
||||
public void setKdBarang(String kdBarang) {
|
||||
this.kdBarang = kdBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("no_barang")
|
||||
public String getNoBarang() {
|
||||
return noBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("no_barang")
|
||||
public void setNoBarang(String noBarang) {
|
||||
this.noBarang = noBarang;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah")
|
||||
public int getJumlah() {
|
||||
return jumlah;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah")
|
||||
public void setJumlah(int jumlah) {
|
||||
this.jumlah = jumlah;
|
||||
}
|
||||
|
||||
@JsonProperty("diskon")
|
||||
public int getDiskon() {
|
||||
return diskon;
|
||||
}
|
||||
|
||||
@JsonProperty("diskon")
|
||||
public void setDiskon(int diskon) {
|
||||
this.diskon = diskon;
|
||||
}
|
||||
|
||||
@JsonProperty("diskon2")
|
||||
public int getDiskon2() {
|
||||
return diskon2;
|
||||
}
|
||||
|
||||
@JsonProperty("diskon2")
|
||||
public void setDiskon2(int diskon2) {
|
||||
this.diskon2 = diskon2;
|
||||
}
|
||||
|
||||
@JsonProperty("harga_jual")
|
||||
public int getHargaJual() {
|
||||
return hargaJual;
|
||||
}
|
||||
|
||||
@JsonProperty("harga_jual")
|
||||
public void setHargaJual(int hargaJual) {
|
||||
this.hargaJual = hargaJual;
|
||||
}
|
||||
|
||||
@JsonProperty("harga_pokok")
|
||||
public String getHargaPokok() {
|
||||
return hargaPokok;
|
||||
}
|
||||
|
||||
@JsonProperty("harga_pokok")
|
||||
public void setHargaPokok(String hargaPokok) {
|
||||
this.hargaPokok = hargaPokok;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_pram")
|
||||
public String getKodePram() {
|
||||
return kodePram;
|
||||
}
|
||||
|
||||
@JsonProperty("kode_pram")
|
||||
public void setKodePram(String kodePram) {
|
||||
this.kodePram = kodePram;
|
||||
}
|
||||
|
||||
@JsonProperty("bonus")
|
||||
public int getBonus() {
|
||||
return bonus;
|
||||
}
|
||||
|
||||
@JsonProperty("bonus")
|
||||
public void setBonus(int bonus) {
|
||||
this.bonus = bonus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this).append("id", id).append("noNota", noNota).append("kdBarang", kdBarang).append("noBarang", noBarang).append("jumlah", jumlah).append("diskon", diskon).append("diskon2", diskon2).append("hargaJual", hargaJual).append("hargaPokok", hargaPokok).append("kodePram", kodePram).append("bonus", bonus).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder().append(jumlah).append(diskon2).append(bonus).append(kdBarang).append(hargaPokok).append(kodePram).append(noNota).append(noBarang).append(id).append(hargaJual).append(diskon).toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if ((other instanceof DNotaTunai) == false) {
|
||||
return false;
|
||||
}
|
||||
DNotaTunai rhs = ((DNotaTunai) other);
|
||||
return new EqualsBuilder().append(jumlah, rhs.jumlah).append(diskon2, rhs.diskon2).append(bonus, rhs.bonus).append(kdBarang, rhs.kdBarang).append(hargaPokok, rhs.hargaPokok).append(kodePram, rhs.kodePram).append(noNota, rhs.noNota).append(noBarang, rhs.noBarang).append(id, rhs.id).append(hargaJual, rhs.hargaJual).append(diskon, rhs.diskon).isEquals();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
|
||||
package id.amigogroup.posterminal.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"no_nota",
|
||||
"tgl_nota",
|
||||
"kd_customer",
|
||||
"jumlah_total",
|
||||
"kasir",
|
||||
"total_diskon",
|
||||
"keterangan",
|
||||
"status_nota"
|
||||
})
|
||||
public class MNotaRetur {
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
private String noNota;
|
||||
@JsonProperty("tgl_nota")
|
||||
private String tglNota;
|
||||
@JsonProperty("kd_customer")
|
||||
private String kdCustomer;
|
||||
@JsonProperty("jumlah_total")
|
||||
private int jumlahTotal;
|
||||
@JsonProperty("kasir")
|
||||
private String kasir;
|
||||
@JsonProperty("total_diskon")
|
||||
private int totalDiskon;
|
||||
@JsonProperty("keterangan")
|
||||
private String keterangan;
|
||||
@JsonProperty("status_nota")
|
||||
private String statusNota;
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
public String getNoNota() {
|
||||
return noNota;
|
||||
}
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
public void setNoNota(String noNota) {
|
||||
this.noNota = noNota;
|
||||
}
|
||||
|
||||
@JsonProperty("tgl_nota")
|
||||
public String getTglNota() {
|
||||
return tglNota;
|
||||
}
|
||||
|
||||
@JsonProperty("tgl_nota")
|
||||
public void setTglNota(String tglNota) {
|
||||
this.tglNota = tglNota;
|
||||
}
|
||||
|
||||
@JsonProperty("kd_customer")
|
||||
public String getKdCustomer() {
|
||||
return kdCustomer;
|
||||
}
|
||||
|
||||
@JsonProperty("kd_customer")
|
||||
public void setKdCustomer(String kdCustomer) {
|
||||
this.kdCustomer = kdCustomer;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah_total")
|
||||
public int getJumlahTotal() {
|
||||
return jumlahTotal;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah_total")
|
||||
public void setJumlahTotal(int jumlahTotal) {
|
||||
this.jumlahTotal = jumlahTotal;
|
||||
}
|
||||
|
||||
@JsonProperty("kasir")
|
||||
public String getKasir() {
|
||||
return kasir;
|
||||
}
|
||||
|
||||
@JsonProperty("kasir")
|
||||
public void setKasir(String kasir) {
|
||||
this.kasir = kasir;
|
||||
}
|
||||
|
||||
@JsonProperty("total_diskon")
|
||||
public int getTotalDiskon() {
|
||||
return totalDiskon;
|
||||
}
|
||||
|
||||
@JsonProperty("total_diskon")
|
||||
public void setTotalDiskon(int totalDiskon) {
|
||||
this.totalDiskon = totalDiskon;
|
||||
}
|
||||
|
||||
@JsonProperty("keterangan")
|
||||
public String getKeterangan() {
|
||||
return keterangan;
|
||||
}
|
||||
|
||||
@JsonProperty("keterangan")
|
||||
public void setKeterangan(String keterangan) {
|
||||
this.keterangan = keterangan;
|
||||
}
|
||||
|
||||
@JsonProperty("status_nota")
|
||||
public String getStatusNota() {
|
||||
return statusNota;
|
||||
}
|
||||
|
||||
@JsonProperty("status_nota")
|
||||
public void setStatusNota(String statusNota) {
|
||||
this.statusNota = statusNota;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this).append("noNota", noNota).append("tglNota", tglNota).append("kdCustomer", kdCustomer).append("jumlahTotal", jumlahTotal).append("kasir", kasir).append("totalDiskon", totalDiskon).append("keterangan", keterangan).append("statusNota", statusNota).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder().append(keterangan).append(totalDiskon).append(statusNota).append(kasir).append(noNota).append(tglNota).append(kdCustomer).append(jumlahTotal).toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if ((other instanceof MNotaRetur) == false) {
|
||||
return false;
|
||||
}
|
||||
MNotaRetur rhs = ((MNotaRetur) other);
|
||||
return new EqualsBuilder().append(keterangan, rhs.keterangan).append(totalDiskon, rhs.totalDiskon).append(statusNota, rhs.statusNota).append(kasir, rhs.kasir).append(noNota, rhs.noNota).append(tglNota, rhs.tglNota).append(kdCustomer, rhs.kdCustomer).append(jumlahTotal, rhs.jumlahTotal).isEquals();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,299 @@
|
||||
|
||||
package id.amigogroup.posterminal.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonPropertyOrder({
|
||||
"no_nota",
|
||||
"nota_lama",
|
||||
"tgl_nota",
|
||||
"kd_customer",
|
||||
"jumlah_total",
|
||||
"kasir",
|
||||
"total_uang",
|
||||
"total_diskon",
|
||||
"status_bayar",
|
||||
"bank",
|
||||
"edc",
|
||||
"no_kartu",
|
||||
"no_validasi_bank",
|
||||
"status_nota",
|
||||
"no_nota_retur",
|
||||
"jumlah_total_retur",
|
||||
"jenis_diskon",
|
||||
"jenis_hadiah",
|
||||
"tgl_ambilhadiah",
|
||||
"user_ambilhadiah"
|
||||
})
|
||||
public class MNotaTunai {
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
private String noNota;
|
||||
@JsonProperty("nota_lama")
|
||||
private Object notaLama;
|
||||
@JsonProperty("tgl_nota")
|
||||
private String tglNota;
|
||||
@JsonProperty("kd_customer")
|
||||
private String kdCustomer;
|
||||
@JsonProperty("jumlah_total")
|
||||
private int jumlahTotal;
|
||||
@JsonProperty("kasir")
|
||||
private String kasir;
|
||||
@JsonProperty("total_uang")
|
||||
private int totalUang;
|
||||
@JsonProperty("total_diskon")
|
||||
private int totalDiskon;
|
||||
@JsonProperty("status_bayar")
|
||||
private String statusBayar;
|
||||
@JsonProperty("bank")
|
||||
private Object bank;
|
||||
@JsonProperty("edc")
|
||||
private Object edc;
|
||||
@JsonProperty("no_kartu")
|
||||
private Object noKartu;
|
||||
@JsonProperty("no_validasi_bank")
|
||||
private Object noValidasiBank;
|
||||
@JsonProperty("status_nota")
|
||||
private String statusNota;
|
||||
@JsonProperty("no_nota_retur")
|
||||
private String noNotaRetur;
|
||||
@JsonProperty("jumlah_total_retur")
|
||||
private int jumlahTotalRetur;
|
||||
@JsonProperty("jenis_diskon")
|
||||
private Object jenisDiskon;
|
||||
@JsonProperty("jenis_hadiah")
|
||||
private Object jenisHadiah;
|
||||
@JsonProperty("tgl_ambilhadiah")
|
||||
private Object tglAmbilhadiah;
|
||||
@JsonProperty("user_ambilhadiah")
|
||||
private Object userAmbilhadiah;
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
public String getNoNota() {
|
||||
return noNota;
|
||||
}
|
||||
|
||||
@JsonProperty("no_nota")
|
||||
public void setNoNota(String noNota) {
|
||||
this.noNota = noNota;
|
||||
}
|
||||
|
||||
@JsonProperty("nota_lama")
|
||||
public Object getNotaLama() {
|
||||
return notaLama;
|
||||
}
|
||||
|
||||
@JsonProperty("nota_lama")
|
||||
public void setNotaLama(Object notaLama) {
|
||||
this.notaLama = notaLama;
|
||||
}
|
||||
|
||||
@JsonProperty("tgl_nota")
|
||||
public String getTglNota() {
|
||||
return tglNota;
|
||||
}
|
||||
|
||||
@JsonProperty("tgl_nota")
|
||||
public void setTglNota(String tglNota) {
|
||||
this.tglNota = tglNota;
|
||||
}
|
||||
|
||||
@JsonProperty("kd_customer")
|
||||
public String getKdCustomer() {
|
||||
return kdCustomer;
|
||||
}
|
||||
|
||||
@JsonProperty("kd_customer")
|
||||
public void setKdCustomer(String kdCustomer) {
|
||||
this.kdCustomer = kdCustomer;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah_total")
|
||||
public int getJumlahTotal() {
|
||||
return jumlahTotal;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah_total")
|
||||
public void setJumlahTotal(int jumlahTotal) {
|
||||
this.jumlahTotal = jumlahTotal;
|
||||
}
|
||||
|
||||
@JsonProperty("kasir")
|
||||
public String getKasir() {
|
||||
return kasir;
|
||||
}
|
||||
|
||||
@JsonProperty("kasir")
|
||||
public void setKasir(String kasir) {
|
||||
this.kasir = kasir;
|
||||
}
|
||||
|
||||
@JsonProperty("total_uang")
|
||||
public int getTotalUang() {
|
||||
return totalUang;
|
||||
}
|
||||
|
||||
@JsonProperty("total_uang")
|
||||
public void setTotalUang(int totalUang) {
|
||||
this.totalUang = totalUang;
|
||||
}
|
||||
|
||||
@JsonProperty("total_diskon")
|
||||
public int getTotalDiskon() {
|
||||
return totalDiskon;
|
||||
}
|
||||
|
||||
@JsonProperty("total_diskon")
|
||||
public void setTotalDiskon(int totalDiskon) {
|
||||
this.totalDiskon = totalDiskon;
|
||||
}
|
||||
|
||||
@JsonProperty("status_bayar")
|
||||
public String getStatusBayar() {
|
||||
return statusBayar;
|
||||
}
|
||||
|
||||
@JsonProperty("status_bayar")
|
||||
public void setStatusBayar(String statusBayar) {
|
||||
this.statusBayar = statusBayar;
|
||||
}
|
||||
|
||||
@JsonProperty("bank")
|
||||
public Object getBank() {
|
||||
return bank;
|
||||
}
|
||||
|
||||
@JsonProperty("bank")
|
||||
public void setBank(Object bank) {
|
||||
this.bank = bank;
|
||||
}
|
||||
|
||||
@JsonProperty("edc")
|
||||
public Object getEdc() {
|
||||
return edc;
|
||||
}
|
||||
|
||||
@JsonProperty("edc")
|
||||
public void setEdc(Object edc) {
|
||||
this.edc = edc;
|
||||
}
|
||||
|
||||
@JsonProperty("no_kartu")
|
||||
public Object getNoKartu() {
|
||||
return noKartu;
|
||||
}
|
||||
|
||||
@JsonProperty("no_kartu")
|
||||
public void setNoKartu(Object noKartu) {
|
||||
this.noKartu = noKartu;
|
||||
}
|
||||
|
||||
@JsonProperty("no_validasi_bank")
|
||||
public Object getNoValidasiBank() {
|
||||
return noValidasiBank;
|
||||
}
|
||||
|
||||
@JsonProperty("no_validasi_bank")
|
||||
public void setNoValidasiBank(Object noValidasiBank) {
|
||||
this.noValidasiBank = noValidasiBank;
|
||||
}
|
||||
|
||||
@JsonProperty("status_nota")
|
||||
public String getStatusNota() {
|
||||
return statusNota;
|
||||
}
|
||||
|
||||
@JsonProperty("status_nota")
|
||||
public void setStatusNota(String statusNota) {
|
||||
this.statusNota = statusNota;
|
||||
}
|
||||
|
||||
@JsonProperty("no_nota_retur")
|
||||
public String getNoNotaRetur() {
|
||||
return noNotaRetur;
|
||||
}
|
||||
|
||||
@JsonProperty("no_nota_retur")
|
||||
public void setNoNotaRetur(String noNotaRetur) {
|
||||
this.noNotaRetur = noNotaRetur;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah_total_retur")
|
||||
public int getJumlahTotalRetur() {
|
||||
return jumlahTotalRetur;
|
||||
}
|
||||
|
||||
@JsonProperty("jumlah_total_retur")
|
||||
public void setJumlahTotalRetur(int jumlahTotalRetur) {
|
||||
this.jumlahTotalRetur = jumlahTotalRetur;
|
||||
}
|
||||
|
||||
@JsonProperty("jenis_diskon")
|
||||
public Object getJenisDiskon() {
|
||||
return jenisDiskon;
|
||||
}
|
||||
|
||||
@JsonProperty("jenis_diskon")
|
||||
public void setJenisDiskon(Object jenisDiskon) {
|
||||
this.jenisDiskon = jenisDiskon;
|
||||
}
|
||||
|
||||
@JsonProperty("jenis_hadiah")
|
||||
public Object getJenisHadiah() {
|
||||
return jenisHadiah;
|
||||
}
|
||||
|
||||
@JsonProperty("jenis_hadiah")
|
||||
public void setJenisHadiah(Object jenisHadiah) {
|
||||
this.jenisHadiah = jenisHadiah;
|
||||
}
|
||||
|
||||
@JsonProperty("tgl_ambilhadiah")
|
||||
public Object getTglAmbilhadiah() {
|
||||
return tglAmbilhadiah;
|
||||
}
|
||||
|
||||
@JsonProperty("tgl_ambilhadiah")
|
||||
public void setTglAmbilhadiah(Object tglAmbilhadiah) {
|
||||
this.tglAmbilhadiah = tglAmbilhadiah;
|
||||
}
|
||||
|
||||
@JsonProperty("user_ambilhadiah")
|
||||
public Object getUserAmbilhadiah() {
|
||||
return userAmbilhadiah;
|
||||
}
|
||||
|
||||
@JsonProperty("user_ambilhadiah")
|
||||
public void setUserAmbilhadiah(Object userAmbilhadiah) {
|
||||
this.userAmbilhadiah = userAmbilhadiah;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this).append("noNota", noNota).append("notaLama", notaLama).append("tglNota", tglNota).append("kdCustomer", kdCustomer).append("jumlahTotal", jumlahTotal).append("kasir", kasir).append("totalUang", totalUang).append("totalDiskon", totalDiskon).append("statusBayar", statusBayar).append("bank", bank).append("edc", edc).append("noKartu", noKartu).append("noValidasiBank", noValidasiBank).append("statusNota", statusNota).append("noNotaRetur", noNotaRetur).append("jumlahTotalRetur", jumlahTotalRetur).append("jenisDiskon", jenisDiskon).append("jenisHadiah", jenisHadiah).append("tglAmbilhadiah", tglAmbilhadiah).append("userAmbilhadiah", userAmbilhadiah).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder().append(edc).append(statusNota).append(jumlahTotalRetur).append(tglAmbilhadiah).append(tglNota).append(noNotaRetur).append(userAmbilhadiah).append(noValidasiBank).append(bank).append(notaLama).append(totalDiskon).append(kasir).append(noNota).append(statusBayar).append(noKartu).append(jenisDiskon).append(jenisHadiah).append(kdCustomer).append(jumlahTotal).append(totalUang).toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) {
|
||||
return true;
|
||||
}
|
||||
if ((other instanceof MNotaTunai) == false) {
|
||||
return false;
|
||||
}
|
||||
MNotaTunai rhs = ((MNotaTunai) other);
|
||||
return new EqualsBuilder().append(edc, rhs.edc).append(statusNota, rhs.statusNota).append(jumlahTotalRetur, rhs.jumlahTotalRetur).append(tglAmbilhadiah, rhs.tglAmbilhadiah).append(tglNota, rhs.tglNota).append(noNotaRetur, rhs.noNotaRetur).append(userAmbilhadiah, rhs.userAmbilhadiah).append(noValidasiBank, rhs.noValidasiBank).append(bank, rhs.bank).append(notaLama, rhs.notaLama).append(totalDiskon, rhs.totalDiskon).append(kasir, rhs.kasir).append(noNota, rhs.noNota).append(statusBayar, rhs.statusBayar).append(noKartu, rhs.noKartu).append(jenisDiskon, rhs.jenisDiskon).append(jenisHadiah, rhs.jenisHadiah).append(kdCustomer, rhs.kdCustomer).append(jumlahTotal, rhs.jumlahTotal).append(totalUang, rhs.totalUang).isEquals();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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 id.amigogroup.posterminal.model.Barang;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author ronal
|
||||
*/
|
||||
public class DetailTransaksi<T,U> {
|
||||
private T masterNota;
|
||||
private U detailNota;
|
||||
private Barang barang;
|
||||
|
||||
/**
|
||||
* @return the masterNota
|
||||
*/
|
||||
public T getMasterNota() {
|
||||
return masterNota;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param masterNota the masterNota to set
|
||||
*/
|
||||
public void setMasterNota(T masterNota) {
|
||||
this.masterNota = masterNota;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the detailNota
|
||||
*/
|
||||
public U getDetailNota() {
|
||||
return detailNota;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param detailNota the detailNota to set
|
||||
*/
|
||||
public void setDetailNota(U detailNota) {
|
||||
this.detailNota = detailNota;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the barang
|
||||
*/
|
||||
public Barang getBarang() {
|
||||
return barang;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param barang the barang to set
|
||||
*/
|
||||
public void setBarang(Barang barang) {
|
||||
this.barang = barang;
|
||||
}
|
||||
}
|
||||
@ -1,103 +1,170 @@
|
||||
/*
|
||||
* 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 java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.Dialog;
|
||||
import javafx.scene.control.RadioButton;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.ToggleGroup;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Window;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Josua
|
||||
*/
|
||||
public class DialogTambahNotaController extends Dialog<String> implements Initializable {
|
||||
|
||||
@FXML
|
||||
private AnchorPane apTambahNota;
|
||||
@FXML
|
||||
private ToggleGroup tgTipe;
|
||||
@FXML
|
||||
private RadioButton rbBaru;
|
||||
@FXML
|
||||
private ComboBox<String> cbxPilihNota;
|
||||
@FXML
|
||||
private RadioButton rbAmbilDariCheckout;
|
||||
@FXML
|
||||
private TextField tfAmbilDariCheckout;
|
||||
|
||||
public static final ButtonType btnLanjutkan = new ButtonType("Lanjutkan");
|
||||
public static final ButtonType btnBatal = new ButtonType("Batal");
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
cbxPilihNota.getItems().setAll(
|
||||
"Tunai",
|
||||
"Bon",
|
||||
"Bawa Dulu",
|
||||
"Retur"
|
||||
);
|
||||
}
|
||||
|
||||
public DialogTambahNotaController() {
|
||||
try {
|
||||
Window window = getDialogPane().getScene().getWindow();
|
||||
window.setOnCloseRequest(event -> this.close());
|
||||
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/DialogTambahNota.fxml"));
|
||||
loader.setController(this);
|
||||
// DialogCariBarangController controller = loader.<DialogCariBarangController>getController();
|
||||
|
||||
Parent root = loader.load();
|
||||
getDialogPane().setContent(root);
|
||||
|
||||
getDialogPane().getButtonTypes().add(btnBatal);
|
||||
getDialogPane().getButtonTypes().add(btnLanjutkan);
|
||||
setResultConverter(buttonType -> {
|
||||
if (buttonType == btnLanjutkan) {
|
||||
//radio button mana yang dipilih
|
||||
if (((RadioButton) tgTipe.getSelectedToggle()) == rbBaru) {
|
||||
return "Baru:" + cbxPilihNota.getValue();
|
||||
} else if (((RadioButton) tgTipe.getSelectedToggle()) == rbAmbilDariCheckout) {
|
||||
return "Checkout:" + tfAmbilDariCheckout.getText();
|
||||
}
|
||||
//baru, balikin tipe yang dipilih
|
||||
//dari checkout, balikin isi nomor nota (hanya jika nota ditemukan)
|
||||
}
|
||||
return "Batal";
|
||||
});
|
||||
setTitle("Tambah Nota");
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(DialogKonfirmasiReturController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void rbNotaBaruOnAction(ActionEvent event) {
|
||||
cbxPilihNota.setDisable(false);
|
||||
tfAmbilDariCheckout.setDisable(true);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void rbAmbilDariCheckoutOnAction(ActionEvent event) {
|
||||
cbxPilihNota.setDisable(true);
|
||||
tfAmbilDariCheckout.setDisable(false);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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 id.amigogroup.posterminal.api.AmigoPosRx;
|
||||
import id.amigogroup.posterminal.model.MNotaRetur;
|
||||
import id.amigogroup.posterminal.model.MNotaTunai;
|
||||
import id.amigogroup.posterminal.util.AlertUtil;
|
||||
import id.amigogroup.posterminal.util.Fucout;
|
||||
import io.reactivex.Observable;
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.Dialog;
|
||||
import javafx.scene.control.RadioButton;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.ToggleGroup;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Window;
|
||||
import retrofit2.HttpException;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Josua
|
||||
*/
|
||||
public class DialogTambahNotaController extends Dialog<String> implements Initializable {
|
||||
|
||||
@FXML
|
||||
private AnchorPane apTambahNota;
|
||||
@FXML
|
||||
private ToggleGroup tgTipe;
|
||||
@FXML
|
||||
private RadioButton rbBaru;
|
||||
@FXML
|
||||
private ComboBox<String> cbxPilihNota;
|
||||
@FXML
|
||||
private RadioButton rbAmbilDariCheckout;
|
||||
@FXML
|
||||
private TextField tfAmbilDariCheckout;
|
||||
|
||||
private AmigoPosRx posRx = new AmigoPosRx();
|
||||
public static final ButtonType btnLanjutkan = new ButtonType("Lanjutkan");
|
||||
public static final ButtonType btnBatal = new ButtonType("Batal");
|
||||
|
||||
@Override
|
||||
public void initialize(URL url, ResourceBundle rb) {
|
||||
cbxPilihNota.getItems().setAll(
|
||||
"Tunai",
|
||||
"Bon",
|
||||
"Bawa Dulu",
|
||||
"Retur"
|
||||
);
|
||||
}
|
||||
|
||||
public DialogTambahNotaController() {
|
||||
try {
|
||||
Window window = getDialogPane().getScene().getWindow();
|
||||
window.setOnCloseRequest(event -> this.close());
|
||||
|
||||
FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/DialogTambahNota.fxml"));
|
||||
loader.setController(this);
|
||||
// DialogCariBarangController controller = loader.<DialogCariBarangController>getController();
|
||||
|
||||
Parent root = loader.load();
|
||||
getDialogPane().setContent(root);
|
||||
|
||||
getDialogPane().getButtonTypes().add(btnBatal);
|
||||
getDialogPane().getButtonTypes().add(btnLanjutkan);
|
||||
|
||||
Button btnLanjutkanR = (Button) getDialogPane().lookupButton(btnLanjutkan);
|
||||
btnLanjutkanR.addEventFilter(ActionEvent.ACTION, event -> {
|
||||
if (((RadioButton) tgTipe.getSelectedToggle()) == rbAmbilDariCheckout) {
|
||||
boolean notaExists = false;
|
||||
try {
|
||||
switch (tfAmbilDariCheckout.getText().charAt(0)) {
|
||||
case Fucout.KODE_NOTA_BON:
|
||||
break;
|
||||
case Fucout.KODE_NOTA_BAWA:
|
||||
break;
|
||||
case Fucout.KODE_NOTA_RETUR:
|
||||
Observable<MNotaRetur> mNotaReturObservable
|
||||
= posRx.getMNotaReturByNoNota(tfAmbilDariCheckout.getText());
|
||||
MNotaRetur resultMNotaRetur
|
||||
= mNotaReturObservable.blockingFirst();
|
||||
if (resultMNotaRetur != null) {
|
||||
notaExists = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
Observable<MNotaTunai> mNotaTunaiObservable
|
||||
= posRx.getMNotaTunaiByNoNota(tfAmbilDariCheckout.getText());
|
||||
MNotaTunai resultMNotaTunai
|
||||
= mNotaTunaiObservable.blockingFirst();
|
||||
if (resultMNotaTunai != null) {
|
||||
notaExists = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (HttpException he) {
|
||||
switch (he.code()) {
|
||||
case HttpURLConnection.HTTP_NOT_FOUND:
|
||||
Alert alert = AlertUtil.getAlertError(
|
||||
AlertUtil.ERROR_TIDAK_DITEMUKAN_TITLE,
|
||||
"Data nota dengan nomor tersebut tidak ditemukan");
|
||||
alert.initOwner(apTambahNota.getScene().getWindow());
|
||||
alert.initModality(Modality.APPLICATION_MODAL);
|
||||
alert.show();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Alert alert = AlertUtil.getAlertError(
|
||||
AlertUtil.ERROR_TIDAK_TERDUGA_TITLE,
|
||||
AlertUtil.ERROR_TIDAK_TERDUGA_MESSAGE);
|
||||
alert.initOwner(apTambahNota.getScene().getWindow());
|
||||
alert.initModality(Modality.APPLICATION_MODAL);
|
||||
alert.show();
|
||||
|
||||
Logger.getLogger(DialogTambahNotaController.class.getName()).log(Level.SEVERE, null, e);
|
||||
}
|
||||
|
||||
if (!notaExists) {
|
||||
event.consume();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setResultConverter(buttonType -> {
|
||||
if (buttonType == btnLanjutkan) {
|
||||
//radio button mana yang dipilih
|
||||
if (((RadioButton) tgTipe.getSelectedToggle()) == rbBaru) {
|
||||
return "Baru:" + cbxPilihNota.getValue();
|
||||
} else if (((RadioButton) tgTipe.getSelectedToggle()) == rbAmbilDariCheckout) {
|
||||
return "Checkout:" + tfAmbilDariCheckout.getText();
|
||||
}
|
||||
}
|
||||
return "Batal";
|
||||
});
|
||||
setTitle("Tambah Nota");
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(DialogKonfirmasiReturController.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void rbNotaBaruOnAction(ActionEvent event) {
|
||||
cbxPilihNota.setDisable(false);
|
||||
tfAmbilDariCheckout.setDisable(true);
|
||||
}
|
||||
|
||||
@FXML
|
||||
void rbAmbilDariCheckoutOnAction(ActionEvent event) {
|
||||
cbxPilihNota.setDisable(true);
|
||||
tfAmbilDariCheckout.setDisable(false);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue