Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2214a00d

Von Jan Büren vor etwa 2 Jahren hinzugefügt

  • ID 2214a00d8519611428ab12709241ea46dd45eb01
  • Vorgänger 73c5b412
  • Nachfolger 67df41d2

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

Unterschiede anzeigen:

SL/Controller/BankTransaction.pm
680 680
    $open_amount            = abs($open_amount);
681 681
    $open_amount           -= $free_skonto_amount if ($payment_type eq 'free_skonto');
682 682
    my $not_assigned_amount = abs($bank_transaction->not_assigned_amount);
683
    my $amount_for_booking  = ($open_amount < $not_assigned_amount) ? $open_amount : $not_assigned_amount;
684
    my $amount_for_payment  = $amount_for_booking;
683
    my $amount_for_payment  = ($open_amount < $not_assigned_amount) ? $open_amount : $not_assigned_amount;
685 684

  
686 685
    # get the right direction for the payment bookings (all amounts < 0 are stornos, credit notes or negative ap)
687 686
    $amount_for_payment *= -1 if $invoice->amount < 0;
688 687
    $free_skonto_amount *= -1 if ($free_skonto_amount && $invoice->amount < 0);
689 688
    # get the right direction for the bank transaction
690
    $amount_for_booking *= $sign;
691

  
692
    $bank_transaction->invoice_amount($bank_transaction->invoice_amount + $amount_for_booking);
689
    # sign is simply the sign of amount in bank_transactions: positive for increase and negative for decrease
690
    # $amount_for_booking *= $sign;
693 691

  
694 692
    # ... and then pay the invoice
695 693
    my @acc_ids = $invoice->pay_invoice(chart_id => $bank_transaction->local_bank_account->chart_id,
bin/mozilla/ap.pl
1377 1377

  
1378 1378
  my $is_linked_bank_transaction;
1379 1379
  if ($::form->{id}
1380
      && SL::DB::Default->get->payments_changeable != 0
1381 1380
      && SL::DB::Manager::BankTransactionAccTrans->find_by(ap_id => $::form->{id})) {
1382 1381

  
1383 1382
    $is_linked_bank_transaction = 1;
......
1478 1477
                    : $is_closed                  ? t8('The billing period has already been locked.')
1479 1478
                    : $has_sepa_exports           ? t8('This invoice has been linked with a sepa export, undo this first.')
1480 1479
                    : $is_linked_bank_transaction ? t8('This transaction is linked with a bank transaction. Please undo and redo the bank transaction booking if needed.')
1481
                    : $is_linked_gl_transaction   ? undef # linked transactions can be deleted, if period is not closed
1480
                    # : $is_linked_gl_transaction   ? undef # linked transactions can be deleted, if period is not closed
1482 1481
                    : $change_never               ? t8('Changing invoices has been disabled in the configuration.')
1483 1482
                    : $change_on_same_day_only    ? t8('Invoices can only be changed on the day they are posted.')
1484 1483
                    : $has_storno                 ? t8('This invoice has been canceled already.')

Auch abrufbar als: Unified diff