Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e0fb092b

Von Werner Hahn vor fast 3 Jahren hinzugefügt

MassRecordCreationAndPrinting - MassInvoiceCreatePrint: Auftrag schliessen

Unterschiede anzeigen:

SL/BackgroundJob/MassRecordCreationAndPrinting.pm
11 11
use SL::DB::Printer;
12 12
use SL::SessionFile;
13 13
use SL::Template;
14
use SL::ARAP;
14 15
use SL::Locale::String qw(t8);
15 16
use SL::Helper::MassPrintCreatePDF qw(:all);
16 17
use SL::Helper::CreatePDF qw(:all);
......
41 42

  
42 43
  my $job_obj = $self->{job_obj};
43 44
  my $db      = $job_obj->db;
45
  my $dbh     = SL::DB->client->dbh;
44 46

  
45 47
  $job_obj->set_data(status => CONVERTING_DELIVERY_ORDERS())->save;
46 48

  
......
55 57
      my $invoice              = $sales_delivery_order->convert_to_invoice(%conversion_params);
56 58

  
57 59
      die $db->error if !$invoice;
60

  
61
      ARAP->close_orders_if_billed('dbh'     => $dbh,
62
                                   'arap_id' => $invoice->id,
63
                                   'table'   => 'ar',);
64

  
58 65
      # update shop status
59 66
      my @linked_shop_orders = $invoice->linked_records(
60 67
        from      => 'ShopOrder',
SL/Controller/MassInvoiceCreatePrint.pm
19 19
use SL::Helper::Flash;
20 20
use SL::Locale::String;
21 21
use SL::SessionFile;
22
use SL::ARAP;
22 23
use SL::System::TaskServer;
23 24
use Rose::Object::MakeMethods::Generic
24 25
(
......
57 58
  }
58 59

  
59 60
  my $db = SL::DB::Invoice->new->db;
61
  my $dbh = SL::DB->client->dbh;
60 62
  my @invoices;
61 63
  my @already_closed_delivery_orders;
62 64

  
......
73 75

  
74 76
      } else {
75 77
        my $invoice = $delivery_order->convert_to_invoice() || die $db->error;
78

  
79
        ARAP->close_orders_if_billed('dbh'     => $dbh,
80
                                     'arap_id' => $invoice->id,
81
                                     'table'   => 'ar',);
82

  
76 83
        push @invoices, $invoice;
77 84
      }
78 85
    }

Auch abrufbar als: Unified diff