Files
cmasa/app/Scripts/report/dana/pos.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

60 lines
1.7 KiB
JavaScript

/*******************************************************************
PHP Class : /Controller/Report/Dana/PosController
Description : Laporan Penerimaan Dana POS / Kasir
Created By : Siau Pheng ([email protected]).
Created Date : September 8th, 2012.
Last Modified : October 9th, 2026.
(c) 3FONIA Software; WWW.3FONIA.COM.
*******************************************************************/
var RepoDanaPosJS = {
PHP: '',
KODE: '',
index() {
$('#butPOS').click(() => this.proses_pos());
$('#butCetak').click(() => this.proses_print(true));
$('#butPreview').click(() => this.proses_print());
$('#butExcel').click(() => this.proses_dload());
},
proses_pos() {
if ($('#KasirID').val()==0){
FoniaJS.showError("Untuk Cetak POS, pilih satu Nama Kasir !");
$('#KasirID').focus();
return;
}
new PrinterPos(this.PHP + '/pos')
.addParam("Tipe", "R")
.addParam("CabID")
.addParam("KasirID")
.addParam("Tgl_From")
.addParam("Tgl_To")
.exec();
},
proses_print(prt) {
let cetak = new Printer(this.PHP + '/print')
.addParam("Tipe")
.addParam("CabID")
.addParam("KasirID")
.addParam("Tgl_From")
.addParam("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
proses_dload() {
var dload = new Download(this.PHP + '/excel');
dload.addParam("Tipe");
dload.addParam("CabID");
dload.addParam("KasirID");
dload.addParam("Tgl_From");
dload.addParam("Tgl_To");
dload.download();
}
};