Revision 2a49e661
Von Kivitendo Admin vor mehr als 1 Jahr hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
39 | 39 |
use List::Util qw(first sum); |
40 | 40 |
|
41 | 41 |
use SL::DB::ApGl; |
42 |
use SL::DB::Cleared; |
|
42 | 43 |
use SL::DB::RecordTemplate; |
43 | 44 |
use SL::DB::ReconciliationLink; |
44 | 45 |
use SL::DB::BankTransactionAccTrans; |
... | ... | |
983 | 984 |
my $form = $::form; |
984 | 985 |
my $change_never = $::instance_conf->get_gl_changeable == 0; |
985 | 986 |
my $change_on_same_day_only = $::instance_conf->get_gl_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate}); |
986 |
my ($is_linked_bank_transaction, $is_linked_ap_transaction, $is_reconciled_bank_transaction); |
|
987 |
my ($is_linked_bank_transaction, $is_linked_ap_transaction, $is_reconciled_bank_transaction, $is_cleared);
|
|
987 | 988 |
|
988 | 989 |
if ($form->{id} && SL::DB::Manager::BankTransactionAccTrans->find_by(gl_id => $form->{id})) { |
989 | 990 |
$is_linked_bank_transaction = 1; |
... | ... | |
991 | 992 |
if ($form->{id} && SL::DB::Manager::ApGl->find_by(gl_id => $form->{id})) { |
992 | 993 |
$is_linked_ap_transaction = 1; |
993 | 994 |
} |
994 |
# dont edit reconcilated bookings!
|
|
995 |
# don't edit reconciled or cleared bookings!
|
|
995 | 996 |
if ($form->{id}) { |
996 | 997 |
my @acc_trans_ids = map { $_->acc_trans_id } @{ SL::DB::Manager::AccTransaction->get_all(select => ["acc_trans_id"], where => [ trans_id => $form->{id} ] ) }; |
997 | 998 |
if (scalar @acc_trans_ids && scalar @{ SL::DB::Manager::ReconciliationLink->get_all(where => [ acc_trans_id => [ @acc_trans_ids ] ]) }) { |
998 | 999 |
$is_reconciled_bank_transaction = 1; |
999 | 1000 |
} |
1001 |
if (scalar @acc_trans_ids && scalar @{ SL::DB::Manager::Cleared->get_all(where => [ acc_trans_id => [ @acc_trans_ids ] ]) }) { |
|
1002 |
$is_cleared = 1; |
|
1003 |
} |
|
1000 | 1004 |
} |
1001 | 1005 |
my $create_post_action = sub { |
1002 | 1006 |
# $_[0]: description |
... | ... | |
1011 | 1015 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
1012 | 1016 |
: $is_linked_ap_transaction ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.') |
1013 | 1017 |
: $is_reconciled_bank_transaction ? t8('This transaction is reconciled with a bank transaction. Please undo the reconciliation if needed.') |
1018 |
: $is_cleared ? t8('This transaction has been cleared. Please undo the clearing if needed.') |
|
1014 | 1019 |
: undef, |
1015 | 1020 |
], |
1016 | 1021 |
}; |
... | ... | |
1044 | 1049 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
1045 | 1050 |
: $is_linked_ap_transaction ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.') |
1046 | 1051 |
: $is_reconciled_bank_transaction ? t8('This transaction is reconciled with a bank transaction. Please undo the reconciliation if needed.') |
1052 |
: $is_cleared ? t8('This transaction has been cleared. Please undo the clearing if needed.') |
|
1047 | 1053 |
: undef, |
1048 | 1054 |
], |
1049 | 1055 |
action => [ t8('Delete'), |
... | ... | |
1056 | 1062 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
1057 | 1063 |
: $is_linked_ap_transaction ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.') |
1058 | 1064 |
: $is_reconciled_bank_transaction ? t8('This transaction is reconciled with a bank transaction. Please undo the reconciliation if needed.') |
1065 |
: $is_cleared ? t8('This transaction has been cleared. Please undo the clearing if needed.') |
|
1059 | 1066 |
: $form->{storno} ? t8('A canceled general ledger transaction cannot be deleted.') |
1060 | 1067 |
: undef, |
1061 | 1068 |
], |
Auch abrufbar als: Unified diff
Konten ausziffern - Dialogbuchungen prüfen
Ausgezifferte Buchungen sollten nicht mehr
bearbeitbar/stornierbar/löschbar sein.