Revision 750ac970
Von Sven Schöling vor fast 13 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
897 | 897 |
} |
898 | 898 |
|
899 | 899 |
sub form_footer { |
900 |
$main::lxdebug->enter_sub(); |
|
901 |
|
|
902 |
$main::auth->assert('general_ledger'); |
|
903 |
|
|
904 |
my $form = $main::form; |
|
905 |
my %myconfig = %main::myconfig; |
|
906 |
my $locale = $main::locale; |
|
907 |
my $cgi = $::request->{cgi}; |
|
908 |
|
|
909 |
my $follow_ups_block; |
|
910 |
if ($form->{id}) { |
|
911 |
my $follow_ups = FU->follow_ups('trans_id' => $form->{id}); |
|
912 |
|
|
913 |
if (@{ $follow_ups} ) { |
|
914 |
my $num_due = sum map { $_->{due} * 1 } @{ $follow_ups }; |
|
915 |
$follow_ups_block = qq|<p>| . $locale->text("There are #1 unfinished follow-ups of which #2 are due.", scalar @{ $follow_ups }, $num_due) . qq|</p>|; |
|
916 |
} |
|
917 |
} |
|
918 |
|
|
919 |
my ($dec) = ($form->{totaldebit} =~ /\.(\d+)/); |
|
920 |
$dec = length $dec; |
|
921 |
my $decimalplaces = ($dec > 2) ? $dec : 2; |
|
922 |
my $radieren = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0; |
|
923 |
|
|
924 |
map { |
|
925 |
$form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, 2, " ") |
|
926 |
} qw(totaldebit totalcredit); |
|
927 |
|
|
928 |
print qq| |
|
929 |
<tr class=listtotal> |
|
930 |
<th colspan="3" align=right class=listtotal> $form->{totaldebit}</th> |
|
931 |
<th align=right class=listtotal> $form->{totalcredit}</th> |
|
932 |
<td colspan=6></td> |
|
933 |
</tr> |
|
934 |
</table> |
|
935 |
</td> |
|
936 |
</tr> |
|
937 |
</table> |
|
938 |
|
|
939 |
<input name=callback type=hidden value="$form->{callback}"> |
|
940 |
|
|
941 |
$follow_ups_block |
|
942 |
|
|
943 |
<br> |
|
944 |
|; |
|
945 |
|
|
946 |
my $transdate = $form->datetonum($form->{transdate}, \%myconfig); |
|
947 |
my $closedto = $form->datetonum($form->{closedto}, \%myconfig); |
|
948 |
|
|
949 |
if ($form->{id}) { |
|
950 |
|
|
951 |
if (!$form->{storno}) { |
|
952 |
print qq|<input class=submit type=submit name=action value="| . $locale->text('Storno') . qq|">|; |
|
953 |
} |
|
954 |
|
|
955 |
# Löschen und Ändern von Buchungen nicht mehr möglich (GoB) nur am selben Tag möglich |
|
956 |
if (!$form->{locked} && $radieren) { |
|
957 |
print qq| |
|
958 |
<input class=submit type=submit name=action value="| . $locale->text('Post') . qq|" accesskey="b"> |
|
959 |
<input class=submit type=submit name=action value="| . $locale->text('Delete') . qq|">|; |
|
960 |
} |
|
961 |
|
|
962 |
print qq| |
|
963 |
<input class=submit type=submit name=action id=update_button value="| . $locale->text('Update') . qq|"> |
|
964 |
<input type="button" class="submit" onclick="follow_up_window()" value="| |
|
965 |
. $locale->text('Follow-Up') |
|
966 |
. qq|"> |; |
|
900 |
$::lxdebug->enter_sub; |
|
901 |
$::auth->assert('general_ledger'); |
|
967 | 902 |
|
968 |
} else { |
|
969 |
if ($form->{draft_id}) { |
|
970 |
my $remove_draft_checked = $form->{remove_draft} ? 'checked' : ''; |
|
971 |
print qq|<p>\n| |
|
972 |
. qq| <input name="remove_draft" id="remove_draft" type="checkbox" class="checkbox" ${remove_draft_checked}>| |
|
973 |
. qq| <label for="remove_draft">| . $locale->text('Remove Draft') . qq|</label>\n| |
|
974 |
. qq|</p>\n|; |
|
975 |
} |
|
903 |
my ($follow_ups, $follow_ups_due); |
|
976 | 904 |
|
977 |
print qq| |
|
978 |
<input class=submit type=submit name=action id=update_button value="| . $locale->text('Update') . qq|"> |
|
979 |
<input class=submit type=submit name=action value="| . $locale->text('Post') . qq|"> | |
|
980 |
. NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit')) |
|
981 |
. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) |
|
982 |
. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]); |
|
905 |
if ($::form->{id}) { |
|
906 |
$follow_ups = FU->follow_ups('trans_id' => $::form->{id}); |
|
907 |
$follow_ups_due = sum map { $_->{due} * 1 } @{ $follow_ups || [] }; |
|
983 | 908 |
} |
984 | 909 |
|
985 |
print " |
|
986 |
</form> |
|
910 |
my $radieren = $::form->current_date(\%::myconfig) eq $::form->{gldate}; |
|
987 | 911 |
|
988 |
</body> |
|
989 |
</html> |
|
990 |
"; |
|
991 |
$main::lxdebug->leave_sub(); |
|
912 |
print $::form->parse_html_template('gl/form_footer', { |
|
913 |
radieren => $radieren, |
|
914 |
follow_ups => $follow_ups, |
|
915 |
follow_ups_due => $follow_ups_due, |
|
916 |
}); |
|
992 | 917 |
|
918 |
$::lxdebug->leave_sub; |
|
993 | 919 |
} |
994 | 920 |
|
995 | 921 |
sub delete { |
Auch abrufbar als: Unified diff
gl::form_footer auf template umgeschrieben.