103
103
if form['filter'] in ('bydate','none'):
104
104
#Para filtrar por 'fechas' o 'sin filtro', este porque se envia el año fiscal por fecha.
106
106
elif form['filter'] == 'byperiod':
107
107
#Para filtrar por periodos
108
108
periodos = str(form['periods']).replace("[","(").replace("]",")")
111
111
#Para filtrar por periodos y fechas
112
112
periodos = str(form['periods']).replace("[","(").replace("]",")")
113
where = """ and aml.period_id in %s and aml.date between '%s' and '%s'"""%(periodos,form['date_from'],form['date_to'])
113
where = """ and am.period_id in %s and am.date between '%s' and '%s'"""%(periodos,form['date_from'],form['date_to'])
114
114
if form.get('state', False):
115
115
estado = " and am.state = '%s'"%form['state']