]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Spalte »nicht gelieferte Menge« in Aufträgen optional anzeigen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 19 Feb 2015 16:16:57 +0000 (17:16 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Thu, 5 Mar 2015 12:42:59 +0000 (13:42 +0100)
SL/DB/MetaSetup/Default.pm
bin/mozilla/io.pl
locale/de/all
sql/Pg-upgrade2/defaults_sales_purchase_order_show_ship_missing_column.sql [new file with mode: 0644]
templates/webpages/client_config/_features.html

index bf9e89c277dcd15512085c112af2b0f2ceeabc6b..accab2995a10acea07f630159c9ddaf5033a6ff6 100644 (file)
@@ -84,6 +84,7 @@ __PACKAGE__->meta->columns(
   rmanumber                                 => { type => 'text' },
   sales_delivery_order_show_delete          => { type => 'boolean', default => 'true' },
   sales_order_show_delete                   => { type => 'boolean', default => 'true' },
+  sales_purchase_order_ship_missing_column  => { type => 'boolean', default => 'false' },
   sdonumber                                 => { type => 'text' },
   sepa_creditor_id                          => { type => 'text' },
   servicenumber                             => { type => 'text' },
index 1acd6a0d35ffd4c3dcf5d65be147f0a67f95bfc1..b2b6979d49770a12163fc450bfd32318ff691479 100644 (file)
@@ -139,6 +139,7 @@ sub display_row {
   my $is_quotation       = $form->{type} =~ /_quotation$/;
   my $is_invoice         = $form->{type} =~ /invoice/;
   my $is_s_p_order       = (first { $_ eq $form->{type} } qw(sales_order purchase_order));
+  my $show_ship_missing  = $is_s_p_order && $::instance_conf->get_sales_purchase_order_ship_missing_column;
 
   if ($is_delivery_order) {
     if ($form->{type} eq 'sales_delivery_order') {
@@ -159,6 +160,7 @@ sub display_row {
     {  id => 'partnumber',    width => 8,     value => $locale->text('Number'),               display => 1, },
     {  id => 'description',   width => 30,    value => $locale->text('Part Description'),     display => 1, },
     {  id => 'ship',          width => 5,     value => $locale->text('Delivered'),            display => $is_s_p_order, },
+    {  id => 'ship_missing',  width => 5,     value => $locale->text('Not delivered'),        display => $show_ship_missing, },
     {  id => 'qty',           width => 5,     value => $locale->text('Qty'),                  display => 1, },
     {  id => 'price_factor',  width => 5,     value => $locale->text('Price Factor'),         display => !$is_delivery_order, },
     {  id => 'unit',          width => 5,     value => $locale->text('Unit'),                 display => 1, },
@@ -200,7 +202,7 @@ sub display_row {
   my $deliverydate  = $locale->text('Required by');
 
   # special alignings
-  my %align  = map { $_ => 'right' } qw(qty ship right discount linetotal stock_in_out weight);
+  my %align  = map { $_ => 'right' } qw(qty ship right discount linetotal stock_in_out weight ship_missing);
   my %nowrap = map { $_ => 1 }       qw(description unit);
 
   $form->{marge_total}           = 0;
@@ -309,6 +311,11 @@ sub display_row {
       $ship_qty          /= ( $all_units->{$form->{"unit_$i"}}->{factor} || 1 );
 
       $column_data{ship}  = $form->format_amount(\%myconfig, $form->round_amount($ship_qty, 2) * 1) . ' ' . $form->{"unit_$i"};
+
+      my $ship_missing_qty    = $form->{"qty_$i"} - $ship_qty;
+      my $ship_missing_amount = $form->round_amount($ship_missing_qty * $form->{"sellprice_$i"} * (100 - $form->{"discount_$i"}) / 100 / $price_factor, 2);
+
+      $column_data{ship_missing} = $form->format_amount(\%myconfig, $ship_missing_qty) . ' ' . $form->{"unit_$i"} . '; ' . $form->format_amount(\%myconfig, $ship_missing_amount, $decimalplaces);
     }
 
     my $sellprice_value = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
@@ -2065,4 +2072,3 @@ sub _make_record {
 
   return $obj;
 }
-
index ffd4375a457edaf28dd30e26417e92c90c4c12d6..7128dd08e5f05a65d59074418ad88fcbb170b762 100755 (executable)
@@ -1278,6 +1278,7 @@ $self->{texts} = {
   'If disabled purchase invoices can only be created by conversion from existing requests for quotations, purchase orders and purchase delivery orders.' => 'Falls deaktiviert, so können Einkaufsrechnungen nur durch Umwandlung aus bestehenden Preisanfragen, Lieferantenaufträgen und Einkaufslieferscheinen angelegt werden.',
   'If disabled sales orders cannot be converted into sales invoices directly.' => 'Falls deaktiviert, so können Verkaufsaufträge nicht direkt in Verkaufsrechnungen umgewandelt werden.',
   'If disabled sales quotations cannot be converted into sales invoices directly.' => 'Falls deaktiviert, so können Verkaufsangebote nicht direkt in Verkaufsrechnungen umgewandelt werden.',
+  'If enabled a column will be shown in sales and purchase orders that lists both the amount and the value not shipped yet for each item.' => 'Falls eingeschaltet, wird für jede Position in Auftragsbestätigungen und Lieferantenaufträgen eine Spalte mit noch nicht gelieferter Menge und Wert angezeigt.',
   'If enabled only those projects that are assigned to the currently selected customer are offered for selection in sales records.' => 'Wenn eingeschaltet, so werden in Verkaufsbelegen nur diejenigen Projekte zur Auswahl angeboten, die dem aktuell ausgewählten Kunden zugewiesen wurden.',
   'If enabled purchase and sales records cannot be saved if no transaction description has been entered.' => 'Wenn angeschaltet, so können Einkaufs- und Verkaufsbelege nicht gespeichert werden, solange keine Vorgangsbezeichnung eingegeben wurde.',
   'If missing then the start date will be used.' => 'Falls es fehlt, so wird die erste Rechnung für das Startdatum erzeugt.',
@@ -2310,6 +2311,7 @@ $self->{texts} = {
   'Show the weights of articles and the total weight in orders, invoices and delivery notes?' => 'Sollen Warengewichte und Gesamtgewicht in Aufträgen, Rechnungen und Lieferscheinen angezeigt werden?',
   'Show weights'                => 'Gewichte anzeigen',
   'Show your TODO list after logging in' => 'Aufgabenliste nach dem Anmelden anzeigen',
+  'Show »not delivered qty/value« column in sales and purchase orders' => 'Spalte »Nicht gelieferte Menge/Wert« in Aufträgen anzeigen',
   'Signature'                   => 'Unterschrift',
   'Since bin is not enforced in the parts data, please specify a bin where goods without a specified bin will be put.' => 'Da Lagerpl&auml;tze kein Pflichtfeld sind, geben Sie bitte einen Lagerplatz an, in dem Waren ohne spezifizierten Lagerplatz eingelagert werden sollen.',
   'Single quotes'               => 'Einfache Anführungszeichen',
diff --git a/sql/Pg-upgrade2/defaults_sales_purchase_order_show_ship_missing_column.sql b/sql/Pg-upgrade2/defaults_sales_purchase_order_show_ship_missing_column.sql
new file mode 100644 (file)
index 0000000..afbac81
--- /dev/null
@@ -0,0 +1,7 @@
+-- @tag: defaults_sales_purchase_order_show_ship_missing_column
+-- @description: Mandantenkonfiguration: Optionale Spalte »Nicht gelieferte Menge« in Auftragsbestätigungen und Lieferantenaufträgen
+-- @depends: release_3_1_0
+
+ALTER TABLE defaults ADD COLUMN sales_purchase_order_ship_missing_column BOOLEAN;
+UPDATE defaults SET sales_purchase_order_ship_missing_column = FALSE;
+ALTER TABLE defaults ALTER COLUMN sales_purchase_order_ship_missing_column SET DEFAULT FALSE;
index f081ca261e245b96a7ae24bc841bf4c9b95fdfe3..14f6d10b1f3d0ac3284d6599b302ea4f2f3ae312 100644 (file)
    <td>[% LxERP.t8('If disabled purchase invoices can only be created by conversion from existing requests for quotations, purchase orders and purchase delivery orders.') %]</td>
   </tr>
 
+  <tr>
+   <td align="right">[% LxERP.t8("Show »not delivered qty/value« column in sales and purchase orders") %]</td>
+   <td>[% L.yes_no_tag("defaults.sales_purchase_order_ship_missing_column", SELF.defaults.sales_purchase_order_ship_missing_column) %]</td>
+   <td>[% LxERP.t8("If enabled a column will be shown in sales and purchase orders that lists both the amount and the value not shipped yet for each item.") %]</td>
+  </tr>
+
   <tr><td class="listheading" colspan="4">[% LxERP.t8("E-mail") %]</td></tr>
 
   <tr>