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:
2026-11-01 14:57:54 +07:00
parent be2091eddd
commit aaaf0a9215
92 changed files with 749 additions and 749 deletions
+26 -26
View File
@@ -14,7 +14,7 @@ var BeliJS = {
PHP: '',
KODE: '',
index: function(q){
index(q) {
$('#butTambah').click(() => this.tx_tambah());
$('#butUbah').click(() => this.tx_ubah());
$('#butHapus').click(() => this.tx_hapus());
@@ -26,7 +26,7 @@ var BeliJS = {
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">&nbsp;</div>');
this.winBTX = FoniaJS.showWindow('BTX', 'Daftar Transaksi', _isi, 'xl', '', () => {
$('#winBTX')
@@ -43,17 +43,17 @@ var BeliJS = {
});
},
tx_select: function(acell){
tx_select(acell) {
FoniaJS.closeWindow(this.winBTX);
$('#No_Beli').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_Beli').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
@@ -65,7 +65,7 @@ var BeliJS = {
FoniaJS.showAuth(() => this.data_query('master', 'edit'), this, 'EDIT '+$('#No_Beli').val());
},
tx_hapus: function(){
tx_hapus() {
if (!$('#No_Beli').val()){
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
return;
@@ -89,7 +89,7 @@ var BeliJS = {
}, 'danger');
},
tx_simpan: function(mode){
tx_simpan(mode) {
if ($('#CabID').val()==0){
FoniaJS.showError("Silakan pilih Nama Cabang !");
return;
@@ -109,14 +109,14 @@ var BeliJS = {
this.data_query('master', 'save');
},
tx_batal: function(){
tx_batal() {
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan membatalkan ?', () => {
this.data_query('master', 'cancel');
$('#No_Beli').val('');
}, 'danger');
},
tx_print: function(prt){
tx_print(prt) {
if ($('#No_Beli').val()) {
var cetak = new Printer('report/nota/beli');
cetak.add_param("Nomor_Cetak", $('#No_Beli').val());
@@ -126,18 +126,18 @@ var BeliJS = {
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
},
pending_brow: function(){
pending_brow() {
var _isi = new String('<div id="divBrowPending">&nbsp;</div>');
this.winBPending = FoniaJS.showWindow('BPending', 'Daftar Pending Pembelian', _isi, 'xl', '', () => this.data_query('brow-pending'));
},
pending_select: function(acell){
pending_select(acell) {
FoniaJS.closeWindow(this.winBPending);
$('#No_Beli').val(acell[0]);
this.data_query('master', 'pending-edit');
},
pending_delete: function(acell){
pending_delete(acell) {
FoniaJS.closeWindow(this.winBPending);
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Transaksi Pending "'+acell[0]+'" ?', () => {
$('#No_Beli').val(acell[0]);
@@ -145,7 +145,7 @@ var BeliJS = {
}, 'danger');
},
produk_brow: function(){
produk_brow() {
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
@@ -173,12 +173,12 @@ var BeliJS = {
});
},
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_Beli','ID='+ID,'InvID='+InvID,'SatuanID='+SatuanID,'VarianID='+VarianID],
@@ -236,7 +236,7 @@ var BeliJS = {
}).send();
},
detail_tambah: function(){
detail_tambah() {
if ($('#SupID').val()==0){
FoniaJS.showError("Silakan pilih Nama Supplier !");
return;
@@ -244,11 +244,11 @@ var BeliJS = {
this.detail_produk('insert', 0, 0, 0, 0);
},
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',
@@ -261,7 +261,7 @@ var BeliJS = {
}, 'danger');
},
detail_simpan: function(){
detail_simpan() {
if (parseInt($('#InvID').val())==0) {
FoniaJS.showError('Silakan masukkan Nama Barang !');
return;
@@ -278,7 +278,7 @@ var BeliJS = {
}).send();
},
total_show: function(){
total_show() {
if (['add','edit'].indexOf($('#mode').val()) == -1) return false;
new Request({
url: this.PHP + '/form_total',
@@ -302,14 +302,14 @@ var BeliJS = {
}).send();
},
total_simpan: function(){
total_simpan() {
$('#Real_Diskon').val(FoniaJS.StrToFloat($('#popTotal_Diskon').val()));
$('#Real_Beli').val(FoniaJS.StrToFloat($('#popTotal_Beli').val()));
$('#tombolTotal').html('<i class="bi-wallet2 me-1"></i>Hutang : '+FoniaJS.FloatToStr($('#Real_Beli').val(),2));
FoniaJS.closeWindow(this.winTotal);
},
data_query: function(tipe, mode, kd_tx){
data_query(tipe, mode, kd_tx) {
if (tipe=="master"){
mode = (mode) ? mode : '';
var sparam = ['mode='+mode,'No_Beli'+((typeof(kd_tx)!=='undefined')?'='+kd_tx:'')];
@@ -386,7 +386,7 @@ var BeliJS = {
}
},
Produk_Comp: function(item){
Produk_Comp(item) {
var adata = item.data.split(':');
$('#InvID').val(item.value);
$('#SatuanID').val(adata[0]);
@@ -398,7 +398,7 @@ var BeliJS = {
BeliJS.update_Items();
},
update_Items: function(){
update_Items() {
new Request({
url: this.PHP + '/item_detail',
sendParam: ['InvID','SatuanID','SupID'],
@@ -419,14 +419,14 @@ var BeliJS = {
}).send();
},
update_Varian: function(){
update_Varian() {
new Request_JSF({
url: this.PHP + '/option_varian',
sendParam: ['InvID','SatuanID','VarianID']
}).send();
},
Hitung_Detail: function(){
Hitung_Detail() {
var dqty = FoniaJS.StrToFloat($('#Qty').val());
var dharga = FoniaJS.StrToFloat($('#Harga_Beli').val());
var ddiskrp = FoniaJS.StrToFloat($('#Disk_Rupiah').val());