Revision ca4e97fd
Von Jan Büren vor etwa 5 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
39 | 39 |
use List::Util qw(first sum); |
40 | 40 |
|
41 | 41 |
use SL::DB::RecordTemplate; |
42 |
use SL::DB::BankTransactionAccTrans; |
|
42 | 43 |
use SL::DB::Tax; |
43 | 44 |
use SL::FU; |
44 | 45 |
use SL::GL; |
... | ... | |
965 | 966 |
my $form = $::form; |
966 | 967 |
my $change_never = $::instance_conf->get_gl_changeable == 0; |
967 | 968 |
my $change_on_same_day_only = $::instance_conf->get_gl_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate}); |
969 |
my $is_linked_bank_transaction; |
|
970 |
|
|
971 |
if ($form->{id} && SL::DB::Manager::BankTransactionAccTrans->find_by(gl_id => $form->{id})) { |
|
972 |
$is_linked_bank_transaction = 1; |
|
973 |
} |
|
968 | 974 |
|
969 | 975 |
for my $bar ($::request->layout->get('actionbar')) { |
970 | 976 |
$bar->add( |
... | ... | |
981 | 987 |
: $form->{storno} ? t8('A canceled general ledger transaction cannot be posted.') |
982 | 988 |
: ($form->{id} && $change_never) ? t8('Changing general ledger transaction has been disabled in the configuration.') |
983 | 989 |
: ($form->{id} && $change_on_same_day_only) ? t8('General ledger transactions can only be changed on the day they are posted.') |
990 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
|
984 | 991 |
: undef, |
985 | 992 |
], |
986 | 993 |
combobox => [ |
... | ... | |
996 | 1003 |
: $form->{locked} ? t8('The billing period has already been locked.') |
997 | 1004 |
: $change_never ? t8('Changing invoices has been disabled in the configuration.') |
998 | 1005 |
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.') |
1006 |
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.') |
|
999 | 1007 |
: undef, |
1000 | 1008 |
], |
1001 | 1009 |
], # end of combobox "Storno" |
... | ... | |
1368 | 1376 |
to_id => $::form->{id}, |
1369 | 1377 |
); |
1370 | 1378 |
SL::DB::RecordLink->new(@props)->save; |
1379 |
# and tighten holy acc_trans_id for this bank_transaction |
|
1380 |
my %props_acc = ( |
|
1381 |
acc_trans_id => $payment->[0]->acc_trans_id, |
|
1382 |
bank_transaction_id => $bt->id, |
|
1383 |
gl_id => $payment->[0]->trans_id, |
|
1384 |
); |
|
1385 |
my $bta = SL::DB::BankTransactionAccTrans->new(%props_acc); |
|
1386 |
$bta->save; |
|
1371 | 1387 |
|
1372 | 1388 |
} |
1373 | 1389 |
1; |
Auch abrufbar als: Unified diff
GL mit Bankbewegungen verbuchen. Helfertabelle und striktere Aktionen
Neue acc_trans_id können wir bei diesem Typ von gl-Einträgen nicht
gebrauchen. Alle Anwendermöglichkeiten von der Oberflächen verbieten