DeliveryOrder: Übergabe in/out verbessert
authorSven Schöling <s.schoeling@googlemail.com>
Sun, 14 Nov 2021 23:28:25 +0000 (00:28 +0100)
committerJan Büren <jan@kivitendo.de>
Mon, 14 Feb 2022 14:02:19 +0000 (15:02 +0100)
SL/Controller/DeliveryOrder.pm
SL/Controller/DeliveryOrder/TypeData.pm
templates/webpages/delivery_order/tabs/basic_data.html

index 547e3e2..505f9de 100644 (file)
@@ -407,7 +407,7 @@ sub action_save_and_show_email_dialog {
                                   email_form  => $email_form,
                                   show_bcc    => $::auth->assert('email_bcc', 'may fail'),
                                   FILES       => \%files,
-                                  is_customer => $self->cv eq 'customer',
+                                  is_customer => $self->type_data->is_customer,
                                   ALL_EMPLOYEES => $self->{all_employees},
   );
 
@@ -1637,7 +1637,7 @@ sub pre_render {
                                                 } } @all_objects;
   }
 
-  $self->{template_args}{inout} = $self->type_data->properties('transfer');
+  $self->{template_args}{in_out} = $self->type_data->transfer;
 
   $self->get_item_cvpartnumber($_) for @{$self->order->items_sorted};
 
@@ -2007,7 +2007,7 @@ sub calculate_stock_in_out {
 
   return "" if !$item->part || !$item->part->unit || !$item->unit;
 
-  my $in_out   = $self->type_data->properties("transfer");
+  my $in_out   = $self->type_data->transfer;
 
   my $do_qty   = $item->qty;
   my $sum      = sum0 map {
index 5b7cfe9..8db84c4 100644 (file)
@@ -65,6 +65,10 @@ sub nr_key {
   get3($_[0]->c->type, "properties", "nr_key");
 }
 
+sub transfer {
+  get3($_[0]->c->type, "properties", "transfer");
+}
+
 sub part_classification_query {
   my ($self, $string) = @_;
   get($self->c->type, "part_classification_query");
index d3ff155..2848532 100644 (file)
                 [%- END -%]
                 <th id="qty_header_id"          class="listheading" nowrap width="5" ><a href='#' onClick='javascript:kivi.DeliveryOrder.reorder_items("qty")'>        [%- 'Qty'         | $T8 %]</a></th>
                 <th class="listheading" nowrap width="5" >[%- 'Unit'         | $T8 %] </th>
-                [% IF inout == 'in' %]
+                [% IF in_out == 'in' %]
                 <th class="listheading" nowrap width="5" >[%- 'Transfer To Stock' | $T8 %] </th>
                 [% END %]
-                [% IF inout == 'out' %]
+                [% IF in_out == 'out' %]
                 <th class="listheading" nowrap width="5" >[%- 'Release From Stock' | $T8 %] </th>
                 [% END %]
               </tr>