Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f4431e33

Von Bernd Bleßmann vor etwa 9 Jahren hinzugefügt

  • ID f4431e33ab04ab24446d60bf2fad06642980fac1
  • Vorgänger 0560b39e
  • Nachfolger 39c2e07d

Auslagern in VK-Rechnung: Mandantenkonfiguration vollständig berücksichtigen …

und Fehlerbehandlung verbessert.

Unterschiede anzeigen:

bin/mozilla/is.pl
785 785
  if ($::instance_conf->get_is_transfer_out && $form->{type} ne 'credit_note' && !$form->{storno}) {
786 786
    require SL::DB::Inventory;
787 787
    my $rose_db = SL::DB::Inventory->new->db;
788
    my $error;
788
    my @errors;
789 789

  
790 790
    if (!$rose_db->with_transaction(sub {
791 791
      if (!eval {
792
        IS->post_invoice(\%myconfig, \%$form, $rose_db->dbh);
793
        IS->transfer_out(\%$form);
792
        if (!IS->post_invoice(\%myconfig, \%$form, $rose_db->dbh)) {
793
          push @errors, $locale->text('Cannot post invoice!');
794
          die 'posting error';
795
        }
796
        my $err = IS->transfer_out(\%$form, $rose_db->dbh);
797
        if (@{ $err }) {
798
          push @errors, @{ $err };
799
          die 'transfer error';
800
        }
801

  
794 802
        1;
795 803
      }) {
796
        $error = $EVAL_ERROR;
797
        return;
804
        push @errors, $EVAL_ERROR;
805
        die 'transaction error';
798 806
      }
799 807

  
800 808
      1;
801 809
    })) {
802
      $form->error($locale->text("Cannot post invoice and/or transfer out!\nError was:\n") . $locale->text($error));
810
      push @errors, $rose_db->error;
811
      $form->error($locale->text('Cannot post invoice and/or transfer out! Error message:') . "\n" . join("\n", @errors));
803 812
    }
804 813
  } else {
805 814
    if (!IS->post_invoice(\%myconfig, \%$form)) {

Auch abrufbar als: Unified diff