Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a371de77

Von Kivitendo Admin vor 11 Monaten hinzugefügt

  • ID a371de772bbabdcc91c324d3341708f729f30e61
  • Vorgänger 853e4147
  • Nachfolger c7a5335e

Kreditorenbuchungen - fx_paid -> defaultcurrency_paid

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

Unterschiede anzeigen:

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

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

  
597 601
  for my $i (1 .. $form->{paidaccounts}) {
598
    # hook for calc of of fx_paid and check if banktransaction has a record exchangerate
599
    if ($form->{"exchangerate_$i"}) {
602
    # hook for calc of of defaultcurrency_paid and check if banktransaction has a record exchangerate
603
    if ($form->{"exchangerate_$i"} && $form->{"acc_trans_id_$i"}) {
600 604
      my $bt_acc_trans = SL::DB::Manager::BankTransactionAccTrans->find_by(acc_trans_id => $form->{"acc_trans_id_$i"});
601 605
      if ($bt_acc_trans) {
602 606
        if ($bt_acc_trans->bank_transaction->exchangerate > 0) {
......
605 609
          $form->{"record_forex_$i"} = 1;
606 610
        }
607 611
      }
608
      $form->{"fx_paid_$i"} = $form->{"paid_$i"} / $form->{"exchangerate_$i"};
609
      $form->{"fx_totalpaid"} +=  $form->{"fx_paid_$i"};
610
    } # end hook fx_paid
612
      $form->{"defaultcurrency_paid_$i"} = $form->{"paid_$i"} * $form->{"exchangerate_$i"};
613
      $form->{"defaultcurrency_totalpaid"} +=  $form->{"defaultcurrency_paid_$i"};
614
    } # end hook defaultcurrency_paid
611 615
    # format amounts
612 616
    if ($form->{"paid_$i"}) {
613 617
      $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
templates/webpages/ap/form_header.html
372 372
              <td align="center">
373 373
                [% temp = "exchangerate_"_ i %]
374 374
                [% temp_forex = "forex_"_ i %]
375
                [% SET fx_paid      = 'fx_paid_'      _ i %]
375
                [% SET defaultcurrency_paid = 'defaultcurrency_paid_' _ i %]
376 376
                [% SET record_forex = 'record_forex_' _ i %]
377 377

  
378 378

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

  
383 383
                  <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
......
416 416
          <td></td>
417 417
          <td></td>
418 418
          <td align="center">[% 'Total' | $T8 %]</td>
419
          <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% defaultcurrency %]</td>
419
          <td align="right">[% LxERP.format_amount(totalpaid, 2) | html %] [% currency %]</td>
420 420
        [% IF ( !defaultcurrency || (currency != defaultcurrency) ) %]
421 421
            <td></td>
422
            <td align="center">[% LxERP.format_amount(fx_totalpaid, 2) | html %] [% currency %]</td>
423
            <input type="hidden" name="fx_totalpaid" value="[% fx_totalpaid %]">
422
            <td align="center">[% LxERP.format_amount(defaultcurrency_totalpaid, 2) | html %] [% defaultcurrency %]</td>
423
            <input type="hidden" name="defaultcurrency_totalpaid" value="[% defaultcurrency_totalpaid %]">
424 424
            <input type="hidden" name="is_linked_bank_transaction" value="[% is_linked_bank_transaction %]">
425 425
        [% END %]
426 426

  
......
429 429
          <td></td>
430 430
          <td></td>
431 431
          <td align="center">[% 'Missing amount' | $T8 %]</td>
432
          <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% defaultcurrency %]</td>
432
          <td align="right">[% LxERP.format_amount(paid_missing, 2) | html %] [% currency %]</td>
433 433
        </tr>
434 434
      </table>
435 435
      [% END %]

Auch abrufbar als: Unified diff