Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f90c73d5

Von Kivitendo Admin vor etwa 1 Jahr hinzugefügt

  • ID f90c73d5a72bd524f9868e3ec97f9e2979e9182a
  • Vorgänger 7368797d

Kreditorenbuchungen - fx_paid -> defaultcurrency_paid

siehe Ticket #563, Währung und Fremdwährung waren vertauscht.

Unterschiede anzeigen:

bin/mozilla/ap.pl
545 545
  # default account for current assets (i.e. 1801 - SKR04)
546 546
  $form->{accno_arap} = IS->get_standard_accno_current_assets(\%myconfig, \%$form);
547 547

  
548
  # reset form value of defaultcurrency_totalpaid, as it is currently a hidden and otherwise it gets accumulated after each update
549
  # is only used if there are exchange rates
550
  $form->{"defaultcurrency_totalpaid"} = 0;
551

  
548 552
  for my $i (1 .. $form->{paidaccounts}) {
549
    # hook for calc of of fx_paid and check if banktransaction has a record exchangerate
550
    if ($form->{"exchangerate_$i"}) {
553
    # hook for calc of of defaultcurrency_paid and check if banktransaction has a record exchangerate
554
    if ($form->{"exchangerate_$i"} && $form->{"acc_trans_id_$i"}) {
551 555
      my $bt_acc_trans = SL::DB::Manager::BankTransactionAccTrans->find_by(acc_trans_id => $form->{"acc_trans_id_$i"});
552 556
      if ($bt_acc_trans) {
553 557
        if ($bt_acc_trans->bank_transaction->exchangerate > 0) {
......
556 560
          $form->{"record_forex_$i"} = 1;
557 561
        }
558 562
      }
559
      $form->{"fx_paid_$i"} = $form->{"paid_$i"} / $form->{"exchangerate_$i"};
560
      $form->{"fx_totalpaid"} +=  $form->{"fx_paid_$i"};
561
    } # end hook fx_paid
563
      $form->{"defaultcurrency_paid_$i"} = $form->{"paid_$i"} * $form->{"exchangerate_$i"};
564
      $form->{"defaultcurrency_totalpaid"} +=  $form->{"defaultcurrency_paid_$i"};
565
    } # end hook defaultcurrency_paid
562 566
    # format amounts
563 567
    if ($form->{"paid_$i"}) {
564 568
      $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
templates/webpages/ap/form_header.html
361 361
              <td align="center">
362 362
                [% temp = "exchangerate_"_ i %]
363 363
                [% temp_forex = "forex_"_ i %]
364
                [% SET fx_paid      = 'fx_paid_'      _ i %]
364
                [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %]
365 365
                [% SET record_forex = 'record_forex_' _ i %]
366 366

  
367 367

  
368 368
                [% IF( $temp_forex || !changeable ) %]
369
                  [% $temp | html %] = [% LxERP.format_amount($fx_paid,2) %] [% currency %] </br>
369
                  [% $temp | html %] = [% LxERP.format_amount($defaultcurrency_paid,2) %] [% defaultcurrency %] </br>
370 370
                [% IF $record_forex %][% 'bank transaction exchange rate' | $T8 %][%- ELSE %][% 'default exchange rate' | $T8 %][%- END %]
371 371

  
372 372
                  <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
......
405 405
          <td></td>
406 406
          <td></td>
407 407
          <td align="center">[% 'Total' | $T8 %]</td>
408
          <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% defaultcurrency %]</td>
408
          <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
409 409
        [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
410 410
            <td></td>
411
            <td align="center">[% LxERP.format_amount(fx_totalpaid, 2) | html %] [% currency %]</td>
412
            <input type="hidden" name="fx_totalpaid" value="[% fx_totalpaid %]">
411
            <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
412
            <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
413 413
            <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
414 414
        [% END %]
415 415

  
......
418 418
          <td></td>
419 419
          <td></td>
420 420
          <td align="center">[% 'Missing amount' | $T8 %]</td>
421
          <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% defaultcurrency %]</td>
421
          <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
422 422
        </tr>
423 423
      </table>
424 424
      [% END %]

Auch abrufbar als: Unified diff