Revision ea14cfa5
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/AR.pm | ||
---|---|---|
135 | 135 |
} else { |
136 | 136 |
$query = qq|SELECT nextval('glid')|; |
137 | 137 |
($form->{id}) = selectrow_query($form, $dbh, $query); |
138 |
$query = qq|INSERT INTO ar (id, invnumber, employee_id, currency_id) VALUES (?, 'dummy', ?, (SELECT id FROM currencies WHERE name=?))|;
|
|
139 |
do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{currency}); |
|
138 |
$query = qq|INSERT INTO ar (id, invnumber, employee_id, currency_id, taxzone_id) VALUES (?, 'dummy', ?, (SELECT id FROM currencies WHERE name=?), (SELECT taxzone_id FROM customer WHERE id = ?))|;
|
|
139 |
do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{currency}, $form->{customer_id});
|
|
140 | 140 |
if (!$form->{invnumber}) { |
141 | 141 |
my $trans_number = SL::TransNumber->new(type => 'invoice', dbh => $dbh, number => $form->{partnumber}, id => $form->{id}); |
142 | 142 |
$form->{invnumber} = $trans_number->create_unique; |
Auch abrufbar als: Unified diff
Einkaufs-/Verkaufsbelege: Spalte taxzone_id bereits beim INSERT befüllen
Ansonsten gibt es wegen der neuen NOT NULL-Restriktion einen Fehler.