Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e6ffa928

Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt

  • ID e6ffa928b78feb3cf0fa2c38da388144543a76dd
  • Vorgänger 8e009de4
  • Nachfolger eed84962

Globale Variablen entfernt/umgewandelt.

Unterschiede anzeigen:

bin/mozilla/ap.pl
661 661
";
662 662

  
663 663
  my @triggers  = ();
664
  my $totalpaid = 0;
664
  $form->{totalpaid} = 0;
665 665

  
666 666
  $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
667 667
  for my $i (1 .. $form->{paidaccounts}) {
......
676 676
                           '-labels' => \%AP_paid_labels,
677 677
                           '-default' => $form->{"AP_paid_$i"}));
678 678

  
679
    $totalpaid += $form->{"paid_$i"};
679
    $form->{totalpaid} += $form->{"paid_$i"};
680 680

  
681 681
    # format amounts
682 682
    if ($form->{"paid_$i"}) {
......
732 732
    push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i");
733 733
  }
734 734

  
735
  my $paid_missing = $form->{invtotal_unformatted} - $totalpaid;
735
  my $paid_missing = $form->{invtotal_unformatted} - $form->{totalpaid};
736 736

  
737 737
  print qq|
738 738
        <tr>
739 739
          <td></td>
740 740
          <td></td>
741 741
          <td align="center">| . $locale->text('Total') . qq|</td>
742
          <td align="center">| . H($form->format_amount(\%myconfig, $totalpaid, 2)) . qq|</td>
742
          <td align="center">| . H($form->format_amount(\%myconfig, $form->{totalpaid}, 2)) . qq|</td>
743 743
        </tr>
744 744
        <tr>
745 745
          <td></td>
......
818 818
|;
819 819
    }
820 820
    # ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it
821
    our $total_paid;
822 821
    print qq| <input class=submit type=submit name=action value="| . $locale->text('Storno') . qq|"> |
823
      if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap', $form->{id}) && (($total_paid == 0) || ($total_paid eq "")));
822
      if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap', $form->{id}) && (($form->{totalpaid} == 0) || ($form->{totalpaid} eq "")));
824 823

  
825 824
    print qq| <input class=submit type=submit name=action value="| . $locale->text('Post Payment') . qq|">
826 825
              <input class=submit type=submit name=action value="| . $locale->text('Use As Template') . qq|">
......
973 972

  
974 973
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
975 974

  
976
  our $invdate;
977 975
  for my $i (1 .. $form->{paidaccounts}) {
978 976
    if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) {
979 977
      my $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
......
985 983

  
986 984
      if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
987 985
        $form->{"exchangerate_$i"} = $form->{exchangerate}
988
          if ($invdate == $datepaid);
986
          if ($form->{transdate} == $datepaid);
989 987
        $form->isblank("exchangerate_$i",
990 988
                       $locale->text('Exchangerate for payment missing!'));
991 989
      }

Auch abrufbar als: Unified diff