summaryrefslogtreecommitdiff
path: root/addons/pos_six/static/src/js/BalanceButton.js
diff options
context:
space:
mode:
authorAntoine Prieels <anp@odoo.com>2020-09-23 11:58:12 +0000
committerAntoine Prieels <anp@odoo.com>2020-09-23 14:02:54 +0000
commitcb16eccbf18ed80fe0d6284fc272148e89c9d0f0 (patch)
tree0093c61a0e31bc4511ab7b960da24b5ad5c1a8de /addons/pos_six/static/src/js/BalanceButton.js
parent32f8e15466e3911ae9083d0c9c07a42283a12d13 (diff)
[FIX] pos_six: Prepare for the certification
- The balance operation is performed automatically at the end of the day but it doesn't print any receipt. We add the possibility to perform the balance manually to get a receipt showing all the transactions of the day. - By default, DCC is set to true, but it requires a different implementation. As we don't support it, Six asked us to changed the variable to False, to make it clearer in case of debugging. closes odoo/odoo#58355 X-original-commit: bc5ea7e3d3b694bbe88b14c10cd5cc80ca617e48 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com> Signed-off-by: Antoine Prieƫls <aprieels@users.noreply.github.com>
Diffstat (limited to 'addons/pos_six/static/src/js/BalanceButton.js')
-rw-r--r--addons/pos_six/static/src/js/BalanceButton.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/addons/pos_six/static/src/js/BalanceButton.js b/addons/pos_six/static/src/js/BalanceButton.js
new file mode 100644
index 00000000000..a792aa3333d
--- /dev/null
+++ b/addons/pos_six/static/src/js/BalanceButton.js
@@ -0,0 +1,21 @@
+odoo.define('pos_six.BalanceButton', function(require) {
+ 'use strict';
+
+ const PosComponent = require('point_of_sale.PosComponent');
+ const Registries = require('point_of_sale.Registries');
+
+ class BalanceButton extends PosComponent {
+ sendBalance() {
+ this.env.pos.payment_methods.map(pm => {
+ if (pm.use_payment_terminal === 'six') {
+ pm.payment_terminal.send_balance();
+ }
+ });
+ }
+ }
+ BalanceButton.template = 'BalanceButton';
+
+ Registries.Component.add(BalanceButton);
+
+ return BalanceButton;
+});