Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d1408ca1

Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt

  • ID d1408ca13458a782cbde2b768cdd7abdbdcb9348
  • Vorgänger 2d881637
  • Nachfolger 3af5e2e0

chart_link in acc_trans

Erstellt ein neues Pflichtfeld chart_link in der Tabelle acc_trans.
Wird bisher nur beschrieben und noch an keiner Stelle ausgelesen.

Conflicts:

SL/AP.pm
SL/AR.pm
SL/IR.pm
SL/IS.pm

Unterschiede anzeigen:

SL/IS.pm
832 832

  
833 833
      if (!$payments_only && ($form->{amount_cogs}{$trans_id}{$accno} != 0)) {
834 834
        $query =
835
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id)
836
               VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT id FROM tax WHERE taxkey=0), 0, ?)|;
837
        @values = (conv_i($trans_id), $accno, $form->{amount_cogs}{$trans_id}{$accno}, conv_date($form->{invdate}), conv_i($project_id));
835
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
836
               VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT id FROM tax WHERE taxkey=0), 0, ?, (SELECT link FROM chart WHERE accno = ?))|;
837
        @values = (conv_i($trans_id), $accno, $form->{amount_cogs}{$trans_id}{$accno}, conv_date($form->{invdate}), conv_i($project_id), $accno);
838 838
        do_query($form, $dbh, $query, @values);
839 839
        $form->{amount_cogs}{$trans_id}{$accno} = 0;
840 840
      }
......
845 845

  
846 846
      if (!$payments_only && ($form->{amount_cogs}{$trans_id}{$accno} != 0)) {
847 847
        $query =
848
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id)
849
               VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT id FROM tax WHERE taxkey=0), 0, ?)|;
850
        @values = (conv_i($trans_id), $accno, $form->{amount_cogs}{$trans_id}{$accno}, conv_date($form->{invdate}), conv_i($project_id));
848
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
849
               VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, (SELECT id FROM tax WHERE taxkey=0), 0, ?, (SELECT link FROM chart WHERE accno = ?))|;
850
        @values = (conv_i($trans_id), $accno, $form->{amount_cogs}{$trans_id}{$accno}, conv_date($form->{invdate}), conv_i($project_id), $accno);
851 851
        do_query($form, $dbh, $query, @values);
852 852
      }
853 853
    }
......
861 861

  
862 862
      if (!$payments_only && ($form->{amount}{$trans_id}{$accno} != 0)) {
863 863
        $query =
864
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id)
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 866
                     (SELECT tax_id 
867 867
                      FROM taxkeys 
......
870 870
                                       WHERE accno = ?) 
871 871
                      AND startdate <= ? 
872 872
                      ORDER BY startdate DESC LIMIT 1),
873
                     (SELECT taxkey_id  FROM chart WHERE accno = ?), ?)|;
874
        @values = (conv_i($trans_id), $accno, $form->{amount}{$trans_id}{$accno}, conv_date($form->{invdate}), $accno, conv_date($taxdate), $accno, conv_i($project_id));
873
                     (SELECT taxkey_id  FROM chart WHERE accno = ?), ?,
874
                     (SELECT link FROM chart WHERE accno = ?))|;
875
        @values = (conv_i($trans_id), $accno, $form->{amount}{$trans_id}{$accno}, conv_date($form->{invdate}), $accno, conv_date($taxdate), $accno, conv_i($project_id), $accno);
875 876
        do_query($form, $dbh, $query, @values);
876 877
        $form->{amount}{$trans_id}{$accno} = 0;
877 878
      }
......
882 883

  
883 884
      if (!$payments_only && ($form->{amount}{$trans_id}{$accno} != 0)) {
884 885
        $query =
885
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id)
886
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
886 887
             VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?,
887 888
                     (SELECT tax_id 
888 889
                      FROM taxkeys 
......
891 892
                                       WHERE accno = ?) 
892 893
                      AND startdate <= ? 
893 894
                      ORDER BY startdate DESC LIMIT 1),
894
                     (SELECT taxkey_id FROM chart WHERE accno = ?), ?)|;
895
        @values = (conv_i($trans_id), $accno, $form->{amount}{$trans_id}{$accno}, conv_date($form->{invdate}), $accno, conv_date($taxdate), $accno, conv_i($project_id));
895
                     (SELECT taxkey_id FROM chart WHERE accno = ?), ?,
896
                     (SELECT link FROM chart WHERE accno = ?))|;
897
        @values = (conv_i($trans_id), $accno, $form->{amount}{$trans_id}{$accno}, conv_date($form->{invdate}), $accno, conv_date($taxdate), $accno, conv_i($project_id), $accno);
896 898
        do_query($form, $dbh, $query, @values);
897 899
      }
898 900
    }
......
938 940

  
939 941
      if ($form->{amount}{ $form->{id} }{ $form->{AR} } != 0) {
940 942
        $query =
941
        qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id)
943
        qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, tax_id, taxkey, project_id, chart_link)
942 944
           VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?,
943 945
                   (SELECT tax_id 
944 946
                    FROM taxkeys 
......
947 949
                                     WHERE accno = ?) 
948 950
                    AND startdate <= ? 
949 951
                    ORDER BY startdate DESC LIMIT 1),
950
                   (SELECT taxkey_id FROM chart WHERE accno = ?), ?)|;
951
        @values = (conv_i($form->{"id"}), $form->{AR}, $amount, $form->{"datepaid_$i"}, $form->{AR}, conv_date($taxdate), $form->{AR}, $project_id);
952
                   (SELECT taxkey_id FROM chart WHERE accno = ?), ?,
953
                   (SELECT link FROM chart WHERE accno = ?))|;
954
        @values = (conv_i($form->{"id"}), $form->{AR}, $amount, $form->{"datepaid_$i"}, $form->{AR}, conv_date($taxdate), $form->{AR}, $project_id, $form->{AR});
952 955
        do_query($form, $dbh, $query, @values);
953 956
      }
954 957

  
......
957 960
      my $gldate = (conv_date($form->{"gldate_$i"}))? conv_date($form->{"gldate_$i"}) : conv_date($form->current_date($myconfig));
958 961

  
959 962
      $query =
960
      qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, tax_id, taxkey, project_id)
963
      qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, tax_id, taxkey, project_id, chart_link)
961 964
         VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?,
962 965
                 (SELECT tax_id 
963 966
                  FROM taxkeys 
......
966 969
                                   WHERE accno = ?) 
967 970
                  AND startdate <= ? 
968 971
                  ORDER BY startdate DESC LIMIT 1),
969
                 (SELECT taxkey_id FROM chart WHERE accno = ?), ?)|;
972
                 (SELECT taxkey_id FROM chart WHERE accno = ?), ?,
973
                 (SELECT link FROM chart WHERE accno = ?))|;
970 974
      @values = (conv_i($form->{"id"}), $accno, $form->{"paid_$i"}, $form->{"datepaid_$i"},
971
                 $gldate, $form->{"source_$i"}, $form->{"memo_$i"}, $accno, conv_date($taxdate), $accno, $project_id);
975
                 $gldate, $form->{"source_$i"}, $form->{"memo_$i"}, $accno, conv_date($taxdate), $accno, $project_id, $accno);
972 976
      do_query($form, $dbh, $query, @values);
973 977

  
974 978
      # exchangerate difference
......
1008 1012
      if ( $form->{fx}{$accno}{$transdate} != 0 ) {
1009 1013

  
1010 1014
        $query =
1011
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, tax_id, taxkey, project_id)
1015
          qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, cleared, fx_transaction, tax_id, taxkey, project_id, chart_link)
1012 1016
             VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, '0', '1',
1013 1017
                 (SELECT tax_id 
1014 1018
                  FROM taxkeys 
......
1017 1021
                                   WHERE accno = ?) 
1018 1022
                  AND startdate <= ? 
1019 1023
                  ORDER BY startdate DESC LIMIT 1),
1020
                 (SELECT taxkey_id FROM chart WHERE accno = ?), ?)|;
1021
        @values = (conv_i($form->{"id"}), $accno, $form->{fx}{$accno}{$transdate}, conv_date($transdate), $accno, conv_date($taxdate), $accno, conv_i($project_id));
1024
                 (SELECT taxkey_id FROM chart WHERE accno = ?), ?,
1025
                 (SELECT link FROM chart WHERE accno = ?))|;
1026
        @values = (conv_i($form->{"id"}), $accno, $form->{fx}{$accno}{$transdate}, conv_date($transdate), $accno, conv_date($taxdate), $accno, conv_i($project_id), $accno);
1022 1027
        do_query($form, $dbh, $query, @values);
1023 1028
      }
1024 1029
    }

Auch abrufbar als: Unified diff