Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 27ca3a23

Von Bernd Bleßmann vor fast 3 Jahren hinzugefügt

  • ID 27ca3a23627019c1fbb0a74ce250beae763bc947
  • Vorgänger c1146a01
  • Nachfolger a4bd790b

Anzahlungs-Rg.: Workflow vom Auftrag: alle Anzahlugns-Rg. und Schluss-Rg.

Wird der Workflow vom Auftrag aus begonnen, so werden alle Anzahlungs- und
die Schlussrechnung vom Auftrag aus gemacht.
Der Einstieg über eine Anzahlungs-Rg. und dann der Workflow
"weitere Anzahlungs-Rg." (...) und hieraus Schluss-Rg. bleibt bestehen.

Unterschiede anzeigen:

bin/mozilla/is.pl
334 334
    $has_final_invoice = any {'SL::DB::Invoice' eq ref $_ && "final_invoice" eq $_->invoice_type} @$lr;
335 335
  }
336 336

  
337
  my $is_invoice_for_advance_payment_from_order;
338
  if ($form->{id} && $form->{type} eq "invoice_for_advance_payment") {
339
    my $invoice_obj = SL::DB::Invoice->load_cached($form->{id});
340
    my $lr          = $invoice_obj->linked_records(direction => 'from', from => ['Order']);
341
    $is_invoice_for_advance_payment_from_order = scalar @$lr >= 1;
342
  }
343

  
337 344
  for my $bar ($::request->layout->get('actionbar')) {
338 345
    $bar->add(
339 346
      action => [
......
426 433
                    : !$form->{id}      ? t8('This invoice has not been posted yet.')
427 434
                    : $has_further_invoice_for_advance_payment ? t8('This invoice has already a further invoice for advanced payment.')
428 435
                    : $has_final_invoice                       ? t8('This invoice has already a final invoice.')
436
                    : $is_invoice_for_advance_payment_from_order ? t8('This invoice was added from an order. See there.')
429 437
                    :                     undef,
430 438
          only_if  => $form->{type} eq "invoice_for_advance_payment",
431 439
        ],
......
437 445
                    : !$form->{id}      ? t8('This invoice has not been posted yet.')
438 446
                    : $has_further_invoice_for_advance_payment ? t8('This invoice has a further invoice for advanced payment.')
439 447
                    : $has_final_invoice                       ? t8('This invoice has already a final invoice.')
448
                    : $is_invoice_for_advance_payment_from_order ? t8('This invoice was added from an order. See there.')
440 449
                    :                     undef,
441 450
          only_if  => $form->{type} eq "invoice_for_advance_payment",
442 451
        ],
......
1203 1212

  
1204 1213
  $main::auth->assert('invoice_edit');
1205 1214

  
1206
  # search all related invoices for advance payment
1207
  #
1208
  # (order) -> invoice for adv. payment 1 -> invoice for adv. payment 2 -> invoice for adv. payment 3 -> final invoice
1209
  #
1210
  # we are currently in the last invoice for adv. payment (3 in this example)
1211 1215
  my $related_invoices = IS->_get_invoices_for_advance_payment($form->{id});
1212 1216

  
1213 1217
  delete @{ $form }{qw(printed emailed queued invnumber invdate exchangerate forex deliverydate datepaid_1 gldate_1 acc_trans_id_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno locked)};

Auch abrufbar als: Unified diff