-
-
Save javier/1134304 to your computer and use it in GitHub Desktop.
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
... | |
<td class="Text13Grey numeric"> | |
<span id="invoice_paid_status_<%= invoice.url_id %>"> <%= partial_payment_in_redbox(invoice) %></span> | |
</td> | |
... |
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
<div id="redbox-for-partial-payment" class="redbox_contents" style="display: none; width: 300px;"> | |
<div style="padding: 10px"> | |
<div id="total_payment"> | |
<table width="100%" border="0" cellspacing="10" cellpadding="0"> | |
<colgroup> | |
<col width="50%" /> | |
<col width="50%" /> | |
</colgroup> | |
<tr> | |
<td class="CellTablebuttonL"> | |
<%= button_to_function t('.full_payment'), :class=> "button", :id => "full-payment", :onclick => "fullPayment();"%> | |
</td> | |
<td> | |
<%= button_to_function t('.partial_payment'), :class=> "button", :id => "partial-payment", :onclick => "partialPayment();" %> | |
</td> | |
</tr> | |
</table> | |
</div> | |
<div id="partial_payment_form" style="display: none;"> | |
<div> | |
<% remote_form_for invoice_partial_payments_path([invoice, PartialPayment.new]) do |f| %> | |
<%= f.text_field :amount, :maxlength => 13, :size => 13, :class => "amount" %> | |
<% end %> | |
</div> | |
<table width="100%" border="0" cellspacing="10" cellpadding="0"> | |
<colgroup> | |
<col width="50%" /> | |
<col width="50%" /> | |
</colgroup> | |
<tr> | |
<td class="CellTablebuttonL"> | |
<%= button_to_function t ('.cancel'), "RedBox.close()", :class => 'button' %> | |
</td> | |
<td class="CellTablebuttonR" align="right"> | |
<%= submit_tag t('.accept'), :class => 'button' %> | |
</td> | |
</tr> | |
</table> | |
</div> | |
</div> | |
</div> |
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
... | |
def partial_payment_in_redbox (invoice) | |
pending = invoice.total-invoice.total_paid | |
if pending > 0 | |
html = render(:partial => 'invoices/redbox/partial_payment', :locals => {:invoice => invoice }) | |
html << link_to_redbox (format_money_as_decimal (pending), 'redbox-for-partial-payment', :class => "Text13Orange") | |
html | |
else | |
html = format_money_as_decimal (0) | |
end | |
end | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment