Revision ae27679f
Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
1286 | 1286 |
} |
1287 | 1287 |
|
1288 | 1288 |
$sth->finish; |
1289 |
|
|
1290 |
#Get currencies: |
|
1291 |
$query = qq|SELECT curr FROM currencies ORDER BY id|; |
|
1292 |
|
|
1293 |
$form->{CURRENCIES} = []; |
|
1294 |
|
|
1295 |
$sth = prepare_execute_query($form, $dbh, $query); |
|
1296 |
$sth->execute || $form->dberror($query); |
|
1297 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
|
1298 |
push @{ $form->{ CURRENCIES } } , $ref; |
|
1299 |
} |
|
1300 |
$sth->finish; |
|
1301 |
|
|
1302 |
#Which of them is the default currency? |
|
1303 |
$query = qq|SELECT curr AS defaultcurrency FROM currencies WHERE id = (SELECT curr FROM defaults LIMIT 1);|; |
|
1304 |
$sth = $dbh->prepare($query); |
|
1305 |
$sth->execute || $form->dberror($query); |
|
1306 |
|
|
1307 |
$form->{defaultcurrency} = ($sth->fetchrow_hashref("NAME_lc"))->{defaultcurrency}; |
|
1308 |
|
|
1309 |
$sth->finish; |
|
1310 |
|
|
1311 | 1289 |
$dbh->disconnect; |
1312 | 1290 |
|
1313 | 1291 |
$main::lxdebug->leave_sub(); |
locale/de/all | ||
---|---|---|
18 | 18 |
'#1 h' => '#1 h', |
19 | 19 |
'#1 of #2 importable objects were imported.' => '#1 von #2 importierbaren Objekten wurden importiert.', |
20 | 20 |
'#1 prices were updated.' => '#1 Preise wurden aktualisiert.', |
21 |
'(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' => '(empfohlen) Fügen Sie die verwaisten Währungen in Ihr System ein. Sie können den Namen der Währung einfach ändern, indem Sie die Felder oben bearbeiten. Benutzen Sie keine Namen von Währungen, die Sie bereits benutzen.', |
|
22 | 21 |
'* there are restrictions for the perpetual method, look at chapter "Bemerkungen zu Bestandsmethode" in' => ' für die Bestandsmethode gibt es Einschränkungen, siehe Kapitel "Bemerkungen zu Bestandsmethode" in', |
23 | 22 |
'*) Since version 2.7 these parameters ares set in the client database and not in the configuration file, details in chapter:' => '*) Seit 2.7 werden Gewinnermittlungsart, Versteuerungsart und Warenbuchungsmethode in der Mandanten-DB gesteuert und nicht mehr in der Konfigurationsdatei, Umstellungs-Details:', |
24 | 23 |
'*/' => '*/', |
... | ... | |
319 | 318 |
'Both' => 'Beide', |
320 | 319 |
'Bottom' => 'Unten', |
321 | 320 |
'Bought' => 'Gekauft', |
322 |
'Break up the update and contact a service provider.' => 'Diese Option bricht das Update ab. Bitte kontaktieren Sie Ihren Administrator oder beauftragen einen Dienstleister.', |
|
323 | 321 |
'Buchungsdatum' => 'Buchungsdatum', |
324 | 322 |
'Buchungsgruppe' => 'Buchungsgruppe', |
325 | 323 |
'Buchungsgruppe (database ID)' => 'Buchungsgruppe (Datenbank-ID)', |
... | ... | |
934 | 932 |
'From' => 'Von', |
935 | 933 |
'From Date' => 'Von', |
936 | 934 |
'From this version on a new feature is available.' => 'Ab dieser Version ist ein neues Feature verfügbar.', |
937 |
'From this version on it is necessary to name a default value.' => 'Ab dieser Version benötigt kivitendo eine Standardwährung.', |
|
938 | 935 |
'From this version on the partnumber of services, articles and assemblies have to be unique.' => 'Ab dieser Version müssen Artikelnummern eindeutig vergeben werden.', |
939 | 936 |
'From this version on the taxkey 0 must have a tax rate of 0 (for DATEV compatibility).' => 'Ab dieser Version muss der Steuerschlüssel 0 einen Steuersatz von 0% haben (auf Grund der DATEV-Kompatibilität).', |
940 | 937 |
'Full Access' => 'Vollzugriff', |
... | ... | |
1289 | 1286 |
'No data was found.' => 'Es wurden keine Daten gefunden.', |
1290 | 1287 |
'No databases have been found on this server.' => 'Auf diesem Server wurden keine Datenbanken gefunden.', |
1291 | 1288 |
'No datasets have been selected.' => 'Es wurden keine Datenbanken ausgewählt.', |
1292 |
'No default currency' => 'Keine Standardwährung', |
|
1293 | 1289 |
'No department has been created yet.' => 'Es wurde noch keine Abteilung erfasst.', |
1294 | 1290 |
'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgewählt.', |
1295 | 1291 |
'No entries were found which had no unit assigned to them.' => 'Es wurden keine Einträge gefunden, denen keine Einheit zugeordnet war.', |
... | ... | |
1375 | 1371 |
'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar', |
1376 | 1372 |
'Orientation' => 'Seitenformat', |
1377 | 1373 |
'Orphaned' => 'Nie benutzt', |
1378 |
'Orphaned currencies' => 'Verwaiste Währungen', |
|
1379 | 1374 |
'Other users\' follow-ups' => 'Wiedervorlagen anderer Benutzer', |
1380 | 1375 |
'Other values are ignored.' => 'Andere Eingaben werden ignoriert.', |
1381 | 1376 |
'Others' => 'Andere', |
... | ... | |
1459 | 1454 |
'Please contact your administrator.' => 'Bitte wenden Sie sich an Ihren Administrator.', |
1460 | 1455 |
'Please define a taxkey for the following taxes and run the update again:' => 'Bitte definieren Sie einen Steuerschlüssel für die folgenden Steuern und starten Sie dann das Update erneut:', |
1461 | 1456 |
'Please enter a profile name.' => 'Bitte geben Sie einen Profilnamen an.', |
1462 |
'Please enter the currency you are working with.' => 'Bitte geben Sie die Währung an, mit der Sie arbeiten.', |
|
1463 | 1457 |
'Please enter the login for the new user.' => 'Bitte geben Sie das Login für den neuen Benutzer ein.', |
1464 | 1458 |
'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage für die neue Datenbank benutzt wird:', |
1465 | 1459 |
'Please enter the name of the dataset you want to restore the backup in.' => 'Bitte geben Sie den Namen der Datenbank ein, in der Sie die Sicherung wiederherstellen wollen.', |
... | ... | |
1621 | 1615 |
'Removed spoolfiles!' => 'Druckdateien entfernt!', |
1622 | 1616 |
'Removing marked entries from queue ...' => 'Markierte Einträge werden von der Warteschlange entfernt ...', |
1623 | 1617 |
'Rename the group' => 'Gruppe umbenennen', |
1624 |
'Replace the orphaned currencies by other not orphaned currencies. To do so, please delete the currency in the textfields above and replace it by another currency. You could loose or change unintentionally exchangerates. Go on very carefully since you could destroy transactions.' => 'Ersetze die Währungen durch andere gültige Währungen. Wenn Sie sich hierfür entscheiden, ersetzen Sie bitte alle Währungen, die oben angegeben sind, durch Währungen, die in Ihrem System ordnungsgemäß eingetragen sind. Alle eingetragenen Wechselkurse für die verwaiste Währung werden dabei gelöscht. Bitte gehen Sie sehr vorsichtig vor, denn die betroffenen Buchungen können unter Umständen kaputt gehen.', |
|
1625 | 1618 |
'Report Positions' => 'Berichte', |
1626 | 1619 |
'Report about warehouse contents' => 'Lagerbestand anzeigen', |
1627 | 1620 |
'Report about warehouse transactions' => 'Lagerbuchungen anzeigen', |
... | ... | |
1930 | 1923 |
'Text variables: \'MAXLENGTH=n\' sets the maximum entry length to \'n\'.' => 'Textzeilen: \'MAXLENGTH=n\' setzt eine Maximallänge von n Zeichen.', |
1931 | 1924 |
'Text, text field and number variables: The default value will be used as-is.' => 'Textzeilen, Textfelder und Zahlenvariablen: Der Standardwert wird so wie er ist übernommen.', |
1932 | 1925 |
'That export does not exist.' => 'Dieser Export existiert nicht.', |
1933 |
'That is why kivitendo could not find a default currency.' => 'Daher konnte kivitendo keine Standardwährung finden.', |
|
1934 | 1926 |
'The \'tag\' field must only consist of alphanumeric characters or the carachters - _ ( )' => 'Das Feld \'tag\' darf nur aus alphanumerischen Zeichen und den Zeichen - _ ( ) bestehen.', |
1935 | 1927 |
'The AP transaction #1 has been deleted.' => 'Die Kreditorenbuchung #1 wurde gelöscht.', |
1936 | 1928 |
'The AR transaction #1 has been deleted.' => 'Die Debitorenbuchung #1 wurde gelöscht.', |
... | ... | |
2010 | 2002 |
'The follow-up date is missing.' => 'Das Wiedervorlagedatum fehlt.', |
2011 | 2003 |
'The following Buchungsgruppen have already been created:' => 'Die folgenden Buchungsgruppen wurden bereits angelegt:', |
2012 | 2004 |
'The following Datasets need to be updated' => 'Folgende Datenbanken müssen aktualisiert werden', |
2013 |
'The following currencies have been used, but they are not defined:' => 'Die folgenden Währungen wurden benutzt, sind aber nicht ordnungsgemäß in der Datenbank eingetragen:', |
|
2014 | 2005 |
'The following drafts have been saved and can be loaded.' => 'Die folgenden Entwürfe wurden gespeichert und können geladen werden.', |
2015 | 2006 |
'The following old files whose settings have to be merged manually into the new configuration file "config/kivitendo.conf" still exist:' => 'Es existieren noch die folgenden alten Dateien, deren Einstellungen manuell in die neue Konfiguratsdatei "config/kivitendo.conf" migriert werden müssen:', |
2016 | 2007 |
'The following transaction contains wrong taxes:' => 'Die folgende Buchung enthält falsche Steuern:', |
... | ... | |
2116 | 2107 |
'There are no entries in the background job history.' => 'Es gibt keine Einträge im Hintergrund-Job-Verlauf.', |
2117 | 2108 |
'There are no items in stock.' => 'Dieser Artikel ist nicht eingelagert.', |
2118 | 2109 |
'There are no items on your TODO list at the moment.' => 'Ihre Aufgabenliste enthält momentan keine Einträge.', |
2119 |
'There are several options you can handle this problem, please select one:' => 'Bitte wählen Sie eine der folgenden Optionen, um mit dem Problem umzugehen:', |
|
2120 | 2110 |
'There are still entries in the database for which no unit has been assigned.' => 'Es gibt noch Einträge in der Datenbank, für die keine Einheit zugeordnet ist.', |
2121 | 2111 |
'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' => 'Einige der Lagerbewegungen sind nicht vollständig und Lagerbewegungen können nachträglich nicht mehr verändert werden. Wollen Sie wirklich fortfahren?', |
2122 |
'There are undefined currencies in your system.' => 'In Ihrer Datenbank wurden Währungen benutzt, die nicht ordnungsgemäß in den Währungen eingetragen wurden.', |
|
2123 | 2112 |
'There are usually three ways to install Perl modules.' => 'Es gibt normalerweise drei Arten, ein Perlmodul zu installieren.', |
2124 | 2113 |
'There is already a taxkey 0 with tax rate not 0.' => 'Es existiert bereits ein Steuerschlüssel mit Steuersatz ungleich 0%.', |
2125 | 2114 |
'There is an inconsistancy in your database.' => 'In Ihrer Datenbank sind Unstimmigkeiten vorhanden.', |
... | ... | |
2354 | 2343 |
'You cannot create an invoice for delivery orders from different vendors.' => 'Sie können keine Rechnung aus Lieferscheinen von verschiedenen Lieferanten erstellen.', |
2355 | 2344 |
'You do not have the permissions to access this function.' => 'Sie verfügen nicht über die notwendigen Rechte, um auf diese Funktion zuzugreifen.', |
2356 | 2345 |
'You have entered or selected the following shipping address for this customer:' => 'Sie haben die folgende Lieferadresse eingegeben oder ausgewählt:', |
2357 |
'You have never worked with currencies.' => 'Sie haben noch nie mit Währungen gearbeitet.', |
|
2358 | 2346 |
'You have not added bank accounts yet.' => 'Sie haben noch keine Bankkonten angelegt.', |
2359 | 2347 |
'You have not selected any delivery order.' => 'Sie haben keinen Lieferschein ausgewählt.', |
2360 | 2348 |
'You have not selected any export.' => 'Sie haben keinen Export ausgewählt.', |
sql/Pg-upgrade2/currencies.pl | ||
---|---|---|
1 |
# @tag: currencies |
|
2 |
# @description: Erstellt neue Tabelle currencies. Währungen können dann einfacher eingegeben und unkritisch geändert werden. |
|
3 |
# @depends: release_3_0_0 rm_whitespaces |
|
4 |
# @charset: utf-8 |
|
5 |
|
|
6 |
use utf8; |
|
7 |
use strict; |
|
8 |
|
|
9 |
die("This script cannot be run from the command line.") unless ($main::form); |
|
10 |
|
|
11 |
sub mydberror { |
|
12 |
my ($msg) = @_; |
|
13 |
die($dbup_locale->text("Database update error:") . "<br>$msg<br>" . $DBI::errstr); |
|
14 |
} |
|
15 |
|
|
16 |
sub do_query { |
|
17 |
my ($query, $may_fail) = @_; |
|
18 |
|
|
19 |
if (!$dbh->do($query)) { |
|
20 |
mydberror($query) unless ($may_fail); |
|
21 |
$dbh->rollback(); |
|
22 |
$dbh->begin_work(); |
|
23 |
} |
|
24 |
} |
|
25 |
|
|
26 |
|
|
27 |
sub do_update { |
|
28 |
#Check wheather default currency exists |
|
29 |
my $query = qq|SELECT curr FROM defaults|; |
|
30 |
my ($currencies) = $dbh->selectrow_array($query); |
|
31 |
|
|
32 |
if (length($currencies) == 0 and length($main::form->{defaultcurrency}) == 0){ |
|
33 |
print_no_default_currency(); |
|
34 |
return 2; |
|
35 |
} else { |
|
36 |
if (length($main::form->{defaultcurrency}) == 0){ |
|
37 |
$main::form->{defaultcurrency} = (split m/:/, $currencies)[0]; |
|
38 |
} |
|
39 |
} |
|
40 |
my @currency_array = grep {$_ ne '' } split m/:/, $currencies; |
|
41 |
|
|
42 |
$query = qq|SELECT DISTINCT curr FROM ar |
|
43 |
UNION |
|
44 |
SELECT DISTINCT curr FROM ap |
|
45 |
UNION |
|
46 |
SELECT DISTINCT curr FROM oe |
|
47 |
UNION |
|
48 |
SELECT DISTINCT curr FROM customer |
|
49 |
UNION |
|
50 |
SELECT DISTINCT curr FROM delivery_orders |
|
51 |
UNION |
|
52 |
SELECT DISTINCT curr FROM exchangerate |
|
53 |
UNION |
|
54 |
SELECT DISTINCT curr FROM vendor|; |
|
55 |
|
|
56 |
my $sth = $dbh->prepare($query); |
|
57 |
$sth->execute || $self->dberror($query); |
|
58 |
|
|
59 |
$main::form->{ORPHANED_CURRENCIES} = []; |
|
60 |
my $is_orphaned; |
|
61 |
my $rowcount = 0; |
|
62 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
|
63 |
next unless length($ref->{curr}) > 0; |
|
64 |
$is_orphaned = 1; |
|
65 |
foreach my $key (split(/:/, $currencies)) { |
|
66 |
if ($ref->{curr} eq $key) { |
|
67 |
$is_orphaned = 0; |
|
68 |
last; |
|
69 |
} |
|
70 |
} |
|
71 |
if ($is_orphaned) { |
|
72 |
push @{ $main::form->{ORPHANED_CURRENCIES} }, $ref; |
|
73 |
$main::form->{ORPHANED_CURRENCIES}[$rowcount]->{name} = "curr_$rowcount"; |
|
74 |
$rowcount++; |
|
75 |
} |
|
76 |
} |
|
77 |
|
|
78 |
$sth->finish; |
|
79 |
|
|
80 |
if (scalar @{ $main::form->{ORPHANED_CURRENCIES} } > 0 and not ($main::form->{continue_options})) { |
|
81 |
print_orphaned_currencies(); |
|
82 |
return 2; |
|
83 |
} |
|
84 |
|
|
85 |
if ($main::form->{continue_options} eq 'break_up') { |
|
86 |
return 0; |
|
87 |
} |
|
88 |
|
|
89 |
if ($main::form->{continue_options} eq 'insert') { |
|
90 |
for my $i (0..($rowcount-1)){ |
|
91 |
push @currency_array, $form->{"curr_$i"}; |
|
92 |
} |
|
93 |
create_and_fill_table(@currency_array); |
|
94 |
return 1; |
|
95 |
} |
|
96 |
|
|
97 |
my $still_orphaned; |
|
98 |
if ($main::form->{continue_options} eq 'replace') { |
|
99 |
for my $i (0..($rowcount - 1)){ |
|
100 |
$still_orphaned = 1; |
|
101 |
for my $item (@currency_array){ |
|
102 |
if ($main::form->{"curr_$i"} eq $item){ |
|
103 |
$still_orphaned = 0; |
|
104 |
$query = qq|DELETE FROM exchangerate WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
105 |
do_query($query); |
|
106 |
$query = qq|UPDATE ap SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
107 |
do_query($query); |
|
108 |
$query = qq|UPDATE ar SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
109 |
do_query($query); |
|
110 |
$query = qq|UPDATE oe SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
111 |
do_query($query); |
|
112 |
$query = qq|UPDATE customer SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
113 |
do_query($query); |
|
114 |
$query = qq|UPDATE delivery_orders SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
115 |
do_query($query); |
|
116 |
$query = qq|UPDATE vendor SET curr = '| . $main::form->{"curr_$i"} . qq|' WHERE curr = '| . $main::form->{"old_curr_$i"} . qq|'|; |
|
117 |
do_query($query); |
|
118 |
last; |
|
119 |
} |
|
120 |
} |
|
121 |
if ($still_orphaned){ |
|
122 |
$main::form->{continue_options} = ''; |
|
123 |
return do_update(); |
|
124 |
} |
|
125 |
} |
|
126 |
create_and_fill_table(@currency_array); |
|
127 |
return 1; |
|
128 |
} |
|
129 |
|
|
130 |
#No orphaned currencies, so create table: |
|
131 |
create_and_fill_table(@currency_array); |
|
132 |
return 1; |
|
133 |
}; # end do_update |
|
134 |
|
|
135 |
sub create_and_fill_table { |
|
136 |
#Create an fill table currencies: |
|
137 |
my $query = qq|CREATE TABLE currencies (id INTEGER DEFAULT nextval(('id'::text)::regclass) UNIQUE NOT NULL, curr TEXT PRIMARY KEY)|; |
|
138 |
do_query($query); |
|
139 |
foreach my $item ( @_ ) { |
|
140 |
$query = qq|INSERT INTO currencies (curr) VALUES ('| . $item . qq|')|; |
|
141 |
do_query($query); |
|
142 |
} |
|
143 |
|
|
144 |
#Set default currency if no currency was chosen: |
|
145 |
$query = qq|UPDATE ap SET curr = '| . $main::form->{"defaultcurrency"} . qq|' WHERE curr IS NULL or curr='';|; |
|
146 |
$query .= qq|UPDATE ar SET curr = '| . $main::form->{"defaultcurrency"} . qq|' WHERE curr IS NULL or curr='';|; |
|
147 |
$query .= qq|UPDATE oe SET curr = '| . $main::form->{"defaultcurrency"} . qq|' WHERE curr IS NULL or curr='';|; |
|
148 |
$query .= qq|UPDATE customer SET curr = '| . $main::form->{"defaultcurrency"} . qq|' WHERE curr IS NULL or curr='';|; |
|
149 |
$query .= qq|UPDATE delivery_orders SET curr = '| . $main::form->{"defaultcurrency"} . qq|' WHERE curr IS NULL or curr='';|; |
|
150 |
$query .= qq|UPDATE vendor SET curr = '| . $main::form->{"defaultcurrency"} . qq|' WHERE curr IS NULL or curr='';|; |
|
151 |
$query .= qq|DELETE FROM exchangerate WHERE curr IS NULL or curr='';|; |
|
152 |
do_query($query); |
|
153 |
|
|
154 |
#Check wheather defaultcurrency is already in table currencies: |
|
155 |
$query = qq|SELECT curr FROM currencies WHERE curr = '| . $main::form->{defaultcurrency} . qq|'|; |
|
156 |
my ($insert_default) = $dbh->selectrow_array($query); |
|
157 |
|
|
158 |
if (!$insert_default) { |
|
159 |
$query = qq|INSERT INTO currencies (curr) VALUES ('| . $main::form->{defaultcurrency} . qq|')|; |
|
160 |
do_query($query); |
|
161 |
} |
|
162 |
|
|
163 |
#Create a new columns currency and update with curr.id: |
|
164 |
$query = qq|ALTER TABLE ap ADD currency INTEGER; |
|
165 |
ALTER TABLE ar ADD currency INTEGER; |
|
166 |
ALTER TABLE oe ADD currency INTEGER; |
|
167 |
ALTER TABLE customer ADD currency INTEGER; |
|
168 |
ALTER TABLE delivery_orders ADD currency INTEGER; |
|
169 |
ALTER TABLE exchangerate ADD currency INTEGER; |
|
170 |
ALTER TABLE vendor ADD currency INTEGER; |
|
171 |
ALTER TABLE defaults ADD currency INTEGER;|; |
|
172 |
do_query($query); |
|
173 |
#Set defaultcurrency: |
|
174 |
$query = qq|UPDATE defaults SET currency= (SELECT id FROM currencies WHERE curr = '| . $main::form->{defaultcurrency} . qq|')|; |
|
175 |
do_query($query); |
|
176 |
$query = qq|UPDATE ap SET currency = (SELECT id FROM currencies c WHERE c.curr = ap.curr); |
|
177 |
UPDATE ar SET currency = (SELECT id FROM currencies c WHERE c.curr = ar.curr); |
|
178 |
UPDATE oe SET currency = (SELECT id FROM currencies c WHERE c.curr = oe.curr); |
|
179 |
UPDATE customer SET currency = (SELECT id FROM currencies c WHERE c.curr = customer.curr); |
|
180 |
UPDATE delivery_orders SET currency = (SELECT id FROM currencies c WHERE c.curr = delivery_orders.curr); |
|
181 |
UPDATE exchangerate SET currency = (SELECT id FROM currencies c WHERE c.curr = exchangerate.curr); |
|
182 |
UPDATE vendor SET currency = (SELECT id FROM currencies c WHERE c.curr = vendor.curr);|; |
|
183 |
do_query($query); |
|
184 |
|
|
185 |
#Drop column 'curr': |
|
186 |
$query = qq|ALTER TABLE ap DROP COLUMN curr; |
|
187 |
ALTER TABLE ar DROP COLUMN curr; |
|
188 |
ALTER TABLE oe DROP COLUMN curr; |
|
189 |
ALTER TABLE customer DROP COLUMN curr; |
|
190 |
ALTER TABLE delivery_orders DROP COLUMN curr; |
|
191 |
ALTER TABLE exchangerate DROP COLUMN curr; |
|
192 |
ALTER TABLE vendor DROP COLUMN curr; |
|
193 |
ALTER TABLE defaults DROP COLUMN curr;|; |
|
194 |
do_query($query); |
|
195 |
|
|
196 |
#Rename currency to curr: |
|
197 |
$query = qq|ALTER TABLE defaults RENAME COLUMN currency TO curr; |
|
198 |
ALTER TABLE ap RENAME COLUMN currency TO curr; |
|
199 |
ALTER TABLE ar RENAME COLUMN currency TO curr; |
|
200 |
ALTER TABLE oe RENAME COLUMN currency TO curr; |
|
201 |
ALTER TABLE customer RENAME COLUMN currency TO curr; |
|
202 |
ALTER TABLE delivery_orders RENAME COLUMN currency TO curr; |
|
203 |
ALTER TABLE exchangerate RENAME COLUMN currency TO curr; |
|
204 |
ALTER TABLE vendor RENAME COLUMN currency TO curr;|; |
|
205 |
do_query($query); |
|
206 |
|
|
207 |
#Set NOT NULL constraints: |
|
208 |
$query = qq|ALTER TABLE ap ALTER COLUMN curr SET NOT NULL; |
|
209 |
ALTER TABLE ar ALTER COLUMN curr SET NOT NULL; |
|
210 |
ALTER TABLE oe ALTER COLUMN curr SET NOT NULL; |
|
211 |
ALTER TABLE customer ALTER COLUMN curr SET NOT NULL; |
|
212 |
ALTER TABLE delivery_orders ALTER COLUMN curr SET NOT NULL; |
|
213 |
ALTER TABLE exchangerate ALTER COLUMN curr SET NOT NULL; |
|
214 |
ALTER TABLE vendor ALTER COLUMN curr SET NOT NULL; |
|
215 |
ALTER TABLE defaults ALTER COLUMN curr SET NOT NULL;|; |
|
216 |
do_query($query); |
|
217 |
|
|
218 |
#Set foreign keys: |
|
219 |
$query = qq|ALTER TABLE ap ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
220 |
ALTER TABLE ar ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
221 |
ALTER TABLE oe ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
222 |
ALTER TABLE customer ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
223 |
ALTER TABLE delivery_orders ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
224 |
ALTER TABLE exchangerate ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
225 |
ALTER TABLE vendor ADD FOREIGN KEY (curr) REFERENCES currencies(id); |
|
226 |
ALTER TABLE defaults ADD FOREIGN KEY (curr) REFERENCES currencies(id);|; |
|
227 |
do_query($query); |
|
228 |
|
|
229 |
}; |
|
230 |
|
|
231 |
sub print_no_default_currency { |
|
232 |
print $main::form->parse_html_template("dbupgrade/no_default_currency"); |
|
233 |
}; |
|
234 |
|
|
235 |
sub print_orphaned_currencies { |
|
236 |
print $main::form->parse_html_template("dbupgrade/orphaned_currencies"); |
|
237 |
}; |
|
238 |
|
|
239 |
return do_update(); |
sql/Pg-upgrade2/rm_whitespaces.pl | ||
---|---|---|
1 |
# @tag: rm_whitespaces |
|
2 |
# @description: Entfernt mögliche Leerzeichen am Anfang und Ende jeder Währung |
|
3 |
# @depends: release_3_0_0 |
|
4 |
# @charset: utf-8 |
|
5 |
|
|
6 |
use utf8; |
|
7 |
use strict; |
|
8 |
|
|
9 |
die("This script cannot be run from the command line.") unless ($main::form); |
|
10 |
|
|
11 |
sub mydberror { |
|
12 |
my ($msg) = @_; |
|
13 |
die($dbup_locale->text("Database update error:") . "<br>$msg<br>" . $DBI::errstr); |
|
14 |
} |
|
15 |
|
|
16 |
sub do_query { |
|
17 |
my ($query, $may_fail) = @_; |
|
18 |
|
|
19 |
if (!$dbh->do($query)) { |
|
20 |
mydberror($query) unless ($may_fail); |
|
21 |
$dbh->rollback(); |
|
22 |
$dbh->begin_work(); |
|
23 |
} |
|
24 |
} |
|
25 |
|
|
26 |
|
|
27 |
sub do_update { |
|
28 |
my $query = qq|UPDATE ar SET curr = RTRIM(LTRIM(curr))|; |
|
29 |
do_query($query); |
|
30 |
$query = qq|UPDATE ap SET curr = RTRIM(LTRIM(curr))|; |
|
31 |
do_query($query); |
|
32 |
$query = qq|UPDATE oe SET curr = RTRIM(LTRIM(curr))|; |
|
33 |
do_query($query); |
|
34 |
$query = qq|UPDATE customer SET curr = RTRIM(LTRIM(curr))|; |
|
35 |
do_query($query); |
|
36 |
$query = qq|UPDATE delivery_orders SET curr = RTRIM(LTRIM(curr))|; |
|
37 |
do_query($query); |
|
38 |
$query = qq|UPDATE exchangerate SET curr = RTRIM(LTRIM(curr))|; |
|
39 |
do_query($query); |
|
40 |
$query = qq|UPDATE vendor SET curr = RTRIM(LTRIM(curr))|; |
|
41 |
do_query($query); |
|
42 |
|
|
43 |
$query = qq|SELECT curr FROM defaults|; |
|
44 |
my ($curr) = selectrow_query($self, $dbh, $query); |
|
45 |
|
|
46 |
$curr =~ s/ //g; |
|
47 |
|
|
48 |
$query = qq|UPDATE defaults SET curr = '$curr'|; |
|
49 |
do_query($query); |
|
50 |
return 1; |
|
51 |
}; |
|
52 |
|
|
53 |
return do_update(); |
templates/webpages/am/edit_defaults.html | ||
---|---|---|
142 | 142 |
</tr> |
143 | 143 |
|
144 | 144 |
<tr> |
145 |
<th align="right">[% 'Default currency' | $T8 %]</th> |
|
146 |
<td colspan="3">[% HTML.escape(defaultcurrency) %]</td> |
|
147 |
</tr> |
|
148 |
|
|
149 |
<tr> |
|
150 |
<input type="hidden" name="rowcount" value="[% CURRENCIES.size %]"> |
|
151 |
<th align="right">[% 'Currencies' | $T8 %]</th> |
|
152 |
<td colspan="3">[% FOREACH row = CURRENCIES %]<input name="curr_[% loop.count %]" size="3" value="[% HTML.escape(row.curr) %]"> |
|
153 |
<input type=hidden name="old_curr_[% loop.count %]" value="[% HTML.escape(defaults_curr) %]"> |
|
154 |
[% END %] |
|
155 |
<input name="new_curr" size="3" value=""> |
|
156 |
</td> |
|
145 |
<th align="right">[% 'Currencies' | $T8 %] <sup>(1)</sup></th> |
|
146 |
<td colspan="3"><input name="curr" size="20" value="[% HTML.escape(defaults_curr) %]"></td> |
|
157 | 147 |
</tr> |
158 | 148 |
|
159 | 149 |
<tr> |
... | ... | |
220 | 210 |
|
221 | 211 |
<hr height="3" noshade> |
222 | 212 |
|
213 |
<p> |
|
214 |
(1) [% 'Enter the abbreviations separated by a colon (i.e CAD:USD:EUR) for your native and foreign currencies' | $T8 %] |
|
215 |
[% 'IMPORTANT NOTE: You cannot safely change currencies, IF you have already booking entries!' | $T8 %] |
|
223 | 216 |
</p> |
224 | 217 |
</form> |
templates/webpages/dbupgrade/no_default_currency.html | ||
---|---|---|
1 |
[%- USE T8 %] |
|
2 |
[% USE HTML %]<div class="listtop">[% 'No default currency' | $T8 %]</div> |
|
3 |
|
|
4 |
<form name="Form" method="post" action="login.pl"> |
|
5 |
<input type="hidden" name="action" value="login"> |
|
6 |
|
|
7 |
<p>[% 'You have never worked with currencies.' | $T8 %]</p> |
|
8 |
<p>[% 'That is why kivitendo could not find a default currency.' | $T8 %]</p> |
|
9 |
<p>[% 'From this version on it is necessary to name a default value.' | $T8 %]</p> |
|
10 |
<p>[% 'Please enter the currency you are working with.' | $T8 %]</p> |
|
11 |
|
|
12 |
<input name="defaultcurrency" value="EUR"> |
|
13 |
<input type="submit" value="[% 'Continue' | $T8 %]"> |
|
14 |
|
|
15 |
</form> |
|
16 |
|
templates/webpages/dbupgrade/orphaned_currencies.html | ||
---|---|---|
1 |
[%- USE T8 %] |
|
2 |
[%- USE L %] |
|
3 |
[% USE HTML %]<div class="listtop">[% 'Orphaned currencies' | $T8 %]</div> |
|
4 |
|
|
5 |
<form name="Form" method="post" action="login.pl"> |
|
6 |
<input type="hidden" name="action" value="login"> |
|
7 |
<input type="hidden" name="defaultcurrency" value="[% HTML.escape(defaultcurrency) %]"> |
|
8 |
|
|
9 |
<p>[% 'There are undefined currencies in your system.' | $T8 %]</p> |
|
10 |
<p>[% 'The following currencies have been used, but they are not defined:' | $T8 %]</p> |
|
11 |
[% FOREACH row = ORPHANED_CURRENCIES %] |
|
12 |
<input name="[% row.name %]" value="[% HTML.escape(row.curr) %]"><br> |
|
13 |
<input type="hidden" name="old_[% row.name %]" value="[% HTML.escape(row.curr) %]"> |
|
14 |
[% END %] |
|
15 |
<p>[% 'There are several options you can handle this problem, please select one:' | $T8 %]</p> |
|
16 |
|
|
17 |
<table width="100%"> |
|
18 |
|
|
19 |
<tr> |
|
20 |
<td> |
|
21 |
[% L.radio_button_tag('continue_options', |
|
22 |
value => 'insert', |
|
23 |
disabled => 0, |
|
24 |
checked => 0) %] |
|
25 |
[% '(recommended) Insert the used currencies in the system. You can simply change the name of the currencies by editing the textfields above. Do not use a name of a currency that is already in use.' | $T8 %] <br> |
|
26 |
[% L.radio_button_tag('continue_options', |
|
27 |
value => 'replace', |
|
28 |
disabled => 0, |
|
29 |
checked => 0) %] |
|
30 |
[% 'Replace the orphaned currencies by other not orphaned currencies. To do so, please delete the currency in the textfields above and replace it by another currency. You could loose or change unintentionally exchangerates. Go on very carefully since you could destroy transactions.' | $T8 %] <br> |
|
31 |
[% L.radio_button_tag('continue_options', |
|
32 |
value => 'break_up', |
|
33 |
disabled => 0, |
|
34 |
checked => 0) %] |
|
35 |
[% 'Break up the update and contact a service provider.' | $T8 %] |
|
36 |
</tr> |
|
37 |
</td> |
|
38 |
</table> |
|
39 |
|
|
40 |
<input type="submit" value="[% 'Continue' | $T8 %]"> |
|
41 |
|
|
42 |
</form> |
|
43 |
|
Auch abrufbar als: Unified diff
Revert "Erstelle Tabelle currencies"
This reverts commit 6d06b178d7e1b488396a91ce337a0801ed5893c8.
Conflicts:
locale/de/all