Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5ad7e1ed

Von Sven Schöling vor mehr als 8 Jahren hinzugefügt

  • ID 5ad7e1ed10430c3e9fbe4e9c9cfcbd409e547251
  • Vorgänger 9df5680a
  • Nachfolger 9bfcaea8

ARAP: single-dbh

Unterschiede anzeigen:

SL/ARAP.pm
4 4
use SL::Common;
5 5
use SL::DBUtils;
6 6
use SL::MoreCommon;
7
use SL::DB;
7 8
use Data::Dumper;
8 9

  
9 10
use strict;
......
19 20
  my $myconfig  = \%main::myconfig;
20 21
  my $form      = $main::form;
21 22

  
22
  my $dbh       = $params{dbh} || $form->get_standard_dbh($myconfig);
23
  my $dbh       = $params{dbh} || SL::DB->client->dbh;
23 24

  
24 25
  # First, find all order IDs from which this invoice has been
25 26
  # created. Either directly by a conversion from an order to this invoice
......
150 151

  
151 152
  # Close orders that have been billed fully.
152 153
  if (scalar @close_oe_ids) {
153
    my $query = qq|UPDATE oe SET closed = TRUE WHERE id IN (| . join(', ', ('?') x scalar @close_oe_ids) . qq|)|;
154
    do_query($form, $dbh, $query, @close_oe_ids);
155

  
156
    $dbh->commit unless $params{dbh};
154
    SL::DB->client->with_transaction(sub {
155
      my $query = qq|UPDATE oe SET closed = TRUE WHERE id IN (| . join(', ', ('?') x scalar @close_oe_ids) . qq|)|;
156
      do_query($form, $dbh, $query, @close_oe_ids);
157
    });
157 158
  }
158 159

  
159 160
  $main::lxdebug->leave_sub();

Auch abrufbar als: Unified diff