Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 389dc658

Von Jan Büren vor mehr als 2 Jahren hinzugefügt

  • ID 389dc658be43d0ef7fda9fadef082547d4c82cee
  • Vorgänger b43a51fd
  • Nachfolger eab8255b

ap.pl: Falls Bankverbuchung verknüpft, Löschen prinzipiell verbieten

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
$open_amount = abs($open_amount);
$open_amount -= $free_skonto_amount if ($payment_type eq 'free_skonto');
my $not_assigned_amount = abs($bank_transaction->not_assigned_amount);
my $amount_for_booking = ($open_amount < $not_assigned_amount) ? $open_amount : $not_assigned_amount;
my $amount_for_payment = $amount_for_booking;
my $amount_for_payment = ($open_amount < $not_assigned_amount) ? $open_amount : $not_assigned_amount;
# get the right direction for the payment bookings (all amounts < 0 are stornos, credit notes or negative ap)
$amount_for_payment *= -1 if $invoice->amount < 0;
$free_skonto_amount *= -1 if ($free_skonto_amount && $invoice->amount < 0);
# get the right direction for the bank transaction
$amount_for_booking *= $sign;
$bank_transaction->invoice_amount($bank_transaction->invoice_amount + $amount_for_booking);
# sign is simply the sign of amount in bank_transactions: positive for increase and negative for decrease
# $amount_for_booking *= $sign;
# ... and then pay the invoice
my @acc_ids = $invoice->pay_invoice(chart_id => $bank_transaction->local_bank_account->chart_id,
bin/mozilla/ap.pl
my $is_linked_bank_transaction;
if ($::form->{id}
&& SL::DB::Default->get->payments_changeable != 0
&& SL::DB::Manager::BankTransactionAccTrans->find_by(ap_id => $::form->{id})) {
$is_linked_bank_transaction = 1;
......
: $is_closed ? t8('The billing period has already been locked.')
: $has_sepa_exports ? t8('This invoice has been linked with a sepa export, undo this first.')
: $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.')
: $is_linked_gl_transaction ? undef # linked transactions can be deleted, if period is not closed
# : $is_linked_gl_transaction ? undef # linked transactions can be deleted, if period is not closed
: $change_never ? t8('Changing invoices has been disabled in the configuration.')
: $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.')
: $has_storno ? t8('This invoice has been canceled already.')

Auch abrufbar als: Unified diff