Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision db01e20b

Von Jan Büren vor fast 3 Jahren hinzugefügt

  • ID db01e20be9990500882c68695bf42d19b15e11c4
  • Vorgänger c0bea950
  • Nachfolger 8ce50957

Anzahlungsrechnung: Transferkonten für Steuerbuchungen anlegen

In defaults persistent setzen
Verrechnungskonto muss doch ein Sammelkonto (Link: AR) sein

Unterschiede anzeigen:

sql/Pg-upgrade2/defaults_advance_payment_transfer_charts.sql
1
-- @tag: defaults_advance_payment_transfer_charts
2
-- @description: Standardkonten für erhaltene versteuerte Anzahlungen 7% und 19% setzen
3
-- @depends:new_chart_3260_1711 new_chart_3272_1718
4

  
5

  
6
ALTER TABLE defaults ADD COLUMN advance_payment_taxable_19_id INTEGER;
7
ALTER TABLE defaults ADD COLUMN advance_payment_taxable_7_id  INTEGER;
8

  
9
DO $$
10
BEGIN
11

  
12
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR03EU' THEN
13
    DECLARE
14
      clearing_accno text := '1718';
15

  
16
    BEGIN
17
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE clearing_accno ) = 1 THEN
18
        UPDATE defaults SET advance_payment_taxable_19_id = (SELECT id FROM chart WHERE accno LIKE clearing_accno);
19
      END IF;
20
    END;
21
  END IF;
22

  
23
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR04EU' THEN
24
    DECLARE
25
      clearing_accno text := '3272';
26

  
27
    BEGIN
28
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE clearing_accno ) = 1 THEN
29
        UPDATE defaults SET advance_payment_taxable_19_id = (SELECT id FROM chart WHERE accno LIKE clearing_accno);
30
      END IF;
31
    END;
32
  END IF;
33

  
34
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR03EU' THEN
35
    DECLARE
36
      clearing_accno text := '1711';
37

  
38
    BEGIN
39
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE clearing_accno ) = 1 THEN
40
        UPDATE defaults SET advance_payment_taxable_7_id = (SELECT id FROM chart WHERE accno LIKE clearing_accno);
41
      END IF;
42
    END;
43
  END IF;
44

  
45
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR04EU' THEN
46
    DECLARE
47
      clearing_accno text := '3260';
48

  
49
    BEGIN
50
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE clearing_accno ) = 1 THEN
51
        UPDATE defaults SET advance_payment_taxable_7_id = (SELECT id FROM chart WHERE accno LIKE clearing_accno);
52
      END IF;
53
    END;
54
  END IF;
55

  
56

  
57
END $$;
sql/Pg-upgrade2/new_chart_3260_1711.sql
1
-- @tag: new_chart_3260_1711
2
-- @description: Neues Konto "Erhaltene, versteuerte Anzahlungen 7 % USt (Verbindlichkeiten)"
3
-- @depends: release_3_5_8
4

  
5

  
6
DO $$
7
BEGIN
8

  
9
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR03EU' THEN
10
    DECLARE
11
      new_accno text := '1711';
12

  
13
    BEGIN
14
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE new_accno ) = 0 THEN
15
        INSERT INTO chart (accno, description, charttype, category, link, taxkey_id)
16
          VALUES (new_accno, 'Erhaltene, versteuerte Anzahlungen 7 % USt (Verbindlichkeiten)','A', 'L', 'AR_amount', 0);
17
        INSERT INTO taxkeys (chart_id, tax_id, taxkey_id, startdate)
18
          VALUES ((SELECT id FROM chart WHERE accno LIKE new_accno), 0, 0, '1970-01-01');
19
      END IF;
20
    END;
21
  END IF;
22

  
23
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR04EU' THEN
24
    DECLARE
25
      new_accno text := '3260';
26

  
27
    BEGIN
28
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE new_accno ) = 0 THEN
29
        INSERT INTO chart (accno, description, charttype, category, link, taxkey_id)
30
          VALUES (new_accno, 'Erhaltene, versteuerte Anzahlungen 7 % USt (Verbindlichkeiten)','A', 'L', 'AR_amount', 0);
31
        INSERT INTO taxkeys (chart_id, tax_id, taxkey_id, startdate)
32
          VALUES ((SELECT id FROM chart WHERE accno LIKE new_accno), 0, 0, '1970-01-01');
33
      END IF;
34
    END;
35
  END IF;
36

  
37
END $$;
sql/Pg-upgrade2/new_chart_3272_1718.sql
1
-- @tag: new_chart_3272_1718
2
-- @description: Neues Konto "Erhaltene, versteuerte Anzahlungen 19 % USt (Verbindlichkeiten)"
3
-- @depends: release_3_5_8
4

  
5

  
6
DO $$
7
BEGIN
8

  
9
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR03EU' THEN
10
    DECLARE
11
      new_accno text := '1718';
12

  
13
    BEGIN
14
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE new_accno ) = 0 THEN
15
        INSERT INTO chart (accno, description, charttype, category, link, taxkey_id)
16
          VALUES (new_accno, 'Erhaltene, versteuerte Anzahlungen 19 % USt (Verbindlichkeiten)','A', 'L', 'AR_amount', 0);
17
        INSERT INTO taxkeys (chart_id, tax_id, taxkey_id, startdate)
18
          VALUES ((SELECT id FROM chart WHERE accno LIKE new_accno), 0, 0, '1970-01-01');
19
      END IF;
20
    END;
21
  END IF;
22

  
23
  IF ( SELECT coa FROM defaults ) = 'Germany-DATEV-SKR04EU' THEN
24
    DECLARE
25
      new_accno text := '3272';
26

  
27
    BEGIN
28
      IF ( SELECT COUNT(accno) FROM chart WHERE accno LIKE new_accno ) = 0 THEN
29
        INSERT INTO chart (accno, description, charttype, category, link, taxkey_id)
30
          VALUES (new_accno, 'Erhaltene, versteuerte Anzahlungen 19 % USt (Verbindlichkeiten)','A', 'L', 'AR_amount', 0);
31
        INSERT INTO taxkeys (chart_id, tax_id, taxkey_id, startdate)
32
          VALUES ((SELECT id FROM chart WHERE accno LIKE new_accno), 0, 0, '1970-01-01');
33
      END IF;
34
    END;
35
  END IF;
36

  
37
END $$;

Auch abrufbar als: Unified diff