Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cf0f9e1d

Von Sven Schöling vor fast 13 Jahren hinzugefügt

  • ID cf0f9e1d0e7ac2f71137b20094f234f1bfafe40c
  • Vorgänger 99e420aa
  • Nachfolger da311bca

am/list_buchungsgruppe nach template ausgelagert

Unterschiede anzeigen:

bin/mozilla/am.pl
830 830
}
831 831

  
832 832
sub list_buchungsgruppe {
833
  $main::lxdebug->enter_sub();
834

  
835
  my $form     = $main::form;
836
  my %myconfig = %main::myconfig;
837
  my $locale   = $main::locale;
838

  
839
  $main::auth->assert('config');
840

  
841
  AM->buchungsgruppe(\%myconfig, \%$form);
842

  
843
  $form->{callback} = "am.pl?action=list_buchungsgruppe";
844

  
845
  my $callback = $form->escape($form->{callback});
846

  
847
  $form->{title} = $locale->text('Buchungsgruppen');
848

  
849
  my @column_index = qw(up down description inventory_accno
850
                     income_accno_0 expense_accno_0
851
                     income_accno_1 expense_accno_1
852
                     income_accno_2 expense_accno_2
853
                     income_accno_3 expense_accno_3 );
854
  my %column_header;
855
  $column_header{up} =
856
      qq|<th class="listheading" width="16">|
857
    . qq|<img src="image/up.png" alt="| . $locale->text("up") . qq|">|
858
    . qq|</th>|;
859
  $column_header{down} =
860
      qq|<th class="listheading" width="16">|
861
    . qq|<img src="image/down.png" alt="| . $locale->text("down") . qq|">|
862
    . qq|</th>|;
863
  $column_header{description} =
864
      qq|<th class="listheading" width="40%">|
865
    . $locale->text('Description')
866
    . qq|</th>|;
867
  $column_header{inventory_accno} =
868
      qq|<th class=listheading>|
869
    . $locale->text('Bestandskonto')
870
    . qq|</th>|;
871
  $column_header{income_accno_0} =
872
      qq|<th class=listheading>|
873
    . $locale->text('National Revenues')
874
    . qq|</th>|;
875
  $column_header{expense_accno_0} =
876
      qq|<th class=listheading>|
877
    . $locale->text('National Expenses')
878
    . qq|</th>|;
879
  $column_header{income_accno_1} =
880
      qq|<th class=listheading>|
881
    . $locale->text('Revenues EU with UStId')
882
    . qq|</th>|;
883
  $column_header{expense_accno_1} =
884
      qq|<th class=listheading>|
885
    . $locale->text('Expenses EU with UStId')
886
    . qq|</th>|;
887
  $column_header{income_accno_2} =
888
      qq|<th class=listheading>|
889
    . $locale->text('Revenues EU without UStId')
890
    . qq|</th>|;
891
  $column_header{expense_accno_2} =
892
      qq|<th class=listheading>|
893
    . $locale->text('Expenses EU without UStId')
894
    . qq|</th>|;
895
  $column_header{income_accno_3} =
896
      qq|<th class=listheading>|
897
    . $locale->text('Foreign Revenues')
898
    . qq|</th>|;
899
  $column_header{expense_accno_3} =
900
      qq|<th class=listheading>|
901
    . $locale->text('Foreign Expenses')
902
    . qq|</th>|;
903
  $form->header;
904

  
905
  print qq|
906
<body>
907

  
908
<table width=100%>
909
  <tr>
910
    <th class=listtop>$form->{title}</th>
911
  </tr>
912
  <tr height="5"></tr>
913
  <tr>
914
    <td>
915
      <table width=100%>
916
        <tr class=listheading>
917
|;
918

  
919
  map { print "$column_header{$_}\n" } @column_index;
920

  
921
  print qq|
922
        </tr>
923
|;
924

  
925
  my $swap_link = qq|am.pl?action=swap_buchungsgruppen&|;
926

  
927
  my $row = 0;
928
  my ($i, %column_data);
929
  foreach my $ref (@{ $form->{ALL} }) {
930

  
931
    $i++;
932
    $i %= 2;
933

  
934
    print qq|
935
        <tr valign=top class=listrow$i>
936
|;
937

  
938
    if ($row) {
939
      my $pref = $form->{ALL}->[$row - 1];
940
      $column_data{up} =
941
        qq|<td align="center" valign="center" width="16">| .
942
        qq|<a href="${swap_link}id1=$ref->{id}&id2=$pref->{id}">| .
943
        qq|<img border="0" src="image/up.png" alt="| . $locale->text("up") . qq|">| .
944
        qq|</a></td>|;
945
    } else {
946
      $column_data{up} = qq|<td width="16">&nbsp;</td>|;
947
    }
948

  
949
    if ($row == (scalar(@{ $form->{ALL} }) - 1)) {
950
      $column_data{down} = qq|<td width="16">&nbsp;</td>|;
951
    } else {
952
      my $nref = $form->{ALL}->[$row + 1];
953
      $column_data{down} =
954
        qq|<td align="center" valign="center" width="16">| .
955
        qq|<a href="${swap_link}id1=$ref->{id}&id2=$nref->{id}">| .
956
        qq|<img border="0" src="image/down.png" alt="| . $locale->text("down") . qq|">| .
957
        qq|</a></td>|;
958
    }
959

  
960
    $column_data{description} = qq|<td><a href="am.pl?action=edit_buchungsgruppe&id=$ref->{id}&callback=$callback">$ref->{description}</td>|;
961
    $column_data{inventory_accno}           = qq|<td align=right>$ref->{inventory_accno}</td>|;
962
    $column_data{income_accno_0} =
963
      qq|<td align=right>$ref->{income_accno_0}</td>|;
964
    $column_data{expense_accno_0}           = qq|<td align=right>$ref->{expense_accno_0}</td>|;
965
    $column_data{income_accno_1} =
966
      qq|<td align=right>$ref->{income_accno_1}</td>|;
967
    $column_data{expense_accno_1}           = qq|<td align=right>$ref->{expense_accno_1}</td>|;
968
    $column_data{income_accno_2} =
969
      qq|<td align=right>$ref->{income_accno_2}</td>|;
970
    $column_data{expense_accno_2}           = qq|<td align=right>$ref->{expense_accno_2}</td>|;
971
    $column_data{income_accno_3} =
972
      qq|<td align=right>$ref->{income_accno_3}</td>|;
973
    $column_data{expense_accno_3}           = qq|<td align=right>$ref->{expense_accno_3}</td>|;
974

  
975
    map { print "$column_data{$_}\n" } @column_index;
976

  
977
    print qq|
978
        </tr>
979
|;
980

  
981
    $row++;
982
  }
983

  
984
  print qq|
985
      </table>
986
    </td>
987
  </tr>
988
  <tr>
989
  <td><hr size=3 noshade></td>
990
  </tr>
991
</table>
992

  
993
<br>
994
<form method=post action=am.pl>
995

  
996
<input name=callback type=hidden value="$form->{callback}">
997

  
998
<input type=hidden name=type value=buchungsgruppe>
833
  $::lxdebug->enter_sub;
834
  $::auth->assert('config');
999 835

  
1000
<input class=submit type=submit name=action value="|
1001
    . $locale->text('Add') . qq|">
836
  AM->buchungsgruppe(\%::myconfig, $::form);
1002 837

  
1003
  </form>
838
  $::form->{callback} = "am.pl?action=list_buchungsgruppe";
839
  $::form->{title}    = $::locale->text('Buchungsgruppen');
840
  $::form->header;
1004 841

  
1005
  </body>
1006
  </html>
1007
|;
842
  print $::form->parse_html_template('am/buchungsgruppe_list', {
843
    swap_link => qq|am.pl?action=swap_buchungsgruppen&|,
844
  });
1008 845

  
1009
  $main::lxdebug->leave_sub();
846
  $::lxdebug->leave_sub;
1010 847
}
1011 848

  
1012 849
sub buchungsgruppe_header {

Auch abrufbar als: Unified diff