</tr>
| if $form->{selectdepartment};
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 1 });
+
+ my %project_labels = ();
+ my @project_values = ("");
+ foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
+ push(@project_values, $item->{"id"});
+ $project_labels{$item->{"id"}} = $item->{"projectnumber"};
+ }
+
+ my $projectnumber =
+ NTI($cgi->popup_menu('-name' => "project_id",
+ '-values' => \@project_values,
+ '-labels' => \%project_labels));
+
# use JavaScript Calendar or not
$form->{jsscript} = $jscalendar;
$jsscript = "";
<th align=right>| . $locale->text('Notes') . qq|</th>
<td colspan=3><input name=notes size=40></td>
</tr>
+ <tr>
+ <th align=right>| . $locale->text('Project Number') . qq|</th>
+ <td colspan=3>$projectnumber</td>
+ </tr>
<tr>
<th align=right>| . $locale->text('From') . qq|</th>
$button1
<tr>
<td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
<td>| . $locale->text('Subtotal') . qq|</td>
+ <td align=right><input name="l_projectnumbers" class=checkbox type=checkbox value=Y></td>
+ <td>| . $locale->text('Project Number') . qq|</td>
</tr>
</table>
</tr>
$option .= "\n<br>" if $option;
$option .= $locale->text('Notes') . " : $form->{notes}";
}
+ if ($form->{project_id}) {
+ $href .= "&project_id=" . $form->escape($form->{project_id});
+ $callback .= "&project_id=" . $form->escape($form->{project_id});
+ }
if ($form->{datefrom}) {
$href .= "&datefrom=$form->{datefrom}";
. $locale->date(\%myconfig, $form->{dateto}, 1);
}
- @columns = $form->sort_columns(
- qw(transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno gifi_accno)
+ @columns = $form->sort_columns( qw(
+ transdate id reference description
+ notes source debit debit_accno
+ credit credit_accno debit_tax debit_tax_accno
+ credit_tax credit_tax_accno accno gifi_accno
+ projectnumbers
+ )
);
if ($form->{accno} || $form->{gifi_accno}) {
. $locale->text('GIFI')
. "</a></th>";
$column_header{balance} = "<th>" . $locale->text('Balance') . "</th>";
+ $column_header{projectnumbers} =
+ "<th class=listheading>" . $locale->text('Project Numbers') . "</th>";
$form->{landscape} = 1;
$column_data{balance} =
"<td align=right>"
. $form->format_amount(\%myconfig, $form->{balance}, 2, 0) . "</td>";
+ $column_data{projectnumbers} =
+ "<td>" . join(", ", sort({ lc($a) cmp lc($b) } keys(%{ $ref->{projectnumbers} }))) . "</td>";
$i++;
$i %= 2;
map { $column_data{$_} = "<td> </td>" } @column_index;
+ my $balanced_ledger = $totaldebit
+ + $totaldebittax
+ - $totalcredit
+ - $totalcredittax;
+ # = 0 for balanced ledger
+
$column_data{debit} =
"<th align=right class=listtotal>"
. $form->format_amount(\%myconfig, $totaldebit, 2, " ") . "</th>";
print qq|
</tr>
+ <tr>|;
+
+
+ if ( abs($balanced_ledger) > 0.001 ) {
+
+ print qq|<td colspan="4" style="background-color:#FFA0A0" >|
+ . $locale->text('Unbalanced Ledger')
+ . ": "
+ . $form->format_amount(\%myconfig, $balanced_ledger, 3, " ")
+
+ } elsif ( abs($balanced_ledger) <= 0.001 ) {
+
+ print qq|<td colspan="3">|
+ . $locale->text('Balanced Ledger')
+
+ }
+
+
+ print qq|
+ </td>
+ </tr>
</tbody>
</table>
</td>
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Storno') . qq|">|;
- # Löschen und ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
+ # Löschen und Ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich
if (!$form->{locked} && $radieren) {
print qq|
sub yes {
$lxdebug->enter_sub();
-
- $form->redirect($locale->text('Transaction deleted!'))
- if (GL->delete_transaction(\%myconfig, \%$form));
+ if (GL->delete_transaction(\%myconfig, \%$form)){
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "DELETED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
+ $form->redirect($locale->text('Transaction deleted!'))
+ }
$form->error($locale->text('Cannot delete transaction!'));
$lxdebug->leave_sub();
$form->error($err[$errno]);
}
undef($form->{callback});
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "SAVED";
+ $form->{what_done} = $locale->text("Buchungsnummer") . " = " . $form->{id};
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$form->redirect("Buchung gespeichert. Buchungsnummer = " . $form->{id});
$lxdebug->leave_sub();
$form->{id} = 0;
$form->{storno} = 1;
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "STORNO";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
&post;
$lxdebug->leave_sub();