def index(): fields = [{ 'fields': ['name', 'is_bundle'], 'custom_format': lambda row, fields: '%s %s' % (T('BUNDLE') if row.is_bundle else '', row.name), 'label_as': T('Name') }, 'sku', 'ean', 'upc'] if EXTRA_FIELD_1_NAME: fields.append({ 'fields': ['extra_data1'], 'label_as': EXTRA_FIELD_1_NAME }) if EXTRA_FIELD_2_NAME: fields.append({ 'fields': ['extra_data2'], 'label_as': EXTRA_FIELD_2_NAME }) if EXTRA_FIELD_3_NAME: fields.append({ 'fields': ['extra_data3'], 'label_as': EXTRA_FIELD_3_NAME }) query = (db.item.is_active == True) if request.vars.show_hidden == 'yes': query = (db.item.id > 0) Supert = supert.Supert() data = Supert.SUPERT(query, fields=fields, options_func=item_options, global_options=[supert.visibility_g_option()]) return locals()
def fill(): """ args [ id_inventory, id_inventory_item ] """ import supert Supert = supert.Supert() inventory = db.inventory(request.args(0)) is_partial = inventory.is_partial is_valid_inventory(inventory) def inventory_item_options(row): return supert.OPTION_BTN( 'edit', URL('fill', args=[inventory.id, row.id], vars=request.vars)) inventory_item = None if request.args(1): inventory_item = db((db.inventory_item.id == request.args(1)) & (db.inventory_item.id_inventory == inventory.id) ).select().first() inventory_items_table = Supert.SUPERT( (db.inventory_item.id_inventory == inventory.id), fields=[ 'id_item.name', 'system_qty', dict(fields=['physical_qty'], label_as=T('Physical quantity'), custom_format=lambda r, f: SPAN(r[f[0]], _id='item_%s_%s' % (r.id, f[0]))) ], options_func=inventory_item_options, global_options=[]) return locals()
def get(): """ args: [purchase_id] """ import supert Supert = supert.Supert() purchase = db.purchase(request.args(0)) if not purchase: raise HTTP(404) if not purchase.is_done: raise HTTP(405) def stock_item_row(row, fields): tr = TR() tr.append(row.id_item.name) for field in fields[1:]: tr.append(row[field]) return tr purchase_items = db(db.stock_item.id_purchase == purchase.id).select() purchase_items_table = Supert.SUPERT( db.stock_item.id_purchase == purchase.id, fields=['id_item.name', 'purchase_qty', 'price', 'taxes'], options_enabled=False, searchable=False) return locals()
def index(): import supert Supert = supert.Supert() 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 q = (db.sale_order.id_store == session.store) & ( db.sale_order.is_active == True) & (db.sale_order.is_ready == False) data = Supert.SUPERT( q, fields=['is_ready', 'is_for_defered_sale', 'created_on'], options_func=order_options, global_options=[], searchable=False) return locals()
def archive(): """ args: [seller_id] """ import supert Supert = supert.Supert() seller = db.auth_user(request.args(0)) if not seller: raise HTTP(404) if not auth.has_membership(None, seller.id, 'Sales checkout'): raise HTTP(404) def cash_out_options(row): options = supert.OPTION_BTN('assignment', URL('details', args=row.id), title=T('details')) return options def status_format(r, f): if r.sys_cash == r.cash: return I(_class='status-circle bg-success'), A( T("Ok"), _href=URL('index', args=seller.id, vars=dict(status="ok"))), elif r.sys_cash < r.cash: return I(_class='status-circle bg-success'), A( T("Added money"), _href=URL('index', args=seller.id, vars=dict(status="added"))) elif r.sys_cash > r.cash: return I(_class='status-circle bg-danger'), A( T("Missing money"), _href=URL('index', args=seller.id, vars=dict(status="missing"))) status = request.vars.status query = (db.cash_out.id_seller == seller.id) & (db.cash_out.is_done == True) if status == 'missing': query &= db.cash_out.sys_cash > db.cash_out.cash elif status == 'added': query &= db.cash_out.sys_cash < db.cash_out.cash elif status == 'ok': query &= db.cash_out.sys_cash == db.cash_out.cash data = Supert.SUPERT(query, fields=[ 'start_date', 'end_date', 'sys_cash', 'cash', 'is_done', dict(fields=['id'], label_as=T('Status'), custom_format=status_format) ], options_func=cash_out_options, global_options=[], searchable=False) return locals()
def index(): import supert Supert = supert.Supert() 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 status_format(r, f): if r[f[0]]: return A(T(r[f[0]]), _href=URL('index', vars=dict(term_0=r[f[0]]))) return '???' query = (db.sale.id_store == session.store) if not auth.has_membership('Admin config'): query &= db.sale.created_by == auth.user.id def user_format(r, f): if r[f[0]]: return "%s %s" % (r[f[0]].first_name, r[f[0]].last_name) return "--" data = Supert.SUPERT( query, fields=[ 'consecutive', 'subtotal', dict(fields=['discount_percentage'], label_as=T('Discount percentage'), custom_format=lambda r, f: "%s %%" % DQ(r[f[0]], True, True)), dict(fields=['total'], label_as=T('total'), custom_format=lambda r, f: r.total - (r.discount or 0)), dict(fields=['last_log_event'], label_as=T("Status"), custom_format=status_format), dict(fields=['id_client'], label_as=T('Client'), custom_format=user_format), 'created_on', dict(fields=['created_by'], label_as=T('Created by'), custom_format=user_format) ], options_func=sale_options, global_options=[]) return locals()
def index(): import supert Supert = supert.Supert() title = T('paper sizes') data = Supert.SUPERT(db.paper_size, fields=['name', 'width', 'height'], options_enabled=False, global_options=[]) return locals()
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 index(): import supert Supert = supert.Supert() trait_category = db.trait_category(request.vars.trait_category) if not trait_category: raise HTTP(400) query = (db.trait.is_active == True) & (db.trait.id_trait_category == trait_category.id) data = Supert.SUPERT(query, fields=['trait_option']) return locals()
def index(): import supert Supert = supert.Supert() query = db.purchase.id_store == session.store data = Supert.SUPERT( query, fields=['invoice_number', 'subtotal', 'total', 'created_on'], options_func=purchase_options, global_options=[]) return locals()
def index(): import supert Supert = supert.Supert() 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')) query = db.category.parent == request.args(0) if not request.vars.show_hidden == 'yes': query &= db.category.is_active == True request.vars.orderby = 'name' data = Supert.SUPERT(query, fields=['name'], options_func=category_options) return locals()
def common_index(table_name, fields=None, supert_vars=None): """ """ import supert Supert = supert.Supert() if fields is None: fields = [] if supert_vars is None: supert_vars = {} show_hidden = request.vars.show_hidden == 'yes' query = db[table_name].is_active == True if not show_hidden else db[ table_name].id > 0 return Supert.SUPERT(query, [db[table_name].ALL], fields=fields, **supert_vars)
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 bag_supert(id_bag): import supert Supert = supert.Supert() query = (db.bag_item.id_bag == id_bag) return Supert.SUPERT(query, fields=[ 'product_name', { 'fields': ['quantity'], 'custom_format': lambda r, f: DQ(r.quantity, True, True), 'label_as': T('Quantity') } ], options_enabled=False, searchable=False)
def index(): """ List of clients """ import supert Supert = supert.Supert() title = T('clients') 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 query = (db.auth_user.is_client == True) data = Supert.SUPERT( query, [db.auth_user.ALL], fields=[ 'first_name', 'last_name', 'email', dict(fields=['phone_number'], custom_format=lambda r, f: A(r[f[0]], _href="tel:%s" % r[f[0]]), label_as=T('Phone number')), dict(fields=['mobile_number'], custom_format=lambda r, f: A(r[f[0]], _href="tel:%s" % r[f[0]]), label_as=T('Mobile number')), dict(fields=['id_wallet.balance'], custom_format=lambda r, f: '$ %s' % DQ(r[f[0]], True), label_as=T('Wallet balance')) ], options_func=client_options, selectable=False) return locals()
def index(): import supert Supert = supert.Supert() 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')) data = Supert.SUPERT(db.account_payable.is_settled == False, fields=['id_purchase', 'epd'], options_func=ar_options) return locals()
def index(): import supert Supert = supert.Supert() def offer_options(row): return supert.supert_default_options(row) + (supert.OPTION_BTN( 'local_offer', URL('fill', args=row.id), title=T("modify discounts")), ) title = T('offer groups') offers_query = (db.offer_group.is_active == True) if not auth.has_membership('Admin'): offers_query &= db.offer_group.id_store == session.store data = Supert.SUPERT(offers_query, fields=['name', 'starts_on', 'ends_on'], options_func=offer_options) return locals()
def index(): import supert Supert = supert.Supert() title = T('labels page layouts') data = Supert.SUPERT( db.labels_page_layout, fields=[ 'name', { 'fields': ['label_cols', 'label_rows'], 'label_as': T('Cols x Rows'), 'custom_format': lambda row, fields: '%s x %s' % (row[fields[0]], row[fields[1]]) } ], options_func=lambda row: supert.supert_default_options(row)[0], global_options=[]) return locals()
def index(): import supert Supert = supert.Supert() def options(row): return supert.OPTION_BTN('info', URL('get', args=row.id), title=T('details')) data = Supert.SUPERT( (db.product_loss.id_store == session.store), fields=[ 'id_store.name', 'created_on', { 'fields': ['created_by.first_name', 'created_by.last_name'], 'label_as': T('Created by') }, 'notes', 'id_reason.name' ], options_func=options, global_options=[]) 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 reasons = Supert.SUPERT((db.product_loss_reason.is_active == True), fields=['name'], options_func=reason_options) return locals()
def get(): """ inventory details args [ id_inventory ] """ import supert Supert = supert.Supert() inventory = db.inventory(request.args(0)) if not inventory.is_done: raise HTTP(405, T("Inventory is not done")) def physical_qty_format(row, f): diff = row.physical_qty - row.system_qty sgn = '-' if diff < 0 else '+' diff = B(' ( %s %s )' % (sgn, abs(diff))) if row.physical_qty == row.system_qty: return I(_class='status-circle accent-color'), SPAN(row[f[0]]), # lost items elif row.physical_qty < row.system_qty: return I(_class='status-circle bg-danger'), SPAN(row[f[0]]), diff, elif row.physical_qty > row.system_qty: return I(_class='status-circle bg-success'), SPAN(row[f[0]]), diff, data = Supert.SUPERT( db.inventory_item.id_inventory == inventory.id, fields=[ 'id_item.name', dict(fields=['id_item'], label_as=T('Barcode'), custom_format=lambda r, f: item_barcode(r[f[0]])), 'system_qty', dict(fields=['physical_qty'], label_as=T('Physical quantity'), custom_format=physical_qty_format) ], options_enabled=False, global_options=[]) return locals()
def index(): """ List of employees """ import supert Supert = supert.Supert() title = T('employees') 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 query = ( (db.auth_membership.user_id == db.auth_user.id) & (db.auth_membership.group_id == db.auth_group.id) & (db.auth_group.role == 'Employee') & (db.auth_membership.user_id != auth.user.id) ) if request.vars.show_hidden != 'yes': query &= db.auth_user.registration_key == '' data = Supert.SUPERT( query, [db.auth_user.ALL], select_args=dict(distinct=db.auth_user.id), fields=[ 'first_name', 'last_name', 'email' ], options_func=employee_options) return locals()
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 index(): import supert Supert = supert.Supert() 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')) title = T('stores') data = Supert.SUPERT(db.store, fields=[ 'name', { 'fields': ['id_address.street', 'id_address.exterior'], 'label_as': T('Address') } ], options_func=store_options) return locals()
def item_analysis(): """ args: [id_item] """ precheck() import supert Supert = supert.Supert() item = db.item(request.args(0)) if not item: session.info = T('Item not found') redirect(URL('default', 'index')) main_image = db(db.item_image.id_item == item.id).select().first() existence = 0 stocks = None if item.has_inventory: existence = item_stock_qty(item, id_store=session.store) stocks = stocks_table(item, Supert) def out_custom_format(row, fields): link = '' if row.sale.id: link = A('%s %s' % (T('Sale'), row.sale.consecutive), _href=URL('ticket', 'show_ticket', vars=dict(id_sale=row.sale.id)), _target='_blank') elif row.product_loss.id: link = A('%s %s' % (T('Product loss'), row.product_loss.id), _href=URL('product_loss', 'get', args=row.product_loss.id), _target='_blank') elif row.stock_transfer.id: link = A('%s %s' % (T('Stock transfer'), row.stock_transfer.id), _href=URL( 'ticket', 'show_ticket', vars=dict(id_stock_transfer=ow.stock_transfer.id)), _target='_blank') return link def created_on_format(row, fields): date = None if row.sale.id: date = row.sale.created_on elif row.product_loss.id: date = row.prodcut_loss.created_on elif row.stock_transfer.id: date = row.stock_transfer.created_on return date # since services do not have stocks the following table is only applied to items with inventory # every stock removal is stored in a stock_item_removal_record outputs_t = None if item.has_inventory: outputs_t = Supert.SUPERT( (db.bag_item.id_bag == db.bag.id) & (db.bag_item.id_item == item.id) & (db.bag.id_store == session.store) & (db.bag.is_delivered == True), select_fields=[ db.bag.ALL, db.bag_item.ALL, db.sale.ALL, db.product_loss.ALL, db.product_loss.ALL, db.stock_transfer.ALL ], select_args=dict(left=[ db.sale.on((db.bag.id == db.sale.id_bag)), db.product_loss.on(db.bag.id == db.product_loss.id_bag), db.stock_transfer.on(db.bag.id == db.stock_transfer.id_bag) ]), fields=[ dict(fields=[''], label_as=T('Concept'), custom_format=out_custom_format), dict(fields=['bag_item.quantity'], label_as=T('Quantity'), custom_format=lambda r, f: DQ(r[f[0]], True, True)), dict(fields=[''], label_as=T('Created on'), custom_format=created_on_format), dict(fields=['bag.created_by'], label_as=T('Created by'), custom_format=lambda r, f: "%s %s" % (r[f[0]].first_name, r[f[0]].last_name)) ], base_table_name='bag_item', title=T('Output'), searchable=False, options_enabled=False, global_options=[]) else: outputs_t = Supert.SUPERT( (db.bag_item.id_bag == db.bag.id) & (db.bag_item.id_item == item.id) & (db.bag.id_store == session.store), select_fields=[db.bag.ALL, db.sale.ALL, db.bag_item.ALL], select_args=dict(left=[db.sale.on(db.bag.id == db.sale.id_bag)]), fields=[ dict(fields=[''], label_as=T('Concept'), custom_format=lambda r, f: A( T('Sale') + ' %s' % r.sale.consecutive, _href=URL('ticket', 'show_ticket', vars=dict(id_sale=r.sale.id)), _target='_blank')), dict(fields=['bag_item.quantity'], label_as=T('Quantity'), custom_format=lambda r, f: DQ(r[f[0]], True, True)), 'bag.created_on', dict(fields=['bag.created_by'], label_as=T('Created by'), custom_format=lambda r, f: "%s %s" % (r[f[0]].first_name, r[f[0]].last_name)) ], base_table_name='bag_item', title=T('Output'), searchable=False, options_enabled=False, global_options=[]) out_inventories_t = Supert.SUPERT( (db.inventory_item.id_inventory == db.inventory.id) & (db.inventory_item.id_item == item.id) & (db.stock_item_removal.id_inventory_item == db.inventory_item.id) & (db.inventory.id_store == session.store), select_args=dict(distinct=db.inventory.id, orderby=~db.inventory.id), fields=[ dict(fields=[''], label_as=T('Inventory'), custom_format=lambda r, f: A( r.inventory.id, _href=URL('inventory', 'get', args=r.inventory.id), _target='_blank')), dict(fields=['stock_item_removal.qty'], label_as=T('Quantity'), custom_format=lambda r, f: DQ(r[f[0]], True, True)), 'inventory.created_on', dict(fields=['inventory.created_by'], label_as=T('Created by'), custom_format=lambda r, f: "%s %s" % (r[f[0]].first_name, r[f[0]].last_name)) ], base_table_name='stock_item_removal', title=T('Missing items'), searchable=False, options_enabled=False, global_options=[]) avg_days_in_shelf = get_wavg_days_in_shelf(item, session.store) return locals()
def ready(): """ args [order_id] """ import supert Supert = supert.Supert() order = db.sale_order(request.args(0)) if not order: raise HTTP(404) # check if the order items are in stock items = [] def ready_status_format(row, f, global_data): quantity = item_stock_qty(row.id_item, session.store) order_items_qty = get_ordered_items_count(order.id, row.id_item.id) item_ready = quantity >= (row.quantity + order_items_qty) global_data['is_ready'] &= item_ready if item_ready: return I(_class='status-circle bg-success'), SPAN(T('yes')), else: return I(_class='status-circle bg-danger'), SPAN(T('no')), global_data = {'is_ready': True} data = Supert.SUPERT(db.bag_item.id_bag == order.id_bag.id, fields=[ 'product_name', 'quantity', dict(fields=['id'], label_as=T('Ready'), custom_format=ready_status_format) ], options_enabled=False, global_data=global_data, global_options=[]) is_ready = global_data['is_ready'] buttons = [] if is_ready else [ A(T('Purchase order'), _class="btn btn-primary", _href=URL('purchase', 'create_from_order', args=order.id)) ] if not buttons and order.id_sale.id_client: form = SQLFORM.factory(submit_button=T('Notify buyer'), formstyle='bootstrap') elif order.is_for_defered_sale and is_ready: buttons = [ A(T('Go to sale'), _class="btn btn-primary", _href=URL('sale', 'update', args=order.id_sale.id)) ] form = SQLFORM.factory(buttons=buttons) else: form = SQLFORM.factory(buttons=buttons) if form.process(onvalidation=validate_ready).accepted: # notify the user mail.send( to=[order.id_client.email], subject='[%s] %s' % (COMPANY_NAME, T('Your order is ready')), message= T('Your order is ready and can be retrieved at the following store %s, be sure to bring your <a href="%s">order ticket</a> with you, since it will be required to verify the order' ) % (order.id_store.name, URL('bag', 'ticket', args=order.id_bag.id, scheme=True, host=True))) elif form.errors: response.flash = form.errors.default return locals()
def fill(): """ Used to add items to the specified purchase args: [purchase_id, current_stock_item] """ import supert Supert = supert.Supert() purchase = db.purchase(request.args(0)) valid_purchase(purchase) current_stock_item = db.stock_item(request.args(1)) if current_stock_item: current_stock_item = Storage(response_stock_item(current_stock_item)) if current_stock_item and current_stock_item.id_purchase != purchase.id: session.flash = T('Invalid stock item') current_stock_item == None buttons = [ A(T('Commit'), _class="btn btn-primary", _href=URL('commit', args=purchase.id)), A(T('Complete later'), _class="btn btn-default", _href=URL('save', args=purchase.id)), A(T('Cancel'), _class="btn btn-default", _href=URL('cancel', args=purchase.id)) ] form = SQLFORM(db.purchase, purchase.id, buttons=buttons, formstyle="bootstrap3_stacked", showid=False, _id="purchase_form") def stock_item_options(row): return supert.OPTION_BTN('edit', url=URL('fill', args=[purchase.id, row.id], vars=request.vars), title=T("modify")) stock_items_table = Supert.SUPERT( db.stock_item.id_purchase == purchase.id, fields=[ dict(fields=['id_item.name'], label_as=T('Name')), dict(fields=[ 'id_item', 'id_item.sku', 'id_item.ean', 'id_item.upc' ], custom_format=lambda r, f: item_barcode(r[f[0]]), label_as=T('Barcode')), dict(fields=['purchase_qty'], custom_format=lambda r, f: SPAN(DQ(r[f[0]], True, True), _id="s_item_%s_%s" % (r.id, f[0])), label_as=T('Quantity')), dict(fields=['price', 'taxes'], custom_format=lambda r, f: SPAN(DQ(r[f[0]] + r[f[1]], True), _id="s_item_%s_%s" % (r.id, f[0])), label_as=T('Buy Price')) ], options_func=stock_item_options, global_options=[]) return locals()
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()