]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'parse-filter-date-le-fix-ticket-2404'
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 6 Jan 2014 13:08:17 +0000 (14:08 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 6 Jan 2014 13:08:17 +0000 (14:08 +0100)
SL/Controller/Inventory.pm
SL/DO.pm
bin/mozilla/is.pl
bin/mozilla/oe.pl
locale/de/all
templates/webpages/do/form_header.html
templates/webpages/oe/sales_order.html

index 3f406ee480b2876d2f3821f494b713572c45ef14..ca6190c902167efec7db2d570c0f5a9c6d01ed7a 100644 (file)
@@ -44,27 +44,33 @@ sub action_stock_in {
 sub action_stock {
   my ($self) = @_;
 
-  # do stock
-  WH->transfer({
-    parts         => $self->part,
-    dst_bin       => $self->bin,
-    dst_wh        => $self->warehouse,
-    qty           => $::form->parse_amount(\%::myconfig, $::form->{qty}),
-    unit          => $self->unit,
-    transfer_type => 'stock',
-    chargenumber  => $::form->{chargenumber},
-    ean           => $::form->{ean},
-    comment       => $::form->{comment},
-  });
-
-  if ($::form->{write_default_bin}) {
-    $self->part->load;   # onhand is calculated in between. don't mess that up
-    $self->part->bin($self->bin);
-    $self->part->warehouse($self->warehouse);
-    $self->part->save;
-  }
+  my $qty = $::form->parse_amount(\%::myconfig, $::form->{qty});
 
-  flash_later('info', t8('Transfer successful'));
+  if ($qty < 0) {
+    flash_later('error', t8('Cannot stock negative amounts'));
+  } else {
+    # do stock
+    WH->transfer({
+      parts         => $self->part,
+      dst_bin       => $self->bin,
+      dst_wh        => $self->warehouse,
+      qty           => $qty,
+      unit          => $self->unit,
+      transfer_type => 'stock',
+      chargenumber  => $::form->{chargenumber},
+      ean           => $::form->{ean},
+      comment       => $::form->{comment},
+    });
+
+    if ($::form->{write_default_bin}) {
+      $self->part->load;   # onhand is calculated in between. don't mess that up
+      $self->part->bin($self->bin);
+      $self->part->warehouse($self->warehouse);
+      $self->part->save;
+    }
+
+    flash_later('info', t8('Transfer successful'));
+  }
 
   # redirect
   $self->redirect_to(
index d83c49b3ef1b46e57887e76a61270ab3a09b0f74..bc651c8ed6b896b49a276cae16114d6a4753a164 100644 (file)
--- a/SL/DO.pm
+++ b/SL/DO.pm
@@ -725,6 +725,8 @@ sub order_details {
   my @partsgroup = ();
   my $partsgroup;
   my $position = 0;
+  my $subtotal_header = 0;
+  my $subposition = 0;
 
   my (@project_ids, %projectnumbers, %projectdescriptions);
 
@@ -797,8 +799,6 @@ sub order_details {
 
     next if (!$form->{"id_$i"});
 
-    $position++;
-
     if ($item->[1] ne $sameitem) {
       push(@{ $form->{description} }, qq|$item->[1]|);
       $sameitem = $item->[1];
@@ -809,6 +809,19 @@ sub order_details {
     $form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
 
     # add number, description and qty to $form->{number}, ....
+    if ($form->{"subtotal_$i"} && !$subtotal_header) {
+      $subtotal_header = $i;
+      $position = int($position);
+      $subposition = 0;
+      $position++;
+    } elsif ($subtotal_header) {
+      $subposition += 1;
+      $position = int($position);
+      $position = $position.".".$subposition;
+    } else {
+      $position = int($position);
+      $position++;
+    }
 
     my $price_factor = $price_factors{$form->{"price_factor_id_$i"}} || { 'factor' => 1 };
 
@@ -826,6 +839,10 @@ sub order_details {
     push @{ $form->{TEMPLATE_ARRAYS}{projectdescription} },
       $projectdescriptions{$form->{"project_id_$i"}};
 
+    if ($form->{"subtotal_$i"} && $subtotal_header && ($subtotal_header != $i)) {
+      $subtotal_header     = 0;
+    }
+
     my $lineweight = $form->{"qty_$i"} * $form->{"weight_$i"};
     $totalweight += $lineweight;
     push @{ $form->{TEMPLATE_ARRAYS}->{weight} },            $form->format_amount($myconfig, $form->{"weight_$i"}, 3);
index d67aac59d1e8e48fa93ee9f9bdf41c9863ea446b..cf3ac5768eabe14e835e3d60b138137926468a7f 100644 (file)
@@ -378,6 +378,7 @@ sub form_header {
     shiptoname shiptostreet shiptozipcode shiptocity shiptocountry  shiptocontact shiptophone shiptofax
     shiptoemail shiptodepartment_1 shiptodepartment_2  shiptocp_gender message email subject cc bcc taxaccounts cursor_fokus
     convert_from_do_ids convert_from_oe_ids
+    show_details
   ), @custom_hiddens,
   map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts}];
 
index 6001c87bcb4cf0bf60434ef0e67baa98386f8703..f08a5249a5ee8183f7b0d11a9468fc2fd9b246ae 100644 (file)
@@ -441,7 +441,8 @@ sub form_header {
         max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode
         shiptocity shiptocountry shiptocontact shiptophone shiptofax
         shiptodepartment_1 shiptodepartment_2 shiptoemail shiptocp_gender
-        message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus),
+        message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus
+        show_details),
         @custom_hiddens,
         map { $_.'_rate', $_.'_description', $_.'_taxnumber' } split / /, $form->{taxaccounts} ];  # deleted: discount
 
index 05673c95f09e0bced20a9a57080cdc713cbf5eb4..2ef84b96c52e716a70359927a2364b30dd5c3d1d 100755 (executable)
@@ -18,10 +18,8 @@ $self->{texts} = {
   '#1 h'                        => '#1 h',
   '#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.',
   '#1 prices were updated.'     => '#1 Preise wurden aktualisiert.',
-  '(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' => '(empfohlen) F&uuml;gen Sie die verwaisten Währungen in Ihr System ein. Sie können den Namen der Währung einfach ändern, indem Sie die Felder oben bearbeiten. Benutzen Sie keine Namen von Währungen, die Sie bereits benutzen.',
   '%'                           => '%',
-  '* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode"  in' => ' für die Bestandsmethode gibt es Einschränkungen, siehe Kapitel "Bemerkungen zu Bestandsmethode"  in',
-  '*) Since version 2.7 these parameters ares set in the client database and not in the configuration file, details in chapter:' => '*) Seit 2.7 werden Gewinnermittlungsart, Versteuerungsart und Warenbuchungsmethode in der Mandanten-DB gesteuert und nicht mehr in der Konfigurationsdatei, Umstellungs-Details:',
+  '(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' => '(empfohlen) F&uuml;gen Sie die verwaisten Währungen in Ihr System ein. Sie können den Namen der Währung einfach ändern, indem Sie die Felder oben bearbeiten. Benutzen Sie keine Namen von Währungen, die Sie bereits benutzen.',
   '*/'                          => '*/',
   ', if set'                    => ', falls gesetzt',
   '---please select---'         => '---bitte auswählen---',
@@ -408,6 +406,7 @@ $self->{texts} = {
   'Cannot save order!'          => 'Auftrag kann nicht gespeichert werden!',
   'Cannot save preferences!'    => 'Einstellungen können nicht gespeichert werden!',
   'Cannot save quotation!'      => 'Angebot kann nicht gespeichert werden!',
+  'Cannot stock negative amounts' => 'Negative Mengen können nicht eingelagert werden!',
   'Cannot storno invoice for a closed period!' => 'Das Rechnungsdatum der zu stornierenden Rechnung fällt in einen abgeschlossenen Zeitraum!',
   'Cannot storno storno invoice!' => 'Kann eine Stornorechnung nicht stornieren',
   'Cannot transfer. <br> Reason:<br>#1' => 'Kann nicht auslagern. <br>Grund:<br>#1',
@@ -420,7 +419,6 @@ $self->{texts} = {
   'Cc E-mail'                   => 'CC (E-Mail)',
   'Change default bin for this parts' => 'Standardlagerplatz für diese Waren ändern',
   'Change kivitendo installation settings (most entries in the \'System\' menu)' => 'Verändern der kivitendo-Installationseinstellungen (die meisten Menüpunkte unterhalb von \'System\')',
-  'Change representative to'    => 'Vertreter ändern in',
   'Changes in this block are only sensible if the account is NOT a summary account AND there exists one valid taxkey. To select both Receivables and Payables only make sense for Payment / Receipt (i.e. account cash).' => 'Es ist nur sinnvoll Änderungen vorzunehmen, wenn das Konto KEIN Sammelkonto ist und wenn ein gültiger Steuerschlüssel für das Konto existiert. Gleichzeitig Haken bei Forderungen und Verbindlichkeiten zu setzen, macht auch NUR für den Zahlungsein- und Ausgang (bspw. Bank oder Kasse) Sinn.',
   'Changes to Receivables and Payables are only possible if no transactions to this account are posted yet.' => 'Änderungen bei Forderungen oder Verbindlichkeiten sind nur möglich, wenn dieses Konto noch nicht bebucht wurde.',
   'Charge Number'               => 'Chargennummer',
@@ -519,7 +517,6 @@ $self->{texts} = {
   'Create a new project type'   => 'Einen neuen Projekttypen anlegen',
   'Create a new user'           => 'Einen neuen Benutzer anlegen',
   'Create a new user group'     => 'Eine neue Benutzergruppe erfassen',
-  'Create a standard group'     => 'Eine Standard-Benutzergruppe anlegen',
   'Create and edit RFQs'        => 'Lieferantenanfragen erfassen und bearbeiten',
   'Create and edit dunnings'    => 'Mahnungen erfassen und bearbeiten',
   'Create and edit invoices and credit notes' => 'Rechnungen und Gutschriften erfassen und bearbeiten',
@@ -545,8 +542,8 @@ $self->{texts} = {
   'Create new delivery term'    => 'Neue Lieferbedingungen anlegen',
   'Create new department'       => 'Neue Abteilung erfassen',
   'Create new payment term'     => 'Neue Zahlungsbedingung anlegen',
-  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
   'Create new project type'     => 'Neuen Projekttypen anlegen',
+  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
   'Create tables'               => 'Tabellen anlegen',
   'Created by'                  => 'Erstellt von',
   'Created for'                 => 'Erstellt f&uuml;r',
@@ -1345,7 +1342,6 @@ $self->{texts} = {
   'MwSt. inkl.'                 => 'MwSt. inkl.',
   'Name'                        => 'Name',
   'Name and Street'             => 'Name und Straße',
-  'Name missing!'               => 'Name fehlt!',
   'National Expenses'           => 'Aufwand Inland',
   'National Revenues'           => 'Erl&ouml;se Inland',
   'Net amount'                  => 'Nettobetrag',
index baf7b3fee0fa6333b0aec9b0a545354717b49a3c..5af79bedc755511c0e5158fd4a73c4cb988a4969 100644 (file)
@@ -99,6 +99,7 @@
   <input type="hidden" name="shiptostreet" value="[% HTML.escape(shiptostreet) %]">
   <input type="hidden" name="shiptozipcode" value="[% HTML.escape(shiptozipcode) %]">
   <input type="hidden" name="shiptocp_gender" value="[% HTML.escape(shiptocp_gender) %]">
+  <input type="hidden" name="show_details" value="[% HTML.escape(show_details) %]">
   <input type="hidden" name="subject" value="[% HTML.escape(subject) %]">
   <input type="hidden" name="taxincluded" value="[% HTML.escape(taxincluded) %]">
   <input type="hidden" name="taxzone_id" value="[% HTML.escape(taxzone_id) %]">
index c16dc11186336e69d12a717aa32c97faed4c021d..1c301080f5181f55c1deb429c25b67a1c58ccdc3 100644 (file)
@@ -3,9 +3,14 @@
 [%- PROCESS 'amcvar/render_inputs_block.html' %]
 <tr>
  <td>
-  <input type="button" id="cb_show_details" name="show_details" value='[% 'Show details' | $T8 %]'>
+  <input type="button" id="cb_show_details" name="show_details_button" value='[% 'Show details' | $T8 %]'>
   <script type="text/javascript">
-   $('#cb_show_details').click(function(){ $('[id^="row2"]').toggle() });
+   $('#cb_show_details').click(function(){ $('[id^="row2"]').toggle();
+                                           if ( $('[id^="row2"]').is(":visible") ) {
+                                            $("[name='show_details']").val(1);
+                                           } else {
+                                            $("[name='show_details']").val(0);
+                                           }});
   </script>
   <table id='display_row' width="100%">
    <tr class="listheading">