Refactor member and product scripts to use concise method definitions
- Updated all function declarations to use ES6 shorthand method syntax in member.js, member_grup.js, point_barang.js, point_skema.js, point_tipe.js, kategori.js, operator.js, produk.js, produk_grup.js, rekpos.js, satuan.js, supplier.js, and varian.js.
This commit is contained in:
+11
-11
@@ -14,21 +14,21 @@ var GELPiutangJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
index(q) {
|
||||
$('#butMode').click(() => this.tx_mode());
|
||||
$('#butBatal').click(() => this.tx_batal());
|
||||
if (FoniaJS.User.Level>0) $('#butMode').hide();
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_mode: function(){
|
||||
tx_mode() {
|
||||
var mode = ($('#Mode_Tampil').val()==1) ? 0 : 1;
|
||||
$('#Mode_Tampil').val(mode);
|
||||
$('#butMode').html('<i class="bi-list me-2"></i>'+(mode==1?'Semua':'Normal'));
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
tx_batal() {
|
||||
$('#divTXNota').removeClass('d-none');
|
||||
$('#divDetailNota').addClass('d-none');
|
||||
$('#divDetailBayar').addClass('d-none');
|
||||
@@ -39,7 +39,7 @@ var GELPiutangJS = {
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
buyer_brow: function(){
|
||||
buyer_brow() {
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_Buyer" placeholder="Kunci Pencarian" type="text"><button class="btn btn-info shadow-none" type="button" id="butSearch">Cari</button><button class="btn btn-secondary shadow-none" type="button" id="butAll">Semua</button></div></div></div><div id="divBrowBuyer"> </div>');
|
||||
this.winBBuyer = FoniaJS.showWindow('BBuyer', 'Daftar Member', _isi, 'xl', '', () => {
|
||||
$('#winBBuyer')
|
||||
@@ -57,7 +57,7 @@ var GELPiutangJS = {
|
||||
});
|
||||
},
|
||||
|
||||
buyer_select: function(acell){
|
||||
buyer_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBBuyer);
|
||||
$('#MemberID').val(acell[0]);
|
||||
$('#Nama_Member').val(acell[2]);
|
||||
@@ -65,7 +65,7 @@ var GELPiutangJS = {
|
||||
this.data_query('tabel-nota');
|
||||
},
|
||||
|
||||
nota_select: function(acell){
|
||||
nota_select(acell) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_nota',
|
||||
sendParam: ['No_Jual='+acell[1],'Tipe_Nota='+acell[0]],
|
||||
@@ -83,7 +83,7 @@ var GELPiutangJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_show: function(){
|
||||
bayar_show() {
|
||||
new Request({
|
||||
url: this.PHP + '/form_bayar',
|
||||
sendParam: ['No_Jual','Total_Sisa'],
|
||||
@@ -96,7 +96,7 @@ var GELPiutangJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
bayar_hapus: function(acell){
|
||||
bayar_hapus(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[1]+'"</strong> ?', () => {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_bayar',
|
||||
@@ -105,7 +105,7 @@ var GELPiutangJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
bayar_simpan: function(){
|
||||
bayar_simpan() {
|
||||
if ((FoniaJS.StrToFloat($('#Total_Bayar').val()) + FoniaJS.StrToFloat($('#Total_Potong').val())) > $('#Total_Sisa').val()){
|
||||
FoniaJS.showError("Jumlah pelunasan melebihi jumlah faktur!");
|
||||
return;
|
||||
@@ -117,7 +117,7 @@ var GELPiutangJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
data_query(tipe, mode, kd_tx) {
|
||||
if (tipe=="master"){
|
||||
new Request({
|
||||
url: this.PHP + '/form_master',
|
||||
@@ -153,7 +153,7 @@ var GELPiutangJS = {
|
||||
}
|
||||
},
|
||||
|
||||
Member_Comp: function(item){
|
||||
Member_Comp(item) {
|
||||
$('#MemberID').val(item.value);
|
||||
$('#Alamat_Member').val(item.data);
|
||||
GELPiutangJS.data_query('tabel-nota');
|
||||
|
||||
Reference in New Issue
Block a user