Beispiel #1
0
def articulo():
    
    # presentacion de tabla de articulos ############    
    datasource = db(db.articulo.id>0).select()
    powerTable = plugins.powerTable
    powerTable.datasource = datasource
    powerTable.headers = 'labels'
    powerTable.showkeycolumn = False
    powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
    powerTable.uitheme = request.vars.get('theme','Smoothness')
    powerTable.dtfeatures["sScrollY"] = "100%"
    powerTable.dtfeatures["sScrollX"] = "100%"
    powerTable.dtfeatures['sPaginationType'] = 'full_numbers'
    powerTable.dtfeatures["iDisplayLength"] = 10
    powerTable.extrajs = dict(autoresize={},
                             tooltip={},
                             details={'detailscolumns':'articulo.memo'}
                             )
    powerTable.keycolumn = 'articulo.id'
    powerTable.columns = ['articulo.descripcion','articulo.link',
                          'articulo.precio','articulo.categoria']
    # alta de articulos ####################    
    mystep = [dict(title='NUEVOS ARTICULOS',Legend='Ingrese los datos del articulo',
                   fields=['descripcion','memo','iva','precio','categoria'])]
    from plugin_PowerFormWizard import PowerFormWizard
    options = {'description':False,'legend':True,'validate':True}
    form = PowerFormWizard(db.articulo, steps=mystep, options=options)
    
    if form.accepts(request.vars, session):
        response.flash = "registro aceptado"
    elif form.errors:
        form.step_validation()
        response.flash = "error en los datos"
    return dict( table=powerTable.create(),form=form)
Beispiel #2
0
def cliente():
    # presentacion de listado de clientes
    datasource = db(db.cliente.id>0).select()
    powerTable = plugins.powerTable
    powerTable.datasource = datasource
    powerTable.headers = 'labels'
    powerTable.showkeycolumn = False
    powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
    powerTable.uitheme = request.vars.get('theme','Smoothness')
    powerTable.dtfeatures["sScrollY"] = "100%"
    powerTable.dtfeatures["sScrollX"] = "100%"
    powerTable.dtfeatures['sPaginationType'] = 'full_numbers'
    powerTable.dtfeatures["iDisplayLength"] = 20
    # alta de clientes 
    mystep = [dict(title='NUEVO CLIENTE',Legend='Ingrese los datos del nuevo cliente',
                   fields=['empresa','contacto','telefono','correo'])]
    from plugin_PowerFormWizard import PowerFormWizard
    options = {'description':False,'legend':True,'validate':True}
    form = PowerFormWizard(db.cliente, steps=mystep, options=options)
    
    if form.accepts(request.vars, session):
        response.flash = "registro aceptado"
    elif form.errors:
        form.step_validation()
        response.flash = "error en los datos"
    return dict( table=powerTable.create(),form=form)    
Beispiel #3
0
def categoria():
    # presentacion de categorias de articulos
    datasource = db(db.categoria.id>0).select()
    powerTable = plugins.powerTable
    powerTable.datasource = datasource
    powerTable.headers = 'labels'
    powerTable.showkeycolumn = False
    powerTable.dtfeatures['bJQueryUI'] = request.vars.get('jqueryui',True)
    powerTable.uitheme = request.vars.get('theme','Smoothness')
    powerTable.dtfeatures["sScrollY"] = "100%"
    powerTable.dtfeatures["sScrollX"] = "100%"
    powerTable.dtfeatures['sPaginationType'] = 'full_numbers'
    powerTable.dtfeatures["iDisplayLength"] = 30
    # alta de categoria de articulos
    mystep = [dict(title='NUEVAS CATEGORIAS',Legend='Ingrese una Categoria para Agrupar artículos',fields=['name'])]
    from plugin_PowerFormWizard import PowerFormWizard
    options = {'description':False,'legend':True,'validate':True}
    form = PowerFormWizard(db.categoria, steps=mystep, options=options)
    
    if form.accepts(request.vars, session):
        response.flash = "registro aceptado"
    elif form.errors:
        form.step_validation()
        response.flash = "error en los datos"
    return dict( table=powerTable.create(),form=form)
Beispiel #4
0
def movimientos():
    mystep = [dict(title='MOVIMIENTOS',Legend='Ingrese los datos solicitados',
                   fields=['entregado_x','retirado_x','id_articulo','cantidad',
                           'estado','Comprobante',
                           'cliente','concepto'])]
    from plugin_PowerFormWizard import PowerFormWizard
    options = {'description':False,'legend':True,'validate':True}
    form = PowerFormWizard(db.movimientos, steps=mystep, options=options)
    
    if form.accepts(request.vars, session):
        response.flash = "registro aceptado"
        #rows = db(db.movimientos.id>0).select()
        #last_row = rows.last()
        #a=db.memomovi.insert(referencia=last_row.id,entregado_x=last_row.entregado_x,
                             #retirado_x=last_row.retirado_x,id_articulo=last_row.id_articulo,
                             #cantidad=last_row.cantidad,fecha_pedido=last_row.fecha_pedido,
                             #fecha_devuelta=last_row.fecha_devuelta,estado=last_row.estado,
                             #Comprobante=last_row.Comprobante,cliente=last_row.cliente)
        #db.commit()
    elif form.errors:
        form.step_validation()
        response.flash = "error en los datos"
    return dict(form=form)