minor fix print info consumer

add button transfer sale_to_folio for hotels
This commit is contained in:
Wilson Gomez 2023-10-26 14:33:30 -05:00
parent fa16cab0ca
commit 48829a0a10
5 changed files with 38 additions and 25 deletions

View File

@ -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):

View File

@ -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)])

View File

@ -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

View File

@ -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')

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 256 256" enable-background="new 0 0 256 256" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><g><path fill="#000000" d="M244.9,179.5l-40.2-35.8c-1.1-1.1-2.7-1.4-4.1-0.8c-1.4,0.6-2.3,2-2.3,3.5v19.5c-25.8,0-60.1,12.5-60.1,76.5c11.3-40.8,26.5-43.9,60.1-43.9v19.8c0,1.5,0.8,2.9,2.3,3.5c0.5,0.2,1,0.3,1.4,0.3c1,0,2-0.4,2.7-1.1l40.2-36.1C246.4,183.4,246.4,181,244.9,179.5z"/><path fill="#000000" d="M46.4,222.8c-10,0-18.2-8.2-18.2-18.2V50c0-10,8.2-18.2,18.2-18.2l57.2,0c6.6,1.7,6.5,9.7,6.5,17.8v27.7c0,5,4.1,9.1,9.1,9.1h27.3c9.1,0,18.2,0,18.2,9.1V141c5.7-2.4,11.8-4,18.2-4.8V86.4c0-9.7-9-18.9-24.9-34.5c-2.2-2.2-4.5-4.4-6.7-6.7c-2.3-2.2-4.5-4.5-6.7-6.7C129,22.6,119.7,13.6,110,13.6H46.4C26.3,13.6,10,29.9,10,50v154.6c0,20.1,16.3,36.4,36.4,36.4h90.9c-4.5-5.4-8.3-11.6-11-18.2L46.4,222.8L46.4,222.8z"/></g></g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB