Refactor AJAX requests from Request.JSONF to Request_JSF across multiple scripts for consistency and improved functionality.
This commit is contained in:
@@ -250,7 +250,7 @@ var BeliJS = {
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','No_Beli','ID='+acell[0]],
|
||||
onSuccess: () => {
|
||||
@@ -267,7 +267,7 @@ var BeliJS = {
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','No_Beli','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Disk_Rupiah','Disk_Persen1','Disk_Persen2','Disk_Persen3','Disk_Persen4','Disk_Persen5'],
|
||||
onSuccess: () => {
|
||||
@@ -358,7 +358,7 @@ var BeliJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','No_Beli'],
|
||||
onSuccess: () => {
|
||||
@@ -367,18 +367,18 @@ var BeliJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-pending"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_pending',
|
||||
sendParam: ['Cari_Pending']
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['Cari_Produk','Filter_Browse','SupID'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
@@ -420,7 +420,7 @@ var BeliJS = {
|
||||
},
|
||||
|
||||
update_Varian: function(){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/option_varian',
|
||||
sendParam: ['InvID','SatuanID','VarianID']
|
||||
}).send();
|
||||
|
||||
@@ -182,7 +182,7 @@ var BeliReturJS = {
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','No_Beli','ID='+acell[0]]
|
||||
}).send();
|
||||
@@ -195,7 +195,7 @@ var BeliReturJS = {
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','No_Beli','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli'],
|
||||
onSuccess: () => {
|
||||
@@ -242,18 +242,18 @@ var BeliReturJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','No_Beli']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['CabID','Cari_Produk'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
@@ -274,7 +274,7 @@ var BeliReturJS = {
|
||||
},
|
||||
|
||||
update_Varian: function(){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/option_varian',
|
||||
sendParam: ['InvID','SatuanID','VarianID']
|
||||
}).send();
|
||||
|
||||
@@ -70,7 +70,7 @@ var CekHargaJS = {
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['Cari_Produk'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
@@ -91,7 +91,7 @@ var CekHargaJS = {
|
||||
|
||||
update_Sup: function(){
|
||||
if (parseInt($('#InvID').val()) == 0) return false;
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/update_sup',
|
||||
sendParam: ['InvID']
|
||||
}).send();
|
||||
|
||||
@@ -237,7 +237,7 @@ var JualJS = {
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','No_Jual','ID='+acell[0]],
|
||||
onSuccess: () => $('#Nama_Produk').focus()
|
||||
@@ -250,7 +250,7 @@ var JualJS = {
|
||||
FoniaJS.showInfo('Nilai Diskon diluar batas !');
|
||||
return false;
|
||||
}
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','No_Jual','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Harga_Jual','Disk_Rupiah','Disk_Persen'],
|
||||
onSuccess: () => {
|
||||
@@ -324,28 +324,28 @@ var JualJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','No_Jual']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-pending"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_pending',
|
||||
}).send();
|
||||
} else if (tipe=="brow-member"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_member',
|
||||
sendParam: ['Cari_Member'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['Cari_Produk','Grup_MemberID'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
@@ -371,7 +371,7 @@ var JualJS = {
|
||||
// P : Satuan : Varian : Harga_Pokok : Harga_Jual : Stok
|
||||
//todo: jika stok kosong tidak simpan !!
|
||||
//if (parseInt(adata[5])>0 || _qty<0){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: JualJS.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=insert','No_Jual','InvID='+item.value,'SatuanID='+adata[1],'VarianID='+adata[2],'Qty='+_qty,'Harga_Beli='+adata[3],'Harga_Jual='+adata[4]],
|
||||
onSuccess: () => $('#POS_Qty').val('1.00')
|
||||
@@ -386,7 +386,7 @@ var JualJS = {
|
||||
},
|
||||
|
||||
update_Piutang: function(){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/update_piutang',
|
||||
sendParam: ['MemberID'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Nama_Produk')
|
||||
|
||||
@@ -180,7 +180,7 @@ var MutasiJS = {
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[5]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','No_Mutasi','ID='+acell[0]],
|
||||
onSuccess: () => $('#Nama_Produk').focus()
|
||||
@@ -189,7 +189,7 @@ var MutasiJS = {
|
||||
},
|
||||
|
||||
detail_simpan: function(){
|
||||
new Request.JSONF({
|
||||
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'],
|
||||
onSuccess: () => {
|
||||
@@ -249,18 +249,18 @@ var MutasiJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','No_Mutasi']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['Cari_Produk','Dari_CabID'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
@@ -276,7 +276,7 @@ var MutasiJS = {
|
||||
var _qty = FoniaJS.StrToFloat($('#POS_Qty').val());
|
||||
var adata = item.data.split(':');
|
||||
// Satuan : Varian : Harga_Pokok
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: MutasiJS.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=insert','No_Mutasi','InvID='+item.value,'SatuanID='+adata[0],'VarianID='+adata[1],'Qty='+_qty,'Harga_Beli='+adata[2]],
|
||||
onSuccess: () => $('#POS_Qty').val('1.00')
|
||||
|
||||
@@ -171,7 +171,7 @@ var OpnameJS = {
|
||||
|
||||
detail_hapus: function(acell){
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Hapus item <strong>"'+acell[2]+'"</strong> ?', () => {
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail=delete','No_Opname','ID='+acell[0]]
|
||||
}).send();
|
||||
@@ -184,7 +184,7 @@ var OpnameJS = {
|
||||
return;
|
||||
}
|
||||
var _mdetail = $('#mode_detail').val();
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','mode_detail','No_Opname','CabID','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli'],
|
||||
onSuccess: () => {
|
||||
@@ -231,18 +231,18 @@ var OpnameJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=="tabel-detail"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode','No_Opname']
|
||||
}).send();
|
||||
} else if (tipe=="brow-tx"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_tx',
|
||||
sendParam: ['Cari_TX'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_TX')
|
||||
}).send();
|
||||
} else if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['CabID','Cari_Produk'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
|
||||
@@ -103,7 +103,7 @@ var OpnameBarangJS = {
|
||||
|
||||
data_query: function(tipe){
|
||||
if (tipe=="brow-produk"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['Cari_Produk'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
|
||||
@@ -207,7 +207,7 @@ var POSJS = {
|
||||
},
|
||||
|
||||
detail_hapus: function(acell){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=delete','No_Jual','ID='+acell[0]],
|
||||
onSuccess: () => {
|
||||
@@ -225,7 +225,7 @@ var POSJS = {
|
||||
FoniaJS.showInfo('Nilai Diskon diluar batas !');
|
||||
return false;
|
||||
}
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail','No_Jual','ID','InvID','SatuanID','VarianID','Qty','Harga_Beli','Harga_Jual','Disk_Rupiah','Disk_Persen'],
|
||||
onSuccess: () => {
|
||||
@@ -392,28 +392,28 @@ var POSJS = {
|
||||
}
|
||||
}).send();
|
||||
} else if (tipe=='detail'){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_detail',
|
||||
sendParam: ['No_Jual']
|
||||
}).send();
|
||||
} else if (tipe=='brow-nota'){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_nota',
|
||||
sendParam: ['Cari_Nota'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Nota')
|
||||
}).send();
|
||||
} else if (tipe=='brow-pending'){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_pending',
|
||||
}).send();
|
||||
} else if (tipe=="brow-member"){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_member',
|
||||
sendParam: ['Cari_Member'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Member')
|
||||
}).send();
|
||||
} else if (tipe=='brow-produk'){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/brow_produk',
|
||||
sendParam: ['Cari_Produk','Grup_MemberID'],
|
||||
onSuccess: () => FoniaJS.setFocus('#Cari_Produk')
|
||||
@@ -455,7 +455,7 @@ var POSJS = {
|
||||
// P : Satuan : Varian : Harga_Pokok : Harga_Jual : Stok
|
||||
//todo: jika stok kosong tidak simpan !!
|
||||
//if (parseInt(adata[5])>0 || _qty<0){
|
||||
new Request.JSONF({
|
||||
new Request_JSF({
|
||||
url: POSJS.PHP + '/table_detail',
|
||||
sendParam: ['mode_detail=insert','No_Jual','InvID='+item.value,'SatuanID='+adata[1],'VarianID='+adata[2],'Qty='+_qty,'Harga_Beli='+adata[3],'Harga_Jual='+adata[4]],
|
||||
onSuccess: () => {
|
||||
|
||||
Reference in New Issue
Block a user