Gewicht im Einkauf/Verkauf
authorNiclas Zimmermann <niclas@kivitendo-premium.de>
Thu, 23 May 2013 14:47:46 +0000 (16:47 +0200)
committerNiclas Zimmermann <niclas@kivitendo-premium.de>
Thu, 23 May 2013 14:47:46 +0000 (16:47 +0200)
Gewicht wird nun sowohl im Einkauf als im Verkauf in allen Masken
angezeigt. Die Variablen stehen auch im Druck zur Verfügung.

bin/mozilla/io.pl
locale/de/all
templates/webpages/do/form_footer.html
templates/webpages/ir/form_footer.html
templates/webpages/is/form_footer.html
templates/webpages/oe/form_footer.html

index ca3d050..a024cd8 100644 (file)
@@ -209,6 +209,8 @@ sub display_row {
 
   my $totalweight = 0;
   my $defaults = AM->get_defaults();
+
+  $form->{weightunit} = $defaults->{weightunit};
   # rows
 
   my @ROWS;
@@ -232,7 +234,6 @@ sub display_row {
     if ((!$form->{"prices_$i"}) || ($form->{"new_pricegroup_$i"} == $form->{"old_pricegroup_$i"})) {
         $form->{"sellprice_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"unit_old_$i"}, $all_units) || 1;
         $form->{"lastcost_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"unit_old_$i"}, $all_units) || 1;
-        $form->{"weight_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"unit_old_$i"}, $all_units) || 1;
         $form->{"unit_old_$i"}   = $form->{"selected_unit_$i"};
     }
     my $this_unit = $form->{"unit_$i"};
@@ -251,6 +252,7 @@ sub display_row {
     } else {
       $column_data{price_factor} = '&nbsp;';
     }
+    $form->{"weight_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"partunit_$i"}, $all_units) || 1;
 
     $column_data{"unit"} = AM->unit_select_html($all_units, "unit_$i", $this_unit, $form->{"id_$i"} ? $form->{"unit_$i"} : undef);
 # / unit ending
@@ -331,6 +333,8 @@ sub display_row {
     $column_data{bin}         = $form->{"bin_$i"};
 
     $column_data{weight}      = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit};
+    #To add the hidden variable lineweight:
+    $form->{"lineweight_$i"}       = $column_data{weight};
 
     if ($is_delivery_order) {
       $column_data{stock_in_out} =  calculate_stock_in_out($i);
@@ -426,7 +430,7 @@ sub display_row {
           map { ($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } map { $_."_$i" }
             (qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes
                 income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber
-                longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars)
+                longdescription basefactor marge_absolut marge_percent marge_price_factor weight lineweight), @hidden_vars)
     );
 
     map { $form->{"${_}_base"} += $linetotal } (split(/ /, $form->{"taxaccounts_$i"}));
index 3b82861..ce0bf65 100755 (executable)
@@ -2165,6 +2165,7 @@ $self->{texts} = {
   'Total Fees'                  => 'Kumulierte Gebühren',
   'Total stock value'           => 'Gesamter Bestandswert',
   'Total sum'                   => 'Gesamtsumme',
+  'Total weight'                => 'Gesamtgewicht',
   'Totals'                      => 'Summen',
   'Trade Discount'              => 'Rabatt',
   'Trans Id'                    => 'Trans-ID',
index 78ad35a..6be2268 100644 (file)
 
      </td>
     </tr>
+  <tr>
+    <td>
+      <table width="100%">
+        <tr valign="bottom">
+          <td align="right">
+            <table>
+            <tr>
+              <th  align="left">[% 'Total weight' | $T8 %]</th>
+              <td align="right">
+                [% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
+                <input type="hidden" name="totalweight" value="[% HTML.escape(totalweight) %]">
+              </td>
+            </tr>
+            </table>
+          </td>
+        </tr>
+      </table>
+    </td>
    </table>
   </p>
 
index 8538fd4..83ab34a 100644 (file)
 [%- END %]
        </table>
       </td>
+      <td>
+       <table>
+        <tr>
+         <th  align=left>[% 'Total weight' | $T8 %]</th>
+         <td>
+          [% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
+          <input type=hidden name="totalweight" value="[% totalweight %]">
+          <input type=hidden name="weightunit" value="[% HTML.escape(weightunit) %]">
+         </td>
+        </tr>
+       </table>
+      </td>
       <td align="right">
   [%- IF taxaccounts %]
        <input name="taxincluded" class="checkbox" type="checkbox" [% IF taxincluded %]checked[% END %]>
index f40dc27..f389e84 100644 (file)
@@ -49,7 +49,8 @@
          <th  align=left>[% 'Total weight' | $T8 %]</th>
          <td>
           [% LxERP.format_amount(totalweight) %] [% HTML.escape(weightunit) %]
-          <input type=hidden name="totalweight" value="[% marge_total %]">
+          <input type=hidden name="totalweight" value="[% totalweight %]">
+          <input type=hidden name="weightunit" value="[% HTML.escape(weightunit) %]">
          </td>
         </tr>
        </table>
index c9078ef..24e9f25 100644 (file)
       [%- END %]
       </table>
           </td>
+          <td>
+            <table>
+            <tr>
+              <th  align="left">[% 'Total weight' | $T8 %]</th>
+              <td align="right">
+                [% LxERP.format_amount(totalweight, 3) %] [% HTML.escape(weightunit) %]
+                <input type=hidden name="totalweight" value="[% totalweight %]">
+                <input type="hidden" name="weightunit" value="[% HTML.escape(weightunit) %]">
+              </td>
+            </tr>
+            </table>
+          </td>
 [%- IF is_sales %]
           <td>
             <table>