. $locale->date(\%myconfig, $form->{dateto}, 1);
}
- @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);
+ @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}) {
@columns = grep !/(accno|gifi_accno)/, @columns;
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();