Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorWulf <wulf@coulmann.de>
Tue, 10 Jan 2012 09:42:13 +0000 (10:42 +0100)
committerWulf <wulf@coulmann.de>
Tue, 10 Jan 2012 09:42:13 +0000 (10:42 +0100)
SL/DN.pm
bin/mozilla/ar.pl
bin/mozilla/do.pl
doc/changelog
doc/dokumentenvorlagen-und-variablen.html
locale/de/all
templates/webpages/admin/create_dataset.html
templates/webpages/do/form_footer.html
templates/webpages/do/set_stock_in_out.html

index f51e211..797588a 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -747,11 +747,13 @@ sub print_dunning {
          c.country,           c.department_1, c.department_2, c.email,     c.customernumber,
          c.greeting,          c.contact,      c.phone,        c.fax,       c.homepage,
          c.email,             c.taxincluded,  c.business_id,  c.taxnumber, c.iban,
+         c,ustid,             e.name as salesman_name,
          co.*
        FROM dunning d
        LEFT JOIN ar          ON (d.trans_id = ar.id)
        LEFT JOIN customer c  ON (ar.customer_id = c.id)
        LEFT JOIN contacts co ON (ar.cp_id = co.cp_id)
+       LEFT JOIN employee e  ON (ar.salesman_id = e.id)
        WHERE (d.dunning_id = ?)
        LIMIT 1|;
   my $ref = selectfirst_hashref_query($form, $dbh, $query, $dunning_id);
index 1522339..a6e1220 100644 (file)
@@ -1046,13 +1046,12 @@ sub update {
 
   $form->{invdate} = $form->{transdate};
 
-  my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1 oldcustomer);
+  my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1 customer_id);
 
   &check_name("customer");
 
-  # check_name ruft get_customer auf, oldcustomer wird überschrieben, daher wird dies vorher gemerkt
-  # get_customer holt Bemerkungen als intnotes, für Debitorenbuchungen gibt es aber nur das Feld notes
-  $form->{notes} = $form->{intnotes} if $saved_variables{oldcustomer} ne $form->{customer};
+  # check_name loads customer notes into notes, but ar only knows intnotes, so copy them
+  $form->{notes} = $form->{intnotes} if $saved_variables{customer_id} != $form->{customer_id};
 
   $form->{AR} = $saved_variables{AR};
   if ($saved_variables{AR_amount_1} =~ m/.--./) {
index 7924b05..cc04f57 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();
index 038b002..78df107 100644 (file)
   - Bugfix 1773: SQL Fehler bei Anzeige von Angeboten
   - Bugfix 1725: In Mahnungen steht currency nicht als Variable zur Verfügung?
   - Bugfix 1771: Zahlungsausgang: Lieferant wird nicht ausgewählt, wenn Name 2 Leerzeichen hintereinander enthält
+  - Bugfix 1566: Variablen für Verkäufer und USTID in Mahnungsdruck hinzugefügt
+  - Bugfix 1588: Einzelteile eines Erzeugnisses von Verkaufsbericht ausnehmen
+  - Bugfix 1756: Ertrag in Bruttorechnungen korrekt berechnen
+
+
 
 
 2011-06-15 - Release 2.6.3
index fa483c6..1009f31 100644 (file)
@@ -598,7 +598,7 @@ td {
    </tr>
    <tr>
     <td><code>ustid</code></td>
-    <td>Usatzsteuer-Identifikationsnummer</td>
+    <td>Umsatzsteuer-Identifikationsnummer</td>
    </tr>
    <tr>
    <tr>
index 2599b7c..e8b538b 100644 (file)
@@ -1879,6 +1879,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 00768f1..ba2d724 100644 (file)
@@ -58,7 +58,9 @@
       <select name="inventory_system">
        [% FOREACH row = INVENTORY_SYSTEMS %]<option value=[% HTML.escape(row.name) %] [% IF row.selected %]selected[% END %]>[% HTML.escape(row.name) | $T8 %]</option>[% END %]
       </select>
+     * f&uuml;r die Bestandsmethode gibt es Einschr&auml;nkungen, siehe Bemerkungen in <a href="doc/umstellung_eur.txt">EUR Umstellung in Mandant</a>.
      </td>
+
     </tr>
 
     <tr>
index b81ce8c..a6a5129 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 07e084d..8110594 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();
       }