add button for transfer sales to folios
release version 6.0.26
This commit is contained in:
parent
42de1961f0
commit
1180a750ee
|
@ -301,18 +301,19 @@ class SearchFolio(SearchWindow):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
headers = OrderedDict()
|
headers = OrderedDict()
|
||||||
headers['id'] = {'desc': 'ID', 'type': 'char'}
|
headers['id'] = {'desc': 'ID', 'type': 'char'}
|
||||||
headers['id_number'] = {'desc': 'NUMERO ID', 'type': 'char'}
|
headers['room.code'] = {'desc': 'HABITACION', 'type': 'char'}
|
||||||
headers['name'] = {'desc': 'NOMBRE', 'type': 'char'}
|
headers['main_guest.name'] = {'desc': 'NOMBRE HUESPED', 'type': 'char'}
|
||||||
headers['phone'] = {'desc': 'TELEFONO', 'type': 'char'}
|
headers['registration_state'] = {'desc': 'ESTADO', 'type': 'char'}
|
||||||
headers['street'] = {'desc': 'DIRECCION', 'type': 'char'}
|
headers['arrival_date'] = {'desc': 'FECHA INGRESO', 'type': 'char'}
|
||||||
|
headers['departure_date'] = {'desc': 'FECHA SALIDA', 'type': 'char'}
|
||||||
|
|
||||||
title = 'BUSCAR FOLIO'
|
title = 'BUSCAR FOLIO'
|
||||||
methods = {
|
methods = {
|
||||||
'on_selected_method': 'on_selected_folio',
|
'on_selected_method': 'on_selected_folio',
|
||||||
'on_return_method': 'on_search_folio',
|
# 'on_return_method': 'on_search_folio',
|
||||||
}
|
}
|
||||||
super(SearchFolio, self).__init__(parent, headers, None, methods,
|
super(SearchFolio, self).__init__(parent, headers, None, methods,
|
||||||
filter_column=[], cols_width=[60, 120, 270, 190, 90],
|
filter_column=[1, 2], cols_width=[10, 220, 670, 220, 220, 220],
|
||||||
title=title, fill=True)
|
title=title, fill=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -329,7 +329,7 @@ class FrontWindow(QMainWindow):
|
||||||
self.RestTables = Model('sale.shop.table', self.ctx, main_window=self)
|
self.RestTables = Model('sale.shop.table', self.ctx, main_window=self)
|
||||||
self.Consumer = Model('party.consumer', self.ctx, main_window=self)
|
self.Consumer = Model('party.consumer', self.ctx, main_window=self)
|
||||||
self.printers_shop, self.products_printers = self.Sale.get_product_printers(
|
self.printers_shop, self.products_printers = self.Sale.get_product_printers(
|
||||||
self.shop['id'])
|
args=[self.shop['id']])
|
||||||
|
|
||||||
self._action_report_invoice, = self.ActionReport.find([
|
self._action_report_invoice, = self.ActionReport.find([
|
||||||
('report_name', '=', 'account.invoice'),
|
('report_name', '=', 'account.invoice'),
|
||||||
|
|
17
app/main.py
17
app/main.py
|
@ -217,7 +217,7 @@ class AppWindow(FrontWindow):
|
||||||
def set_printing_context(self):
|
def set_printing_context(self):
|
||||||
|
|
||||||
ctx_printing = self.Sale.get_printing_context(
|
ctx_printing = self.Sale.get_printing_context(
|
||||||
{'device_id': self.device['id']})
|
args=[{'device_id': self.device['id']}])
|
||||||
ctx_printing['row_characters'] = self.row_characters
|
ctx_printing['row_characters'] = self.row_characters
|
||||||
ctx_printing['delta_locale'] = DELTA_LOCALE
|
ctx_printing['delta_locale'] = DELTA_LOCALE
|
||||||
locale_logo = ''
|
locale_logo = ''
|
||||||
|
@ -3426,9 +3426,8 @@ class AppWindow(FrontWindow):
|
||||||
|
|
||||||
def action_transfer_to_folio(self):
|
def action_transfer_to_folio(self):
|
||||||
folios = self.Folio.get_current_folios()
|
folios = self.Folio.get_current_folios()
|
||||||
print(folios, 'validate folios')
|
|
||||||
self.dialog_search_folio.set_from_values(folios)
|
|
||||||
self.dialog_search_folio.show()
|
self.dialog_search_folio.show()
|
||||||
|
self.dialog_search_folio.set_from_values(folios)
|
||||||
|
|
||||||
def key_pressed(self, text):
|
def key_pressed(self, text):
|
||||||
if self._state == 'disabled':
|
if self._state == 'disabled':
|
||||||
|
@ -3736,7 +3735,11 @@ class AppWindow(FrontWindow):
|
||||||
self.dialog_test_printer.exec_()
|
self.dialog_test_printer.exec_()
|
||||||
|
|
||||||
def on_selected_folio(self):
|
def on_selected_folio(self):
|
||||||
pass
|
folio_id = self.dialog_search_folio.get_id()
|
||||||
|
if not folio_id:
|
||||||
def on_search_folio(self):
|
return
|
||||||
pass
|
sale_id = self.sale_id
|
||||||
|
current_row = self.dialog_search_folio.current_row
|
||||||
|
result = self.Sale.transfer_to_folio(args=[sale_id, folio_id])
|
||||||
|
if result == 'ok':
|
||||||
|
self.dialog('transfer_folio', extra_message='\n' + current_row['main_guest.name'])
|
||||||
|
|
10
app/proxy.py
10
app/proxy.py
|
@ -2,6 +2,7 @@
|
||||||
import os
|
import os
|
||||||
import base64
|
import base64
|
||||||
import tempfile
|
import tempfile
|
||||||
|
import logging
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from decimal import Decimal
|
from decimal import Decimal
|
||||||
from http.client import HTTPConnection, HTTPSConnection
|
from http.client import HTTPConnection, HTTPSConnection
|
||||||
|
@ -54,8 +55,10 @@ def logout(ctx):
|
||||||
}, default=encoder)
|
}, default=encoder)
|
||||||
conn.request('POST', url, body=payload, headers=HEADERS)
|
conn.request('POST', url, body=payload, headers=HEADERS)
|
||||||
response = conn.getresponse()
|
response = conn.getresponse()
|
||||||
|
print(response.status, 'status logout')
|
||||||
if response.status != 200:
|
if response.status != 200:
|
||||||
res = response.read()
|
res = response.read()
|
||||||
|
logging.error(f'error request {res}')
|
||||||
else:
|
else:
|
||||||
res = json.loads(response.read())
|
res = json.loads(response.read())
|
||||||
conn.close()
|
conn.close()
|
||||||
|
@ -208,8 +211,8 @@ class Model(object):
|
||||||
response = conn.getresponse()
|
response = conn.getresponse()
|
||||||
res = json.loads(response.read())
|
res = json.loads(response.read())
|
||||||
if response.status != 200:
|
if response.status != 200:
|
||||||
|
logging.error(f'error request {str(res)}')
|
||||||
if self.main_window and hasattr(self.main_window, 'statusbar'):
|
if self.main_window and hasattr(self.main_window, 'statusbar'):
|
||||||
print(res, 'valida')
|
|
||||||
self.main_window.dialog(
|
self.main_window.dialog(
|
||||||
'error_server',
|
'error_server',
|
||||||
extra_message=res['detail']['error'])
|
extra_message=res['detail']['error'])
|
||||||
|
@ -217,7 +220,7 @@ class Model(object):
|
||||||
conn.close()
|
conn.close()
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def __call__(self, values=None, ctx=None):
|
def __call__(self, values=None, args=None, ctx=None):
|
||||||
if ctx:
|
if ctx:
|
||||||
self.ctx.update(ctx)
|
self.ctx.update(ctx)
|
||||||
args_ = {
|
args_ = {
|
||||||
|
@ -227,7 +230,10 @@ class Model(object):
|
||||||
'context': self.ctx,
|
'context': self.ctx,
|
||||||
}
|
}
|
||||||
if values:
|
if values:
|
||||||
|
logging.warning(f'deprecate option values call method with list instance. \n model: {self.model} method: {self.method}')
|
||||||
args_['args'] = [values]
|
args_['args'] = [values]
|
||||||
|
if args:
|
||||||
|
args_['args'] = args
|
||||||
res = self.get_connection('POST', '/method', args_)
|
res = self.get_connection('POST', '/method', args_)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
|
@ -70,5 +70,6 @@ class StackMessages(QWidget):
|
||||||
'qty_combo_min_req': ('error', 'Cantidad minima requerida!'),
|
'qty_combo_min_req': ('error', 'Cantidad minima requerida!'),
|
||||||
'error_server': ('error', 'Error'),
|
'error_server': ('error', 'Error'),
|
||||||
'print_error': ('error', 'Error de Impresión'),
|
'print_error': ('error', 'Error de Impresión'),
|
||||||
'test_printer': ('error', 'Resultado Test: ')
|
'test_printer': ('error', 'Resultado Test: '),
|
||||||
|
'transfer_folio': ('info', 'VENTA TRANSFERIDA A FOLIO DE: ')
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
__version__ = "6.0.25"
|
__version__ = "6.0.26"
|
||||||
|
|
Loading…
Reference in New Issue