def ar_options(row): return supert.OPTION_BTN('receipt', URL('purchase', 'get', args=row.id_purchase.id), title=T('view')), supert.OPTION_BTN( 'done', URL('settle', args=row.id), title=T('settle'))
def order_options(row): buttons = () if row.is_for_defered_sale: buttons += supert.OPTION_BTN('receipt', URL('ticket', 'show_ticket', vars=dict(id_sale=row.id_sale)), _target='_blank'), buttons += supert.OPTION_BTN('playlist_add_check', URL('sale_order', 'ready', args=row.id)), return buttons
def employee_options(row): options = supert.OPTION_BTN( 'edit', URL('get_employee', args=row.id), title=T('edit') ) if row.registration_key == '': options += supert.OPTION_BTN( 'visibility_off', URL('delete', args=row.id, vars=dict(_next=URL('user', 'index', vars=request.vars))), title=T('hide') ) else: options += supert.OPTION_BTN( 'visibility', URL('undelete', args=row.id, vars=dict(_next=URL('user', 'index', vars=request.vars))), title=T('show') ) return options
def sale_options(row): buttons = () if row.is_deferred or not row.last_log_event: buttons += supert.OPTION_BTN('edit', URL('update', args=row.id), title=T('update')), buttons += supert.OPTION_BTN('receipt', URL('ticket', 'show_ticket', vars=dict(id_sale=row.id)), title=T('view ticket'), _target='_blank'), supert.OPTION_BTN( 'description', URL('invoice', 'create')), return buttons
def index(): import supert def client_format(row, fields): if row.id_sale and row.id_sale.id_client: return "%s %s" % (row.id_sale.id_client.first_name, row.id_sale.id_client.last_name) return "--" data = common_index( 'credit_note', [ 'subtotal', 'total', 'created_on', dict(fields=[ 'id_sale.id_client.first_name', 'id_sale.id_client.last_name' ], label_as=T('Client'), custom_format=client_format) ], supert_vars=dict(options_func=lambda row: supert.OPTION_BTN( 'receipt', URL('ticket', 'show_ticket', vars=dict(id_credit_note=row.id)), _target='_blank'), global_options=[])) return locals()
def client_options(row): edit_btn = supert.OPTION_BTN('edit', URL('update', args=row.id), title=T('edit')) icon_name = 'thumb_down' if row.registration_key == 'blocked': icon_name = 'thumb_up' ban_btn = supert.OPTION_BTN(icon_name, URL('ban', args=row.id), title=T('ban')) wallet_btn = supert.OPTION_BTN('account_balance_wallet', URL('wallet', 'index', args=row.id_wallet.id), title=T('wallet')) return edit_btn, ban_btn, wallet_btn
def item_options(row): buttons = () if auth.has_membership('Items info') or auth.has_membership( 'Items prices') or auth.has_membership('Items management'): _vars = {'is_bundle': True} if row.is_bundle else {} buttons += supert.OPTION_BTN('edit', URL('update', args=row.id, vars=_vars), title=T('edit')), # hide button if auth.has_membership('Items management'): buttons += supert.supert_default_options(row)[1], buttons += supert.OPTION_BTN('shopping_basket', _onclick="add_bag_item(%s);" % row.id, title=T('add to bag')), return buttons
def index(): import supert data = common_index( 'trait_category', ['name'], dict(options_func=lambda row: supert.supert_default_options(row) + (supert.OPTION_BTN( 'details', URL('get', args=row.id), title=T('values')), ))) return locals()
def purchase_options(row): import supert buttons = () # edit option if not row.is_done: buttons += supert.OPTION_BTN('edit', URL('update', args=row.id), title=T('edit')), else: buttons += supert.OPTION_BTN('receipt', URL('get', args=row.id), title=T('view')), buttons += supert.OPTION_BTN('label', URL('item', 'labels', vars=dict(id_purchase=row.id)), title=T('print labels')), return buttons
def index(): import supert Supert = supert.Supert() data = Supert.SUPERT(db.stock_transfer, fields=[ 'id_store_from.name', 'id_store_to.name', 'is_done' ], options_func=lambda row: [supert.OPTION_BTN('receipt', URL('ticket', args=row.id), title=T('view ticket'))] , selectable=False, searchable=False ) return locals()
def inventory_options(row): import supert buttons = () # edit option if not row.is_done: buttons += supert.OPTION_BTN('edit', URL('fill', args=row.id), title=T('edit')), buttons += supert.OPTION_BTN('delete', URL('delete', args=row.id), title=T('delete')), else: buttons += supert.OPTION_BTN('undo', URL('undo', args=row.id), title=T('undo')), buttons += supert.OPTION_BTN('assignment', URL('get', args=row.id), title=T('details')), return buttons
def index(): import supert Supert = supert.Supert() store_group = db(db.auth_group.role == 'Store %s' % session.store).select().first() checkout_group = db( db.auth_group.role == 'Sales checkout').select().first() # query the employees with current store membership store_employees_ids = [ r.id for r in db((db.auth_user.id == db.auth_membership.user_id) & (db.auth_membership.group_id == store_group.id)).select( db.auth_user.id) ] # employees with store membership and checkout membership employees_query = ((db.auth_user.id == db.auth_membership.user_id) & (db.auth_user.id.belongs(store_employees_ids)) & (db.auth_membership.group_id == checkout_group.id) & (db.auth_user.registration_key == '')) employees_data = Supert.SUPERT( employees_query, select_fields=[db.auth_user.ALL], fields=[ dict(fields=['first_name', 'last_name'], label_as=T('Name')), 'email' ], options_func=lambda row: (supert.OPTION_BTN('attach_money', URL('cash_out', 'create', args=row.id), title=T('cash out')), supert.OPTION_BTN('archive', URL('cash_out', 'archive', args=row.id), title=T('previous cash outs'))), global_options=[], title=T("Sellers")) return dict(employees=employees_data)
def reason_options(row): options = supert.OPTION_BTN('edit', URL('update_reason', args=row.id), title=T('update')) # if row.is_active: # options += OPTION_BTN( # 'visibility_off', URL('hide_reason', args=row.id), title=T('hide') # ), # else: # options += OPTION_BTN( # 'visibility', URL('unhide_reason', args=row.id), title=T('unhide') # ), return options
def profile(): import supert Supert = supert.Supert() orders_data = Supert.SUPERT( db.sale_order.id_client == auth.user.id, fields=['id', 'is_ready'], searchable=False, options_func=lambda r: supert.OPTION_BTN( 'receipt', URL('ticket', 'get', vars=dict(id_bag=r.id_bag.id)), title=T('ticket'))) wallet_balance = 0 if auth.user.id_wallet: wallet_balance = db.wallet(auth.user.id_wallet).balance wallet_balance = str(DQ(wallet_balance, True)) return locals()
def store_options(row): update_btn, hide_btn = supert.supert_default_options(row) return update_btn, hide_btn, supert.OPTION_BTN('vpn_key', URL('seals', args=row.id), title=T('upload seals'))
def inventory_item_options(row): return supert.OPTION_BTN( 'edit', URL('fill', args=[inventory.id, row.id], vars=request.vars))
def category_options(row): update_btn, hide_btn = supert.supert_default_options(row) return update_btn, hide_btn, supert.OPTION_BTN( 'details', URL('index', args=row.id), title=T('subcategories'))
def stock_item_options(row): return supert.OPTION_BTN('edit', url=URL('fill', args=[purchase.id, row.id], vars=request.vars), title=T("modify"))
def offer_options(row): return supert.supert_default_options(row) + (supert.OPTION_BTN( 'local_offer', URL('fill', args=row.id), title=T("modify discounts")), )
def index(): import supert Supert = supert.Supert() data = Supert.SUPERT(db.payment.is_settled == False, fields=['id_sale.consecutive', 'epd', 'amount'], options_func=lambda row : [supert.OPTION_BTN('receipt', URL('sale', 'ticket', args=row.id_sale.id), title=T('ticket')), supert.OPTION_BTN('done', URL('settle', args=row.id), title=T('settle') )]) return locals()
def options(row): return supert.OPTION_BTN('info', URL('get', args=row.id), title=T('details'))
def cash_out_options(row): options = supert.OPTION_BTN('assignment', URL('details', args=row.id), title=T('details')) return options