From e3501040df5a905acdf2102b7b7fec9a95667788 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Fri, 12 Nov 2021 12:10:06 -0500 Subject: [PATCH] minor fix --- app/commons/dblogin.py | 2 ++ app/main.py | 4 +--- app/reporting.py | 4 ++-- pospro | 5 ++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/commons/dblogin.py b/app/commons/dblogin.py index 9ce45e6..8bed4ca 100644 --- a/app/commons/dblogin.py +++ b/app/commons/dblogin.py @@ -130,6 +130,7 @@ class Login(QDialog): self.error_msg.hide() def run(self, profile=None): + self.api_url = self.params['api_url'] if self.params['database']: self.field_database.setText(self.params['database']) if self.params['user']: @@ -137,6 +138,7 @@ class Login(QDialog): if self.params['server']: self.field_host.setText(self.params['server']) if self.mode_conn == 'offline': + self.api_url = self.params['api_url_offline'] if self.params['database_offline']: self.field_database.setText(self.params['database_offline']) if self.params['user']: diff --git a/app/main.py b/app/main.py index 7779083..06797ef 100644 --- a/app/main.py +++ b/app/main.py @@ -188,7 +188,6 @@ class AppWindow(FrontWindow): }) ctx_printing['row_characters'] = self.row_characters ctx_printing['delta_locale'] = DELTA_LOCALE - locale_logo = '' if self.logo: locale_logo = os.path.join(os.path.abspath( @@ -2767,12 +2766,11 @@ class AppWindow(FrontWindow): self.label_input.setFocus() self.dialog_product_edit.close() if self.enviroment == 'restaurant': - if self._config['tip_product']['code'] == removed_item['product'].['code']: + if self._config['tip_product']['code'] == removed_item['product']['code']: self.Sale.write([self._sale['id']], {'tip': None}) def set_discount(self, eval_value, lines_ids=[], type_='percentage'): res = False - print(lines_ids, type_, 'set_discount') try: value = round(float(str(eval_value)), 6) except ValueError: diff --git a/app/reporting.py b/app/reporting.py index f90df86..b6daee8 100755 --- a/app/reporting.py +++ b/app/reporting.py @@ -228,7 +228,7 @@ class Receipt(object): if sale.get('cufe'): self._printer.text('CUFE: ' + sale['cufe']) try: - if self._img_logo and sale.get('qr_code'): + if sale.get('qr_code'): self.print_qrcode(sale['qr_code']) except: pass @@ -699,7 +699,7 @@ class Receipt(object): if sale.get('delivery_party'): self._printer.text('DOMICILIARIO: %s' % sale['delivery_party']) self.print_enter() - + print(self._show_position, sale['position'], '*************') if self._show_position: self._printer.text('POSICION: %s' % str(sale['position'])) self.print_enter() diff --git a/pospro b/pospro index 98ceec2..4bd5884 100755 --- a/pospro +++ b/pospro @@ -30,11 +30,14 @@ class Client(object): if args.o: _file_config = args.o login = Login(file_config=_file_config) - while not login.connection: login.run() login.exec_() + login.params['database'] = login.field_database.text() + login.params['user'] = login.field_user.text() + login.params['server'] = login.field_host.text() + login.params['api_url'] = login.api_url return login.connection, login.params, login.mode_conn def main(self, conn, params, mode_conn):