Ejemplo n.º 1
0
def sidebarvars():
    if hasattr(g, "user"):
        # More access control?
        org_ids = g.user.organizations_memberof_ids()
    else:
        org_ids = []
    workspaces = Workspace.query.filter(Workspace.userid.in_(org_ids)).order_by("title").all()
    if hasattr(g, "workspace"):
        return {
            "workspaces": workspaces,
            "categories": Category.get(g.workspace).order_by("title").all(),
            "invoice_states": InvoiceWorkflow.states(),
            "permissions": lastuser.permissions(),
        }
    else:
        return {"workspaces": workspaces}
Ejemplo n.º 2
0
def sidebarvars():
    if hasattr(g, 'user') and g.user:
        # More access control?
        org_ids = g.user.organizations_memberof_ids()
    else:
        org_ids = []
    workspaces = Workspace.query.filter(Workspace.userid.in_(org_ids)).order_by('title').all()
    if hasattr(g, 'workspace'):
        return {
            'workspaces': workspaces,
            'categories': Category.get(g.workspace).order_by('title').all(),
            'invoice_states': InvoiceWorkflow.states(),
            'permissions': lastuser.permissions()
        }
    else:
        return {
            'workspaces': workspaces,
        }
Ejemplo n.º 3
0
def invoice_list(workspace):
    # Sort invoices by status
    invoices = InvoiceWorkflow.sort_documents(available_invoices(workspace).all())
    return render_template('invoices.html.jinja2', invoices=invoices, invoicespage=True)