]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorG. Richardson <information@lx-office-hosting.de>
Mon, 9 Jan 2012 17:34:47 +0000 (18:34 +0100)
committerG. Richardson <information@lx-office-hosting.de>
Mon, 9 Jan 2012 17:34:47 +0000 (18:34 +0100)
bin/mozilla/dn.pl
bin/mozilla/do.pl
js/checkbox_utils.js [deleted file]
locale/de/all
templates/webpages/do/form_footer.html
templates/webpages/do/set_stock_in_out.html
templates/webpages/dunning/show_invoices.html

index 132286fbd6293227acb16c625b3ce4837457fd9d..6c3492b983ed66260d4a624c69aa36d67a31f901 100644 (file)
@@ -368,7 +368,7 @@ sub show_dunning {
                                duedate amount dunning_date dunning_duedate fee interest salesman));
   $report->set_sort_indicator($form->{sort}, $form->{sortdir});
 
-  my $edit_url  = build_std_url('script=is.pl', 'action=edit', 'callback') . '&id=';
+  my $edit_url  = sub { build_std_url('script=' . ($_[0]->{invoice} ? 'is' : 'ar') . '.pl', 'action=edit', 'callback') . '&id=' . $::form->escape($_[0]->{id}) };
   my $print_url = build_std_url('action=print_dunning', 'format=pdf', 'media=screen') . '&dunning_id=';
   my $sort_url  = build_std_url('action=show_dunning', grep { $form->{$_} } @filter_field_list);
 
@@ -403,8 +403,9 @@ sub show_dunning {
 
         'align' => $alignment{$column},
 
-        'link'  => ($column eq 'invnumber'           ? $edit_url  . E($ref->{id})         :
-                    $column eq 'dunning_description' ? $print_url . E($ref->{dunning_id}) : ''),
+        'link'  => (  $column eq 'invnumber'           ? $edit_url->($ref)
+                    : $column eq 'dunning_description' ? $print_url . E($ref->{dunning_id})
+                    :                                    ''),
       };
     }
 
index 7924b05a21c5d52c433423c447503d6aaef2ed88..cc04f5789336cf30678594d476e0ba46019ba3f2 100644 (file)
@@ -984,14 +984,16 @@ sub calculate_stock_in_out {
   my $in_out   = $form->{type} =~ /^sales/ ? 'out' : 'in';
   my $sinfo    = DO->unpack_stock_information('packed' => $form->{"stock_${in_out}_${i}"});
 
+  my $do_qty   = AM->sum_with_unit($::form->{"qty_$i"}, $::form->{"unit_$i"});
   my $sum      = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $sinfo });
+  my $matches  = $do_qty == $sum;
 
   my $content  = $form->format_amount_units('amount'      => $sum * 1,
                                             'part_unit'   => $form->{"partunit_$i"},
                                             'amount_unit' => $all_units->{$form->{"partunit_$i"}}->{base_unit},
                                             'conv_units'  => 'convertible_not_smaller',
                                             'max_places'  => 2);
-  $content     = qq|<span id="stock_in_out_qty_display_${i}">${content}</span> <input type="button" onclick="open_stock_in_out_window('${in_out}', $i);" value="?">|;
+  $content     = qq|<span id="stock_in_out_qty_display_${i}">${content}</span><input type=hidden id='stock_in_out_qty_matches_$i' value='$matches'> <input type="button" onclick="open_stock_in_out_window('${in_out}', $i);" value="?">|;
 
   $main::lxdebug->leave_sub();
 
@@ -1146,8 +1148,13 @@ sub set_stock_in {
 
   _stock_in_out_set_qty_display($stock_info);
 
+  my $do_qty       = AM->sum_with_unit($::form->parse_amount(\%::myconfig, $::form->{do_qty}), $::form->{do_unit});
+  my $transfer_qty = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info });
+
   $form->header();
-  print $form->parse_html_template('do/set_stock_in_out');
+  print $form->parse_html_template('do/set_stock_in_out', {
+    qty_matches => $do_qty == $transfer_qty,
+  });
 
   $main::lxdebug->leave_sub();
 }
@@ -1241,8 +1248,13 @@ sub set_stock_out {
   } else {
     _stock_in_out_set_qty_display($stock_info);
 
+    my $do_qty       = AM->sum_with_unit($::form->parse_amount(\%::myconfig, $::form->{do_qty}), $::form->{do_unit});
+    my $transfer_qty = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info });
+
     $form->header();
-    print $form->parse_html_template('do/set_stock_in_out');
+    print $form->parse_html_template('do/set_stock_in_out', {
+      qty_matches => $do_qty == $transfer_qty,
+    });
   }
 
   $main::lxdebug->leave_sub();
diff --git a/js/checkbox_utils.js b/js/checkbox_utils.js
deleted file mode 100644 (file)
index b5d4e61..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-function checkbox_check_all(cb_name, prefix, start, end) {
-  var i;
-
-  var control = document.getElementsByName(cb_name)[0];
-  if (!control)
-    return;
-
-  var checked = control.checked;
-
-  for (i = start; i <= end; i++) {
-    control = document.getElementsByName(prefix + i)[0];
-    if (control)
-      control.checked = checked;
-  }
-}
index 971c2ac4ca33c0e3b6bf80edff6e5352788b0e78..db410c7580721c14ba8528e43ce7570b565addd2 100644 (file)
@@ -1878,6 +1878,7 @@ $self->{texts} = {
   'There are no items in stock.' => 'Dieser Artikel ist nicht eingelagert.',
   'There are no items on your TODO list at the moment.' => 'Ihre Aufgabenliste enth&auml;lt momentan keine Eintr&auml;ge.',
   'There are still entries in the database for which no unit has been assigned.' => 'Es gibt noch Eintr&auml;ge in der Datenbank, f&uuml;r die keine Einheit zugeordnet ist.',
+  'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' => 'Einige der Lagerbewegungen sind nicht vollständig und Lagerbewegungen können nachträglich nicht mehr verändert werden. Wollen Sie wirklich fortfahren?',
   'There are usually three ways to install Perl modules.' => 'Es gibt normalerweise drei Arten, ein Perlmodul zu installieren.',
   'There is at least one sales or purchase invoice for which Lx-Office recorded an inventory transaction with taxkeys even though no tax was recorded.' => 'Es gibt mindestens eine Einkaufs- oder Verkaufsrechnung, für die Lx-Office einen Steuerschlüssel ungleich 0 verzeichnet hat, obwohl für Warenbestandsbuchugen bei Rechnungen nie Steuern gebucht werden.',
   'There is at least one transaction for which the user has chosen a logically wrong taxkey.' => 'Es gibt mindestens eine Buchung, bei der ein logisch nicht passender Steuerschlüssel ausgewählt wurde.',
index b81ce8cfe3d071f7aeadc917701b2f2060347f4c..a6a51299e034d3c2fac5533b4bd185792a4e295e 100644 (file)
@@ -68,9 +68,9 @@
    [%- UNLESS delivered %]
    <input class="submit" type="submit" name="action_save" value="[% 'Save' | $T8 %]">
    [%- IF vc == 'customer' %]
-   <input class="submit" type="submit" name="action_transfer_out" value="[% 'Transfer out' | $T8 %]">
+   <input class="submit" type="submit" name="action_transfer_out" onclick="return check_transfer_qty()" value="[% 'Transfer out' | $T8 %]">
    [%- ELSE %]
-   <input class="submit" type="submit" name="action_transfer_in" value="[% 'Transfer in' | $T8 %]">
+   <input class="submit" type="submit" name="action_transfer_in"  onclick="return check_transfer_qty()" value="[% 'Transfer in' | $T8 %]">
    [%- END %]
    [%- END %]
    [%- IF id %]
   <input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
 
  </form>
-
+<script type='text/javascript'>
+  function check_transfer_qty() {
+    var all_match = true;
+    var rowcount = $('input[name=rowcount]').val();
+    for (var i = 1; i < rowcount; i++) {
+      if ($('#stock_in_out_qty_matches_' + i).val() != 1) {
+        all_match = false;
+      }
+    }
+
+    if (all_match) {
+      return true;
+    } else {
+      return confirm("[% 'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' | $T8 %]");
+    }
+  }
+</script>
 </body>
 </html>
index 07e084d4d14ce308c9a38fa174763f61ae1ac623..8110594446e5b198ac9fbe6160393b801614ba80 100644 (file)
@@ -9,6 +9,7 @@
         var row = $('#row').attr('value');
         window.opener.document.getElementsByName("stock_" + $('#in_out').attr('value') + "_" + row)[0].value = $('#stock').attr('value');
         $(window.opener.document.getElementById("stock_in_out_qty_display_" + row)).html($('#qty_display').attr('value'));
+        $(window.opener.document.getElementById("stock_in_out_qty_matches_" + row)).val([% qty_matches %]);
 
         window.close();
       }
index db6b1adfdc6b332d1fa5bd23eb8acc8399d4997f..cd8c434227ea3d9185627630015db8bddf5ad4c7 100644 (file)
@@ -1,6 +1,10 @@
 [%- USE T8 %]
-[% USE HTML %]<body>
- <script type="text/javascript" src="js/checkbox_utils.js"></script>
+[% USE HTML %]
+[% USE L %]
+[% L.javascript_tag('jquery.checkall') %]
+[% SET all_active = 1 %][% FOREACH row = DUNNINGS %][% IF !row.active %][% SET all_active = 0 %][% LAST %][% END %][% END %]
+[% SET all_email = 1 %][% FOREACH row = DUNNINGS %][% IF !row.email %][% SET all_email = 0 %][% LAST %][% END %][% END %]
+<body>
  <script type="text/javascript" src="js/common.js"></script>
  <script type="text/javascript" src="js/dunning.js"></script>
 
    <th class="listheading" colspan="2">[% 'Current / Next Level' | $T8 %]</th>
 
    <th class="listheading">
-    <input type="checkbox" name="selectall_active" id="selectall_active" onclick="checkbox_check_all('selectall_active', 'active_', 1, [% rowcount %]);">
+    [% L.checkbox_tag('selectall_active', checkall='INPUT[name*=active_]', checked=all_active) %]
     <label for="selectall_active">[% 'Active?' | $T8 %]</label>
    </th>
 
    <th class="listheading">
-    <input type="checkbox" name="selectall_email" id="selectall_email" onclick="checkbox_check_all('selectall_email', 'email_', 1, [% rowcount %]);">
+    [% L.checkbox_tag('selectall_email', checkall='INPUT[name*=email_]', checked=all_email) %]
     <label for="selectall_email">[% 'eMail?' | $T8 %]</label>
    </th>