Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ea14cfa5

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID ea14cfa54fc510f47a4ec9a85939deacf780adde
  • Vorgänger 43ad317e
  • Nachfolger c3fa430e

Einkaufs-/Verkaufsbelege: Spalte taxzone_id bereits beim INSERT befüllen

Ansonsten gibt es wegen der neuen NOT NULL-Restriktion einen Fehler.

Unterschiede anzeigen:

SL/AP.pm
167 167
      ($form->{id}) = selectrow_query($form, $dbh, qq|SELECT nextval('glid')|);
168 168
 
169 169
      $query =
170
        qq|INSERT INTO ap (id, invnumber, employee_id,currency_id) | .
170
        qq|INSERT INTO ap (id, invnumber, employee_id,currency_id, taxzone_id) | .
171 171
        qq|VALUES (?, ?, (SELECT e.id FROM employee e WHERE e.login = ?),
172
                      (SELECT id FROM currencies WHERE name = ?) )|;
173
      do_query($form, $dbh, $query, $form->{id}, $form->{invnumber}, $form->{login}, $form->{currency});
172
                      (SELECT id FROM currencies WHERE name = ?), (SELECT taxzone_id FROM vendor WHERE id = ?) )|;
173
      do_query($form, $dbh, $query, $form->{id}, $form->{invnumber}, $form->{login}, $form->{currency}, $form->{vendor_id});
174 174

  
175 175
    }
176 176

  
SL/AR.pm
135 135
    } else {
136 136
      $query = qq|SELECT nextval('glid')|;
137 137
      ($form->{id}) = selectrow_query($form, $dbh, $query);
138
      $query = qq|INSERT INTO ar (id, invnumber, employee_id, currency_id) VALUES (?, 'dummy', ?, (SELECT id FROM currencies WHERE name=?))|;
139
      do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{currency});
138
      $query = qq|INSERT INTO ar (id, invnumber, employee_id, currency_id, taxzone_id) VALUES (?, 'dummy', ?, (SELECT id FROM currencies WHERE name=?), (SELECT taxzone_id FROM customer WHERE id = ?))|;
139
      do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{currency}, $form->{customer_id});
140 140
      if (!$form->{invnumber}) {
141 141
        my $trans_number   = SL::TransNumber->new(type => 'invoice', dbh => $dbh, number => $form->{partnumber}, id => $form->{id});
142 142
        $form->{invnumber} = $trans_number->create_unique;
SL/DO.pm
250 250
    $query = qq|SELECT nextval('id')|;
251 251
    ($form->{id}) = selectrow_query($form, $dbh, $query);
252 252

  
253
    $query = qq|INSERT INTO delivery_orders (id, donumber, employee_id, currency_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults LIMIT 1))|;
254
    do_query($form, $dbh, $query, $form->{id}, conv_i($form->{employee_id}));
253
    $query = qq|INSERT INTO delivery_orders (id, donumber, employee_id, currency_id, taxzone_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults LIMIT 1), ?)|;
254
    do_query($form, $dbh, $query, $form->{id}, conv_i($form->{employee_id}), $form->{taxzone_id});
255 255
  }
256 256

  
257 257
  my $project_id;
SL/IR.pm
81 81
      &reverse_invoice($dbh, $form);
82 82
    } else {
83 83
      ($form->{id}) = selectrow_query($form, $dbh, qq|SELECT nextval('glid')|);
84
      do_query($form, $dbh, qq|INSERT INTO ap (id, invnumber, currency_id) VALUES (?, '', (SELECT id FROM currencies WHERE name=?))|, $form->{id}, $form->{currency});
84
      do_query($form, $dbh, qq|INSERT INTO ap (id, invnumber, currency_id, taxzone_id) VALUES (?, '', (SELECT id FROM currencies WHERE name=?), ?)|, $form->{id}, $form->{currency}, $form->{taxzone_id});
85 85
    }
86 86
  }
87 87

  
SL/IS.pm
583 583
      $query = qq|SELECT nextval('glid')|;
584 584
      ($form->{"id"}) = selectrow_query($form, $dbh, $query);
585 585

  
586
      $query = qq|INSERT INTO ar (id, invnumber, currency_id) VALUES (?, ?, (SELECT id FROM currencies WHERE name=?))|;
587
      do_query($form, $dbh, $query, $form->{"id"}, $form->{"id"}, $form->{currency});
586
      $query = qq|INSERT INTO ar (id, invnumber, currency_id, taxzone_id) VALUES (?, ?, (SELECT id FROM currencies WHERE name=?), ?)|;
587
      do_query($form, $dbh, $query, $form->{"id"}, $form->{"id"}, $form->{currency}, $form->{taxzone_id});
588 588

  
589 589
      if (!$form->{invnumber}) {
590 590
        my $trans_number   = SL::TransNumber->new(type => $form->{type}, dbh => $dbh, number => $form->{invnumber}, id => $form->{id});
SL/OE.pm
393 393
    $query = qq|SELECT nextval('id')|;
394 394
    ($form->{id}) = selectrow_query($form, $dbh, $query);
395 395

  
396
    $query = qq|INSERT INTO oe (id, ordnumber, employee_id, currency_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults))|;
397
    do_query($form, $dbh, $query, $form->{id}, $form->{employee_id});
396
    $query = qq|INSERT INTO oe (id, ordnumber, employee_id, currency_id, taxzone_id) VALUES (?, '', ?, (SELECT currency_id FROM defaults), ?)|;
397
    do_query($form, $dbh, $query, $form->{id}, $form->{employee_id}, $form->{taxzone_id});
398 398
  }
399 399

  
400 400
  my $amount    = 0;

Auch abrufbar als: Unified diff