Fixed bug in stock orders (orderfooter commit).
This commit is contained in:
parent
55d2976e98
commit
94d1a897e7
3 changed files with 49 additions and 71 deletions
25
app/views/ordering/_order_footer.html.erb
Normal file
25
app/views/ordering/_order_footer.html.erb
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
<div id="order-footer">
|
||||||
|
<div id="info-box">
|
||||||
|
</div>
|
||||||
|
<div id="total-sum">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Gesamtbetrag:</td>
|
||||||
|
<td class="currency"><span id="total_price"><%= total %></span> €</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Verfügbares Guthaben:</td>
|
||||||
|
<td class="currency"><%= number_to_currency(@availableFunds) %></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Neuer Kontostand:</td>
|
||||||
|
<td class="currency"><strong><span id="new_balance"><%= @ordergroup.account_balance - total %></span> €</strong></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div id="order-button">
|
||||||
|
<%= submit_tag( "Bestellung speichern", :id => 'submit_button' ) %></span> oder <%= link_to "abbrechen", :controller => 'ordering' %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" id="total_balance" name="total_balance" value="<%= @ordergroup.account_balance - total %>"/>
|
||||||
|
<input type="hidden" name="version" value="<%= @version %>"/>
|
|
@ -91,31 +91,7 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="order-footer">
|
<%= render "order_footer", :total => total %>
|
||||||
<div id="info-box">
|
|
||||||
</div>
|
|
||||||
<div id="total-sum">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>Gesamtbetrag:</td>
|
|
||||||
<td class="currency"><span id="total_price"><%= total %></span> €</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Verfügbares Guthaben:</td>
|
|
||||||
<td class="currency"><%= number_to_currency(@availableFunds) %></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>Neuer Kontostand:</td>
|
|
||||||
<td class="currency"><strong><span id="new_balance"><%= @ordergroup.account_balance - total %></span> €</strong></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<div id="order-button">
|
|
||||||
<%= submit_tag( "Bestellung speichern", :id => 'submit_button' ) %></span> oder <%= link_to "abbrechen", :controller => 'ordering' %>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input type="hidden" id="total_balance" name="total_balance" value="<%= @ordergroup.account_balance - total %>"/>
|
|
||||||
<input type="hidden" name="version" value="<%= @version %>"/>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -10,12 +10,11 @@
|
||||||
%tr
|
%tr
|
||||||
%th Name
|
%th Name
|
||||||
%th
|
%th
|
||||||
%th Herstellerin
|
|
||||||
%th Lieferantin
|
%th Lieferantin
|
||||||
%th{:style => "width:5em;"} Einheit
|
%th{:style => "width:5em;"} Einheit
|
||||||
%th{:style => "width:4.5em;"} Preis
|
%th{:style => "width:4.5em;"} Preis
|
||||||
%th Verfügbar
|
%th(style="width:20px") Verfügbar
|
||||||
%th#col_required Menge
|
%th#col_required(style="width:110px") Menge
|
||||||
%th Summe
|
%th Summe
|
||||||
%tbody
|
%tbody
|
||||||
- total = 0
|
- total = 0
|
||||||
|
@ -28,13 +27,9 @@
|
||||||
- for order_article in order_articles
|
- for order_article in order_articles
|
||||||
- article_total = @price[i] * @quantity[i]
|
- article_total = @price[i] * @quantity[i]
|
||||||
- total += article_total
|
- total += article_total
|
||||||
%tr{:class => cycle('even', 'odd', :name => 'articles'), :valign => "top"}
|
%tr{:class => cycle('even', 'odd', :name => 'articles')+' order-article', :valign => "top"}
|
||||||
%td.name
|
%td.name= order_article.article.name
|
||||||
= order_article.article.name
|
|
||||||
- unless order_article.article.note.blank?
|
|
||||||
= image_tag "lamp_grey.png", {:alt => _("Show note"), :size => "15x16", :border => "0", :onmouseover => "$('note_#{i}').show();", :onmouseout => "$('note_#{i}').hide();" }
|
|
||||||
%td=h order_article.article.origin
|
%td=h order_article.article.origin
|
||||||
%td=h truncate order_article.article.manufacturer, :length => 11
|
|
||||||
%td=h truncate order_article.article.supplier.name, :length => 11
|
%td=h truncate order_article.article.supplier.name, :length => 11
|
||||||
%td=h order_article.article.unit
|
%td=h order_article.article.unit
|
||||||
%td= number_to_currency @price[i]
|
%td= number_to_currency @price[i]
|
||||||
|
@ -42,50 +37,32 @@
|
||||||
%td{:style => "text-align:right;"}
|
%td{:style => "text-align:right;"}
|
||||||
= hidden_field_tag "ordered[#{order_article.id}][quantity]", @quantity[i], :id => "q_#{i}", :size => "2"
|
= hidden_field_tag "ordered[#{order_article.id}][quantity]", @quantity[i], :id => "q_#{i}", :size => "2"
|
||||||
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
|
%span.used{:id => "q_used_#{i}"}= @used_quantity[i]
|
||||||
%span.total= "(<span id='q_total_#{i}'>#{@quantity[i] + @others_quantity[i]}</span>)"
|
|
||||||
= button_to_function('+', "increaseStockQuantity(#{i})")
|
= button_to_function('+', "increaseStockQuantity(#{i})")
|
||||||
= button_to_function('-', "decreaseStockQuantity(#{i})")
|
= button_to_function('-', "decreaseStockQuantity(#{i})")
|
||||||
|
|
||||||
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
|
%td{:id => "td_price_#{i}", :style => "text-align:right; padding-right:10px; width:4em"}
|
||||||
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
|
%span{:id => "price_#{i}_display"}= number_to_currency(article_total, :unit => "")
|
||||||
€
|
€
|
||||||
- unless order_article.article.note.blank?
|
.article-info
|
||||||
%tr.note{:id => "note_#{i}", :style => "display:none"}
|
%h3= order_article.article.name
|
||||||
%td{:colspan => "10"}
|
.right
|
||||||
=h order_article.article.note
|
Gesamt-Einheiten:
|
||||||
|
|
%span{:id => "q_total_#{i}"}= @quantity[i] + @others_quantity[i]
|
||||||
=h order_article.article.manufacturer
|
%br/
|
||||||
|
.left
|
||||||
|
Hersteller:
|
||||||
|
= order_article.article.manufacturer
|
||||||
|
%br/
|
||||||
|
Gebinde:
|
||||||
|
= order_article.article.quantity_available
|
||||||
|
*
|
||||||
|
= order_article.article.unit
|
||||||
|
%br/
|
||||||
|
Notiz:
|
||||||
|
= order_article.article.note
|
||||||
|
%br/
|
||||||
- i = i + 1
|
- i = i + 1
|
||||||
%tfoot
|
= render "order_footer", :total => total
|
||||||
%tr
|
|
||||||
%td{:colspan => "5"}
|
|
||||||
%td.currency{:colspan => "3"}
|
|
||||||
Gesamtbetrag:
|
|
||||||
%span#total_price= total
|
|
||||||
€
|
|
||||||
%tr
|
|
||||||
%td{:colspan => "5"}
|
|
||||||
%td.currency{:colspan => "3"}
|
|
||||||
Verfügbares Guthaben:
|
|
||||||
= number_to_currency @availableFunds
|
|
||||||
%tr
|
|
||||||
%td{:colspan => "5"}
|
|
||||||
%td.currency{:colspan => "3"}
|
|
||||||
Neuer Kontostand:
|
|
||||||
%strong
|
|
||||||
%span#new_balance= @ordergroup.account_balance - total
|
|
||||||
€
|
|
||||||
%tr
|
|
||||||
%td{:style => "text-align:left;"}= link_to_top
|
|
||||||
%td{:colspan => "4"}
|
|
||||||
%td{:colspan => "3", :style => "text-align:right;"}
|
|
||||||
%span{:style => "font-size:1.2em"}= submit_tag("Bestellung speichern", :id => 'submit_button' )
|
|
||||||
|
|
|
||||||
= link_to "Abbrechen", :controller => 'ordering'
|
|
||||||
|
|
||||||
= hidden_field_tag "total_balance", @ordergroup.account_balance - total, :id => "total_balance"
|
|
||||||
= hidden_field_tag "version", @version
|
|
||||||
|
|
||||||
%script{:type => "text/" + "javascript"}
|
%script{:type => "text/" + "javascript"}
|
||||||
// preset data
|
// preset data
|
||||||
|
|
Loading…
Add table
Reference in a new issue