diff --git a/app/buttonpad.py b/app/buttonpad.py index b207bb0..c85c122 100644 --- a/app/buttonpad.py +++ b/app/buttonpad.py @@ -242,6 +242,15 @@ class ButtonsStacked(QWidget): method='action_payment_term' ) + self.button_transfer_to_folio = CustomButton( + id='button_transfer_to_folio', + parent=parent, + title='TRANSFERIR A FOLIO', + icon=get_icon('transfer_to_folio'), + name_style='toolbar', + method='action_transfer_to_folio' + ) + if pos_user not in ('order', 'salesman'): self.stacked.addWidget(self.button_accept) self.stacked.addWidget(self.button_checkout) @@ -249,6 +258,8 @@ class ButtonsStacked(QWidget): hbox.addWidget(self.stacked, 0) if pos_user in ('cashier', 'frontend_admin'): + if parent._hotel_activated: + hbox.addWidget(self.button_transfer_to_folio, 0) hbox.addWidget(self.button_payment_term, 0) if parent.environment == 'retail': if pos_user == 'cashier' and getattr(parent, 'button_to_draft_active', None): diff --git a/app/frontwindow.py b/app/frontwindow.py index a189ac1..17740c2 100644 --- a/app/frontwindow.py +++ b/app/frontwindow.py @@ -201,7 +201,7 @@ class FrontWindow(QMainWindow): module_names = [ 'sale_pos_frontend_rest', 'sale_pos', 'sale_pos_frontend', 'account_credit_limit', - 'product_onebarcode'] + 'product_onebarcode', 'hotel'] modules = self.Module.find([ ('name', 'in', module_names), ('state', '=', 'activated'), @@ -235,6 +235,7 @@ class FrontWindow(QMainWindow): self._commission_activated = True if res.get('commission') else False self._credit_limit_activated = 'account_credit_limit' in self.modules self._onebarcode_activated = 'product_onebarcode' in self.modules + self._hotel_activated = 'hotel' in self.modules self.User = Model('res.user', self.ctx, main_window=self) self._user, = self.User.find([('login', '=', self.user)]) diff --git a/app/main.py b/app/main.py index 77cb02d..38ff94a 100644 --- a/app/main.py +++ b/app/main.py @@ -109,11 +109,7 @@ class AppWindow(FrontWindow): if self.server_printer and self.environment == 'restaurant': self.timer = QTimer() - self.timer.timeout.connect(self.verify_print_order_automatic) - self.timer.start(30000) - # self.timer = threading.Timer(30, self.verify_print_order_automatic) - # self.timer.start() - # atexit.register(self.terminate_timer) + self.timer.singleShot(30000, self.verify_print_order_automatic) self.do_invoice = DoInvoice(self, self.ctx) self.do_invoice.sigDoInvoice.connect(self.__do_invoice_thread) @@ -124,9 +120,6 @@ 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 @@ -173,8 +166,8 @@ class AppWindow(FrontWindow): self.SaleLine.mark_tasks_printed({'task_ids': result_print}) except Exception: traceback.print_exc() - # timer = QTimer() - # timer.singleShot(30000, self.verify_print_order_automatic) + timer = QTimer() + timer.singleShot(30000, self.verify_print_order_automatic) # self.verify_command_order_th.exit(0) def set_printers_usb(self, PATH_PRINTERS): @@ -1828,15 +1821,6 @@ class AppWindow(FrontWindow): return True def get_header_sale(self, sale): - # TODO: for remove pass consumer to reporting - def _get_info_consumer(consumer_): - consumer = {} - if consumer_: - consumer['consumer_name'] = consumer_.get('name', None) - consumer['consumer_phone'] = consumer_.get('phone', '') - consumer['consumer_address'] = consumer_.get('address', '') - consumer['consumer_notes'] = consumer_.get('notes', '') - return consumer order = { 'id': self.sale_id, @@ -1853,7 +1837,7 @@ class AppWindow(FrontWindow): 'delivery_charge': sale.get('delivery_charge'), 'total_amount': sale['total_amount'], 'shop': self.shop['name'], - 'consumer': _get_info_consumer(sale.get('consumer')), + 'consumer': sale.get('consumer'), 'table_assigned': sale['table_assigned']['name'] if sale.get('table_assigned') else '' } return order @@ -3429,6 +3413,10 @@ class AppWindow(FrontWindow): if self.environment == 'restaurant': self.menu_dash.setDisabled(True) + def action_transfer_to_folio(self): + print('ingreso por este punto') + pass + def key_pressed(self, text): if self._state == 'disabled': return diff --git a/app/reporting.py b/app/reporting.py index ec5bd37..9f9a7b8 100755 --- a/app/reporting.py +++ b/app/reporting.py @@ -62,7 +62,7 @@ SSH_PORT = 23 def money(value): if type(value) is int: value = int(value) - return '{:,.2f}'.format(value) + return '{:,.0f}'.format(value) dev_printers = {} @@ -606,9 +606,15 @@ 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', '') + if consumer.get('name') or consumer.get('phone'): + consumer_name = consumer.get('name', None) + consumer_address = consumer.get('address', '') + consumer_phone = consumer.get('phone', '') + else: + # for remove this option + consumer_name = consumer.get('consumer_name', None) + consumer_address = consumer.get('consumer_address', '') + consumer_phone = consumer.get('consumer_phone', '') self.print_horinzontal_line() self.print_enter() self._printer.set(align='center') diff --git a/app/share/transfer_to_folio.svg b/app/share/transfer_to_folio.svg new file mode 100644 index 0000000..4a14bc4 --- /dev/null +++ b/app/share/transfer_to_folio.svg @@ -0,0 +1,7 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon + + \ No newline at end of file