Revision aa0fece0
Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt
SL/CT.pm | ||
---|---|---|
72 | 72 |
|
73 | 73 |
#get name of currency instead of id: |
74 | 74 |
$query = qq|SELECT name AS curr FROM currencies WHERE id=?|; |
75 |
($form->{curr}) = selectrow_query($form, $dbh, $query, conv_i($form->{curr})); |
|
75 |
($form->{curr}) = selectrow_query($form, $dbh, $query, conv_i($form->{currency_id}));
|
|
76 | 76 |
|
77 | 77 |
if ( $form->{salesman_id} ) { |
78 | 78 |
my $query = |
... | ... | |
276 | 276 |
$query = qq|SELECT nextval('id')|; |
277 | 277 |
($form->{id}) = selectrow_query($form, $dbh, $query); |
278 | 278 |
|
279 |
$query = qq|INSERT INTO customer (id, name) VALUES (?, '')|;
|
|
279 |
$query = qq|INSERT INTO customer (id, name, currency_id) VALUES (?, '', (SELECT currency_id FROM defaults))|;
|
|
280 | 280 |
do_query($form, $dbh, $query, $form->{id}); |
281 | 281 |
} |
282 | 282 |
|
... | ... | |
423 | 423 |
$query = qq|SELECT nextval('id')|; |
424 | 424 |
($form->{id}) = selectrow_query($form, $dbh, $query); |
425 | 425 |
|
426 |
$query = qq|INSERT INTO vendor (id, name) VALUES (?, '')|;
|
|
426 |
$query = qq|INSERT INTO vendor (id, name, currency_id) VALUES (?, '', (SELECT currency_id FROM defaults))|;
|
|
427 | 427 |
do_query($form, $dbh, $query, $form->{id}); |
428 | 428 |
|
429 | 429 |
my $vendornumber = SL::TransNumber->new(type => 'vendor', |
SL/DO.pm | ||
---|---|---|
227 | 227 |
$query = qq|SELECT nextval('id')|; |
228 | 228 |
($form->{id}) = selectrow_query($form, $dbh, $query); |
229 | 229 |
|
230 |
$query = qq|INSERT INTO delivery_orders (id, donumber, employee_id) VALUES (?, '', ?)|;
|
|
230 |
$query = qq|INSERT INTO delivery_orders (id, donumber, employee_id, currency_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults LIMIT 1))|;
|
|
231 | 231 |
do_query($form, $dbh, $query, $form->{id}, conv_i($form->{employee_id})); |
232 | 232 |
} |
233 | 233 |
|
... | ... | |
362 | 362 |
conv_i($form->{salesman_id}), conv_i($form->{cp_id}), |
363 | 363 |
$form->{transaction_description}, |
364 | 364 |
$form->{type} =~ /^sales/ ? 't' : 'f', |
365 |
conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), substr($form->{currency}, 0, 3),
|
|
365 |
conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{currency},
|
|
366 | 366 |
conv_i($form->{id})); |
367 | 367 |
do_query($form, $dbh, $query, @values); |
368 | 368 |
|
SL/Form.pm | ||
---|---|---|
2864 | 2864 |
"a.department_id" => "department_id", |
2865 | 2865 |
"d.description" => "department", |
2866 | 2866 |
"ct.name" => $table, |
2867 |
"cu.name AS curr" => "currency",
|
|
2867 |
"cu.name" => "currency",
|
|
2868 | 2868 |
"current_date + ct.terms" => "duedate", |
2869 | 2869 |
); |
2870 | 2870 |
|
sql/Pg-upgrade2/currencies.pl | ||
---|---|---|
141 | 141 |
$self->db_query($query); |
142 | 142 |
|
143 | 143 |
#Check wheather defaultcurrency is already in table currencies: |
144 |
$query = qq|SELECT curr FROM currencies WHERE curr = '| . $main::form->{defaultcurrency} . qq|'|;
|
|
144 |
$query = qq|SELECT name FROM currencies WHERE name = '| . $main::form->{defaultcurrency} . qq|'|;
|
|
145 | 145 |
my ($insert_default) = $self->dbh->selectrow_array($query); |
146 | 146 |
|
147 | 147 |
if (!$insert_default) { |
148 |
$query = qq|INSERT INTO currencies (curr) VALUES ('| . $main::form->{defaultcurrency} . qq|')|;
|
|
148 |
$query = qq|INSERT INTO currencies (name) VALUES ('| . $main::form->{defaultcurrency} . qq|')|;
|
|
149 | 149 |
$self->db_query($query); |
150 | 150 |
} |
151 | 151 |
|
templates/webpages/ct/form_header.html | ||
---|---|---|
233 | 233 |
<td>[% L.input_tag('bic', bic, maxlength=100, size=30) %]</td> |
234 | 234 |
[%- IF ALL_CURRENCIES.size %] |
235 | 235 |
<th align="right">[% 'Currency' | $T8 %]</th> |
236 |
<td>[% L.select_tag('currency', ALL_CURRENCIES, default = currency, with_empty = 1) %]</td>
|
|
236 |
<td>[% L.select_tag('currency', ALL_CURRENCIES, default = currency) %]</td> |
|
237 | 237 |
[%- END %] |
238 | 238 |
</tr> |
239 | 239 |
|
Auch abrufbar als: Unified diff
Behebt Bugs für Währungen
Vergessene Anpassungen von der Spaltenumbenennung in currencies.pl
wurden noch repariert (auch in currencies.pl selbst). Weiterhin
wurden noch andere Bugs repariert, wie Anlegen von Kunden, korrekte
Anzeige der Währung bei Lieferanten und Kunden, speichern von Rechnungen
(VK und EK), Angebot und Lieferschein erfassen.