Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0437033e

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID 0437033e3e747a77b8999ae13a599e3c614be817
  • Vorgänger 185d7c5b
  • Nachfolger 960160dc

Dialogbuchen: Anzeigen und Speichern von Projektnummern für jede Zeile.

Unterschiede anzeigen:

SL/GL.pm
39 39
package GL;
40 40

  
41 41
use Data::Dumper;
42
use SL::DBUtils;
42 43

  
43 44
sub delete_transaction {
44 45
  my ($self, $myconfig, $form) = @_;
......
179 180
      $posted = 0;
180 181
    }
181 182

  
183
    $project_id = conv_i($form->{"project_id_$i"});
184

  
182 185
    # if there is an amount, add the record
183 186
    if ($amount != 0) {
184
      $project_id =
185
        ($form->{"project_id_$i"}) ? $form->{"project_id_$i"} : 'NULL';
186 187
      $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
187 188
                  source, memo, project_id, taxkey)
188 189
		  VALUES
......
192 193
		   $amount, '$form->{transdate}', |
193 194
        . $dbh->quote($form->{"source_$i"}) . qq|, |
194 195
        . $dbh->quote($form->{"memo_$i"}) . qq|,
195
		  $project_id, $taxkey)|;
196
		  ?, $taxkey)|;
196 197

  
197
      $dbh->do($query) || $form->dberror($query);
198
      do_query($form, $dbh, $query, $project_id);
198 199
    }
199 200

  
200 201
    if ($tax != 0) {
201

  
202 202
      # add taxentry
203
      $amount = $tax;
204

  
205
      $project_id =
206
        ($form->{"project_id_$i"}) ? $form->{"project_id_$i"} : 'NULL';
207 203
      $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate,
208
                  source, memo, project_id, taxkey)
204
                  source, memo, taxkey)
209 205
                  VALUES
210 206
                  ($form->{id}, (SELECT t.chart_id
211 207
                  FROM tax t
212 208
                  WHERE t.id = $form->{"tax_id_$i"}),
213
                  $amount, '$form->{transdate}', |
209
                  $tax, '$form->{transdate}', |
214 210
        . $dbh->quote($form->{"source_$i"}) . qq|, |
215
        . $dbh->quote($form->{"memo_$i"}) . qq|,
216
                          $project_id, $taxkey)|;
211
        . $dbh->quote($form->{"memo_$i"}) . qq|, ?, $taxkey)|;
217 212

  
218
      $dbh->do($query) || $form->dberror($query);
213
      do_query($form, $dbh, $query, $project_id);
219 214
    }
220 215
  }
221 216

  
bin/mozilla/gl.pl
35 35
use SL::PE;
36 36

  
37 37
require "$form->{path}/arap.pl";
38
require "bin/mozilla/common.pl";
38 39

  
39 40
1;
40 41

  
......
154 155
  my $tax      = 0;
155 156
  my $taxaccno = "";
156 157
  foreach $ref (@{ $form->{GL} }) {
157
    $form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}";
158

  
159 158
    $j = $i - 1;
160 159
    if ($tax && ($ref->{accno} eq $taxaccno)) {
161 160
      $form->{"tax_$j"}      = abs($ref->{amount});
......
895 894
sub update {
896 895
  $lxdebug->enter_sub();
897 896

  
898
  if ($form->{transdate} ne $form->{oldtransdate}) {
899
    if ($form->{selectprojectnumber}) {
900
      $form->all_projects(\%myconfig, undef, $form->{transdate});
901
      if (@{ $form->{all_project} }) {
902
        $form->{selectprojectnumber} = "<option>\n";
903
        for (@{ $form->{all_project} }) {
904
          $form->{selectprojectnumber} .=
905
            qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|;
906
        }
907
        $form->{selectprojectnumber} =
908
          $form->escape($form->{selectprojectnumber}, 1);
909
      }
910
    }
911
    $form->{oldtransdate} = $form->{transdate};
912
  }
897
  $form->{oldtransdate} = $form->{transdate};
913 898

  
914 899
  my @a           = ();
915 900
  my $count       = 0;
......
1033 1018
  my ($init) = @_;
1034 1019
  $lxdebug->enter_sub();
1035 1020

  
1036
  $form->{selectprojectnumber} = $form->unescape($form->{selectprojectnumber})
1037
    if $form->{selectprojectnumber};
1038

  
1039 1021
  $form->{totaldebit}  = 0;
1040 1022
  $form->{totalcredit} = 0;
1041 1023
  my $chart = $form->{chart};
1042 1024
  $chart            = $form->unquote($chart);
1043 1025
  $form->{taxchart} = $form->unquote($form->{taxchart});
1044 1026
  $taxchart         = $form->{taxchart};
1027

  
1028
  my @old_project_ids = ();
1029
  map({ push(@old_project_ids, $form->{"project_id_$_"})
1030
          if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
1031

  
1032
  $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
1033
                                   "all" => 0,
1034
                                   "old_id" => \@old_project_ids });
1035

  
1036
  my %project_labels = ();
1037
  my @project_values = ("");
1038
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
1039
    push(@project_values, $item->{"id"});
1040
    $project_labels{$item->{"id"}} = $item->{"projectnumber"};
1041
  }
1042

  
1045 1043
  for $i (1 .. $form->{rowcount}) {
1046 1044

  
1047 1045
    $source = qq|
......
1060 1058
        . ($i + 10 + (($i - 1) * 8))
1061 1059
        . qq|>$form->{taxchart}</select></td>|;
1062 1060

  
1063
      #       if ($form->{selectprojectnumber}) {
1064
      #         $project = qq|
1065
      #     <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
1066
      #       }
1067 1061
      $korrektur =
1068 1062
        qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
1069 1063
        . ($i + 9 + (($i - 1) * 8))
......
1112 1106
          . ($i + 10 + (($i - 1) * 8))
1113 1107
          . qq|>$tax</select></td>|;
1114 1108

  
1115
        #         if ($form->{selectprojectnumber}) {
1116
        #           $form->{"projectnumber_$i"} = ""
1117
        #             if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/;
1118
        #
1119
        #           $project = $form->{"projectnumber_$i"};
1120
        #           $project =~ s/--.*//;
1121
        #           $project = qq|<td>$project</td>|;
1122
        #         }
1123

  
1124 1109
        if ($form->{transfer}) {
1125 1110
          $checked = ($form->{"fx_transaction_$i"}) ? "1" : "";
1126 1111
          $x = ($checked) ? "x" : "";
......
1144 1129
      <td><select id="taxchart_$i" name="taxchart_$i" tabindex=|
1145 1130
          . ($i + 10 + (($i - 1) * 8)) . qq|>$taxchart</select></td>|;
1146 1131

  
1147
        #         if ($form->{selectprojectnumber}) {
1148
        #           $project = qq|
1149
        #       <td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|;
1150
        #         }
1151 1132
        $korrektur =
1152 1133
          qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|
1153 1134
          . ($i + 9 + (($i - 1) * 8))
......
1169 1150
      }
1170 1151
    }
1171 1152

  
1153
    my $projectnumber =
1154
      NTI($cgi->popup_menu('-name' => "project_id_$i",
1155
                           '-values' => \@project_values,
1156
                           '-labels' => \%project_labels,
1157
                           '-default' => $form->{"project_id_$i"} ));
1158

  
1172 1159
    print qq|<tr valign=top>
1173 1160
    $accno
1174 1161
    $fx_transaction
......
1182 1169
    $tax
1183 1170
    $source
1184 1171
    $memo
1172
    <td>$projectnumber</td>
1185 1173
  </tr>
1186 1174

  
1187 1175
  |;
......
1189 1177

  
1190 1178
  $form->hide_form(qw(rowcount selectaccno));
1191 1179

  
1192
  #   print qq|
1193
  # <input type=hidden name=selectprojectnumber value="|
1194
  #     . $form->escape($form->{selectprojectnumber}, 1) . qq|">|;
1195 1180
  $lxdebug->leave_sub();
1196 1181

  
1197 1182
}
......
1391 1376
	  <th class=listheading style="width:20%">|
1392 1377
    . $locale->text('Source') . qq|</th>
1393 1378
	  <th class=listheading style="width:20%">| . $locale->text('Memo') . qq|</th>
1394
	  $project
1379
	  <th class=listheading style="width:20%">|
1380
    . $locale->text('Project Number') . qq|</th>
1395 1381
	</tr>
1396 1382

  
1397 1383
$jsscript
......
1417 1403
    <td></td>
1418 1404
    <th align=right class=listtotal> $form->{totaldebit}</th>
1419 1405
    <th align=right class=listtotal> $form->{totalcredit}</th> 
1420
    <td colspan=5></td>
1406
    <td colspan=6></td>
1421 1407
    </tr>
1422 1408
  </table>
1423 1409
  </td>
......
1529 1515
  $transdate = $form->datetonum($form->{transdate}, \%myconfig);
1530 1516
  $closedto  = $form->datetonum($form->{closedto},  \%myconfig);
1531 1517

  
1532
  # check project
1533
  &check_project;
1534

  
1535 1518
  my @a           = ();
1536 1519
  my $count       = 0;
1537 1520
  my $debittax    = 0;
locale/de/gl
77 77
  'Out of balance transaction!' => 'Buchung ist nicht ausgeglichen!',
78 78
  'Post'                        => 'Buchen',
79 79
  'Post as new'                 => 'Neu buchen',
80
  'Project Number'              => 'Projektnummer',
80 81
  'Project not on file!'        => 'Dieses Projekt ist nicht in der Datenbank!',
81 82
  'Reference'                   => 'Referenz',
82 83
  'Reference missing!'          => 'Referenz fehlt!',

Auch abrufbar als: Unified diff