@treeio_login_required
@handle_response_format
def receivable_delete(request, receivable_id, response_format='html'):
 receivable = get_object_or_404(Liability, pk=receivable_id)
 if (not request.user.profile.has_permission(receivable, mode='w')):
  return user_denied(request, "You don't have access to this Receivable", response_format)
 if request.POST:
  if ('delete' in request.POST):
   if ('trash' in request.POST):
    receivable.trash = True
    receivable.save()
   else:
    receivable.delete()
   return HttpResponseRedirect(reverse('finance_index_receivables'))
  elif ('cancel' in request.POST):
   return HttpResponseRedirect(reverse('finance_receivable_view', args=[receivable.id]))
 return render_to_response('finance/receivable_delete', {'liability': receivable}, context_instance=RequestContext(request), response_format=response_format)

@ treeio_login_required @ handle_response_format def receivable_delete ( request , receivable_id , response_format = 'html' ) : receivable = get_object_or_404 ( Liability , pk = receivable_id ) if ( not request . user . profile . has_permission ( receivable , mode = 'w' ) ) : return user_denied ( request , "You don't have access to this Receivable" , response_format ) if request . POST : if ( 'delete' in request . POST ) : if ( 'trash' in request . POST ) : receivable . trash = True receivable . save ( ) else : receivable . delete ( ) return HttpResponseRedirect ( reverse ( 'finance_index_receivables' ) ) elif ( 'cancel' in request . POST ) : return HttpResponseRedirect ( reverse ( 'finance_receivable_view' , args = [ receivable . id ] ) ) return render_to_response ( 'finance/receivable_delete' , { 'liability' : receivable } , context_instance = RequestContext ( request ) , response_format = response_format )
receivable delete .