Add option to set all received items to zero

When an order could not be delivered, this option makes it easy to
set all amounts to zero with only one click.
This commit is contained in:
Patrick Gansterer 2021-02-08 01:07:59 +01:00
parent 26a91ec957
commit aad4fbd5b6
3 changed files with 13 additions and 1 deletions

View File

@ -41,6 +41,13 @@
$(document).on('touchclick', '#order_articles .unlocker', unlock_receive_input_field); $(document).on('touchclick', '#order_articles .unlocker', unlock_receive_input_field);
$(document).on('click', '#set_all_to_zero', function() {
$('tbody input').each(function(i, input) {
$(input).val(0);
update_delta(input);
});
})
$(function() { $(function() {
$('input[data-units-expected]').each(function() { $('input[data-units-expected]').each(function() {
update_delta(this); update_delta(this);
@ -97,7 +104,10 @@
= render :partial => 'edit_amount', :locals => {:order_article => order_article} = render :partial => 'edit_amount', :locals => {:order_article => order_article}
%tfoot %tfoot
%tr %tr
%th{:colspan => 10} %th{colspan: 6}
%select#add_article{:style => 'width: 500px;'} %select#add_article{:style => 'width: 500px;'}
- new_article_data.each do |option| - new_article_data.each do |option|
%option{id: "add_article_#{option[:id]}", value: option[:id]}= option[:text] %option{id: "add_article_#{option[:id]}", value: option[:id]}= option[:text]
%th{colspan: 4}
%button.btn#set_all_to_zero{type: :button}
= t '.set_all_to_zero'

View File

@ -1415,6 +1415,7 @@ de:
field_unlocked_title: Die Verteilung dieses Artikels auf die einzelnen Bestellgruppen wurde manuell angepasst. Wenn du die gelieferte Menge änderst, werden die vorherigen manuellen Änderungen überschrieben. field_unlocked_title: Die Verteilung dieses Artikels auf die einzelnen Bestellgruppen wurde manuell angepasst. Wenn du die gelieferte Menge änderst, werden die vorherigen manuellen Änderungen überschrieben.
edit_amounts: edit_amounts:
no_articles_available: Keine Artikel zum hinzufügen verfügbar no_articles_available: Keine Artikel zum hinzufügen verfügbar
set_all_to_zero: Alle auf Null setzen
fax: fax:
amount: Menge amount: Menge
articles: Artikel articles: Artikel

View File

@ -1428,6 +1428,7 @@ en:
field_unlocked_title: The distribution of this article among the ordergroups was changed manually. When you change the amount, those manual changes will be overwritten. field_unlocked_title: The distribution of this article among the ordergroups was changed manually. When you change the amount, those manual changes will be overwritten.
edit_amounts: edit_amounts:
no_articles_available: No articles to add. no_articles_available: No articles to add.
set_all_to_zero: Set all to zero
fax: fax:
amount: Amount amount: Amount
articles: Articles articles: Articles