Merge branch '2020-leistungsdatum'
authorMoritz Bunkus <m.bunkus@linet.de>
Thu, 3 Dec 2020 13:13:09 +0000 (14:13 +0100)
committerMoritz Bunkus <m.bunkus@linet.de>
Thu, 3 Dec 2020 13:13:09 +0000 (14:13 +0100)
1  2 
SL/AR.pm
SL/Form.pm
bin/mozilla/io.pl
locale/de/all
templates/webpages/gl/form_header.html
templates/webpages/ir/form_header.html

diff --combined SL/AR.pm
+++ b/SL/AR.pm
@@@ -134,14 -134,14 +134,14 @@@ sub _post_transaction 
      $query =
        qq|UPDATE ar set
             invnumber = ?, ordnumber = ?, transdate = ?, customer_id = ?,
-            taxincluded = ?, amount = ?, duedate = ?, deliverydate = ?, paid = ?,
+            taxincluded = ?, amount = ?, duedate = ?, deliverydate = ?, tax_point = ?, paid = ?,
             currency_id = (SELECT id FROM currencies WHERE name = ?),
             netamount = ?, notes = ?, department_id = ?,
             employee_id = ?, storno = ?, storno_id = ?, globalproject_id = ?,
             direct_debit = ?
           WHERE id = ?|;
      my @values = ($form->{invnumber}, $form->{ordnumber}, conv_date($form->{transdate}), conv_i($form->{customer_id}), $form->{taxincluded} ? 't' : 'f', $form->{amount},
-                   conv_date($form->{duedate}), conv_date($form->{deliverydate}), $form->{paid},
+                   conv_date($form->{duedate}), conv_date($form->{deliverydate}), conv_date($form->{tax_point}), $form->{paid},
                    $form->{currency},
                    $form->{netamount}, $form->{notes}, conv_i($form->{department_id}),
                    conv_i($form->{employee_id}), $form->{storno} ? 't' : 'f', $form->{storno_id},
@@@ -481,7 -481,6 +481,7 @@@ sub ar_transactions 
  
    my $query =
      qq|SELECT DISTINCT a.id, a.invnumber, a.ordnumber, a.cusordnumber, a.transdate, | .
 +    qq|  a.donumber, a.deliverydate, | .
      qq|  a.duedate, a.netamount, a.amount, a.paid, | .
      qq|  a.invoice, a.datepaid, a.notes, a.shipvia, | .
      qq|  a.shippingpoint, a.storno, a.storno_id, a.globalproject_id, | .
@@@ -683,7 -682,7 +683,7 @@@ SQ
    my $sortdir   = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC';
    my $sortorder = join(', ', map { "$_ $sortdir" } @a);
  
 -  if (grep({ $_ eq $form->{sort} } qw(id transdate duedate invnumber ordnumber cusordnumber name datepaid employee shippingpoint shipvia transaction_description department))) {
 +  if (grep({ $_ eq $form->{sort} } qw(id transdate duedate invnumber ordnumber cusordnumber donumber deliverydate name datepaid employee shippingpoint shipvia transaction_description department))) {
      $sortorder = $form->{sort} . " $sortdir";
    }
  
diff --combined SL/Form.pm
@@@ -382,11 -382,10 +382,11 @@@ sub create_http_response 
      my $session_cookie_value = $main::auth->get_session_id();
  
      if ($session_cookie_value) {
 -      $session_cookie = $cgi->cookie('-name'   => $main::auth->get_session_cookie_name(),
 -                                     '-value'  => $session_cookie_value,
 -                                     '-path'   => $uri->path,
 -                                     '-secure' => $::request->is_https);
 +      $session_cookie = $cgi->cookie('-name'    => $main::auth->get_session_cookie_name(),
 +                                     '-value'   => $session_cookie_value,
 +                                     '-path'    => $uri->path,
 +                                     '-expires' => '+' . $::auth->{session_timeout} . 'm',
 +                                     '-secure'  => $::request->is_https);
      }
    }
  
@@@ -2567,7 -2566,7 +2567,7 @@@ sub create_links 
      $query =
        qq|SELECT
             a.cp_id, a.invnumber, a.transdate, a.${table}_id, a.datepaid, a.deliverydate,
-            a.duedate, a.ordnumber, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.notes,
+            a.duedate, a.tax_point, a.ordnumber, a.taxincluded, (SELECT cu.name FROM currencies cu WHERE cu.id=a.currency_id) AS currency, a.notes,
             a.mtime, a.itime,
             a.intnotes, a.department_id, a.amount AS oldinvtotal,
             a.paid AS oldtotalpaid, a.employee_id, a.gldate, a.type,
@@@ -3230,7 -3229,7 +3230,7 @@@ sub prepare_for_printing 
  
    # Format dates.
    $self->format_dates($output_dateformat, $output_longdates,
-                       qw(invdate orddate quodate pldate duedate reqdate transdate shippingdate deliverydate validitydate paymentdate datepaid
+                       qw(invdate orddate quodate pldate duedate reqdate transdate tax_point shippingdate deliverydate validitydate paymentdate datepaid
                           transdate_oe deliverydate_oe employee_startdate employee_enddate),
                        grep({ /^(?:datepaid|transdate_oe|reqdate|deliverydate|deliverydate_oe|transdate)_\d+$/ } keys(%{$self})));
  
diff --combined bin/mozilla/io.pl
@@@ -328,7 -328,7 +328,7 @@@ 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"}
 -      . $cgi->hidden(-name => "ship_$i", -value => $form->format_amount(\%myconfig, $form->{"ship_$i"}, $qty_dec));
 +      . $cgi->hidden(-name => "ship_$i", -value => $form->{"ship_$i"}, $qty_dec);
  
        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);
@@@ -1409,7 -1409,7 +1409,7 @@@ sub print_form 
  
    # Format dates.
    format_dates($output_dateformat, $output_longdates,
-                qw(invdate orddate quodate pldate duedate reqdate transdate
+                qw(invdate orddate quodate pldate duedate reqdate transdate tax_point
                    shippingdate deliverydate validitydate paymentdate
                    datepaid transdate_oe transdate_do transdate_quo deliverydate_oe dodate
                    employee_startdate employee_enddate
diff --combined locale/de/all
@@@ -263,8 -263,6 +263,8 @@@ $self->{texts} = 
    'All groups'                  => 'Alle Gruppen',
    'All modules'                 => 'Alle Module',
    'All partsgroups'             => 'Alle Warengruppen',
 +  'All payments have already been posted.' => 'Es wurden bereits alle Zahlungen verbucht.',
 +  'All payments must be posted before the payment list can be downloaded.' => 'Alle Zahlungen müssen verbucht werden, bevor die Zahlungsliste heruntergeladen werden kann.',
    'All price sources'           => 'Alle Preisquellen',
    'All reports'                 => 'Alle Berichte (Kontenübersicht, Summen- u. Saldenliste, Erfolgsrechnung, GuV, BWA, Bilanz, Projektbuchungen)',
    'All the other clients will start with an empty set of WebDAV folders.' => 'Alle anderen Mandanten werden mit einem leeren Satz von Dokumenten-Ordnern ausgestattet.',
    'All transactions'            => 'Alle Buchungen',
    'All units have either no or exactly one base unit of which they are multiples.' => 'Einheiten haben entweder keine oder genau eine Basiseinheit, von der sie ein Vielfaches sind.',
    'All users'                   => 'Alle BenutzerInnen',
 +  'Allocations didn\'t pass constraints' => 'Keine Verfügbarkeit wegen Lagereinschränkung',
    'Allow access'                => 'Zugriff erlauben',
    'Allow conversion from sales orders to sales invoices' => 'Umwandlung von Verkaufsaufträgen in Verkaufsrechnungen zulassen',
    'Allow conversion from sales quotations to sales invoices' => 'Umwandlung von Verkaufsangeboten in Verkaufsrechnungen zulassen',
    'Cancel Accounts Payables Transaction' => 'Kreditorenbuchung stornieren',
    'Cancel Accounts Receivables Transaction' => 'Debitorenbuchung stornieren',
    'Cancelling is disallowed. Either undo or balance the current payments until the open amount matches the invoice amount' => 'Storno verboten, da Zahlungen zum Beleg vorhanden sind. Entweder die Zahlungen löschen oder mit umgekehrten Vorzeichen ausbuchen, sodass der offene Betrag dem Rechnungsbetrag entspricht.',
 +  'Cannot allocate parts.'      => 'Es sind nicht genügend Artikel vorhanden',
    'Cannot change transaction in a closed period!' => 'In einem bereits abgeschlossenen Zeitraum kann keine Buchung verändert werden!',
    'Cannot check correct WebDAV folder' => 'Kann nicht den richtigen WebDAV Pfad überprüfen',
    'Cannot delete account!'      => 'Konto kann nicht gelöscht werden!',
    'Charge'                      => 'Berechnen',
    'Charge Number'               => 'Chargennummer',
    'Charge number'               => 'Chargennummer',
 +  'Chargenumbers'               => 'Chargennummern',
    'Charset'                     => 'Zeichensatz',
    'Chart'                       => 'Buchungskonto',
    'Chart Type'                  => 'Kontentyp',
    'Tax deleted!'                => 'Steuer gelöscht!',
    'Tax number'                  => 'Steuernummer',
    'Tax paid'                    => 'Vorsteuer',
+   'Tax point'                   => 'Leistungsdatum',
    'Tax rate'                    => 'Steuersatz',
    'Tax saved!'                  => 'Steuer gespeichert!',
    'Tax zone'                    => 'Steuerzone',
    'The first reason is that kivitendo contained a bug which resulted in the wrong taxkeys being recorded for transactions in which two entries are posted for the same chart with different taxkeys.' => 'Der erste Grund war ein Fehler in kivitendo, der dazu führte, dass bei einer Transaktion, bei der zwei Buchungen mit unterschiedlichen Steuerschlüsseln auf dasselbe Konto durchgeführt wurden, die falschen Steuerschlüssel gespeichert wurden.',
    'The follow-up date is missing.' => 'Das Wiedervorlagedatum fehlt.',
    'The following currencies have been used, but they are not defined:' => 'Die folgenden Währungen wurden benutzt, sind aber nicht ordnungsgemäß in der Datenbank eingetragen:',
 +  'The following delivery orders could not be processed because they are already closed: #1' => 'Die folgenden Lieferscheine konnten nicht verarbeitet werden, da sie bereits geschlossen sind: #1',
    'The following drafts have been saved and can be loaded.' => 'Die folgenden Entwürfe wurden gespeichert und können geladen werden.',
    'The following groups are valid for this client' => 'Die folgenden Gruppen sind für diesen Mandanten gültig',
    'The following is only a preview.' => 'Das Folgende ist nur eine Vorschau.',
    'brutto'                      => 'brutto',
    'building data'               => 'Verarbeite Daten',
    'building report'             => 'Erstelle Bericht',
 +  'can not allocate #1 units of #2, missing #3 units' => 'Kann keine #1 Einheiten von #2 belegen, es fehlen #3 Einheiten',
    'can only parse a pdf file'   => 'Kann nur eine gültige PDF-Datei verwenden.',
    'cash'                        => 'Ist-Versteuerung',
    'chargenumber #1'             => 'Chargennummer #1',
    'our vendor number at customer' => 'Unsere Lieferanten-Nr. beim Kunden',
    'parsing csv'                 => 'Parse CSV Daten',
    'part'                        => 'Ware',
 +  'part \'#\'1 in bin \'#2\' only with qty #3 (need additional #4) and chargenumber \'#5\'.' => 'Artikel \'#1\' im \'#2\' nur mit der Menge #3 (noch #4 benötig) und Chargennummer \'#5\'.',
    'part_list'                   => 'Warenliste',
    'percental'                   => 'prozentual',
    'periodic'                    => 'Aufwandsmethode',
@@@ -6,15 -6,7 +6,15 @@@
  
  [%- INCLUDE 'common/flash.html' %]
  
 -<script type="text/javascript" src="js/show_form_details.js"></script>
 +<script type="text/javascript">
 +  <!--
 +  function copy_debit_to_credit() {
 +    var txt = document.getElementsByName('debit_1')[0].value;
 +    document.getElementsByName('credit_2')[0].value = txt;
 +  };
 +  //-->
 +  </script>
 +  <script type="text/javascript" src="js/show_form_details.js"></script>
  <script type="text/javascript" src="js/follow_up.js"></script>
  <script type="text/javascript" src="js/kivi.Draft.js"></script>
  
          <tr>
            <th [%- departments_style -%]align="right">[% 'Department' | $T8 %]</th>
            <td [%- departments_style -%]>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1) %]</td>
-           <th align=right>[% 'Delivery Date' | $T8 %]</th>
-           <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
+           <th align=right>[% 'Tax point' | $T8 %]</th>
+           <td>[% L.date_tag('tax_point', tax_point) %]</td>
          </tr>
          <tr>
            <th align="right">[% 'Description' | $T8 %]</th>
            <td>[% L.areainput_tag('description', description, cols=50, readonly=readonly) %]</td>
-           <th align="right">[% 'MwSt. inkl.' | $T8 %]</th>
-           <td>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
+           <th align=right>[% 'Delivery Date' | $T8 %]</th>
+           <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
          </tr>
- [%- IF id %]
          <tr>
-           <th align="right">[% 'Mitarbeiter' | $T8 %]</th>
-           <td>[% L.input_tag('employee', employee, size=20, readonly=readonly) %]</td>
+           <th align="right">[%- IF id %][% 'Mitarbeiter' | $T8 %][% END %]</th>
+           <td>[%- IF id %][% L.input_tag('employee', employee, size=20, readonly=readonly) %][% END %]</td>
+           <th align="right">[% 'MwSt. inkl.' | $T8 %]</th>
+           <td>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
          </tr>
- [%- END %]
  
        <tr>
         <td colspan=4>
             <span id="duedate_fixed"[% IF !payment_terms_obj.auto_calculation %] style="display:none"[% END %]>[% HTML.escape(duedate) %]</span>
            </td>
          </tr>
+         <tr>
+           <th align="right" nowrap>[% LxERP.t8('Tax point') %]</th>
+           <td nowrap>[% L.date_tag('tax_point', tax_point, id='tax_point') %]</td>
+         </tr>
          <tr>
            <th align="right">[% 'Delivery Date' | $T8 %]</th>
            <td>[% L.date_tag('deliverydate', deliverydate) %]</td>
          </tr>
          <tr>
            <th align="right" nowrap>[% 'Project Number' | $T8 %]</th>
 -          <td>[%- L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = '1', onChange = "document.getElementById('update_button').click();") %]</td>
 +          <td>[% P.project.picker('globalproject_id', globalproject_id, onchange="document.getElementById('update_button').click();") %]</td>
          </tr>
        </table>
      </td>