Files
cmasa/app/Scripts/ppob/ppobtx.js
T
siaupheng dcd13bb9df Refactor printing logic across multiple scripts to use method chaining for improved readability and consistency
- Updated Printer and PrinterPos instantiation to use method chaining with addParam instead of add_param.
- Refactored print functions in various modules including opname.js, pos.js, tukar.js, ppobtx.js, prabayar.js, and multiple report scripts.
- Enhanced code clarity and maintainability by standardizing parameter addition for print jobs.
2026-11-02 14:03:32 +07:00

98 lines
2.9 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/Ppob/PpobtxController
Description : Transaksi PPOB
Created By : Siau Pheng ([email protected]).
Created Date : October 6th, 2017.
Last Modified : September 16th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var PPOBTXJS = {
PHP: '',
KODE: '',
index() {
this.data_query('tabel-detail');
$('#Cari_TX').keydown((e) => {
var key = e.keyCode || e.which || 0;
if (key==13 && e.target.value!='') this.data_query('tabel-detail');
});
$('#butSearch').click(() => this.data_query('tabel-detail'));
$('#butAll').click(() => {
$('#Cari_TX').val('');
this.data_query('tabel-detail');
});
FoniaJS.setFocus('#Cari_TX');
},
proses_print(oc, no_cetak) {
new PrinterPos('report/nota/ppob')
.addParam("Nomor_Cetak", no_cetak)
.addParam("Open_Cash", oc)
.exec();
},
proses_delete(no_tx) {
new Request_JSF({
url: this.PHP + '/table_tx',
sendParam: ['mode_detail=delete','No_TX='+no_tx,'Tgl_From','Tgl_To','Cari_TX']
}).send();
},
proses_reproc(no_tx) {
new Request_JSF({
url: this.PHP + '/table_tx',
sendParam: ['mode_detail=reproc','No_TX='+no_tx,'Tgl_From','Tgl_To','Cari_TX']
}).send();
},
nota_print(acell) {
FoniaJS.showConfirm('Konfirmasi', 'Yakin ingin cetak ulang Nota "'+acell[0]+'" ?', () => {
this.proses_print(0, acell[0]);
}, 'info');
},
nota_delete(acell) {
FoniaJS.showConfirm('Konfirmasi', 'Yakin akan hapus Nota "'+acell[0]+'" ?', () => {
FoniaJS.showAuth(() => this.proses_delete(acell[0]), this, 'DELETE '+acell[0]);
}, 'danger');
},
nota_reproc(acell) {
FoniaJS.showConfirm('Konfirmasi', 'Yakin proses ulang "'+acell[0]+'" ?', () => this.proses_reproc(acell[0]), 'warning');
},
nota_detail(acell) {
new Request({
url: this.PHP + '/form_tx',
sendParam: ['No_TX='+acell[0]],
onSuccess: (adata) => {
this.winInfo = FoniaJS.showWindow('Info', 'Informasi Transaksi', adata.html, 'md');
}
}).send();
},
saldo_ppob() {
new Request({
url: this.PHP + '/form_saldo',
onSuccess: (adata) => {
var _obtn = $('button:contains("Saldo")');
if (_obtn) _obtn.html('<i class="bi-coin me-2"></i>Saldo Rp. '+adata.Saldo);
}
}).send();
},
data_query(tipe) {
if (tipe=="tabel-detail"){
new Request_JSF({
url: this.PHP + '/table_tx',
sendParam: ['Tgl_From','Tgl_To','Cari_TX']
}).send();
}
}
};