From c47675437f3d8b71cd5ebdec0484677d2cb94ab0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 18 Jun 2020 16:25:36 +0200 Subject: [PATCH] Lieferdatum in Debitoren-und Kreditorenbuchung --- SL/AP.pm | 6 +++--- SL/AR.pm | 4 ++-- SL/Form.pm | 2 +- bin/mozilla/ap.pl | 1 + templates/webpages/ap/form_header.html | 4 ++++ templates/webpages/ar/form_header.html | 4 ++++ 6 files changed, 15 insertions(+), 6 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index 060b55a7c..937af8b58 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -139,15 +139,15 @@ sub _post_transaction { $query = qq|UPDATE ap SET invnumber = ?, transdate = ?, ordnumber = ?, vendor_id = ?, taxincluded = ?, - amount = ?, duedate = ?, paid = ?, netamount = ?, + amount = ?, duedate = ?, deliverydate = ?, paid = ?, netamount = ?, currency_id = (SELECT id FROM currencies WHERE name = ?), notes = ?, department_id = ?, storno = ?, storno_id = ?, globalproject_id = ?, direct_debit = ? WHERE id = ?|; @values = ($form->{invnumber}, conv_date($form->{transdate}), $form->{ordnumber}, conv_i($form->{vendor_id}), $form->{taxincluded} ? 't' : 'f', $form->{invtotal}, - conv_date($form->{duedate}), $form->{invpaid}, - $form->{netamount}, + conv_date($form->{duedate}), conv_date($form->{deliverydate}), + $form->{invpaid}, $form->{netamount}, $form->{currency}, $form->{notes}, conv_i($form->{department_id}), $form->{storno}, $form->{storno_id}, conv_i($form->{globalproject_id}), diff --git a/SL/AR.pm b/SL/AR.pm index 8c15b7ebd..b26911af7 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -134,14 +134,14 @@ sub _post_transaction { $query = qq|UPDATE ar set invnumber = ?, ordnumber = ?, transdate = ?, customer_id = ?, - taxincluded = ?, amount = ?, duedate = ?, paid = ?, + taxincluded = ?, amount = ?, duedate = ?, deliverydate = ?, 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}), $form->{paid}, + conv_date($form->{duedate}), conv_date($form->{deliverydate}), $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}, diff --git a/SL/Form.pm b/SL/Form.pm index e81435136..3da4e62f6 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2683,7 +2683,7 @@ sub create_links { if ($self->{id}) { $query = qq|SELECT - a.cp_id, a.invnumber, a.transdate, a.${table}_id, a.datepaid, + 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.mtime, a.itime, a.intnotes, a.department_id, a.amount AS oldinvtotal, diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index a3869d13b..704ae4c78 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -1211,6 +1211,7 @@ sub add_from_purchase_order { $::form->{transdate} = $today->to_kivitendo; $::form->{duedate} = $today->to_kivitendo; $::form->{duedate} = $order->payment_terms->calc_date(reference_date => $today)->to_kivitendo if $order->payment_terms; + $::form->{deliverydate} = $order->reqdate->to_kivitendo if $order->reqdate; create_links(); my $config_po_ap_workflow_chart_id = $::instance_conf->get_workflow_po_ap_chart_id; diff --git a/templates/webpages/ap/form_header.html b/templates/webpages/ap/form_header.html index bd52a5189..e569004bc 100644 --- a/templates/webpages/ap/form_header.html +++ b/templates/webpages/ap/form_header.html @@ -163,6 +163,10 @@ [% 'Due Date' | $T8 %] [% L.date_tag('duedate', duedate) %] + + [% 'Delivery Date' | $T8 %] + [% L.date_tag('deliverydate', deliverydate) %] + [% 'Project Number' | $T8 %] diff --git a/templates/webpages/ar/form_header.html b/templates/webpages/ar/form_header.html index 75bc22eb4..edfc2d239 100644 --- a/templates/webpages/ar/form_header.html +++ b/templates/webpages/ar/form_header.html @@ -141,6 +141,10 @@ [% 'Due Date' | $T8 %] [% L.date_tag('duedate', duedate) %] + + [% 'Delivery Date' | $T8 %] + [% L.date_tag('deliverydate', deliverydate) %] + [% 'Project Number' | $T8 %] [% L.select_tag('globalproject_id', ALL_PROJECTS, title_key = 'projectnumber', default = globalproject_id, with_empty = 1, onChange = "document.getElementById('update_button').click();") %] -- 2.20.1