Option cancel only by admins
This commit is contained in:
commit
565f36be3a
|
@ -1,3 +1,8 @@
|
||||||
|
v 1.42.0 [24-May-2021]
|
||||||
|
----------------------
|
||||||
|
- Opción para que solo un admin pueda cancelar.
|
||||||
|
|
||||||
|
|
||||||
v 1.41.4 [13-Abr-2021]
|
v 1.41.4 [13-Abr-2021]
|
||||||
----------------------
|
----------------------
|
||||||
- Error - Ticket #4
|
- Error - Ticket #4
|
||||||
|
|
|
@ -120,12 +120,6 @@ class StorageEngine(object):
|
||||||
def enviar_prefac(self, values):
|
def enviar_prefac(self, values):
|
||||||
return main.PreFacturas.enviar(values['id'])
|
return main.PreFacturas.enviar(values['id'])
|
||||||
|
|
||||||
# ~ def _get_cancelinvoice(self, values):
|
|
||||||
# ~ return main.Facturas.cancel(values['id'])
|
|
||||||
|
|
||||||
# ~ def _get_statussat(self, values):
|
|
||||||
# ~ return main.Facturas.get_status_sat(values['id'])
|
|
||||||
|
|
||||||
def _get_verifysat(self, values):
|
def _get_verifysat(self, values):
|
||||||
return main.Facturas.get_verify_sat(values['id'])
|
return main.Facturas.get_verify_sat(values['id'])
|
||||||
|
|
||||||
|
@ -372,7 +366,7 @@ class StorageEngine(object):
|
||||||
if opt == 'add':
|
if opt == 'add':
|
||||||
return main.Tickets.add(values, user)
|
return main.Tickets.add(values, user)
|
||||||
if opt == 'cancel':
|
if opt == 'cancel':
|
||||||
return main.Tickets.cancel(values)
|
return main.Tickets.cancel(values, user)
|
||||||
if opt == 'invoice':
|
if opt == 'invoice':
|
||||||
return main.Tickets.invoice(values, user)
|
return main.Tickets.invoice(values, user)
|
||||||
if opt == 'print':
|
if opt == 'print':
|
||||||
|
|
|
@ -614,6 +614,8 @@ class Configuracion(BaseModel):
|
||||||
'chk_ticket_user_show_doc',
|
'chk_ticket_user_show_doc',
|
||||||
'chk_config_invoice_by_ticket',
|
'chk_config_invoice_by_ticket',
|
||||||
'chk_config_show_total_cant',
|
'chk_config_show_total_cant',
|
||||||
|
'chk_cancel_invoices_by_admin',
|
||||||
|
'chk_cancel_tickets_by_admin',
|
||||||
)
|
)
|
||||||
data = (Configuracion
|
data = (Configuracion
|
||||||
.select()
|
.select()
|
||||||
|
@ -5512,6 +5514,12 @@ class Facturas(BaseModel):
|
||||||
return cls.timbrar(args, user)
|
return cls.timbrar(args, user)
|
||||||
|
|
||||||
if args['opt'] == 'cancel':
|
if args['opt'] == 'cancel':
|
||||||
|
admin_cancel = Configuracion.get_bool('chk_cancel_invoices_by_admin')
|
||||||
|
if admin_cancel and not user.es_admin:
|
||||||
|
msg = 'Solo un admin puede cancelar'
|
||||||
|
result = {'ok': False, 'msg': msg, 'row': {}}
|
||||||
|
return result
|
||||||
|
|
||||||
result = cls.cancel(args['id'])
|
result = cls.cancel(args['id'])
|
||||||
if result['ok']:
|
if result['ok']:
|
||||||
m = 'C {}'.format(args['id'])
|
m = 'C {}'.format(args['id'])
|
||||||
|
@ -7487,7 +7495,13 @@ class Tickets(BaseModel):
|
||||||
return
|
return
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def cancel(cls, values):
|
def cancel(cls, values, user):
|
||||||
|
admin_cancel = Configuracion.get_bool('chk_cancel_tickets_by_admin')
|
||||||
|
if admin_cancel and not user.es_admin:
|
||||||
|
msg = 'Solo un admin puede cancelar tickets'
|
||||||
|
result = {'ok': False, 'msg': msg, 'row': {}}
|
||||||
|
return result
|
||||||
|
|
||||||
id = int(values['id'])
|
id = int(values['id'])
|
||||||
msg = 'Ticket cancelado correctamente'
|
msg = 'Ticket cancelado correctamente'
|
||||||
u = {'cancelado': True, 'estatus': 'Cancelado'}
|
u = {'cancelado': True, 'estatus': 'Cancelado'}
|
||||||
|
|
|
@ -42,7 +42,7 @@ except ImportError:
|
||||||
|
|
||||||
|
|
||||||
DEBUG = DEBUG
|
DEBUG = DEBUG
|
||||||
VERSION = '1.41.4'
|
VERSION = '1.42.0'
|
||||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||||
|
|
||||||
|
@ -235,10 +235,11 @@ RFCS = {
|
||||||
'FOREIGN': 'XEXX010101000',
|
'FOREIGN': 'XEXX010101000',
|
||||||
'CVD110412TF6': 'finkok',
|
'CVD110412TF6': 'finkok',
|
||||||
'SCD110105654': 'comercio',
|
'SCD110105654': 'comercio',
|
||||||
|
'AAA010101AAA': 'comercio',
|
||||||
}
|
}
|
||||||
|
|
||||||
URL = {
|
URL = {
|
||||||
'SEAFILE': 'https://seafile.elmau.net',
|
'SEAFILE': 'https://seafile.cuates.net',
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFAULT_GLOBAL = {
|
DEFAULT_GLOBAL = {
|
||||||
|
|
|
@ -129,6 +129,7 @@ var controllers = {
|
||||||
$$('chk_config_user_show_doc').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_user_show_doc').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('chk_config_invoice_by_ticket').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_invoice_by_ticket').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('chk_config_show_total_cant').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_show_total_cant').attachEvent('onItemClick', chk_config_item_click)
|
||||||
|
$$('chk_cancel_invoices_by_admin').attachEvent('onItemClick', chk_config_item_click)
|
||||||
|
|
||||||
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_config_anticipo').attachEvent('onItemClick', chk_config_item_click)
|
||||||
|
|
||||||
|
@ -138,6 +139,7 @@ var controllers = {
|
||||||
$$('chk_ticket_edit_cant').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_ticket_edit_cant').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('chk_ticket_total_up').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_ticket_total_up').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('chk_ticket_user_show_doc').attachEvent('onItemClick', chk_config_item_click)
|
$$('chk_ticket_user_show_doc').attachEvent('onItemClick', chk_config_item_click)
|
||||||
|
$$('chk_cancel_tickets_by_admin').attachEvent('onItemClick', chk_config_item_click)
|
||||||
$$('txt_ticket_printer').attachEvent('onKeyPress', txt_ticket_printer_key_press)
|
$$('txt_ticket_printer').attachEvent('onKeyPress', txt_ticket_printer_key_press)
|
||||||
$$('lst_pac').attachEvent('onChange', lst_pac_on_change)
|
$$('lst_pac').attachEvent('onChange', lst_pac_on_change)
|
||||||
$$('cmd_save_pac').attachEvent('onItemClick', cmd_save_pac_click)
|
$$('cmd_save_pac').attachEvent('onItemClick', cmd_save_pac_click)
|
||||||
|
|
|
@ -690,7 +690,12 @@ var options_admin_otros = [
|
||||||
labelRight: 'Factura global por ticket'},
|
labelRight: 'Factura global por ticket'},
|
||||||
{view: 'checkbox', id: 'chk_config_show_total_cant', labelWidth: 0,
|
{view: 'checkbox', id: 'chk_config_show_total_cant', labelWidth: 0,
|
||||||
labelRight: 'Mostrar total de cantidades'},
|
labelRight: 'Mostrar total de cantidades'},
|
||||||
{},
|
{}
|
||||||
|
]},
|
||||||
|
{cols: [{maxWidth: 15},
|
||||||
|
{view: 'checkbox', id: 'chk_cancel_invoices_by_admin', labelWidth: 0,
|
||||||
|
labelRight: 'Solo admins pueden cancelar'},
|
||||||
|
{}
|
||||||
]},
|
]},
|
||||||
{maxHeight: 15},
|
{maxHeight: 15},
|
||||||
|
|
||||||
|
@ -739,6 +744,11 @@ var options_admin_otros = [
|
||||||
{view: 'checkbox', id: 'chk_ticket_user_show_doc', labelWidth: 0,
|
{view: 'checkbox', id: 'chk_ticket_user_show_doc', labelWidth: 0,
|
||||||
labelRight: 'Usuarios pueden ver todos los documentos'}
|
labelRight: 'Usuarios pueden ver todos los documentos'}
|
||||||
]},
|
]},
|
||||||
|
{cols: [{maxWidth: 15},
|
||||||
|
{view: 'checkbox', id: 'chk_cancel_tickets_by_admin', labelWidth: 0,
|
||||||
|
labelRight: 'Solo admins pueden cancelar'},
|
||||||
|
{}
|
||||||
|
]},
|
||||||
{maxHeight: 20},
|
{maxHeight: 20},
|
||||||
{}]
|
{}]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue