Revision b810b2e9
Von Moritz Bunkus vor fast 12 Jahren hinzugefügt
SL/TransNumber.pm | ||
---|---|---|
124 | 124 |
|
125 | 125 |
my %numbers_in_use = selectall_as_map($form, $self->dbh, $query, $filters{trans_number}, 'in_use'); |
126 | 126 |
|
127 |
my $number; |
|
128 |
($number) = selectfirst_array_query($form, $self->dbh, qq|SELECT customernumberinit FROM business WHERE id = ?|, $self->business_id) if $self->business_id; |
|
129 |
($number) = selectfirst_array_query($form, $self->dbh, qq|SELECT $filters{numberfield} FROM defaults|) if !$number; |
|
130 |
$number ||= ''; |
|
127 |
my $business_number; |
|
128 |
($business_number) = selectfirst_array_query($form, $self->dbh, qq|SELECT customernumberinit FROM business WHERE id = ?|, $self->business_id) if $self->business_id; |
|
129 |
my $number = $business_number; |
|
130 |
($number) = selectfirst_array_query($form, $self->dbh, qq|SELECT $filters{numberfield} FROM defaults|) if !$number; |
|
131 |
$number ||= ''; |
|
131 | 132 |
|
132 | 133 |
do { |
133 | 134 |
if ($number =~ m/\d+$/) { |
... | ... | |
141 | 142 |
} while ($numbers_in_use{$number}); |
142 | 143 |
|
143 | 144 |
if ($self->save) { |
144 |
if ($self->business_id) { |
|
145 |
if ($self->business_id && $business_number) {
|
|
145 | 146 |
do_query($form, $self->dbh, qq|UPDATE business SET customernumberinit = ? WHERE id = ?|, $number, $self->business_id); |
146 | 147 |
} else { |
147 | 148 |
do_query($form, $self->dbh, qq|UPDATE defaults SET $filters{numberfield} = ?|, $number); |
Auch abrufbar als: Unified diff
Kundentypnummernkreis nur berücksichtigen, falls dafür Nummernkreis gesetzt ist
Gilt analog für Lieferanten.
Siehe #2138.