Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d53cd961

Von Jan Büren vor fast 3 Jahren hinzugefügt

  • ID d53cd96129bd8a2ac1f5bb5a34f88e87d723d751
  • Vorgänger 23b40897
  • Nachfolger 479d8db7

Mit Bankimport abgeglichen Dialog-Buchungen schreibschützen

Unterschiede anzeigen:

bin/mozilla/gl.pl
40 40

  
41 41
use SL::DB::ApGl;
42 42
use SL::DB::RecordTemplate;
43
use SL::DB::ReconciliationLink;
43 44
use SL::DB::BankTransactionAccTrans;
44 45
use SL::DB::Tax;
45 46
use SL::FU;
......
974 975
  my $form   = $::form;
975 976
  my $change_never            = $::instance_conf->get_gl_changeable == 0;
976 977
  my $change_on_same_day_only = $::instance_conf->get_gl_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate});
977
  my ($is_linked_bank_transaction, $is_linked_ap_transaction);
978
  my ($is_linked_bank_transaction, $is_linked_ap_transaction, $is_reconciled_bank_transaction);
978 979

  
979 980
  if ($form->{id} && SL::DB::Manager::BankTransactionAccTrans->find_by(gl_id => $form->{id})) {
980 981
    $is_linked_bank_transaction = 1;
......
982 983
  if ($form->{id} && SL::DB::Manager::ApGl->find_by(gl_id => $form->{id})) {
983 984
    $is_linked_ap_transaction = 1;
984 985
  }
985

  
986

  
986
  # dont edit reconcilated bookings!
987
  if ($form->{id}) {
988
    my @acc_trans = map { $_->acc_trans_id } @{ SL::DB::Manager::AccTransaction->get_all( where => [ trans_id => $form->{id} ] ) };
989
    if (scalar @acc_trans && scalar @{ SL::DB::Manager::ReconciliationLink->get_all(where => [ acc_trans_id  => [ @acc_trans ] ]) }) {
990
      $is_reconciled_bank_transaction = 1;
991
    }
992
  }
987 993
  my $create_post_action = sub {
988 994
    # $_[0]: description
989 995
    # $_[1]: after_action
......
996 1002
                : ($form->{id} && $change_on_same_day_only) ? t8('General ledger transactions can only be changed on the day they are posted.')
997 1003
                : $is_linked_bank_transaction               ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.')
998 1004
                : $is_linked_ap_transaction                 ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.')
1005
                : $is_reconciled_bank_transaction           ? t8('This transaction is reconciled with a bank transaction. Please undo the reconciliation if needed.')
999 1006
                : undef,
1000 1007
    ],
1001 1008
  };
......
1028 1035
                    : $form->{storno}             ? t8('A canceled general ledger transaction cannot be canceled again.')
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.')
1030 1037
                    : $is_linked_ap_transaction   ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.')
1038
                    : $is_reconciled_bank_transaction ? t8('This transaction is reconciled with a bank transaction. Please undo the reconciliation if needed.')
1031 1039
                    : undef,
1032 1040
        ],
1033 1041
        action => [ t8('Delete'),
......
1039 1047
                    : $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.')
1040 1048
                    : $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.')
1041 1049
                    : $is_linked_ap_transaction   ? t8('This transaction is linked with a AP transaction. Please undo and redo the AP transaction booking if needed.')
1050
                    : $is_reconciled_bank_transaction ? t8('This transaction is reconciled with a bank transaction. Please undo the reconciliation if needed.')
1042 1051
                    : $form->{storno}             ? t8('A canceled general ledger transaction cannot be deleted.')
1043 1052
                    : undef,
1044 1053
        ],

Auch abrufbar als: Unified diff