Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 9f07753b

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 9f07753bc46cf5614fe454656f352bc74de5920a
  • Vorgänger 168836cf
  • Nachfolger 02144d2e

Überflüssige Tabellen customertax, vendortax, partstax entfernt

Fixt #2186.

Unterschiede anzeigen:

SL/IS.pm
863 863
        $query =
864 864
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
865 865
             VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?,
866
                     (SELECT tax_id 
867
                      FROM taxkeys 
868
                      WHERE chart_id= (SELECT id  
869
                                       FROM chart 
870
                                       WHERE accno = ?) 
871
                      AND startdate <= ? 
866
                     (SELECT tax_id
867
                      FROM taxkeys
868
                      WHERE chart_id= (SELECT id
869
                                       FROM chart
870
                                       WHERE accno = ?)
871
                      AND startdate <= ?
872 872
                      ORDER BY startdate DESC LIMIT 1),
873 873
                     (SELECT taxkey_id
874
                      FROM taxkeys 
875
                      WHERE chart_id= (SELECT id  
876
                                       FROM chart 
877
                                       WHERE accno = ?) 
878
                      AND startdate <= ? 
874
                      FROM taxkeys
875
                      WHERE chart_id= (SELECT id
876
                                       FROM chart
877
                                       WHERE accno = ?)
878
                      AND startdate <= ?
879 879
                      ORDER BY startdate DESC LIMIT 1),
880 880
                     ?,
881 881
                     (SELECT link FROM chart WHERE accno = ?))|;
......
892 892
        $query =
893 893
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
894 894
             VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?,
895
                     (SELECT tax_id 
896
                      FROM taxkeys 
897
                      WHERE chart_id= (SELECT id 
898
                                       FROM chart 
899
                                       WHERE accno = ?) 
900
                      AND startdate <= ? 
895
                     (SELECT tax_id
896
                      FROM taxkeys
897
                      WHERE chart_id= (SELECT id
898
                                       FROM chart
899
                                       WHERE accno = ?)
900
                      AND startdate <= ?
901 901
                      ORDER BY startdate DESC LIMIT 1),
902
                     (SELECT taxkey_id 
903
                      FROM taxkeys 
904
                      WHERE chart_id= (SELECT id 
905
                                       FROM chart 
906
                                       WHERE accno = ?) 
907
                      AND startdate <= ? 
902
                     (SELECT taxkey_id
903
                      FROM taxkeys
904
                      WHERE chart_id= (SELECT id
905
                                       FROM chart
906
                                       WHERE accno = ?)
907
                      AND startdate <= ?
908 908
                      ORDER BY startdate DESC LIMIT 1),
909 909
                     ?,
910 910
                     (SELECT link FROM chart WHERE accno = ?))|;
......
956 956
        $query =
957 957
        qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
958 958
           VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?,
959
                   (SELECT tax_id 
960
                    FROM taxkeys 
961
                    WHERE chart_id= (SELECT id  
962
                                     FROM chart 
963
                                     WHERE accno = ?) 
964
                    AND startdate <= ? 
959
                   (SELECT tax_id
960
                    FROM taxkeys
961
                    WHERE chart_id= (SELECT id
962
                                     FROM chart
963
                                     WHERE accno = ?)
964
                    AND startdate <= ?
965 965
                    ORDER BY startdate DESC LIMIT 1),
966
                   (SELECT taxkey_id 
967
                    FROM taxkeys 
968
                    WHERE chart_id= (SELECT id  
969
                                     FROM chart 
970
                                     WHERE accno = ?) 
971
                    AND startdate <= ? 
966
                   (SELECT taxkey_id
967
                    FROM taxkeys
968
                    WHERE chart_id= (SELECT id
969
                                     FROM chart
970
                                     WHERE accno = ?)
971
                    AND startdate <= ?
972 972
                    ORDER BY startdate DESC LIMIT 1),
973 973
                   ?,
974 974
                   (SELECT link FROM chart WHERE accno = ?))|;
......
983 983
      $query =
984 984
      qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, tax_id, taxkey, project_id, chart_link)
985 985
         VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?,
986
                 (SELECT tax_id 
987
                  FROM taxkeys 
988
                  WHERE chart_id= (SELECT id  
989
                                   FROM chart 
990
                                   WHERE accno = ?) 
991
                  AND startdate <= ? 
986
                 (SELECT tax_id
987
                  FROM taxkeys
988
                  WHERE chart_id= (SELECT id
989
                                   FROM chart
990
                                   WHERE accno = ?)
991
                  AND startdate <= ?
992 992
                  ORDER BY startdate DESC LIMIT 1),
993
                 (SELECT taxkey_id 
994
                  FROM taxkeys 
995
                  WHERE chart_id= (SELECT id  
996
                                   FROM chart 
997
                                   WHERE accno = ?) 
998
                  AND startdate <= ? 
993
                 (SELECT taxkey_id
994
                  FROM taxkeys
995
                  WHERE chart_id= (SELECT id
996
                                   FROM chart
997
                                   WHERE accno = ?)
998
                  AND startdate <= ?
999 999
                  ORDER BY startdate DESC LIMIT 1),
1000 1000
                 ?,
1001 1001
                 (SELECT link FROM chart WHERE accno = ?))|;
......
1042 1042
        $query =
1043 1043
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, tax_id, taxkey, project_id, chart_link)
1044 1044
             VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, '0', '1',
1045
                 (SELECT tax_id 
1046
                  FROM taxkeys 
1047
                  WHERE chart_id= (SELECT id  
1048
                                   FROM chart 
1049
                                   WHERE accno = ?) 
1050
                  AND startdate <= ? 
1045
                 (SELECT tax_id
1046
                  FROM taxkeys
1047
                  WHERE chart_id= (SELECT id
1048
                                   FROM chart
1049
                                   WHERE accno = ?)
1050
                  AND startdate <= ?
1051 1051
                  ORDER BY startdate DESC LIMIT 1),
1052
                 (SELECT taxkey_id 
1053
                  FROM taxkeys 
1054
                  WHERE chart_id= (SELECT id  
1055
                                   FROM chart 
1056
                                   WHERE accno = ?) 
1057
                  AND startdate <= ? 
1052
                 (SELECT taxkey_id
1053
                  FROM taxkeys
1054
                  WHERE chart_id= (SELECT id
1055
                                   FROM chart
1056
                                   WHERE accno = ?)
1057
                  AND startdate <= ?
1058 1058
                  ORDER BY startdate DESC LIMIT 1),
1059 1059
                 ?,
1060 1060
                 (SELECT link FROM chart WHERE accno = ?))|;
......
2034 2034
    my $i = 0;
2035 2035
    while (my $ptr = $stw->fetchrow_hashref('NAME_lc')) {
2036 2036

  
2037
      #    if ($customertax{$ref->{accno}})
2038 2037
      if (($ptr->{accno} eq "") && ($ptr->{rate} == 0)) {
2039 2038
        $i++;
2040 2039
        $ptr->{accno} = $i;

Auch abrufbar als: Unified diff