From ee2b1ef305f1723d7ad39a44e195c7e15f8af810 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 10 Jan 2013 13:23:00 +0100 Subject: [PATCH] =?utf8?q?Debitorenbuchungen:=20Checkbox=20f=C3=BCr=20"Las?= =?utf8?q?tschrifteinzug";=20Vorbelegung=20aus=20Stammdaten?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AR.pm | 5 +++-- SL/Form.pm | 5 ++++- bin/mozilla/ar.pl | 11 +++-------- templates/webpages/ar/form_header.html | 6 +++++- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/SL/AR.pm b/SL/AR.pm index 8331c39c3..3016f5bc6 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -158,12 +158,13 @@ sub post_transaction { invnumber = ?, ordnumber = ?, transdate = ?, customer_id = ?, taxincluded = ?, amount = ?, duedate = ?, paid = ?, netamount = ?, curr = ?, notes = ?, department_id = ?, - employee_id = ?, storno = ?, storno_id = ?, globalproject_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}, $form->{netamount}, $form->{currency}, $form->{notes}, conv_i($form->{department_id}), conv_i($form->{employee_id}), $form->{storno} ? 't' : 'f', $form->{storno_id}, - conv_i($form->{globalproject_id}), conv_i($form->{id})); + conv_i($form->{globalproject_id}), $form->{direct_debit} ? 't' : 'f', conv_i($form->{id})); do_query($form, $dbh, $query, @values); # add individual transactions for AR, amount and taxes diff --git a/SL/Form.pm b/SL/Form.pm index b34458ef6..f966a2d6f 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2736,6 +2736,9 @@ sub create_links { $self->{TAX} = selectall_hashref_query($self, $dbh, $query); } + my $extra_columns = ''; + $extra_columns .= 'a.direct_debit, ' if $module eq 'AR'; + if ($self->{id}) { $query = qq|SELECT @@ -2743,7 +2746,7 @@ sub create_links { a.duedate, a.ordnumber, a.taxincluded, a.curr AS currency, a.notes, a.intnotes, a.department_id, a.amount AS oldinvtotal, a.paid AS oldtotalpaid, a.employee_id, a.gldate, a.type, - a.globalproject_id, + a.globalproject_id, ${extra_columns} c.name AS $table, d.description AS department, e.name AS employee diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index f8b4f0ba7..a05a97178 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -146,18 +146,13 @@ sub create_links { my $form = $main::form; my %myconfig = %main::myconfig; - my ($duedate, $taxincluded); - $form->create_links("AR", \%myconfig, "customer"); - $duedate = $form->{duedate}; - $taxincluded = $form->{taxincluded}; - my $id = $form->{id}; + my %saved = map { ($_ => $form->{$_}) } qw(direct_debit duedate id taxincluded); + IS->get_customer(\%myconfig, \%$form); - $form->{taxincluded} = $taxincluded; - $form->{id} = $id; - $form->{duedate} = $duedate if $duedate; + $form->{$_} = $saved{$_} for keys %saved; $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; $form->{rowcount} = 1; diff --git a/templates/webpages/ar/form_header.html b/templates/webpages/ar/form_header.html index ea17d6ddc..af574a598 100644 --- a/templates/webpages/ar/form_header.html +++ b/templates/webpages/ar/form_header.html @@ -80,7 +80,11 @@ [%- END %] [% L.checkbox_tag('taxincluded', checked=taxincluded) %] - [% 'Tax Included' | $T8 %] + + + + [% L.checkbox_tag('direct_debit', checked=direct_debit) %] + -- 2.20.1