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.
This commit is contained in:
2026-11-02 14:03:32 +07:00
parent 5d246e039e
commit dcd13bb9df
52 changed files with 277 additions and 278 deletions
+8 -8
View File
@@ -32,14 +32,14 @@ var RepoInvBarcodeJS = {
FoniaJS.showError('Silakan pilih Nama Printer Barcode !');
return;
}
var cetak = new PrinterPos(this.PHP + '/barcode');
cetak.setPrinter($('#Printer').val());
cetak.add_param("InvID");
cetak.add_param("SatuanID");
cetak.add_param("VarianID");
cetak.add_param("Qty");
cetak.add_param("Printer");
cetak.exec();
new PrinterPos(this.PHP + '/barcode')
.setPrinter($('#Printer').val())
.addParam("InvID")
.addParam("SatuanID")
.addParam("VarianID")
.addParam("Qty")
.addParam("Printer")
.exec();
},
produk_brow() {
+6 -6
View File
@@ -21,12 +21,12 @@ var RepoInvHutangJS = {
},
proses_print(prt) {
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("SupID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
let cetak = new Printer(this.PHP + '/print')
.addParam("Tipe")
.addParam("CabID")
.addParam("SupID")
.addParam("Tgl_From")
.addParam("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},
+1 -1
View File
@@ -29,7 +29,7 @@ var RepoInvLabelJS = {
},
proses_print(prt) {
var cetak = new Printer(this.PHP + '/print');
let cetak = new Printer(this.PHP + '/print');
if (prt) cetak.doPrint(); else cetak.doPreview();
},
+6 -6
View File
@@ -23,12 +23,12 @@ var RepoInvPiutangJS = {
},
proses_print(prt) {
var cetak = new Printer(this.PHP + '/print');
cetak.add_param("Tipe");
cetak.add_param("CabID");
cetak.add_param("MemberID");
cetak.add_param("Tgl_From");
cetak.add_param("Tgl_To");
let cetak = new Printer(this.PHP + '/print')
.addParam("Tipe")
.addParam("CabID")
.addParam("MemberID")
.addParam("Tgl_From")
.addParam("Tgl_To");
if (prt) cetak.doPrint(); else cetak.doPreview();
},