forked from svs/misfit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Siddharth
committed
Jul 20, 2011
1 parent
51120fe
commit 8994fe0
Showing
10 changed files
with
301 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,98 @@ | ||
= form_for(:loan, :class => "_remote_", :action => url(:controller => :loans, :action => :update_utilization, :id => @loan.id), :method => "POST") do | ||
%div.box | ||
%h3 Loan Utilization | ||
= select :loan_utilization_id, :collection => LoanUtilization.all.map{|lu| [lu.id, lu.name]}, :include_blank => true | ||
= submit "Save" | ||
|
||
- if @loan.status == :outstanding | ||
%div{:style => "float: left; width: 55%"} | ||
.box | ||
%hr | ||
%h3 Prepay this loan | ||
%p | ||
= link_to("Calculate prepayment amount", url(:prepay_loan, @loan.id), :class => "_remote_") | ||
%fieldset | ||
%legend Loan Utilization | ||
= form_for(:loan, :class => "_remote_", :action => url(:controller => :loans, :action => :update_utilization, :id => @loan.id), :method => "POST") do | ||
%h3 Update Loan Utilization | ||
= select :loan_utilization_id, :collection => LoanUtilization.all.map{|lu| [lu.id, lu.name]}, :include_blank => true | ||
= submit "Save" | ||
|
||
|
||
- if @loan.status == :outstanding | ||
.box | ||
%fieldset | ||
%legend Pay | ||
= link_to("Prepay This Loan", url(:prepay_loan, @loan.id), :class => "_remote_") | ||
|
||
- if [:admin, :mis_manager].include?(session.user.role) | ||
.box | ||
%fieldset | ||
%legend Levy Penalty/Fee | ||
= partial "applicable_fees/form", :layout => false, :object => @loan | ||
|
||
- if session.user.role==:admin | ||
.box | ||
%fieldset | ||
%legend Write Off Loan | ||
= form_for(@loan, :action => url(:action => :write_off, :id => @loan.id), :method => "POST", :class => "_disable_button_") do | ||
%table.tall.shaded | ||
%tr | ||
%th | ||
Write off Date : | ||
%td | ||
= date_select_for @loan, :written_off_on | ||
%tr | ||
%th | ||
Select Staff Member : | ||
%td | ||
- center = @client.center | ||
- branch = center.branch | ||
= select :written_off_by_staff_id, :id => "written_off_by_staff_id", :collection => [branch.manager, center.manager].uniq.map{|m| [m.id, m.name]}, :prompt => "select staff member" | ||
%tr | ||
%td{:colspan => "2"} | ||
%span.greytext | ||
Pick the staff member who is writing off the loan | ||
= submit "Write off" | ||
- elsif staff_member = session.user.staff_member | ||
= form_for(@loan, :action => url(:action => :suggest_write_off, :id => @loan.id), :method => "POST", :class => "_disable_button_") do | ||
%table | ||
%tr | ||
%td | ||
%b Suggest to Write Off this Loan | ||
%tr | ||
%td | ||
suggested write off Date : | ||
%td | ||
= date_select_for @loan, :suggested_written_off_on | ||
%tr | ||
%td | ||
Suggested by staff member : | ||
%td | ||
= staff_member.name | ||
%td | ||
%tr | ||
%td | ||
= submit "Send suggestion" | ||
|
||
- if [:admin, :mis_manager].include?(session.user.role) | ||
%hr | ||
.box | ||
= partial "applicable_fees/form", :layout => false, :object => @loan | ||
%hr | ||
%div{:style => "float: left; width: 40%"} | ||
.box | ||
%h3 Applicable fees | ||
- if @loan.applicable_fees.empty? | ||
= form_for(@loan, :action => url(:controller => :loans, :action => :levy_fees, :id => @loan.id)) do | ||
= submit 'Apply Fees' | ||
= partial "applicable_fees/list", :layout => false, :applicable_fees => @loan.applicable_fees, :return_url => url_for_loan(@loan) + "#misc" | ||
- if session.user.role==:admin | ||
%hr | ||
%fieldset | ||
%legend Applicable fees | ||
- if @loan.applicable_fees.empty? | ||
= form_for(@loan, :action => url(:controller => 'loans', :action => 'levy_fees', :id => @loan.id)) do | ||
= submit 'Apply Fees' | ||
= partial "applicable_fees/list", :layout => false, :applicable_fees => @loan.applicable_fees, :return_url => url_for_loan(@loan) + "#misc" | ||
.box | ||
%h3 Write Off Loan | ||
= form_for(@loan, :action => url(:action => :write_off, :id => @loan.id), :method => "POST", :class => "_disable_button_") do | ||
%table | ||
%fieldset | ||
%legend Values | ||
%table.tall | ||
%tr | ||
%th | ||
Branch | ||
%td | ||
Write off Date : | ||
%td | ||
= date_select_for @loan, :written_off_on | ||
= @loan.c_branch_id | ||
%tr | ||
%th | ||
Center | ||
%td | ||
Select Staff Member : | ||
= @loan.c_center_id | ||
%tr | ||
%th | ||
Scheduled Maturity Date | ||
%td | ||
- center = @client.center | ||
- branch = center.branch | ||
= select :written_off_by_staff_id, :id => "written_off_by_staff_id", :collection => [branch.manager, center.manager].uniq.map{|m| [m.id, m.name]}, :prompt => "select staff member" | ||
= @loan.c_scheduled_maturity_date | ||
%tr | ||
%td{:colspan => "2"} | ||
%span.greytext | ||
Pick the staff member who is writing off the loan | ||
%tr | ||
%td | ||
= submit "Write off" | ||
- elsif staff_member = session.user.staff_member | ||
= form_for(@loan, :action => url(:action => :suggest_write_off, :id => @loan.id), :method => "POST", :class => "_disable_button_") do | ||
%table | ||
%tr | ||
%td | ||
%b Suggest to Write Off this Loan | ||
%tr | ||
%td | ||
suggested write off Date : | ||
%td | ||
= date_select_for @loan, :suggested_written_off_on | ||
%tr | ||
%td | ||
Suggested by staff member : | ||
%td | ||
= staff_member.name | ||
%td | ||
%tr | ||
%td | ||
= submit "Send suggestion" | ||
|
||
%th | ||
Branch | ||
%td | ||
= @loan.c_branch_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.