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:
+19
-19
@@ -14,7 +14,7 @@ var MutasiJS = {
|
||||
PHP: '',
|
||||
KODE: '',
|
||||
|
||||
index: function(q){
|
||||
index(q) {
|
||||
$('#butTambah').click(() => this.tx_tambah());
|
||||
$('#butUbah').click(() => this.tx_ubah());
|
||||
$('#butHapus').click(() => this.tx_hapus());
|
||||
@@ -25,7 +25,7 @@ var MutasiJS = {
|
||||
this.data_query('master', 'view', ((typeof(q)!=='undefined') ? q : ''));
|
||||
},
|
||||
|
||||
tx_brow: function(){
|
||||
tx_brow() {
|
||||
var _isi = new String('<div class="row mb-1"><div class="col"><div class="input-group"><input class="form-control" id="Cari_TX" 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="divBrowTX"> </div>');
|
||||
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
|
||||
$('#winBTX')
|
||||
@@ -42,17 +42,17 @@ var MutasiJS = {
|
||||
});
|
||||
},
|
||||
|
||||
tx_select: function(acell){
|
||||
tx_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBTX);
|
||||
$('#No_Mutasi').val(acell[0]);
|
||||
this.data_query('master', 'view');
|
||||
},
|
||||
|
||||
tx_tambah: function(){
|
||||
tx_tambah() {
|
||||
this.data_query('master', 'add');
|
||||
},
|
||||
|
||||
tx_ubah: function(){
|
||||
tx_ubah() {
|
||||
if (!$('#No_Mutasi').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
@@ -60,7 +60,7 @@ var MutasiJS = {
|
||||
FoniaJS.showAuth(function(){this.data_query('master', 'edit')}.bind(this), this, 'EDIT '+$('#No_Mutasi').val());
|
||||
},
|
||||
|
||||
tx_hapus: function(){
|
||||
tx_hapus() {
|
||||
if (!$('#No_Mutasi').val()){
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
return;
|
||||
@@ -84,7 +84,7 @@ var MutasiJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_simpan: function(){
|
||||
tx_simpan() {
|
||||
if ($('#Dari_CabID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Dari Cabang !");
|
||||
return;
|
||||
@@ -100,14 +100,14 @@ var MutasiJS = {
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
tx_batal: function(){
|
||||
tx_batal() {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
|
||||
this.data_query('master', 'cancel');
|
||||
$('#No_Mutasi').val('');
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
tx_print: function(prt){
|
||||
tx_print(prt) {
|
||||
if ($('#No_Mutasi').val()) {
|
||||
var cetak = new Printer('report/nota/mutasi');
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
|
||||
@@ -117,7 +117,7 @@ var MutasiJS = {
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
},
|
||||
|
||||
tx_print_pos: function(){
|
||||
tx_print_pos() {
|
||||
if ($('#No_Mutasi').val()) {
|
||||
var cetak = new PrinterPos('report/nota/mutasi_pos');
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
|
||||
@@ -127,7 +127,7 @@ var MutasiJS = {
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
},
|
||||
|
||||
produk_brow: function(){
|
||||
produk_brow() {
|
||||
if ($('#Dari_CabID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Dari Cabang !");
|
||||
return;
|
||||
@@ -148,12 +148,12 @@ var MutasiJS = {
|
||||
});
|
||||
},
|
||||
|
||||
produk_select: function(acell){
|
||||
produk_select(acell) {
|
||||
FoniaJS.closeWindow(this.winBProduk);
|
||||
this.detail_produk('insert', 0, acell[0], acell[1], acell[2]);
|
||||
},
|
||||
|
||||
detail_produk: function(mode, ID, InvID, SatuanID, VarianID){
|
||||
detail_produk(mode, ID, InvID, SatuanID, VarianID) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_produk',
|
||||
sendParam: ['mode','mode_detail='+mode,'No_Mutasi','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID],
|
||||
@@ -174,11 +174,11 @@ var MutasiJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
detail_ubah: function(acell){
|
||||
detail_ubah(acell) {
|
||||
this.detail_produk('update', acell[0], acell[1], acell[2], acell[3]);
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
detail_hapus(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
@@ -188,7 +188,7 @@ var MutasiJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
detail_simpan() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','No_Mutasi','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Dari_CabID','Ke_CabID'],
|
||||
@@ -199,7 +199,7 @@ var MutasiJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode, kd_tx){
|
||||
data_query(tipe, mode, kd_tx) {
|
||||
if (tipe=="master"){
|
||||
var sparam = ['mode='+mode,'No_Mutasi'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
|
||||
if ((mode ?? '')=='save') sparam = ['mode='+mode,'No_Mutasi','Tgl_Mutasi','Dari_CabID','Ke_CabID','Catatan'];
|
||||
@@ -268,7 +268,7 @@ var MutasiJS = {
|
||||
}
|
||||
},
|
||||
|
||||
Produk_Comp: function(item){
|
||||
Produk_Comp(item) {
|
||||
if ($('#Dari_CabID').val()==0){
|
||||
FoniaJS.showError("Silakan pilih Dari Cabang !");
|
||||
return;
|
||||
@@ -284,7 +284,7 @@ var MutasiJS = {
|
||||
$('#Nama_Produk').val('').focus();
|
||||
},
|
||||
|
||||
Hitung_Detail: function(){
|
||||
Hitung_Detail() {
|
||||
$('#Jumlah').val(FoniaJS.FloatToStr(FoniaJS.StrToFloat($('#Qty').val()) * FoniaJS.StrToFloat($('#Harga_Beli').val()), 2));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user