1 -- @tag: tax_reverse_charge_key_18
2 -- @description: Reverse Charge für Kreditorenbelege Steuerschlüssel 18
3 -- @depends: release_3_6_0 clean_tax_18_19
8 reverse_charge_chart_id,
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'
26 reverse_charge_chart_id,
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'
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 AND (EXISTS (SELECT coa FROM defaults WHERE defaults.coa='Germany-DATEV-SKR04EU') OR EXISTS (SELECT coa FROM defaults WHERE defaults.coa='Germany-DATEV-SKR03EU'));
48 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
49 (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))
50 AND (EXISTS (SELECT coa FROM defaults WHERE defaults.coa='Germany-DATEV-SKR04EU') OR EXISTS (SELECT coa FROM defaults WHERE defaults.coa='Germany-DATEV-SKR03EU'));