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
$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
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
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;
[%- END %]
<tr>
<td align=right>[% L.checkbox_tag('taxincluded', checked=taxincluded) %]</td>
- <th align=left nowrap>[% 'Tax Included' | $T8 %]</th>
+ <th align="left" nowrap><label for="taxincluded">[% 'Tax Included' | $T8 %]</label></th>
+ </tr>
+ <tr>
+ <td align="right">[% L.checkbox_tag('direct_debit', checked=direct_debit) %]</td>
+ <th align="left" nowrap><label for="direct_debit">[% 'direct debit' | $T8 %]</label></th>
</tr>
</table>
</td>