projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Schreibfehler.
[kivitendo-erp.git]
/
bin
/
mozilla
/
ir.pl
diff --git
a/bin/mozilla/ir.pl
b/bin/mozilla/ir.pl
index
9baa523
..
4f40da7
100644
(file)
--- a/
bin/mozilla/ir.pl
+++ b/
bin/mozilla/ir.pl
@@
-32,11
+32,13
@@
#======================================================================
use SL::IR;
#======================================================================
use SL::IR;
+use SL::IS;
use SL::PE;
require "$form->{path}/io.pl";
require "$form->{path}/arap.pl";
require "$form->{path}/common.pl";
use SL::PE;
require "$form->{path}/io.pl";
require "$form->{path}/arap.pl";
require "$form->{path}/common.pl";
+require "bin/mozilla/drafts.pl";
1;
1;
@@
-45,6
+47,8
@@
require "$form->{path}/common.pl";
sub add {
$lxdebug->enter_sub();
sub add {
$lxdebug->enter_sub();
+ return $lxdebug->leave_sub() if (load_draft_maybe());
+
$form->{title} = $locale->text('Add Vendor Invoice');
&invoice_links;
$form->{title} = $locale->text('Add Vendor Invoice');
&invoice_links;
@@
-236,6
+240,9
@@
sub form_header {
#quote selectvendor Bug 133
$form->{"selectvendor"} = $form->quote($form->{"selectvendor"});
#quote selectvendor Bug 133
$form->{"selectvendor"} = $form->quote($form->{"selectvendor"});
+ #substitute \n and \r to \s (bug 543)
+ $form->{"selectvendor"} =~ s/[\n\r]/ /g;
+
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
$form->{exchangerate} =
$form->format_amount(\%myconfig, $form->{exchangerate});
@@
-273,7
+280,8
@@
sub form_header {
"all" => 0,
"old_id" => \@old_project_ids });
"all" => 0,
"old_id" => \@old_project_ids });
- my (%labels, @values);
+ my %labels;
+ my @values = (undef);
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
$labels{$item->{"cp_id"}} = $item->{"cp_name"} .
foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
push(@values, $item->{"cp_id"});
$labels{$item->{"cp_id"}} = $item->{"cp_name"} .
@@
-325,7
+333,10
@@
sub form_header {
$vendor =
($form->{selectvendor})
$vendor =
($form->{selectvendor})
- ? qq|<select name=vendor>$form->{selectvendor}</select>\n<input type=hidden name="selectvendor" value="$form->{selectvendor}">|
+ ? qq|<select name="vendor"
+onchange="document.getElementById('update_button').click();">| .
+ qq|$form->{selectvendor}</select>\n<input type=hidden name="selectvendor" value="| .
+ Q($form->{selectvendor}) . qq|">|
: qq|<input name=vendor value="$form->{vendor}" size=35>|;
$department = qq|
: qq|<input name=vendor value="$form->{vendor}" size=35>|;
$department = qq|
@@
-399,6
+410,8
@@
sub form_header {
<input type=hidden name=storno value=$form->{storno}>
<input type=hidden name=storno_id value=$form->{storno_id}>
<input type=hidden name=storno value=$form->{storno}>
<input type=hidden name=storno_id value=$form->{storno_id}>
+| . ($form->{saved_message} ? qq|<p>$form->{saved_message}</p>| : "") . qq|
+
<table width=100%>
<tr class=listtop>
<th class=listtop>$form->{title}</th>
<table width=100%>
<tr class=listtop>
<th class=listtop>$form->{title}</th>
@@
-553,7
+566,8
@@
sub form_footer {
$tax .= qq|
<tr>
$tax .= qq|
<tr>
- <th align=right>$form->{"${item}_description"}</th>
+ <th align=right>$form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|%</th>
<td align=right>$form->{"${item}_total"}</td>
</tr>
|;
<td align=right>$form->{"${item}_total"}</td>
</tr>
|;
@@
-594,7
+608,8
@@
sub form_footer {
$tax .= qq|
<tr>
$tax .= qq|
<tr>
- <th align=right>Enthaltene $form->{"${item}_description"}</th>
+ <th align=right>Enthaltene $form->{"${item}_description"} |
+ . $form->{"${item}_rate"} * 100 .qq|%</th>
<td align=right>$form->{"${item}_total"}</td>
</tr>
<tr>
<td align=right>$form->{"${item}_total"}</td>
</tr>
<tr>
@@
-778,12
+793,14
@@
sub form_footer {
$closedto = $form->datetonum($form->{closedto}, \%myconfig);
if ($form->{id}) {
$closedto = $form->datetonum($form->{closedto}, \%myconfig);
if ($form->{id}) {
+ my $show_storno = !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ap");
+
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Post Payment') . qq|">
|;
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Storno') . qq|">
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Post Payment') . qq|">
|;
print qq|<input class=submit type=submit name=action value="|
. $locale->text('Storno') . qq|">
-|
unless ($form->{storno}
);
+|
if ($show_storno
);
if ($form->{radier}) {
print qq|
<input class=submit type=submit name=action value="|
if ($form->{radier}) {
print qq|
<input class=submit type=submit name=action value="|
@@
-801,7
+818,9
@@
sub form_footer {
if (!$form->{id} && ($invdate > $closedto)) {
print qq| <input class=submit type=submit name=action value="|
if (!$form->{id} && ($invdate > $closedto)) {
print qq| <input class=submit type=submit name=action value="|
- . $locale->text('Post') . qq|">|;
+ . $locale->text('Post') . qq|"> | .
+ NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'),
+ '-class' => 'submit'));
}
print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
}
print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) .
@@
-814,15
+833,18
@@
sub form_footer {
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
<input type=hidden name=path value=$form->{path}>
<input type=hidden name=login value=$form->{login}>
<input type=hidden name=password value=$form->{password}>
-|;
+|
+ . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
+ . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]);
+
# button for saving history
if($form->{id} ne "") {
print qq|
# button for saving history
if($form->{id} ne "") {
print qq|
- <input type=
button class=submit onclick=
set_history_window(|
- .
$form->{id}
- . qq|);
name=history id=history value=
|
- . $locale->text('history')
- . qq|>|;
+ <input type=
"button" class="submit" onclick="
set_history_window(|
+ .
Q($form->{id})
+ . qq|);
" name="history" id="history" value="
|
+ . $locale->text('history')
+ . qq|
"
>|;
}
# /button for saving history
}
# /button for saving history
@@
-869,7
+891,7
@@
sub update {
}
$i = $form->{rowcount};
}
$i = $form->{rowcount};
- $exchangerate = ($form->{exchangerate}
) ? $form->{exchangerate}
: 1;
+ $exchangerate = ($form->{exchangerate}
* 1) ? $form->{exchangerate} * 1
: 1;
if ( ($form->{"partnumber_$i"} eq "")
&& ($form->{"description_$i"} eq "")
if ( ($form->{"partnumber_$i"} eq "")
&& ($form->{"description_$i"} eq "")
@@
-960,6
+982,14
@@
sub storno {
$form->error($locale->text('Cannot storno storno invoice!'));
}
$form->error($locale->text('Cannot storno storno invoice!'));
}
+ if (IS->has_storno(\%myconfig, $form, "ap")) {
+ $form->error($locale->text("Invoice has already been storno'd!"));
+ }
+
+ invoice_links();
+ prepare_invoice();
+ relink_accounts();
+
$form->{storno_id} = $form->{id};
$form->{storno} = 1;
$form->{id} = "";
$form->{storno_id} = $form->{id};
$form->{storno} = 1;
$form->{id} = "";
@@
-1068,7
+1098,7
@@
sub post {
relink_accounts();
relink_accounts();
- if (IR->post_invoice(\%myconfig, \%$form)){
+ if (IR->post_invoice(\%myconfig, \%$form)){
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{addition} = "POSTED";
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{addition} = "POSTED";
@@
-1076,6
+1106,7
@@
sub post {
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
+ remove_draft() if $form->{remove_draft};
$form->redirect( $locale->text('Invoice')
. " $form->{invnumber} "
. $locale->text('posted!'));
$form->redirect( $locale->text('Invoice')
. " $form->{invnumber} "
. $locale->text('posted!'));