Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision b231d037

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

  • ID b231d03716d0dcd795749c49bb5c3c6095111ede
  • Vorgänger 00d97258
  • Nachfolger f38ccc2d

Stornos bei EK-Rechnungen verbieten, solange SEPA-Exports verknüpft sind

Unterschiede anzeigen:

bin/mozilla/ir.pl
221 221
  my $change_never            = $::instance_conf->get_ir_changeable == 0;
222 222
  my $change_on_same_day_only = $::instance_conf->get_ir_changeable == 2 && ($form->current_date(\%::myconfig) ne $form->{gldate});
223 223

  
224
  my $has_sepa_exports;
225

  
226
  if ($form->{id}) {
227
    my $invoice = SL::DB::Manager::PurchaseInvoice->find_by(id => $form->{id});
228
    $has_sepa_exports = 1 if ($invoice->find_sepa_export_items()->[0]);
229
  }
230

  
224 231
  for my $bar ($::request->layout->get('actionbar')) {
225 232
    $bar->add(
226 233
      action => [
......
263 270
          submit   => [ '#form', { action => "storno" } ],
264 271
          checks   => [ 'kivi.validate_form' ],
265 272
          confirm  => t8('Do you really want to cancel this invoice?'),
266
          disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
273
          disabled => !$form->{id}          ? t8('This invoice has not been posted yet.')
274
                      : $has_sepa_exports   ? t8('This invoice has been linked with a sepa export, undo this first.')
275
                      : undef,
267 276
        ],
268 277
        action => [ t8('Delete'),
269 278
          submit   => [ '#form', { action => "delete" } ],
......
273 282
                    : $form->{locked}          ? t8('The billing period has already been locked.')
274 283
                    : $change_never            ? t8('Changing invoices has been disabled in the configuration.')
275 284
                    : $change_on_same_day_only ? t8('Invoices can only be changed on the day they are posted.')
285
                    : $has_sepa_exports        ? t8('This invoice has been linked with a sepa export, undo this first.')
276 286
                    :                            undef,
277 287
        ],
278 288
      ], # end of combobox "Storno"

Auch abrufbar als: Unified diff