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:
@@ -21,23 +21,23 @@ var RepoJualJS = {
|
||||
},
|
||||
|
||||
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();
|
||||
},
|
||||
|
||||
proses_dload() {
|
||||
var dload = new Download(this.PHP + '/excel');
|
||||
dload.addParam("Tipe");
|
||||
dload.addParam("CabID");
|
||||
dload.addParam("MemberID");
|
||||
dload.addParam("Tgl_From");
|
||||
dload.addParam("Tgl_To");
|
||||
dload.download();
|
||||
new Download(this.PHP + '/excel')
|
||||
.addParam("Tipe")
|
||||
.addParam("CabID")
|
||||
.addParam("MemberID")
|
||||
.addParam("Tgl_From")
|
||||
.addParam("Tgl_To")
|
||||
.download();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user