Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7dd42f87

Von Jan Büren vor etwa 5 Jahren hinzugefügt

  • ID 7dd42f875621bd0b26efecaeb1fbc87e72b84c9a
  • Vorgänger 800e16d8
  • Nachfolger b92403ae

Payment pay_invoice alle acc_trans_ids sammeln

Hintergrund. new_acc_trans wird mehrfach für verschiedene
Fälle verwendet, entsprechend nach jeder Änderung einsammeln

Unterschiede anzeigen:

SL/DB/Helper/Payment.pm
158 158
                                                   tax_id     => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
159 159
      $new_acc_trans->save;
160 160

  
161
      push @new_acc_ids, $new_acc_trans->acc_trans_id;
161 162
      # deal with fxtransaction
162 163
      if ( $self->currency_id != $::instance_conf->get_currency_id ) {
163 164
        my $fxamount = _round($amount - ($amount * $exchangerate));
......
172 173
                                                     fx_transaction => 1,
173 174
                                                     tax_id         => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
174 175
        $new_acc_trans->save;
176
        push @new_acc_ids, $new_acc_trans->acc_trans_id;
175 177
        # if invoice exchangerate differs from exchangerate of payment
176 178
        # deal with fxloss and fxamount
177 179
        if ($self->exchangerate and $self->exchangerate != 1 and $self->exchangerate != $exchangerate) {
......
192 194
                                                       fx_transaction => 0,
193 195
                                                       tax_id         => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
194 196
          $new_acc_trans->save;
197
          push @new_acc_ids, $new_acc_trans->acc_trans_id;
195 198

  
196 199
        };
197 200
      };
......
232 235

  
233 236
        # the acc_trans entries are saved individually, not added to $self and then saved all at once
234 237
        $new_acc_trans->save;
238
        push @new_acc_ids, $new_acc_trans->acc_trans_id;
235 239

  
236 240
        $reference_amount -= abs($amount);
237 241
        $paid_amount      += -1 * $amount * $exchangerate;
......
267 271
                                                  taxkey     => 0,
268 272
                                                  tax_id     => SL::DB::Manager::Tax->find_by(taxkey => 0)->id);
269 273
    $arap_booking->save;
274
    push @new_acc_ids, $arap_booking->acc_trans_id;
270 275

  
271 276
    $fx_gain_loss_amount *= -1 if $self->is_sales;
272 277
    $self->paid($self->paid + _round($paid_amount) + $fx_gain_loss_amount) if $paid_amount;
......
306 311
      }
307 312
    }
308 313

  
309
    push @new_acc_ids, ($new_acc_trans->acc_trans_id, $arap_booking->acc_trans_id);
310 314
    1;
311 315

  
312 316
  }) || die t8('error while paying invoice #1 : ', $self->invnumber) . $db->error . "\n";

Auch abrufbar als: Unified diff