Revision 053d0c37
Von Jan Büren vor fast 3 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
38 | 38 |
use POSIX qw(strftime); |
39 | 39 |
use List::Util qw(first sum); |
40 | 40 |
|
41 |
use SL::DB::ApGl; |
|
41 | 42 |
use SL::DB::RecordTemplate; |
42 | 43 |
use SL::DB::BankTransactionAccTrans; |
43 | 44 |
use SL::DB::Tax; |
... | ... | |
969 | 970 |
my $form = $::form; |
970 | 971 |
my $change_never = $::instance_conf->get_gl_changeable == 0; |
971 | 972 |
my $change_on_same_day_only = $::instance_conf->get_gl_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate}); |
972 |
my $is_linked_bank_transaction;
|
|
973 |
my ($is_linked_bank_transaction, $is_linked_ap_transaction);
|
|
973 | 974 |
|
974 | 975 |
if ($form->{id} && SL::DB::Manager::BankTransactionAccTrans->find_by(gl_id => $form->{id})) { |
975 | 976 |
$is_linked_bank_transaction = 1; |
976 | 977 |
} |
978 |
if ($form->{id} && SL::DB::Manager::ApGl->find_by(gl_id => $form->{id})) { |
|
979 |
$is_linked_ap_transaction = 1; |
|
980 |
} |
|
981 |
|
|
977 | 982 |
|
978 | 983 |
my $create_post_action = sub { |
979 | 984 |
# $_[0]: description |
... | ... | |
986 | 991 |
: ($form->{id} && $change_never) ? t8('Changing general ledger transaction has been disabled in the configuration.') |
987 | 992 |
: ($form->{id} && $change_on_same_day_only) ? t8('General ledger transactions can only be changed on the day they are posted.') |
988 | 993 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
989 |
: undef, |
|
994 |
: $is_linked_ap_transaction ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.') |
|
995 |
: undef, |
|
990 | 996 |
], |
991 | 997 |
}; |
992 | 998 |
|
... | ... | |
1017 | 1023 |
disabled => !$form->{id} ? t8('This general ledger transaction has not been posted yet.') |
1018 | 1024 |
: $form->{storno} ? t8('A canceled general ledger transaction cannot be canceled again.') |
1019 | 1025 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
1026 |
: $is_linked_ap_transaction ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.') |
|
1020 | 1027 |
: undef, |
1021 | 1028 |
], |
1022 | 1029 |
action => [ t8('Delete'), |
... | ... | |
1027 | 1034 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.') |
1028 | 1035 |
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') |
1029 | 1036 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
1037 |
: $is_linked_ap_transaction ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.') |
|
1030 | 1038 |
: $form->{storno} ? t8('A canceled general ledger transaction cannot be deleted.') |
1031 |
: undef,
|
|
1039 |
: undef, |
|
1032 | 1040 |
], |
1033 | 1041 |
], # end of combobox "Storno" |
1034 | 1042 |
|
... | ... | |
1053 | 1061 |
call => [ 'kivi.Draft.popup', 'gl', 'unknown', $form->{draft_id}, $form->{draft_description} ], |
1054 | 1062 |
disabled => $form->{id} ? t8('This invoice has already been posted.') |
1055 | 1063 |
: $form->{locked} ? t8('The billing period has already been locked.') |
1056 |
: undef,
|
|
1064 |
: undef, |
|
1057 | 1065 |
], |
1058 | 1066 |
], # end of combobox "more" |
1059 | 1067 |
); |
Auch abrufbar als: Unified diff
Buchen und Verändern für gl sperren, falls kreditorische Folgebuchung