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:
@@ -109,8 +109,8 @@ var MutasiJS = {
|
||||
|
||||
tx_print(prt) {
|
||||
if ($('#No_Mutasi').val()) {
|
||||
var cetak = new Printer('report/nota/mutasi');
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
|
||||
let cetak = new Printer('report/nota/mutasi')
|
||||
.addParam("Nomor_Cetak", $('#No_Mutasi').val());
|
||||
if (prt) cetak.doPrint(); else cetak.doPreview();
|
||||
return;
|
||||
}
|
||||
@@ -119,9 +119,9 @@ var MutasiJS = {
|
||||
|
||||
tx_print_pos() {
|
||||
if ($('#No_Mutasi').val()) {
|
||||
var cetak = new PrinterPos('report/nota/mutasi_pos');
|
||||
cetak.add_param("Nomor_Cetak", $('#No_Mutasi').val());
|
||||
cetak.exec();
|
||||
new PrinterPos('report/nota/mutasi_pos')
|
||||
.addParam("Nomor_Cetak", $('#No_Mutasi').val())
|
||||
.exec();
|
||||
return;
|
||||
}
|
||||
FoniaJS.showError("Silakan masukkan Nomor Transaksi !");
|
||||
|
||||
Reference in New Issue
Block a user