Erweiterung Lieferplan
authorNiclas Zimmermann <niclas@lx-office-hosting.de>
Thu, 13 Sep 2012 14:39:08 +0000 (16:39 +0200)
committerNiclas Zimmermann <niclas@lx-office-hosting.de>
Thu, 13 Sep 2012 14:39:08 +0000 (16:39 +0200)
Im Lieferplan wird jetzt noch zusätzlich zu der Gesamtliefermenge
und der schon gelieferten Menge auch noch die Differenz (also die
Menge, die noch nicht geliefert wurde) angezeigt.

SL/Controller/DeliveryPlan.pm
locale/de/all

index 5ce462b..5937c5b 100644 (file)
@@ -26,19 +26,20 @@ __PACKAGE__->make_paginated(
 );
 
 __PACKAGE__->make_sorted(
-  MODEL       => 'OrderItem',
-  ONLY        => [ qw(list) ],
-
-  DEFAULT_BY  => 'reqdate',
-  DEFAULT_DIR => 1,
-
-  reqdate     => t8('Reqdate'),
-  description => t8('Description'),
-  partnumber  => t8('Part Number'),
-  qty         => t8('Qty'),
-  shipped_qty => t8('shipped'),
-  ordnumber   => t8('Order'),
-  customer    => t8('Customer'),
+  MODEL             => 'OrderItem',
+  ONLY              => [ qw(list) ],
+
+  DEFAULT_BY        => 'reqdate',
+  DEFAULT_DIR       => 1,
+
+  reqdate           => t8('Reqdate'),
+  description       => t8('Description'),
+  partnumber        => t8('Part Number'),
+  qty               => t8('Qty'),
+  shipped_qty       => t8('shipped'),
+  not_shipped_qty   => t8('not shipped'),
+  ordnumber         => t8('Order'),
+  customer          => t8('Customer'),
 );
 
 sub action_list {
@@ -131,21 +132,22 @@ sub prepare_report {
   my $report      = SL::ReportGenerator->new(\%::myconfig, $::form);
   $self->{report} = $report;
 
-  my @columns     = qw(reqdate customer ordnumber partnumber description qty shipped_qty);
+  my @columns     = qw(reqdate customer ordnumber partnumber description qty shipped_qty not_shipped_qty);
   my @sortable    = qw(reqdate customer ordnumber partnumber description                );
 
   my %column_defs = (
-    reqdate       => {      sub => sub { $_[0]->reqdate_as_date || $_[0]->order->reqdate_as_date                         } },
-    description   => {      sub => sub { $_[0]->description                                                              },
-                       obj_link => sub { $self->link_to($_[0]->part)                                                     } },
-    partnumber    => {      sub => sub { $_[0]->part->partnumber                                                         },
-                       obj_link => sub { $self->link_to($_[0]->part)                                                     } },
-    qty           => {      sub => sub { $_[0]->qty_as_number . ' ' . $_[0]->unit                                        } },
-    shipped_qty   => {      sub => sub { $::form->format_amount(\%::myconfig, $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit } },
-    ordnumber     => {      sub => sub { $_[0]->order->ordnumber                                                         },
-                       obj_link => sub { $self->link_to($_[0]->order)                                                    } },
-    customer      => {      sub => sub { $_[0]->order->customer->name                                                    },
-                       obj_link => sub { $self->link_to($_[0]->order->customer)                                          } },
+    reqdate           => {      sub => sub { $_[0]->reqdate_as_date || $_[0]->order->reqdate_as_date                         } },
+    description       => {      sub => sub { $_[0]->description                                                              },
+                            obj_link => sub { $self->link_to($_[0]->part)                                                     } },
+    partnumber        => {      sub => sub { $_[0]->part->partnumber                                                         },
+                            obj_link => sub { $self->link_to($_[0]->part)                                                     } },
+    qty               => {      sub => sub { $_[0]->qty_as_number . ' ' . $_[0]->unit                                        } },
+    shipped_qty       => {      sub => sub { $::form->format_amount(\%::myconfig, $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit } },
+    not_shipped_qty   => {      sub => sub { $::form->format_amount(\%::myconfig, $_[0]->qty - $_[0]->shipped_qty, 2) . ' ' . $_[0]->unit } },
+    ordnumber         => {      sub => sub { $_[0]->order->ordnumber                                                         },
+                            obj_link => sub { $self->link_to($_[0]->order)                                                    } },
+    customer          => {      sub => sub { $_[0]->order->customer->name                                                    },
+                            obj_link => sub { $self->link_to($_[0]->order->customer)                                          } },
   );
 
   map { $column_defs{$_}->{text} = $::locale->text( $self->get_sort_spec->{$_}->{title} ) } keys %column_defs;
index 5740fd0..9fbd29b 100644 (file)
@@ -2336,6 +2336,7 @@ $self->{texts} = {
   'not logged in'               => 'nicht eingeloggt',
   'not running'                 => 'läuft nicht',
   'not set'                     => 'nicht gesetzt',
+  'not shipped'                 => 'nicht geliefert',
   'not transferred in yet'      => 'noch nicht eingelagert',
   'not transferred out yet'     => 'noch nicht ausgelagert',
   'not yet executed'            => 'Noch nicht ausgeführt',