Revision 30b4a78c
Von Jan Büren vor fast 3 Jahren hinzugefügt
sql/Pg-upgrade2/tax_reverse_charge_key_18.sql | ||
---|---|---|
1 |
-- @tag: tax_reverse_charge_key_18 |
|
2 |
-- @description: Reverse Charge für Kreditorenbelege Steuerschlüssel 18 |
|
3 |
-- @depends: release_3_6_0 |
|
4 |
-- @ignore: 0 |
|
5 |
|
|
6 |
INSERT INTO tax ( |
|
7 |
chart_id, |
|
8 |
reverse_charge_chart_id, |
|
9 |
rate, |
|
10 |
taxkey, |
|
11 |
taxdescription, |
|
12 |
chart_categories |
|
13 |
) |
|
14 |
SELECT |
|
15 |
(SELECT id FROM chart WHERE accno = '1572'), |
|
16 |
(SELECT id FROM chart WHERE accno = '1772'), 0.07, |
|
17 |
'18', 'Stpf. innergemeinschaftlicher Erwerb zum verminderten Vor- und Ust.-satz', 'EI' |
|
18 |
WHERE EXISTS ( -- update only for SKR03 |
|
19 |
SELECT coa FROM defaults |
|
20 |
WHERE defaults.coa='Germany-DATEV-SKR03EU' |
|
21 |
); |
|
22 |
|
|
23 |
|
|
24 |
INSERT INTO tax ( |
|
25 |
chart_id, |
|
26 |
reverse_charge_chart_id, |
|
27 |
rate, |
|
28 |
taxkey, |
|
29 |
taxdescription, |
|
30 |
chart_categories |
|
31 |
) |
|
32 |
SELECT |
|
33 |
(SELECT id FROM chart WHERE accno = '1402'), |
|
34 |
(SELECT id FROM chart WHERE accno = '3802'), 0.07, |
|
35 |
'18', 'Stpf. innergemeinschaftlicher Erwerb zum verminderten Vor- und Ust.-satz', 'EI' |
|
36 |
WHERE EXISTS ( -- update only for SKR04 |
|
37 |
SELECT coa FROM defaults |
|
38 |
WHERE defaults.coa='Germany-DATEV-SKR04EU' |
|
39 |
); |
|
40 |
|
|
41 |
|
|
42 |
-- if not defined |
|
43 |
insert into taxkeys(chart_id,tax_id,taxkey_id,startdate) SELECT (SELECT reverse_charge_chart_id FROM tax WHERE taxkey = '18' and rate = 0.07 and reverse_charge_chart_id is not null),0,0,'1970-01-01' WHERE NOT EXISTS |
|
44 |
(SELECT chart_id from taxkeys where chart_id = ( SELECT reverse_charge_chart_id FROM tax WHERE taxkey = '18' and rate = 0.07 and reverse_charge_chart_id is not null)); |
|
45 |
-- if not defined |
|
46 |
insert into taxkeys(chart_id,tax_id,taxkey_id,startdate) SELECT (SELECT chart_id FROM tax WHERE taxkey = '18' and rate = 0.07 and reverse_charge_chart_id is not null),0,0,'1970-01-01' WHERE NOT EXISTS |
|
47 |
(SELECT chart_id from taxkeys where chart_id = ( SELECT chart_id FROM tax WHERE taxkey = '18' and rate = 0.07 and reverse_charge_chart_id is not null)); |
|
48 |
|
sql/Pg-upgrade2/tax_reverse_charge_key_19.sql | ||
---|---|---|
1 |
-- @tag: tax_reverse_charge_key_19 |
|
2 |
-- @description: Reverse Charge für Kreditorenbelege Steuerschlüssel 19 |
|
3 |
-- @depends: release_3_6_0 |
|
4 |
-- @ignore: 0 |
|
5 |
|
|
6 |
UPDATE tax set rate=0.19 where taxkey=94 AND reverse_charge_chart_id is not NULL; |
|
7 |
|
|
8 |
INSERT INTO chart ( |
|
9 |
accno, description, |
|
10 |
charttype, category, link, |
|
11 |
taxkey_id |
|
12 |
) |
|
13 |
SELECT |
|
14 |
'1774','Umsatzsteuer aus innergemeinschftl. Erwerb 19%', |
|
15 |
'A', 'I', 'AR_tax:IC_taxpart:IC_taxservice', |
|
16 |
0 |
|
17 |
WHERE EXISTS ( -- update only for SKR03 |
|
18 |
SELECT coa FROM defaults |
|
19 |
WHERE defaults.coa='Germany-DATEV-SKR03EU' AND NOT EXISTS (SELECT id from chart where accno='1774') |
|
20 |
); |
|
21 |
|
|
22 |
INSERT INTO tax ( |
|
23 |
chart_id, |
|
24 |
reverse_charge_chart_id, |
|
25 |
rate, |
|
26 |
taxkey, |
|
27 |
taxdescription, |
|
28 |
chart_categories |
|
29 |
) |
|
30 |
SELECT |
|
31 |
(SELECT id FROM chart WHERE accno = '1574'), |
|
32 |
(SELECT id FROM chart WHERE accno = '1774'), 0.19, |
|
33 |
'19', 'Stpf. innergemeinschaftlicher Erwerb zum vollem Vor- und Ust.-satz', 'EI' |
|
34 |
WHERE EXISTS ( -- update only for SKR03 |
|
35 |
SELECT coa FROM defaults |
|
36 |
WHERE defaults.coa='Germany-DATEV-SKR03EU' |
|
37 |
); |
|
38 |
|
|
39 |
|
|
40 |
INSERT INTO tax ( |
|
41 |
chart_id, |
|
42 |
reverse_charge_chart_id, |
|
43 |
rate, |
|
44 |
taxkey, |
|
45 |
taxdescription, |
|
46 |
chart_categories |
|
47 |
) |
|
48 |
SELECT |
|
49 |
(SELECT id FROM chart WHERE accno = '1404'), |
|
50 |
(SELECT id FROM chart WHERE accno = '3804'), 0.19, |
|
51 |
'19', 'Stpf. innergemeinschaftlicher Erwerb zum vollem Vor- und Ust.-satz', 'EI' |
|
52 |
WHERE EXISTS ( -- update only for SKR04 |
|
53 |
SELECT coa FROM defaults |
|
54 |
WHERE defaults.coa='Germany-DATEV-SKR04EU' |
|
55 |
); |
|
56 |
|
|
57 |
-- if not defined |
|
58 |
insert into taxkeys(chart_id,tax_id,taxkey_id,startdate) SELECT (SELECT reverse_charge_chart_id FROM tax WHERE taxkey = '19' and rate = 0.19 and reverse_charge_chart_id is not null),0,0,'1970-01-01' WHERE NOT EXISTS |
|
59 |
(SELECT chart_id from taxkeys where chart_id = ( SELECT reverse_charge_chart_id FROM tax WHERE taxkey = '19' and rate = 0.19 and reverse_charge_chart_id is not null)); |
|
60 |
-- if not defined |
|
61 |
insert into taxkeys(chart_id,tax_id,taxkey_id,startdate) SELECT (SELECT chart_id FROM tax WHERE taxkey = '19' and rate = 0.19 and reverse_charge_chart_id is not null),0,0,'1970-01-01' WHERE NOT EXISTS |
|
62 |
(SELECT chart_id from taxkeys where chart_id = ( SELECT chart_id FROM tax WHERE taxkey = '19' and rate = 0.19 and reverse_charge_chart_id is not null)); |
|
63 |
|
Auch abrufbar als: Unified diff
Steuerschlüssel 18 und 19 mit reverse_charge Funktion hinzugefügt