Skip to content

Commit

Permalink
[10.0][fiscal_epos_print] Show subtotal in the printer display when s…
Browse files Browse the repository at this point in the history
…howing the payment screen
  • Loading branch information
robyf70 authored and eLBati committed Jan 9, 2020
1 parent 28be575 commit ea82e0c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fiscal_epos_print/static/src/js/epson_epos_print.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,14 @@ odoo.define("fiscal_epos_print.epson_epos_print", function (require) {
return msg;
},

printDisplayText: function(msg) {
var xml = '<printerCommand>'
+ '<displayText '
+ ' operator="1" text="' + this.encodeXml(msg || '') + '"'
+ ' /></printerCommand>';
this.fiscalPrinter.send(this.url, xml);
},

/*
Prints a receipt
*/
Expand Down
10 changes: 10 additions & 0 deletions fiscal_epos_print/static/src/js/screens.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ odoo.define("fiscal_epos_print.screens", function (require) {
});

PaymentScreenWidget.include({
show: function() {
this._super.apply(this, arguments);
if (this.pos.config.printer_ip) {
var currentOrder = this.pos.get_order();
var printer_options = currentOrder.getPrinterOptions();
var fp90 = new eposDriver(printer_options, this);
var amount = this.format_currency(currentOrder.get_total_with_tax());
fp90.printDisplayText(_t("SubTotal") + " " + amount);
}
},
sendToFP90Printer: function(receipt, printer_options) {
var fp90 = new eposDriver(printer_options, this);
fp90.printFiscalReceipt(receipt);
Expand Down

0 comments on commit ea82e0c

Please sign in to comment.