Add filter by day
This commit is contained in:
parent
070ee31a1b
commit
390ec60fdd
|
@ -1,3 +1,7 @@
|
|||
v 2.1.0 [26-Dic-2023]
|
||||
- Mejora: Se agrega filtro por día en facturas.
|
||||
|
||||
|
||||
v 2.0.9 [20-Dic-2023]
|
||||
- Fix: Issue 98 y 107
|
||||
|
||||
|
|
|
@ -328,6 +328,7 @@ def config_main(user):
|
|||
'decimales_precios': DECIMALES,
|
||||
'pagos': Configuracion.get_bool('chk_config_pagos'),
|
||||
'pays_data_bank': Configuracion.get_bool('chk_cfg_pays_data_bank'),
|
||||
'show_filter_by_day': Configuracion.get_bool('chk_config_show_filter_by_day'),
|
||||
}
|
||||
dp = Configuracion.get_bool('chk_config_decimales_precios')
|
||||
if dp:
|
||||
|
@ -684,6 +685,7 @@ class Configuracion(BaseModel):
|
|||
'chk_cancel_invoices_by_admin',
|
||||
'chk_config_change_date_invoice',
|
||||
'chk_cancel_tickets_by_admin',
|
||||
'chk_config_show_filter_by_day',
|
||||
)
|
||||
data = (Configuracion
|
||||
.select()
|
||||
|
@ -4685,7 +4687,11 @@ class Facturas(BaseModel):
|
|||
fm = (Facturas.fecha.month > 0)
|
||||
else:
|
||||
fm = (Facturas.fecha.month == int(values['month']))
|
||||
filters = (fy & fm)
|
||||
if values['day'] == '-1':
|
||||
filters = (fy & fm)
|
||||
else:
|
||||
fd = (Facturas.fecha.day == int(values['day']))
|
||||
filters = (fy & fm & fd)
|
||||
|
||||
if 'client' in values:
|
||||
filters &= (Socios.nombre==values['client'])
|
||||
|
|
|
@ -39,7 +39,7 @@ except ImportError:
|
|||
|
||||
|
||||
DEBUG = DEBUG
|
||||
VERSION = '2.0.9'
|
||||
VERSION = '2.1.0'
|
||||
|
||||
EMAIL_SUPPORT = ('soporte@empresalibre.mx',)
|
||||
TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)
|
||||
|
|
|
@ -134,6 +134,7 @@ var controllers = {
|
|||
$$('chk_config_user_show_doc').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_filter_by_day').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_cancel_invoices_by_admin').attachEvent('onItemClick', chk_config_item_click)
|
||||
$$('chk_config_change_date_invoice').attachEvent('onItemClick', chk_config_item_click)
|
||||
|
||||
|
|
|
@ -69,6 +69,11 @@ var invoices_controllers = {
|
|||
|
||||
$$('filter_year').attachEvent('onChange', filter_year_change)
|
||||
$$('filter_month').attachEvent('onChange', filter_month_change)
|
||||
var show_filter_by_day = get_config('show_filter_by_day')
|
||||
show('filter_day', show_filter_by_day)
|
||||
if(show_filter_by_day){
|
||||
$$('filter_day').attachEvent('onChange', filter_day_change)
|
||||
}
|
||||
$$('filter_dates').attachEvent('onChange', filter_dates_change)
|
||||
$$('cmd_prefactura').attachEvent('onItemClick', cmd_prefactura_click)
|
||||
$$('cmd_preinvoice_generate_delete').attachEvent('onItemClick', cmd_preinvoice_generate_delete_click)
|
||||
|
@ -210,7 +215,6 @@ function default_config(){
|
|||
|
||||
webix.ajax().sync().get('/values/configtimbrar', function(text, data){
|
||||
var values = data.json()
|
||||
//~ showvar(values)
|
||||
show('chk_cfdi_anticipo', values.cfdi_anticipo)
|
||||
show('chk_cfdi_donativo', values.cfdi_donativo)
|
||||
show('lst_metodo_pago', !values.cfdi_metodo_pago)
|
||||
|
@ -1690,6 +1694,10 @@ function get_filters_invoices(){
|
|||
|
||||
filters['year'] = $$('filter_year').getValue()
|
||||
filters['month'] = $$('filter_month').getValue()
|
||||
filters['day'] = '-1'
|
||||
if(get_config('show_filter_by_day')){
|
||||
filters['day'] = $$('filter_day').getValue()
|
||||
}
|
||||
filters['client'] = $$('grid_invoices').getFilter('cliente').value
|
||||
return filters
|
||||
}
|
||||
|
@ -1727,6 +1735,11 @@ function filter_month_change(nv, ov){
|
|||
}
|
||||
|
||||
|
||||
function filter_day_change(nv, ov){
|
||||
get_invoices()
|
||||
}
|
||||
|
||||
|
||||
function filter_dates_change(range){
|
||||
if(range.start != null && range.end != null){
|
||||
get_invoices()
|
||||
|
|
|
@ -40,6 +40,7 @@ function configuracion_inicial(){
|
|||
add_config({'key': 'used_cfdi_pays', 'value': values.pagos})
|
||||
add_config({'key': 'multi_currency', 'value': values.multi_currency})
|
||||
add_config({'key': 'pays_data_bank', 'value': values.pays_data_bank})
|
||||
add_config({'key': 'show_filter_by_day', 'value': values.show_filter_by_day})
|
||||
|
||||
})
|
||||
|
||||
|
@ -115,16 +116,19 @@ function menu_user_click(id, e, node){
|
|||
function current_dates(){
|
||||
var fy = $$('filter_year')
|
||||
var fm = $$('filter_month')
|
||||
var fd = $$('filter_day')
|
||||
var pfy = $$('prefilter_year')
|
||||
var pfm = $$('prefilter_month')
|
||||
var d = new Date()
|
||||
|
||||
fy.blockEvent()
|
||||
fm.blockEvent()
|
||||
fd.blockEvent()
|
||||
pfy.blockEvent()
|
||||
pfm.blockEvent()
|
||||
|
||||
fm.setValue(d.getMonth() + 1)
|
||||
fd.setValue(d.getDate())
|
||||
pfm.setValue(d.getMonth() + 1)
|
||||
webix.ajax().sync().get('/values/filteryears', function(text, data){
|
||||
var values = data.json()
|
||||
|
@ -136,6 +140,7 @@ function current_dates(){
|
|||
|
||||
fy.unblockEvent()
|
||||
fm.unblockEvent()
|
||||
fd.unblockEvent()
|
||||
pfy.unblockEvent()
|
||||
pfm.unblockEvent()
|
||||
}
|
||||
|
|
|
@ -55,6 +55,42 @@ var months = [
|
|||
{id: 12, value: 'Diciembre'},
|
||||
]
|
||||
|
||||
var days = [
|
||||
{id: -1, value: '00'},
|
||||
{id: 1, value: '01'},
|
||||
{id: 2, value: '02'},
|
||||
{id: 3, value: '03'},
|
||||
{id: 4, value: '04'},
|
||||
{id: 5, value: '05'},
|
||||
{id: 6, value: '06'},
|
||||
{id: 7, value: '07'},
|
||||
{id: 8, value: '08'},
|
||||
{id: 9, value: '09'},
|
||||
{id: 10, value: '10'},
|
||||
{id: 11, value: '11'},
|
||||
{id: 12, value: '12'},
|
||||
{id: 13, value: '13'},
|
||||
{id: 14, value: '14'},
|
||||
{id: 15, value: '15'},
|
||||
{id: 16, value: '16'},
|
||||
{id: 17, value: '17'},
|
||||
{id: 18, value: '18'},
|
||||
{id: 19, value: '19'},
|
||||
{id: 20, value: '20'},
|
||||
{id: 21, value: '21'},
|
||||
{id: 22, value: '22'},
|
||||
{id: 23, value: '23'},
|
||||
{id: 24, value: '24'},
|
||||
{id: 25, value: '25'},
|
||||
{id: 26, value: '26'},
|
||||
{id: 27, value: '27'},
|
||||
{id: 28, value: '28'},
|
||||
{id: 29, value: '29'},
|
||||
{id: 30, value: '30'},
|
||||
{id: 31, value: '31'},
|
||||
]
|
||||
|
||||
|
||||
|
||||
function get_icon(tipo){
|
||||
icons = {
|
||||
|
|
|
@ -689,6 +689,8 @@ var options_admin_otros = [
|
|||
labelRight: 'Factura global por ticket'},
|
||||
{view: 'checkbox', id: 'chk_config_show_total_cant', labelWidth: 0,
|
||||
labelRight: 'Mostrar total de cantidades'},
|
||||
{view: 'checkbox', id: 'chk_config_show_filter_by_day', labelWidth: 0,
|
||||
labelRight: 'Mostrar filtro por día'},
|
||||
{}
|
||||
]},
|
||||
{cols: [{maxWidth: 15},
|
||||
|
|
|
@ -234,6 +234,8 @@ var toolbar_invoices_filter = [
|
|||
labelWidth: 50, width: 150, options: []},
|
||||
{view: 'richselect', id: 'filter_month', label: 'Mes', labelAlign: 'right',
|
||||
labelWidth: 50, width: 200, options: months},
|
||||
{view: 'richselect', id: 'filter_day', label: 'Día', labelAlign: 'right',
|
||||
labelWidth: 50, width: 125, options: days},
|
||||
{view: 'daterangepicker', id: 'filter_dates', label: 'Fechas',
|
||||
labelAlign: 'right', width: 300},
|
||||
{},
|
||||
|
|
|
@ -116,6 +116,7 @@ var opt_tax_object = [
|
|||
{id: '02', value: '[02] Sí objeto de impuesto.'},
|
||||
{id: '03', value: '[03] Sí objeto del impuesto y no obligado al desglose.'},
|
||||
{id: '04', value: '[04] Sí objeto del impuesto y no causa impuesto.'},
|
||||
{id: '05', value: '[05] Sí objeto del impuesto, IVA crédito PODEBI.'},
|
||||
]
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue