From 4f64c01b99923fbd34bc12587728cb4a8ef4c861 Mon Sep 17 00:00:00 2001 From: Wilson Gomez Date: Wed, 25 Oct 2023 17:36:33 -0500 Subject: [PATCH] minor fix --- app/main.py | 16 +++++++++++++--- app/reporting.py | 6 +++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/main.py b/app/main.py index 1333a5b..e5218a3 100644 --- a/app/main.py +++ b/app/main.py @@ -6,11 +6,13 @@ import logging import base64 import time import traceback +import threading +import atexit from decimal import Decimal from datetime import datetime, timedelta from collections import OrderedDict from PySide6 import QtGui -from PySide6.QtCore import Qt, QTimer +from PySide6.QtCore import Qt, QTimer, QThread from PySide6.QtWidgets import ( QLabel, QHBoxLayout, QVBoxLayout, QWidget) @@ -109,6 +111,9 @@ class AppWindow(FrontWindow): timer = QTimer() timer.timeout.connect(self.verify_print_order_automatic) timer.start(30000) + # self.timer = threading.Timer(30, self.verify_print_order_automatic) + # self.timer.start() + # atexit.register(self.terminate_timer) self.do_invoice = DoInvoice(self, self.ctx) self.do_invoice.sigDoInvoice.connect(self.__do_invoice_thread) @@ -119,6 +124,9 @@ class AppWindow(FrontWindow): if matching_journal: self.default_journal = matching_journal + # def terminate_timer(self): + # self.timer.cancel() + def get_defaults_variables(self): self._clear_invoice_number = False self.reader_thread = None @@ -1116,9 +1124,11 @@ class AppWindow(FrontWindow): elif environment == 'retail': if not self._check_quantity(): return - self.Sale.button_method('quote', [sale_id]) - self.load_sale(sale_id) + self.Sale.write([sale_id], {'state': 'quotation'}) + # self.load_sale(sale_id) + self.store.set({'state': 'quotation'}) self.set_state('accept') + self.set_amounts() def button_checkout_pressed(self): if not self.check_salesman(): diff --git a/app/reporting.py b/app/reporting.py index ec5bd37..659313d 100755 --- a/app/reporting.py +++ b/app/reporting.py @@ -606,9 +606,9 @@ class Receipt(object): consumer = sale.get('consumer', None) if consumer: payment_method = sale.get('payment_method', None) - consumer_name = consumer.get('consumer_name', None) - consumer_address = consumer.get('consumer_address', '') - consumer_phone = consumer.get('consumer_phone', '') + consumer_name = consumer.get('name', None) + consumer_address = consumer.get('address', '') + consumer_phone = consumer.get('phone', '') self.print_horinzontal_line() self.print_enter() self._printer.set(align='center')