Revision 5f0a5514
Von Sven Schöling vor mehr als 16 Jahren hinzugefügt
locale/de/all | ||
---|---|---|
180 | 180 |
aktualisieren wollen?', |
181 | 181 |
'Article Code' => 'Artikelk?rzel', |
182 | 182 |
'Article Code missing!' => 'Artikelk?rzel fehlt', |
183 |
'As a result, the saved onhand values of the present goods can be stored into a warehouse designated by you, or will be reset for a proper warehouse tracking' => 'Als Konsequenz können die gespeicherten Mengen entweder in ein Lager überführt werden, oder für eine frische Lagerverwaltung resettet werden.', |
|
183 | 184 |
'Assemblies' => 'Erzeugnisse', |
184 | 185 |
'Assembly Number missing!' => 'Erzeugnisnummer fehlt!', |
185 | 186 |
'Asset' => 'Aktiva/Mittelverwendung', |
... | ... | |
478 | 479 |
'Do you want Lx-Office to create a group for access to all functions?' => 'Wollen Sie, dass Lx-Office eine Gruppe mit Zugriff auf alle Funktionen anlegt?', |
479 | 480 |
'Do you want to <b>limit</b> your search?' => 'Wollen Sie Ihre Suche <b>spezialisieren</b>?', |
480 | 481 |
'Do you want to carry this shipping address over to the new purchase order so that the vendor can deliver the goods directly to your customer?' => 'Wollen Sie diese Lieferadresse in den neuen Lieferantenauftrag übernehmen, damit der Händler die Waren direkt an Ihren Kunden liefern kann?', |
482 |
'Do you want to store the existing onhand values into a new warehouse?' => 'Möchten Sie die vorhandenen Mengendaten in ein Lager übertragen?', |
|
481 | 483 |
'Documents in the WebDAV repository' => 'Dokumente im WebDAV-Repository', |
482 | 484 |
'Done' => 'Fertig', |
483 | 485 |
'Download the backup' => 'Die Sicherungsdatei herunterladen', |
... | ... | |
843 | 845 |
'Lx-Office 2.4.0 introduces two new concepts: tax zones and Buchungsgruppen.' => 'Lx-Office 2.4.0 führt zwei neue Konzepte ein: Steuerzonen und Buchungsgruppen.', |
844 | 846 |
'Lx-Office has been switched to group-based access restrictions.' => 'Lx-Office wurde auf eine gruppenbasierte Benutzerzugriffsverwaltung umgestellt.', |
845 | 847 |
'Lx-Office is about to update the database <b>[% HTML.escape(dbname) %]</b>. You should create a backup of the database before proceeding because the backup might not be reversible.' => 'Lx-Office wird gleich die Datenbank <b>[% HTML.escape(dbname) %]</b> aktualisieren. Sie sollten eine Sicherungskopie der Datenbank erstellen, bevor Sie fortfahren, da die Aktualisierung unter Umständen nicht umkehrbar ist.', |
848 |
'Lx-Office is now able to manage warehouses instead of just tracking the amount of goods in your system.' => 'Lx-Office enthält jetzt auch echte Lagerverwaultung anstatt reiner Mengenzählung.', |
|
846 | 849 |
'Lx-Office website' => 'Lx-Office-Webseite', |
847 | 850 |
'MAILED' => 'Gesendet', |
848 | 851 |
'MSG_BROWSER_DOES_NOT_SUPPORT_IFRAMES' => 'Ihr Browser kann leider keine eingebetteten Frames anzeigen. Bitte wählen Sie ein anderes Menü in der Benutzerkonfiguration im Administrationsmenü aus.', |
... | ... | |
1050 | 1053 |
'Please select the chart of accounts this installation is using from the list below.' => 'Bitte wählen Sie den Kontenrahmen aus, der bei dieser Installation verwendet wird.', |
1051 | 1054 |
'Please select the database you want to backup' => 'Bitte wählen Sie die zu sichernde Datenbank gefunden', |
1052 | 1055 |
'Please seletct the dataset you want to delete:' => 'Bitte wählen Sie die zu löschende Datenbank aus:', |
1056 |
'Please specify a description for the warehouse designated for these goods.' => 'Bitte geben Sie den Namen des Ziellagers für die übernommenen Daten ein.', |
|
1053 | 1057 |
'Plural' => 'Plural', |
1054 | 1058 |
'Port' => 'Port', |
1055 | 1059 |
'Portrait' => 'Hochformat', |
... | ... | |
1262 | 1266 |
'Show overdue sales quotations...' => 'Zeige überfällige Angebote...', |
1263 | 1267 |
'Show your TODO list after loggin in' => 'Aufgabenliste nach dem Anmelden anzeigen', |
1264 | 1268 |
'Signature' => 'Unterschrift', |
1269 |
'Since bin is not enforced in the parts data, please specify a bin where goods without a specified bin will be put.' => 'Da Lagerplätze kein Pflichtfeld sind, geben Sie bitte einen Lagerplatz an, in dem Waren ohne spezifizierten Lagerplatz eingelagert werden sollen.', |
|
1265 | 1270 |
'Skip' => '?berspringen', |
1266 | 1271 |
'Skonto' => 'Skonto', |
1267 | 1272 |
'Skonto Terms' => 'Zahlungsziel Skonto', |
... | ... | |
1458 | 1463 |
'This group will be called "Full Access".' => 'Diese Gruppe wird "Vollzugriff" genannt.', |
1459 | 1464 |
'This installation uses an unknown chart of accounts ("[% HTML.escape(coa) %]"). This database upgrade cannot create standard buchungsgruppen automatically.' => 'Diese Installation benutzt einen unbekannten Kontenrahmen ("[% HTML.escape(coa) %]"). Dieses Datenbankupgrade kann die Standardbuchungsgruppen nicht automatisch anlegen.', |
1460 | 1465 |
'This is a preliminary check for existing sources. Nothing will be created or deleted at this stage!' => 'In diesem Schritt werden bestehende Datenbanken gesucht. Es werden noch keine Änderungen vorgenommen!', |
1466 |
'This update will change the nature the onhand of goods is tracked.' => 'Dieses update ändert die Art und Weise wie Lagermengen gezält werden.', |
|
1461 | 1467 |
'This upgrade script tries to map all existing parts in the database to the newly created Buchungsgruppen.' => 'Dieses Upgradescript versucht, bei allen bestehenden Artikeln neu erstellte Buchungsgruppen zuzuordnen.', |
1462 | 1468 |
'This upgrade script tries to map all existing units in the database to the newly created units.' => 'Dieses Update-Script versucht, alle bestehenden Einheiten automatisch in die neuen Einheiten umzuwandeln.', |
1463 | 1469 |
'This vendor number is already in use.' => 'Diese Lieferantennummer wird bereits verwendet.', |
... | ... | |
1570 | 1576 |
'WHJournal' => 'Lagerbuchungen', |
1571 | 1577 |
'Warehouse' => 'Lager', |
1572 | 1578 |
'Warehouse From' => 'Quelllager', |
1579 |
'Warehouse MIgration' => 'Lagermigration', |
|
1573 | 1580 |
'Warehouse To' => 'Ziellager', |
1574 | 1581 |
'Warehouse content' => 'Lagerbestand', |
1575 | 1582 |
'Warehouse deleted.' => 'Lager gelöscht.', |
sql/Pg-upgrade2/warehouse.pl | ||
---|---|---|
1 |
# @tag: warehouse |
|
2 |
# @description: Diverse neue Tabellen und Spalten zur Mehrlagerfähigkeit inkl. Migration |
|
3 |
# @depends: release_2_4_3 |
|
4 |
|
|
5 |
|
|
6 |
die("This script cannot be run from the command line.") unless ($main::form); |
|
7 |
$do_sql_migration = 0; |
|
8 |
|
|
9 |
sub print_question { |
|
10 |
print $main::form->parse_html_template("dbupgrade/warehouse_form"); |
|
11 |
} |
|
12 |
|
|
13 |
sub do_update { |
|
14 |
if (!$main::form->{do_migrate} |
|
15 |
&& (selectfirst_array_query($main::form, $dbh, $check_sql))[0]) { # check if update is needed |
|
16 |
print_question(); |
|
17 |
return 2; |
|
18 |
} else { |
|
19 |
if ($main::form->{do_migrate} eq 'Y') { |
|
20 |
# if yes, both warehouse and bin must be given |
|
21 |
if (!$main::form->{import_warehouse} || !$main::form->{bin_default}) { |
|
22 |
print_question(); |
|
23 |
return 2; |
|
24 |
} |
|
25 |
# flag for extra code |
|
26 |
$do_sql_migration = 1; |
|
27 |
} |
|
28 |
} |
|
29 |
my $warehouse = $main::form->{import_warehouse} ne '' ? $main::form->{import_warehouse} : "Transfer"; |
|
30 |
my $bin = $main::form->{bin_default} ne '' ? $main::form->{bin_default} : "1"; |
|
31 |
|
|
32 |
|
|
33 |
my $migration_code = <<EOF |
|
34 |
|
|
35 |
-- Warehouse anpassen |
|
36 |
INSERT INTO warehouse (description) VALUES ('$warehouse'); |
|
37 |
|
|
38 |
UPDATE tmp_parts SET bin = NULL WHERE bin = ''; |
|
39 |
|
|
40 |
-- Warenbestand wiederherstellen |
|
41 |
INSERT INTO bin |
|
42 |
(warehouse_id, description) |
|
43 |
(SELECT DISTINCT warehouse.id, COALESCE(bin, '$bin') |
|
44 |
FROM warehouse, tmp_parts |
|
45 |
WHERE warehouse.description='$warehouse'); |
|
46 |
INSERT INTO inventory |
|
47 |
(warehouse_id, parts_id, bin_id, qty, employee_id, trans_id, trans_type_id) |
|
48 |
(SELECT warehouse.id, tmp_parts.id, bin.id, onhand, (SELECT id FROM employee LIMIT 1), nextval('id'), transfer_type.id |
|
49 |
FROM transfer_type, warehouse, tmp_parts, bin |
|
50 |
WHERE warehouse.description = '$warehouse' |
|
51 |
AND COALESCE(bin, '$bin') = bin.description |
|
52 |
AND transfer_type.description = 'stock'); |
|
53 |
EOF |
|
54 |
; |
|
55 |
|
|
56 |
# do standard code |
|
57 |
my $query = $sqlcode; |
|
58 |
$query .= $migration_code if $do_sql_migration; |
|
59 |
|
|
60 |
do_query($main::form, $dbh, $query); |
|
61 |
|
|
62 |
return 1; |
|
63 |
} |
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
$sqlcode = <<EOF |
|
68 |
-- Tabelle "bin" f?r Lagerpl?tze. |
|
69 |
CREATE TABLE bin ( |
|
70 |
id integer NOT NULL DEFAULT nextval('id'), |
|
71 |
warehouse_id integer NOT NULL, |
|
72 |
description text, |
|
73 |
itime timestamp DEFAULT now(), |
|
74 |
mtime timestamp, |
|
75 |
|
|
76 |
PRIMARY KEY (id), |
|
77 |
FOREIGN KEY (warehouse_id) REFERENCES warehouse (id) |
|
78 |
); |
|
79 |
|
|
80 |
CREATE TRIGGER mtime_bin BEFORE UPDATE ON bin |
|
81 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
82 |
|
|
83 |
-- Tabelle "warehouse" |
|
84 |
ALTER TABLE warehouse ADD COLUMN sortkey integer; |
|
85 |
CREATE SEQUENCE tmp_counter; |
|
86 |
UPDATE warehouse SET sortkey = nextval('tmp_counter'); |
|
87 |
DROP SEQUENCE tmp_counter; |
|
88 |
|
|
89 |
ALTER TABLE warehouse ADD COLUMN invalid boolean; |
|
90 |
UPDATE warehouse SET invalid = 'f'; |
|
91 |
|
|
92 |
CREATE TRIGGER mtime_warehouse BEFORE UPDATE ON warehouse |
|
93 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
94 |
|
|
95 |
-- Tabelle "transfer_type" |
|
96 |
CREATE TABLE transfer_type ( |
|
97 |
id integer NOT NULL DEFAULT nextval('id'), |
|
98 |
direction varchar(10) NOT NULL, |
|
99 |
description text, |
|
100 |
sortkey integer, |
|
101 |
itime timestamp DEFAULT now(), |
|
102 |
mtime timestamp, |
|
103 |
|
|
104 |
PRIMARY KEY (id) |
|
105 |
); |
|
106 |
|
|
107 |
CREATE TRIGGER mtime_transfer_type BEFORE UPDATE ON transfer_type |
|
108 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
109 |
|
|
110 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('in', 'stock', 1); |
|
111 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('in', 'found', 2); |
|
112 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('in', 'correction', 3); |
|
113 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'used', 4); |
|
114 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'disposed', 5); |
|
115 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'back', 6); |
|
116 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'missing', 7); |
|
117 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'correction', 9); |
|
118 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('transfer', 'transfer', 10); |
|
119 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('transfer', 'correction', 11); |
|
120 |
|
|
121 |
-- Anpassungen an "inventory". |
|
122 |
DELETE FROM inventory; |
|
123 |
|
|
124 |
ALTER TABLE inventory ADD COLUMN bin_id integer; |
|
125 |
ALTER TABLE inventory ADD FOREIGN KEY (bin_id) REFERENCES bin (id); |
|
126 |
ALTER TABLE inventory ALTER COLUMN bin_id SET NOT NULL; |
|
127 |
|
|
128 |
ALTER TABLE inventory DROP COLUMN qty; |
|
129 |
ALTER TABLE inventory ADD COLUMN qty numeric(25, 5); |
|
130 |
|
|
131 |
ALTER TABLE inventory ALTER COLUMN parts_id SET NOT NULL; |
|
132 |
ALTER TABLE inventory ADD FOREIGN KEY (parts_id) REFERENCES parts(id); |
|
133 |
|
|
134 |
ALTER TABLE inventory ALTER COLUMN warehouse_id SET NOT NULL; |
|
135 |
ALTER TABLE inventory ADD FOREIGN KEY (warehouse_id) REFERENCES warehouse(id); |
|
136 |
|
|
137 |
ALTER TABLE inventory ALTER COLUMN employee_id SET NOT NULL; |
|
138 |
ALTER TABLE inventory ADD FOREIGN KEY (employee_id) REFERENCES employee (id); |
|
139 |
|
|
140 |
ALTER TABLE inventory ADD COLUMN trans_id integer; |
|
141 |
ALTER TABLE inventory ALTER COLUMN trans_id SET NOT NULL; |
|
142 |
|
|
143 |
ALTER TABLE inventory ADD COLUMN trans_type_id integer; |
|
144 |
ALTER TABLE inventory ALTER COLUMN trans_type_id SET NOT NULL; |
|
145 |
ALTER TABLE inventory ADD FOREIGN KEY (trans_type_id) REFERENCES transfer_type (id); |
|
146 |
|
|
147 |
ALTER TABLE inventory ADD COLUMN project_id integer; |
|
148 |
ALTER TABLE inventory ADD FOREIGN KEY (project_id) REFERENCES project (id); |
|
149 |
|
|
150 |
ALTER TABLE inventory ADD COLUMN chargenumber text; |
|
151 |
ALTER TABLE inventory ADD COLUMN comment text; |
|
152 |
|
|
153 |
-- "onhand" in "parts" ?ber einen Trigger automatisch berechnen lassen. |
|
154 |
-- Vorher Warenbestand sichern JZ |
|
155 |
SELECT id, onhand, bin INTO TEMP TABLE tmp_parts FROM parts WHERE onhand > 0; |
|
156 |
ALTER TABLE parts DROP COLUMN onhand; |
|
157 |
ALTER TABLE parts ADD COLUMN onhand numeric(25,5); |
|
158 |
UPDATE parts SET onhand = COALESCE((SELECT SUM(qty) FROM inventory WHERE inventory.parts_id = parts.id), 0); |
|
159 |
|
|
160 |
ALTER TABLE parts ADD COLUMN stockable boolean; |
|
161 |
ALTER TABLE parts ALTER COLUMN stockable SET DEFAULT 'f'; |
|
162 |
UPDATE parts SET stockable = 'f'; |
|
163 |
|
|
164 |
CREATE OR REPLACE FUNCTION update_onhand() RETURNS trigger AS ' |
|
165 |
BEGIN |
|
166 |
IF tg_op = ''INSERT'' THEN |
|
167 |
UPDATE parts SET onhand = COALESCE(onhand, 0) + new.qty WHERE id = new.parts_id; |
|
168 |
RETURN new; |
|
169 |
ELSIF tg_op = ''DELETE'' THEN |
|
170 |
UPDATE parts SET onhand = COALESCE(onhand, 0) - old.qty WHERE id = old.parts_id; |
|
171 |
RETURN old; |
|
172 |
ELSE |
|
173 |
UPDATE parts SET onhand = COALESCE(onhand, 0) - old.qty + new.qty WHERE id = old.parts_id; |
|
174 |
RETURN new; |
|
175 |
END IF; |
|
176 |
END; |
|
177 |
' LANGUAGE plpgsql; |
|
178 |
|
|
179 |
CREATE TRIGGER trig_update_onhand |
|
180 |
AFTER INSERT OR UPDATE OR DELETE ON inventory |
|
181 |
FOR EACH ROW EXECUTE PROCEDURE update_onhand(); |
|
182 |
EOF |
|
183 |
; |
|
184 |
|
|
185 |
|
|
186 |
$check_sql = <<EOF |
|
187 |
SELECT COUNT(id) FROM parts WHERE onhand > 0; |
|
188 |
EOF |
|
189 |
; |
|
190 |
|
|
191 |
return do_update(); |
sql/Pg-upgrade2/warehouse.sql | ||
---|---|---|
1 |
-- @tag: warehouse |
|
2 |
-- @description: Diverse neue Tabellen und Spalten zur Mehrlagerfähigkeit |
|
3 |
-- @depends: release_2_4_3 |
|
4 |
|
|
5 |
-- Tabelle "bin" f?r Lagerpl?tze. |
|
6 |
CREATE TABLE bin ( |
|
7 |
id integer NOT NULL DEFAULT nextval('id'), |
|
8 |
warehouse_id integer NOT NULL, |
|
9 |
description text, |
|
10 |
itime timestamp DEFAULT now(), |
|
11 |
mtime timestamp, |
|
12 |
|
|
13 |
PRIMARY KEY (id), |
|
14 |
FOREIGN KEY (warehouse_id) REFERENCES warehouse (id) |
|
15 |
); |
|
16 |
|
|
17 |
CREATE TRIGGER mtime_bin BEFORE UPDATE ON bin |
|
18 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
19 |
|
|
20 |
-- Tabelle "warehouse" |
|
21 |
ALTER TABLE warehouse ADD COLUMN sortkey integer; |
|
22 |
CREATE SEQUENCE tmp_counter; |
|
23 |
UPDATE warehouse SET sortkey = nextval('tmp_counter'); |
|
24 |
DROP SEQUENCE tmp_counter; |
|
25 |
|
|
26 |
ALTER TABLE warehouse ADD COLUMN invalid boolean; |
|
27 |
UPDATE warehouse SET invalid = 'f'; |
|
28 |
|
|
29 |
CREATE TRIGGER mtime_warehouse BEFORE UPDATE ON warehouse |
|
30 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
31 |
|
|
32 |
-- Tabelle "transfer_type" |
|
33 |
CREATE TABLE transfer_type ( |
|
34 |
id integer NOT NULL DEFAULT nextval('id'), |
|
35 |
direction varchar(10) NOT NULL, |
|
36 |
description text, |
|
37 |
sortkey integer, |
|
38 |
itime timestamp DEFAULT now(), |
|
39 |
mtime timestamp, |
|
40 |
|
|
41 |
PRIMARY KEY (id) |
|
42 |
); |
|
43 |
|
|
44 |
CREATE TRIGGER mtime_transfer_type BEFORE UPDATE ON transfer_type |
|
45 |
FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
|
46 |
|
|
47 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('in', 'stock', 1); |
|
48 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('in', 'found', 2); |
|
49 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('in', 'correction', 3); |
|
50 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'used', 4); |
|
51 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'disposed', 5); |
|
52 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'back', 6); |
|
53 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'missing', 7); |
|
54 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('out', 'correction', 9); |
|
55 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('transfer', 'transfer', 10); |
|
56 |
INSERT INTO transfer_type (direction, description, sortkey) VALUES ('transfer', 'correction', 11); |
|
57 |
|
|
58 |
-- Anpassungen an "inventory". |
|
59 |
DELETE FROM inventory; |
|
60 |
|
|
61 |
ALTER TABLE inventory ADD COLUMN bin_id integer; |
|
62 |
ALTER TABLE inventory ADD FOREIGN KEY (bin_id) REFERENCES bin (id); |
|
63 |
ALTER TABLE inventory ALTER COLUMN bin_id SET NOT NULL; |
|
64 |
|
|
65 |
ALTER TABLE inventory DROP COLUMN qty; |
|
66 |
ALTER TABLE inventory ADD COLUMN qty numeric(25, 5); |
|
67 |
|
|
68 |
ALTER TABLE inventory ALTER COLUMN parts_id SET NOT NULL; |
|
69 |
ALTER TABLE inventory ADD FOREIGN KEY (parts_id) REFERENCES parts(id); |
|
70 |
|
|
71 |
ALTER TABLE inventory ALTER COLUMN warehouse_id SET NOT NULL; |
|
72 |
ALTER TABLE inventory ADD FOREIGN KEY (warehouse_id) REFERENCES warehouse(id); |
|
73 |
|
|
74 |
ALTER TABLE inventory ALTER COLUMN employee_id SET NOT NULL; |
|
75 |
ALTER TABLE inventory ADD FOREIGN KEY (employee_id) REFERENCES employee (id); |
|
76 |
|
|
77 |
ALTER TABLE inventory ADD COLUMN trans_id integer; |
|
78 |
ALTER TABLE inventory ALTER COLUMN trans_id SET NOT NULL; |
|
79 |
|
|
80 |
ALTER TABLE inventory ADD COLUMN trans_type_id integer; |
|
81 |
ALTER TABLE inventory ALTER COLUMN trans_type_id SET NOT NULL; |
|
82 |
ALTER TABLE inventory ADD FOREIGN KEY (trans_type_id) REFERENCES transfer_type (id); |
|
83 |
|
|
84 |
ALTER TABLE inventory ADD COLUMN project_id integer; |
|
85 |
ALTER TABLE inventory ADD FOREIGN KEY (project_id) REFERENCES project (id); |
|
86 |
|
|
87 |
ALTER TABLE inventory ADD COLUMN chargenumber text; |
|
88 |
ALTER TABLE inventory ADD COLUMN comment text; |
|
89 |
|
|
90 |
-- "onhand" in "parts" ?ber einen Trigger automatisch berechnen lassen. |
|
91 |
ALTER TABLE parts DROP COLUMN onhand; |
|
92 |
ALTER TABLE parts ADD COLUMN onhand numeric(25,5); |
|
93 |
UPDATE parts SET onhand = COALESCE((SELECT SUM(qty) FROM inventory WHERE inventory.parts_id = parts.id), 0); |
|
94 |
|
|
95 |
ALTER TABLE parts ADD COLUMN stockable boolean; |
|
96 |
ALTER TABLE parts ALTER COLUMN stockable SET DEFAULT 'f'; |
|
97 |
UPDATE parts SET stockable = 'f'; |
|
98 |
|
|
99 |
CREATE OR REPLACE FUNCTION update_onhand() RETURNS trigger AS ' |
|
100 |
BEGIN |
|
101 |
IF tg_op = ''INSERT'' THEN |
|
102 |
UPDATE parts SET onhand = COALESCE(onhand, 0) + new.qty WHERE id = new.parts_id; |
|
103 |
RETURN new; |
|
104 |
ELSIF tg_op = ''DELETE'' THEN |
|
105 |
UPDATE parts SET onhand = COALESCE(onhand, 0) - old.qty WHERE id = old.parts_id; |
|
106 |
RETURN old; |
|
107 |
ELSE |
|
108 |
UPDATE parts SET onhand = COALESCE(onhand, 0) - old.qty + new.qty WHERE id = old.parts_id; |
|
109 |
RETURN new; |
|
110 |
END IF; |
|
111 |
END; |
|
112 |
' LANGUAGE plpgsql; |
|
113 |
|
|
114 |
CREATE TRIGGER trig_update_onhand |
|
115 |
AFTER INSERT OR UPDATE OR DELETE ON inventory |
|
116 |
FOR EACH ROW EXECUTE PROCEDURE update_onhand(); |
|
117 |
|
templates/webpages/dbupgrade/warehouse_form_de.html | ||
---|---|---|
1 |
[% USE HTML %]<div class="listtop">Lagermigration</div> |
|
2 |
|
|
3 |
<form action="[% script %]" method="POST"> |
|
4 |
|
|
5 |
<p>Lx-Office enthält jetzt auch echte Lagerverwaultung anstatt reiner Mengenzählung. |
|
6 |
Dieses update ändert die Art und Weise wie Lagermengen gezält werden. |
|
7 |
Als Konsequenz können die gespeicherten Mengen entweder in ein Lager überführt werden, oder für eine frische Lagerverwaltung resettet werden.</p> |
|
8 |
|
|
9 |
<p>Möchten Sie die vorhandenen Mengendaten in ein Lager übertragen?</p> |
|
10 |
<input id=do_migrate_Y name=do_migrate type=radio value=Y> <label for=do_migrate_Y>Ja</label> |
|
11 |
<input id=do_migrate_N name=do_migrate type=radio value=N checked> <label for=do_migrate_N>Nein</label> |
|
12 |
|
|
13 |
<p>Bitte geben Sie den Namen des Ziellagers für die übernommenen Daten ein.</p> |
|
14 |
<input name=import_warehouse size=50> |
|
15 |
|
|
16 |
<p>Da Lagerplätze kein Pflichtfeld sind, geben Sie bitte einen Lagerplatz an, in dem Waren ohne spezifizierten Lagerplatz eingelagert werden sollen.<p> |
|
17 |
<input name=bin_default size=50> |
|
18 |
|
|
19 |
<p><input type=submit value="Weiter"></p> |
templates/webpages/dbupgrade/warehouse_form_master.html | ||
---|---|---|
1 |
[% USE HTML %]<div class="listtop"><translate>Warehouse MIgration</translate></div> |
|
2 |
|
|
3 |
<form action="[% script %]" method="POST"> |
|
4 |
|
|
5 |
<p><translate>Lx-Office is now able to manage warehouses instead of just tracking the amount of goods in your system.</translate> |
|
6 |
<translate>This update will change the nature the onhand of goods is tracked.</translate> |
|
7 |
<translate>As a result, the saved onhand values of the present goods can be stored into a warehouse designated by you, or will be reset for a proper warehouse tracking</translate></p> |
|
8 |
|
|
9 |
<p><translate>Do you want to store the existing onhand values into a new warehouse?</translate></p> |
|
10 |
<input id=do_migrate_Y name=do_migrate type=radio value=Y> <label for=do_migrate_Y><translate>Yes</translate></label> |
|
11 |
<input id=do_migrate_N name=do_migrate type=radio value=N checked> <label for=do_migrate_N><translate>No</translate></label> |
|
12 |
|
|
13 |
<p><translate>Please specify a description for the warehouse designated for these goods.</translate></p> |
|
14 |
<input name=import_warehouse size=50> |
|
15 |
|
|
16 |
<p><translate>Since bin is not enforced in the parts data, please specify a bin where goods without a specified bin will be put.</translate><p> |
|
17 |
<input name=bin_default size=50> |
|
18 |
|
|
19 |
<p><input type=submit value="<translate>Continue</translate>"></p> |
Auch abrufbar als: Unified diff
Migrationsfaehigkeit im Warenhausupdate