Revision ac271c64
Von Jan Büren vor fast 6 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
24 | 24 |
use SL::DB::BankTransactionAccTrans; |
25 | 25 |
use SL::DB::Tax; |
26 | 26 |
use SL::DB::BankAccount; |
27 |
use SL::DB::GLTransaction; |
|
27 | 28 |
use SL::DB::RecordTemplate; |
28 | 29 |
use SL::DB::SepaExportItem; |
29 | 30 |
use SL::DBUtils qw(like do_query); |
30 | 31 |
|
31 |
use SL::Presenter::Tag qw(checkbox_tag); |
|
32 |
use SL::Presenter::Tag qw(checkbox_tag html_tag);
|
|
32 | 33 |
use Carp; |
33 | 34 |
use List::UtilsBy qw(partition_by); |
34 | 35 |
use List::MoreUtils qw(any); |
... | ... | |
765 | 766 |
$_->delete for @{ $acc_trans }; |
766 | 767 |
} |
767 | 768 |
# 3. update arap.paid (may not be 0, yet) |
769 |
# or in case of gl, delete whole entry |
|
768 | 770 |
while (my ($trans_id, $type) = each %trans_ids) { |
769 |
next if $type eq 'gl'; |
|
771 |
if ($type eq 'gl') { |
|
772 |
SL::DB::Manager::GLTransaction->delete_all(where => [ id => $trans_id ]); |
|
773 |
next; |
|
774 |
} |
|
770 | 775 |
die ("invalid type") unless $type =~ m/^(ar|ap)$/; |
771 | 776 |
|
772 | 777 |
# recalc and set paid via database query |
... | ... | |
843 | 848 |
my %column_defs = ( |
844 | 849 |
ids => { raw_header_data => checkbox_tag("", id => "check_all", checkall => "[data-checkall=1]"), |
845 | 850 |
'align' => 'center', |
846 |
raw_data => sub { if (@{ $_[0]->linked_invoices } && !(grep {ref ($_) eq 'SL::DB::GLTransaction' } @{ $_[0]->linked_invoices })) { |
|
847 |
checkbox_tag("ids[]", value => $_[0]->id, "data-checkall" => 1); } } }, |
|
851 |
raw_data => sub { if (@{ $_[0]->linked_invoices }) { |
|
852 |
if ($_[0]->closed_period) { |
|
853 |
html_tag('text', "X"); #, tooltip => t8('Bank Transaction is in a closed period.')), |
|
854 |
} else { |
|
855 |
checkbox_tag("ids[]", value => $_[0]->id, "data-checkall" => 1); |
|
856 |
} |
|
857 |
} } }, |
|
848 | 858 |
transdate => { sub => sub { $_[0]->transdate_as_date } }, |
849 | 859 |
valutadate => { sub => sub { $_[0]->valutadate_as_date } }, |
850 | 860 |
remote_name => { }, |
Auch abrufbar als: Unified diff
Kontoauszug verbuchen rückgängig machen. Closedto und GL
Falls eine Buchung in einer geschlossenen Periode ist,
erst gar nicht die Möglichkeit zum Anwählen geben.
Ferner GLTransaction auch erlauben, allerdings diese dann
komplett (gl Nebenbuch) rauslöschen