Revision 642d2475
Von Sven Schöling vor mehr als 8 Jahren hinzugefügt
bin/mozilla/is.pl | ||
---|---|---|
993 | 993 |
|
994 | 994 |
} |
995 | 995 |
|
996 |
sub delete { |
|
997 |
$main::lxdebug->enter_sub(); |
|
998 |
|
|
999 |
my $form = $main::form; |
|
1000 |
my $locale = $main::locale; |
|
1001 |
|
|
1002 |
$main::auth->assert('invoice_edit'); |
|
1003 |
|
|
1004 |
if ($form->{second_run}) { |
|
1005 |
$form->{print_and_post} = 0; |
|
1006 |
} |
|
1007 |
$form->header; |
|
1008 |
|
|
1009 |
print qq| |
|
1010 |
<form method="post" action="$form->{script}"> |
|
1011 |
|; |
|
1012 |
|
|
1013 |
# delete action variable |
|
1014 |
map { delete $form->{$_} } qw(action header); |
|
1015 |
|
|
1016 |
foreach my $key (keys %$form) { |
|
1017 |
next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); |
|
1018 |
$form->{$key} =~ s/\"/"/g; |
|
1019 |
print qq|<input type="hidden" name="$key" value="$form->{$key}">\n|; |
|
1020 |
} |
|
1021 |
|
|
1022 |
print qq| |
|
1023 |
<h2 class="confirm">| . $locale->text('Confirm!') . qq|</h2> |
|
1024 |
|
|
1025 |
<h4>| |
|
1026 |
. $locale->text('Are you sure you want to delete Invoice Number') |
|
1027 |
. qq| $form->{invnumber} |
|
1028 |
</h4> |
|
1029 |
|
|
1030 |
<p> |
|
1031 |
<input name="action" class="submit" type="submit" value="| |
|
1032 |
. $locale->text('Yes') . qq|"> |
|
1033 |
</form> |
|
1034 |
|; |
|
1035 |
|
|
1036 |
$main::lxdebug->leave_sub(); |
|
1037 |
} |
|
1038 |
|
|
1039 | 996 |
sub credit_note { |
1040 | 997 |
$main::lxdebug->enter_sub(); |
1041 | 998 |
|
... | ... | |
1124 | 1081 |
$::lxdebug->leave_sub; |
1125 | 1082 |
} |
1126 | 1083 |
|
1127 |
sub yes { |
|
1128 |
$main::lxdebug->enter_sub(); |
|
1129 |
|
|
1130 |
my $form = $main::form; |
|
1131 |
my %myconfig = %main::myconfig; |
|
1132 |
my $locale = $main::locale; |
|
1133 |
|
|
1134 |
$main::auth->assert('invoice_edit'); |
|
1084 |
sub delete { |
|
1085 |
$::auth->assert('invoice_edit'); |
|
1135 | 1086 |
|
1136 |
if (IS->delete_invoice(\%myconfig, \%$form)) {
|
|
1087 |
if (IS->delete_invoice(\%::myconfig, $::form)) {
|
|
1137 | 1088 |
# saving the history |
1138 |
if(!exists $form->{addition}) { |
|
1139 |
$form->{snumbers} = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
|
|
1140 |
$form->{what_done} = 'invoice'; |
|
1141 |
$form->{addition} = "DELETED"; |
|
1142 |
$form->save_history; |
|
1089 |
if(!exists $::form->{addition}) {
|
|
1090 |
$::form->{snumbers} = 'invnumber' .'_'. $::form->{invnumber};
|
|
1091 |
$::form->{what_done} = 'invoice';
|
|
1092 |
$::form->{addition} = "DELETED";
|
|
1093 |
$::form->save_history;
|
|
1143 | 1094 |
} |
1144 | 1095 |
# /saving the history |
1145 |
$form->redirect($locale->text('Invoice deleted!'));
|
|
1096 |
$::form->redirect($::locale->text('Invoice deleted!'));
|
|
1146 | 1097 |
} |
1147 |
$form->error($locale->text('Cannot delete invoice!')); |
|
1148 |
|
|
1149 |
$main::lxdebug->leave_sub(); |
|
1098 |
$::form->error($::locale->text('Cannot delete invoice!')); |
|
1150 | 1099 |
} |
1151 | 1100 |
|
1152 | 1101 |
sub post_and_e_mail { |
Auch abrufbar als: Unified diff
Rechnungen löschen mit confirm nachfragen, und nicht mit Extrarequest