$::request->layout->focus('#part_id_name');
my $transfer_types = WH->retrieve_transfer_types('in');
map { $_->{description} = $main::locale->text($_->{description}) } @{ $transfer_types };
+ $self->setup_stock_in_action_bar;
$self->render('inventory/warehouse_selection_stock', title => $::form->{title}, TRANSFER_TYPES => $transfer_types );
}
'bins' => 'BINS', });
$::request->layout->use_javascript("${_}.js") for qw(kivi.PartsWarehouse);
+ $self->setup_stock_usage_action_bar;
$self->render('inventory/warehouse_usage',
title => $::form->{title},
year => DateTime->today->year,
$report->set_options('raw_bottom_info_text' => $self->render('inventory/report_bottom', { output => 0 }) );
}
- $report->generate_with_headers();
+ $report->generate_with_headers(action_bar => 1);
$main::lxdebug->leave_sub();
$::form->show_generic_error($msg);
}
+sub setup_stock_in_action_bar {
+ my ($self, %params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Stock'),
+ submit => [ '#form', { action => 'Inventory/stock' } ],
+ checks => [ 'check_part_selection_before_stocking' ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_stock_usage_action_bar {
+ my ($self, %params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Show'),
+ submit => [ '#form', { action => 'Inventory/usage' } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
1;
__END__
only for C<action_stock_usage> and C<action_usage>:
-Martin Helmling E<lt>martin.helmling@opendynamic.deE<gt>
+pMartin Helmling E<lt>martin.helmling@opendynamic.deE<gt>
=cut
-
"Map":"Karte",
"More than one file selected, please set only one checkbox!":"Mehr als ein Element selektiert, bitte nur eine Box anklicken",
"No":"Nein",
+"No article has been selected yet.":"Es wurde noch kein Artikel ausgewählt.",
"No delievery orders selected, please set one checkbox!":"Kein Lieferschein selektiert, bitte eine Box anklicken!",
"No delivery orders have been selected.":"Es wurden keine Lieferscheine ausgewählt.",
"No entries have been selected.":"Es wurden keine Einträge ausgewählt.",
'No Journal' => 'Kein Journal',
'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein Händler gefunden',
'No action defined.' => 'Keine Aktion definiert.',
+ 'No article has been selected yet.' => 'Es wurde noch kein Artikel ausgewählt.',
'No articles have been added yet.' => 'Es wurden noch keine Artikel hinzugefügt.',
'No background job has been created yet.' => 'Es wurden noch keine Hintergrund-Jobs angelegt.',
'No bank account chosen!' => 'Kein Bankkonto ausgewählt!',
[%- INCLUDE 'common/flash.html' %]
-<form name="Form" method="post" action="controller.pl">
+<form name="Form" method="post" action="controller.pl" id="form">
<table>
<tr>
<td>[% L.input_tag('comment', FORM.comment, size=60) %]</td>
</tr>
</table>
-
- <input type="hidden" name="action" value="Inventory/dispatch">
- <input type="submit" id='action_stock' class="submit" name="action_stock" value="[% 'Stock' | $T8 %]" [% IF !SELF.part.id %]disabled[% END %]>
</form>
<div id='stock'>
function reload_bin_selection () {
$.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
}
+function check_part_selection_before_stocking() {
+ if ($('#part_id').val() !== '')
+ return true;
+
+ alert(kivi.t8('No article has been selected yet.'));
+ return false;
+}
$(function(){
$('#part_id').change(reload_warehouse_selection);
- $('#part_id').change(function(){
- if ($('#part_id').val() > 0)
- $('#action_stock').removeAttr('disabled');
- else
- $('#action_stock').attr('disabled', 'disabled');
- });
$('#warehouse_id').change(reload_bin_selection);
})
</script>
[%- INCLUDE 'common/flash.html' %]
-<form name="Form" method="post" action="controller.pl">
+<form name="Form" method="post" action="controller.pl" id="form">
<table border="0">
<tr>
</tr>
</table>
</p>
-
- <p>
- <input type="hidden" name="action" value="Inventory/dispatch">
- <input type="submit" id="action_usage" class="submit" name="action_usage" value="[% 'Continue' | $T8 %]">
- </p>
</form>