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,7 +19,7 @@ var PrabayarJS = {
|
||||
KATE_PREFIX: [1,2,3,4],
|
||||
KATE_TOKEN: [5],
|
||||
|
||||
index: function(){
|
||||
index() {
|
||||
$('#Cari_PPOB').keydown((e) => {
|
||||
var key = e.keyCode || e.which || 0;
|
||||
if (key==13 && e.target.value!='') this.data_query('tabel-tx');
|
||||
@@ -34,7 +34,7 @@ var PrabayarJS = {
|
||||
this.data_query('pole-config');
|
||||
},
|
||||
|
||||
proses_print: function(oc, no_cetak){
|
||||
proses_print(oc, no_cetak) {
|
||||
var cetak = new PrinterPos('apps/php/repo/nota.php');
|
||||
cetak.add_param("data", "ppob-pos");
|
||||
cetak.add_param("Nomor_Cetak", no_cetak);
|
||||
@@ -42,31 +42,31 @@ var PrabayarJS = {
|
||||
cetak.exec();
|
||||
},
|
||||
|
||||
proses_delete: function(){
|
||||
proses_delete() {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_tx',
|
||||
sendParam: ['mode_detail=delete','No_TX']
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_reproc: function(ft){
|
||||
proses_reproc(ft) {
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/table_tx',
|
||||
sendParam: ['mode_detail=reproc','No_TX','FT='+ft]
|
||||
}).send();
|
||||
},
|
||||
|
||||
proses_cancel: function(){
|
||||
proses_cancel() {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Apakah Anda yakin ingin membatalkan ?', () => this.data_query('master','cancel'), 'danger');
|
||||
},
|
||||
|
||||
nota_print: function(acell){
|
||||
nota_print(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin cetak ulang Nota "'+acell[0]+'" ?', () => {
|
||||
this.proses_print(0, acell[0]);
|
||||
}, 'info');
|
||||
},
|
||||
|
||||
nota_delete: function(acell){
|
||||
nota_delete(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Nota "'+acell[0]+'" ?', () => {
|
||||
FoniaJS.showAuth(() => {
|
||||
$('#No_TX').val(acell[0]);
|
||||
@@ -75,14 +75,14 @@ var PrabayarJS = {
|
||||
}, 'danger');
|
||||
},
|
||||
|
||||
nota_reproc: function(acell){
|
||||
nota_reproc(acell) {
|
||||
FoniaJS.showConfirm('Konfirmasi', 'Yakin proses ulang "'+acell[0]+'" ?', () => {
|
||||
$('#No_TX').val(acell[0]);
|
||||
this.proses_reproc();
|
||||
}, 'warning');
|
||||
},
|
||||
|
||||
nota_detail: function(acell){
|
||||
nota_detail(acell) {
|
||||
new Request({
|
||||
url: this.PHP + '/form_tx',
|
||||
sendParam: ['No_TX='+acell[0]],
|
||||
@@ -92,7 +92,7 @@ var PrabayarJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
kasir_show: function(){
|
||||
kasir_show() {
|
||||
if ($('#Tujuan').val()=='') {
|
||||
FoniaJS.showInfo('Silahkan masukkan Nomor Tujuan !');
|
||||
FoniaJS.setFocus('#Tujuan');
|
||||
@@ -163,14 +163,14 @@ var PrabayarJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
kasir_hitung: function(){
|
||||
kasir_hitung() {
|
||||
const totBayar = FoniaJS.StrToFloat($('#popTotal_Tunai').val()) + FoniaJS.StrToFloat($('#popTotal_Kartu').val());
|
||||
const totSisa = totBayar - FoniaJS.StrToFloat($('#popTotal_Jual').val());
|
||||
$('#popTotal_Bayar').val(totBayar);
|
||||
$('#popTotal_Sisa').val(FoniaJS.FloatToStr(totSisa, 2)).removeClass('border-danger border-success').addClass((totSisa < 0) ? 'border-danger' : 'border-success');
|
||||
},
|
||||
|
||||
kasir_simpan: function(){
|
||||
kasir_simpan() {
|
||||
const totTunai = FoniaJS.StrToFloat($('#popTotal_Tunai').val());
|
||||
const totKartu = FoniaJS.StrToFloat($('#popTotal_Kartu').val());
|
||||
const jenKartu = $('#popKartuID').val();
|
||||
@@ -203,7 +203,7 @@ var PrabayarJS = {
|
||||
this.data_query('master', 'save');
|
||||
},
|
||||
|
||||
data_query: function(tipe, mode){
|
||||
data_query(tipe, mode) {
|
||||
if (tipe=='master'){
|
||||
mode = (mode) ? mode : '';
|
||||
var sparam = ['mode='+mode,'No_TX'];
|
||||
@@ -266,7 +266,7 @@ var PrabayarJS = {
|
||||
}
|
||||
},
|
||||
|
||||
oc_KateID: function(){
|
||||
oc_KateID() {
|
||||
if ($.inArray(parseInt($('#KateID').val()), this.KATE_TOKEN) !== -1) {
|
||||
$('.rowToken').removeClass('d-none');
|
||||
$('.rowPulsa').addClass('d-none');
|
||||
@@ -280,7 +280,7 @@ var PrabayarJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
oc_Tujuan: function(){
|
||||
oc_Tujuan() {
|
||||
if ($('#Tujuan').val()=='') return false;
|
||||
if ($.inArray(parseInt($('#KateID').val()), this.KATE_PREFIX) === -1) return false;
|
||||
new Request_JSF({
|
||||
@@ -289,7 +289,7 @@ var PrabayarJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
oc_OpeID: function(){
|
||||
oc_OpeID() {
|
||||
if ($('#OpeID').val()==0) return false;
|
||||
new Request_JSF({
|
||||
url: this.PHP + '/option_produk',
|
||||
@@ -297,7 +297,7 @@ var PrabayarJS = {
|
||||
}).send();
|
||||
},
|
||||
|
||||
oc_ProdukID: function(){
|
||||
oc_ProdukID() {
|
||||
const obj = $('#ProdukID');
|
||||
var harga = $(obj).find(":selected").attr('olabel');
|
||||
$('#Harga_Jual').val(harga);
|
||||
|
||||
Reference in New Issue
Block a user