Revision d331a3d7
Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
68 | 68 |
my $ref = $sth->fetchrow_hashref("NAME_lc"); |
69 | 69 |
|
70 | 70 |
map { $form->{$_} = $ref->{$_} } keys %$ref; |
71 |
$sth->finish; |
|
71 | 72 |
|
72 |
# remove any trailing whitespace |
|
73 |
$form->{curr} =~ s/\s*$//; |
|
73 |
#get name of currency instead of id: |
|
74 |
$query = qq|SELECT curr FROM currencies WHERE id=?|; |
|
75 |
($form->{curr}) = selectrow_query($form, $dbh, $query, conv_i($form->{curr})); |
|
74 | 76 |
|
75 |
$sth->finish; |
|
76 | 77 |
if ( $form->{salesman_id} ) { |
77 | 78 |
my $query = |
78 | 79 |
qq|SELECT ct.name AS salesman | . |
... | ... | |
319 | 320 |
qq|user_password = ?, | . |
320 | 321 |
qq|c_vendor_id = ?, | . |
321 | 322 |
qq|klass = ?, | . |
322 |
qq|curr = ?, | .
|
|
323 |
qq|curr = (SELECT id FROM currencies WHERE curr = ?), | .
|
|
323 | 324 |
qq|taxincluded_checked = ? | . |
324 | 325 |
qq|WHERE id = ?|; |
325 | 326 |
my @values = ( |
... | ... | |
362 | 363 |
$form->{user_password}, |
363 | 364 |
$form->{c_vendor_id}, |
364 | 365 |
conv_i($form->{klass}), |
365 |
substr($form->{currency}, 0, 3),
|
|
366 |
$form->{currency},
|
|
366 | 367 |
$form->{taxincluded_checked} ne '' ? $form->{taxincluded_checked} : undef, |
367 | 368 |
$form->{id} |
368 | 369 |
); |
... | ... | |
471 | 472 |
qq| username = ?, | . |
472 | 473 |
qq| user_password = ?, | . |
473 | 474 |
qq| v_customer_id = ?, | . |
474 |
qq| curr = ? | .
|
|
475 |
qq| curr = (SELECT id FROM currencies WHERE curr = ?) | .
|
|
475 | 476 |
qq|WHERE id = ?|; |
476 | 477 |
my @values = ( |
477 | 478 |
$form->{vendornumber}, |
... | ... | |
511 | 512 |
$form->{username}, |
512 | 513 |
$form->{user_password}, |
513 | 514 |
$form->{v_customer_id}, |
514 |
substr($form->{currency}, 0, 3),
|
|
515 |
$form->{currency},
|
|
515 | 516 |
$form->{id} |
516 | 517 |
); |
517 | 518 |
do_query($form, $dbh, $query, @values); |
Auch abrufbar als: Unified diff
Nutzung der Tabelle currencies
Dieser Commmit passt den Code an, um die Tabelle currencies zu nutzen.