projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bericht BankTransaction auch Verknüpfungen mit Dialogbuchungen anzeigen
[kivitendo-erp.git]
/
sql
/
Pg-upgrade2
/
invoice_positions.pl
diff --git
a/sql/Pg-upgrade2/invoice_positions.pl
b/sql/Pg-upgrade2/invoice_positions.pl
index
18ea9e9
..
fea63da
100644
(file)
--- a/
sql/Pg-upgrade2/invoice_positions.pl
+++ b/
sql/Pg-upgrade2/invoice_positions.pl
@@
-1,7
+1,6
@@
# @tag: invoice_positions
# @description: Spalte für Positionen der Einträge in Rechnungen
# @depends: release_3_1_0
# @tag: invoice_positions
# @description: Spalte für Positionen der Einträge in Rechnungen
# @depends: release_3_1_0
-# @encoding: utf-8
package SL::DBUpgrade2::invoice_positions;
use strict;
package SL::DBUpgrade2::invoice_positions;
use strict;
@@
-17,11
+16,13
@@
sub run {
$query = qq|SELECT * FROM invoice ORDER BY trans_id, id|;
$query = qq|SELECT * FROM invoice ORDER BY trans_id, id|;
+ my $query2 = qq|UPDATE invoice SET position = ? WHERE id = ?|;
my $sth = $self->dbh->prepare($query);
my $sth = $self->dbh->prepare($query);
+ my $sth2 = $self->dbh->prepare($query2);
$sth->execute || $::form->dberror($query);
$sth->execute || $::form->dberror($query);
- # set new posit
t
ion field in order of ids, starting by one for each invoice
+ # set new position field in order of ids, starting by one for each invoice
my $last_invoice_id;
my $position;
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
my $last_invoice_id;
my $position;
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
@@
-32,10
+33,10
@@
sub run {
}
$last_invoice_id = $ref->{trans_id};
}
$last_invoice_id = $ref->{trans_id};
- $query = qq|UPDATE invoice SET position = ? WHERE id = ?|;
- $self->db_query($query, bind => [ $position, $ref->{id} ]);
+ $sth2->execute($position, $ref->{id});
}
$sth->finish;
}
$sth->finish;
+ $sth2->finish;
$query = qq|ALTER TABLE invoice ALTER COLUMN position SET NOT NULL|;
$self->db_query($query);
$query = qq|ALTER TABLE invoice ALTER COLUMN position SET NOT NULL|;
$self->db_query($query);