# HG changeset patch
# User Prakash M <prakash@qualiantech.com>
# Date 1586154459 -19800
#      Mon Apr 06 11:57:39 2020 +0530
# Node ID 244f68618015a15d43141ad7e5275bf4caa31413
# Parent  b39c56e1a6fe3645b84f70b6eebefa2275c2ffc5
Fixed BUG-43588 : Fixes new styling in print receipt modal

diff -r b39c56e1a6fe -r 244f68618015 web/org.openbravo.retail.posterminal/css/obpos-main.css
--- a/web/org.openbravo.retail.posterminal/css/obpos-main.css	Thu Apr 02 05:09:57 2020 +0000
+++ b/web/org.openbravo.retail.posterminal/css/obpos-main.css	Mon Apr 06 11:57:39 2020 +0530
@@ -6652,18 +6652,43 @@
 # Inherits: [OB.UI.CheckboxButton]
 */
 .obUiListInvoicesLine {
-  height: 38px;
-  background-position: 10px center;
   vertical-align: middle;
   width: 100%;
-  border-bottom: 1px solid #cccccc;
+  border-bottom: var(--separator-slim);
   text-align: left;
-  padding-left: 70px;
-  height: 58px;
-}
+  padding-left: 10px;
+  height: 90px;
+}
+
+.obUiListInvoicesLine .obUiButton-components {
+  grid-auto-flow: column;
+  grid-template-columns: 50px 1fr;
+}
+
+.obUiListInvoicesLine .obUiButton-components-icon {
+  width: 100%;
+  height: 100%;;
+  border: none;
+  background-repeat: no-repeat;
+  background-position: left center;
+  background-color: transparent;
+  background-image: url('./../../org.openbravo.mobile.core/assets/img/iconCheck.svg');
+  background-size: 34px 27px;
+  filter: var(--color-quaternary_img);
+}
+
+.obUiListInvoicesLine.active .obUiButton-components-icon {
+  filter: var(--color-secondary_img);
+}
+
+.obUiListInvoicesLine .obUiButton-components-label {
+  color: var(--color-on-surface-variant);
+}
+
+.obUiListInvoicesLine:focus {}
 
 .obUiListInvoicesLine-line {
-  line-height: 23px;
+  line-height: 30px;
   display: inline;
 }
 
@@ -6679,7 +6704,6 @@
   clear: both;
 }
 
-
 /*
 # Component: OB.UI.ListInvoices
 */
diff -r b39c56e1a6fe -r 244f68618015 web/org.openbravo.retail.posterminal/js/components/modalinvoices.js
--- a/web/org.openbravo.retail.posterminal/js/components/modalinvoices.js	Thu Apr 02 05:09:57 2020 +0000
+++ b/web/org.openbravo.retail.posterminal/js/components/modalinvoices.js	Mon Apr 06 11:57:39 2020 +0530
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2018-2019 Openbravo S.L.U.
+ * Copyright (C) 2018-2020 Openbravo S.L.U.
  * Licensed under the Openbravo Commercial License version 1.0
  * You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
  * or in the legal folder of this module distribution.
@@ -52,52 +52,71 @@
 /*items of collection*/
 enyo.kind({
   name: 'OB.UI.ListInvoicesLine',
-  kind: 'OB.UI.CheckboxButton',
+  kind: 'OB.UI.Button',
   classes: 'obUiListInvoicesLine',
   tap: function() {
     this.inherited(arguments);
     this.model.set('checked', !this.model.get('checked'));
     this.model.trigger('verifyDoneButton', this.model);
   },
-  components: [
-    {
-      name: 'line',
-      classes: 'obUiListInvoicesLine-line',
-      components: [
-        {
-          name: 'topLine',
-          classes: 'obUiListInvoicesLine-line-topLine'
-        },
-        {
-          name: 'bottonLine',
-          classes: 'obUiListInvoicesLine-line-bottonLine'
-        },
-        {
-          classes: 'obUiListInvoicesLine-line-element1'
-        }
-      ]
+  labelComponents: {
+    name: 'line',
+    classes: 'obUiListInvoicesLine-line',
+    components: [
+      {
+        name: 'topLine',
+        classes: 'obUiListInvoicesLine-line-topLine'
+      },
+      {
+        name: 'bottonLine',
+        classes: 'obUiListInvoicesLine-line-bottonLine'
+      },
+      {
+        classes: 'obUiListInvoicesLine-line-element1'
+      }
+    ]
+  },
+  toggle: function() {
+    this.setChecked(!this.getChecked());
+  },
+  setChecked: function(value) {
+    if (value) {
+      this.check();
+    } else {
+      this.unCheck();
     }
-  ],
+  },
+  getChecked: function(value) {
+    return this.checked;
+  },
+  check: function() {
+    this.addClass('active');
+    this.checked = true;
+  },
+  unCheck: function() {
+    this.removeClass('active');
+    this.checked = false;
+  },
+  initComponents: function() {
+    this.inherited(arguments);
+    this.$.label.createComponent(this.labelComponents);
+  },
   create: function() {
     this.inherited(arguments);
-    this.$.topLine.setContent(
+    this.$.label.$.topLine.setContent(
       this.model.get('documentNo') +
         ' - ' +
         (this.model.get('bp')
           ? this.model.get('bp').get('_identifier')
           : this.model.get('businessPartner'))
     );
-    this.$.bottonLine.setContent(
+    this.$.label.$.bottonLine.setContent(
       this.model.get('totalamount') +
         ' (' +
         OB.I18N.formatDate(new Date(this.model.get('orderDate'))) +
         ') '
     );
-    if (this.model.get('checked')) {
-      this.addClass('active');
-    } else {
-      this.removeClass('active');
-    }
+    this.setChecked(this.model.get('checked'));
     this.render();
   }
 });
@@ -220,15 +239,16 @@
     {
       classes: 'obUiModalInvoicesFooter-printReceipt',
       name: 'printReceipt',
-      kind: 'OB.UI.SmallButton',
+      kind: 'OB.UI.ModalDialogButton',
       ontap: 'printReceiptAction',
       i18nContent: 'OBPOS_LblPrintOneReceipt',
-      position: 10
+      isDefaultAction: true,
+      position: 30
     },
     {
       classes: 'obUiModalInvoicesFooter-printInvoices',
       name: 'printInvoices',
-      kind: 'OB.UI.SmallButton',
+      kind: 'OB.UI.ModalDialogButton',
       ontap: 'printInvoiceAction',
       i18nContent: 'OBPOS_LblPrintInvoices',
       position: 20
@@ -236,7 +256,7 @@
   ],
   components: [
     {
-      classes: 'obUiModalInvoicesFooter-buttonsContainer',
+      classes: 'obUiModal-footer-mainButtons',
       name: 'modalInvoicesFooter__buttonsContainer'
     }
   ],
@@ -245,15 +265,13 @@
     var cancelButton = {
       classes: 'obUiModalInvoicesFooter-cancelButton',
       name: 'cancelButton',
-      kind: 'OB.UI.SmallButton',
+      kind: 'OB.UI.ModalDialogButton',
       ontap: 'cancelAction',
-      i18nContent: 'OBMOBC_LblCancel'
+      i18nContent: 'OBMOBC_LblCancel',
+      position: 10
     };
     // Sort buttons by positions
     if (this.buttons && _.isArray(this.buttons)) {
-      this.buttons.sort(function(a, b) {
-        return a.position - b.position;
-      });
       // Add cancel button
       var cancel = _.find(this.buttons, function(b) {
         return b.name === 'cancelButton';
@@ -261,6 +279,9 @@
       if (!cancel) {
         this.buttons.push(cancelButton);
       }
+      this.buttons.sort(function(a, b) {
+        return a.position - b.position;
+      });
     }
     // Create components
     if (
