fix type_invoice options

fix select invoice for salesman
This commit is contained in:
Wilson Gomez 2022-11-21 09:56:42 -05:00
parent e4663c273f
commit a940193b6d
2 changed files with 16 additions and 6 deletions

View File

@ -37,7 +37,7 @@ from .constants import (
)
from .dialogs import DialogDeliveryParty
invoice_type = [('P', ('POS'))]
invoice_type = []
_SALE_HISTORIC = [
'party', 'sale_date', 'number', 'invoice_number', 'consumer',
@ -371,6 +371,9 @@ class AppWindow(FrontWindow):
size_input = 300
self.label_input.setMaximumWidth(size_input)
if self.shop.get('pos_authorization'):
invoice_type.append(('P', ('POS')))
if self.shop.get('electronic_authorization'):
invoice_type.append(('1', ('VENTA ELECTRONICA')))
@ -395,7 +398,7 @@ class AppWindow(FrontWindow):
# LEFT TABLE COMPONENTS
self.buttons_function = ButtonsFunction(self)
info_fields = [
('party', {
'name': 'CLIENTE',
@ -1884,6 +1887,14 @@ class AppWindow(FrontWindow):
sale_id = self.dialog_search_sales.get_id()
if not sale_id:
return
if self.enviroment != 'restaurant' and self.type_pos_user == 'salesman':
sale = self.Sale.find([('id', '=', sale_id)], fields=['salesman.code'])
salesman = self.action_salesman_code()
self.field_salesman_code_ask.setText('')
if not salesman:
return self.dialog('error_salesman_wrong')
elif salesman['code'] != sale[0]['salesman']['code']:
return self.dialog('error_salesman_wrong')
self.load_sale(sale_id)
self.setFocus()
self.label_input.setFocus()
@ -2060,7 +2071,6 @@ class AppWindow(FrontWindow):
return
self.dialog_reports.open_report(report_name, values)
def action_terminal_journal_report(self):
pass
@ -2314,7 +2324,7 @@ class AppWindow(FrontWindow):
self.field_party.setText('')
self.field_salesman.setText('')
self.field_salesman_id = None
self.field_invoice_type.set_from_id('P')
self.field_invoice_type.set_from_id(invoice_type[0][0])
self.field_party_id = None
self.field_agent_id = None
self.field_payment_term_id = self.default_payment_term['id']
@ -2408,7 +2418,7 @@ class AppWindow(FrontWindow):
self.message_bar.set('system_ready')
to_create = {
'shop': self.shop['id'],
'invoice_type': 'P',
'invoice_type': invoice_type[0][0],
'company': self.company['id'],
'party': self.default_party['id'],
'sale_device': self.device['id'],

View File

@ -1 +1 @@
__version__ = "5.0.57"
__version__ = "5.0.58"