Revision f54fd660
Von Sven Schöling vor fast 16 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
914 | 914 |
if ($amount eq "") { |
915 | 915 |
$amount = 0; |
916 | 916 |
} |
917 |
|
|
917 |
|
|
918 | 918 |
# Hey watch out! The amount can be an exponential term like 1.13686837721616e-13 |
919 |
|
|
919 |
|
|
920 | 920 |
my $neg = ($amount =~ s/^-//); |
921 | 921 |
my $exp = ($amount =~ m/[e]/) ? 1 : 0; |
922 |
|
|
922 |
|
|
923 | 923 |
if (defined($places) && ($places ne '')) { |
924 | 924 |
if (not $exp) { |
925 | 925 |
if ($places < 0) { |
... | ... | |
1228 | 1228 |
open(OUT, $self->{OUT}) |
1229 | 1229 |
or $self->error($self->cleanup . "$self->{OUT} : $!"); |
1230 | 1230 |
} else { |
1231 |
$self->{attachment_filename} = ($self->{attachment_filename})
|
|
1231 |
$self->{attachment_filename} = ($self->{attachment_filename}) |
|
1232 | 1232 |
? $self->{attachment_filename} |
1233 | 1233 |
: $self->generate_attachment_filename(); |
1234 | 1234 |
|
... | ... | |
1437 | 1437 |
$main::lxdebug->enter_sub(); |
1438 | 1438 |
|
1439 | 1439 |
my ($self, $myconfig) = @_; |
1440 |
|
|
1440 |
|
|
1441 | 1441 |
# connect to database |
1442 | 1442 |
my $dbh = |
1443 | 1443 |
DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, |
... | ... | |
1518 | 1518 |
if ($curr eq '') { |
1519 | 1519 |
$main::lxdebug->leave_sub(); |
1520 | 1520 |
return; |
1521 |
}
|
|
1521 |
} |
|
1522 | 1522 |
$query = qq|SELECT curr FROM defaults|; |
1523 | 1523 |
|
1524 | 1524 |
my ($currency) = selectrow_query($self, $dbh, $query); |
... | ... | |
1559 | 1559 |
SET $set |
1560 | 1560 |
WHERE curr = ? |
1561 | 1561 |
AND transdate = ?|; |
1562 |
|
|
1562 |
|
|
1563 | 1563 |
} else { |
1564 | 1564 |
$query = qq|INSERT INTO exchangerate (curr, buy, sell, transdate) |
1565 | 1565 |
VALUES (?, $buy, $sell, ?)|; |
... | ... | |
1870 | 1870 |
shiptophone = ? AND |
1871 | 1871 |
shiptofax = ? AND |
1872 | 1872 |
shiptoemail = ? AND |
1873 |
module = ? AND
|
|
1873 |
module = ? AND |
|
1874 | 1874 |
trans_id = ?|; |
1875 | 1875 |
my $insert_check = selectfirst_hashref_query($self, $dbh, $query, @values, $module, $id); |
1876 | 1876 |
if(!$insert_check){ |
... | ... | |
2177 | 2177 |
$key = "all_currencies" unless ($key); |
2178 | 2178 |
|
2179 | 2179 |
my $query = qq|SELECT curr AS currency FROM defaults|; |
2180 |
|
|
2180 |
|
|
2181 | 2181 |
$self->{$key} = [split(/\:/ , selectfirst_hashref_query($self, $dbh, $query)->{currency})]; |
2182 | 2182 |
|
2183 | 2183 |
$main::lxdebug->leave_sub(); |
... | ... | |
2191 | 2191 |
$key = "all_payments" unless ($key); |
2192 | 2192 |
|
2193 | 2193 |
my $query = qq|SELECT * FROM payment_terms ORDER BY id|; |
2194 |
|
|
2194 |
|
|
2195 | 2195 |
$self->{$key} = selectall_hashref_query($self, $dbh, $query); |
2196 | 2196 |
|
2197 | 2197 |
$main::lxdebug->leave_sub(); |
... | ... | |
2356 | 2356 |
if ($params{"employees"}) { |
2357 | 2357 |
$self->_get_employees($dbh, "all_employees", $params{"employees"}); |
2358 | 2358 |
} |
2359 |
|
|
2359 |
|
|
2360 | 2360 |
if ($params{"salesmen"}) { |
2361 | 2361 |
$self->_get_employees($dbh, "all_salesmen", $params{"salesmen"}); |
2362 | 2362 |
} |
... | ... | |
2368 | 2368 |
if ($params{"dunning_configs"}) { |
2369 | 2369 |
$self->_get_dunning_configs($dbh, $params{"dunning_configs"}); |
2370 | 2370 |
} |
2371 |
|
|
2371 |
|
|
2372 | 2372 |
if($params{"currencies"}) { |
2373 | 2373 |
$self->_get_currencies($dbh, $params{"currencies"}); |
2374 | 2374 |
} |
2375 |
|
|
2375 |
|
|
2376 | 2376 |
if($params{"customers"}) { |
2377 | 2377 |
if (ref $params{"customers"} eq 'HASH') { |
2378 | 2378 |
$self->_get_customers($dbh, $params{"customers"}{key}, $params{"customers"}{limit}); |
... | ... | |
2380 | 2380 |
$self->_get_customers($dbh, $params{"customers"}); |
2381 | 2381 |
} |
2382 | 2382 |
} |
2383 |
|
|
2383 |
|
|
2384 | 2384 |
if($params{"vendors"}) { |
2385 | 2385 |
if (ref $params{"vendors"} eq 'HASH') { |
2386 | 2386 |
$self->_get_vendors($dbh, $params{"vendors"}{key}, $params{"vendors"}{limit}); |
... | ... | |
2388 | 2388 |
$self->_get_vendors($dbh, $params{"vendors"}); |
2389 | 2389 |
} |
2390 | 2390 |
} |
2391 |
|
|
2391 |
|
|
2392 | 2392 |
if($params{"payments"}) { |
2393 | 2393 |
$self->_get_payments($dbh, $params{"payments"}); |
2394 | 2394 |
} |
... | ... | |
3115 | 3115 |
qq|WHERE trans_id = | . $trans_id |
3116 | 3116 |
. $restriction . qq| | |
3117 | 3117 |
. $order; |
3118 |
|
|
3118 |
|
|
3119 | 3119 |
my $sth = $dbh->prepare($query) || $self->dberror($query); |
3120 | 3120 |
|
3121 | 3121 |
$sth->execute() || $self->dberror("$query"); |
... | ... | |
3126 | 3126 |
$hash_ref->{snumbers} =~ s/^.+_(.*)$/$1/g; |
3127 | 3127 |
$tempArray[$i++] = $hash_ref; |
3128 | 3128 |
} |
3129 |
$main::lxdebug->leave_sub() and return \@tempArray
|
|
3129 |
$main::lxdebug->leave_sub() and return \@tempArray |
|
3130 | 3130 |
if ($i > 0 && $tempArray[0] ne ""); |
3131 | 3131 |
} |
3132 | 3132 |
$main::lxdebug->leave_sub(); |
Auch abrufbar als: Unified diff
Whitespace Purge