From: Moritz Bunkus Date: Thu, 10 Jan 2013 12:23:00 +0000 (+0100) Subject: Debitorenbuchungen: Checkbox für "Lastschrifteinzug"; Vorbelegung aus Stammdaten X-Git-Tag: release-3.1.0beta1~753^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ee2b1ef305f1723d7ad39a44e195c7e15f8af810;p=kivitendo-erp.git Debitorenbuchungen: Checkbox für "Lastschrifteinzug"; Vorbelegung aus Stammdaten --- 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) %] +