X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=a6d5cdc5c1073cfbf6c21b9e956e7101fe66fa8d;hb=b71b35308c2f7c628666e4a69e6c3b90cefc5ed0;hp=e593083d49a7f78fa78b49b432655f10e7dab1e3;hpb=e9e28dd26de569ab7b721560d84ea8ddb0c1dda1;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index e593083d4..a6d5cdc5c 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -265,13 +265,13 @@ sub form_header {
if ($form->{forex}) {
$exchangerate .= qq|
- | . $locale->text('Exchangerate') . qq| |
+ | . $locale->text('Exchangerate') . qq| |
{exchangerate}>$form->{exchangerate} |
|;
} else {
$exchangerate .= qq|
- | . $locale->text('Exchangerate') . qq| |
+ | . $locale->text('Exchangerate') . qq| |
{exchangerate}> |
|;
}
@@ -296,11 +296,11 @@ sub form_header {
my $department = qq|
- | . $locale->text('Department') . qq| |
-
-
- |
-
+ | . $locale->text('Department') . qq| |
+
+
+ |
+
| if $form->{selectdepartment};
my $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
@@ -440,64 +440,64 @@ sub form_header {
|
@@ -507,20 +507,15 @@ sub form_header {
$jsscript
{rowcount}>
-
-
-
- |
- . $locale->text('Account') . qq| |
- |
- . $locale->text('Amount') . qq| |
- |
- . $locale->text('Tax') . qq| |
- |
- . $locale->text('Taxkey') . qq| |
- |
- . $locale->text('Project') . qq| |
-
+
+
- |
+
+ |
- | . $locale->text('Notes') . qq| |
- $notes |
-
+ | . $locale->text('Notes') . qq| |
+ $notes |
+
|
-
- | . $locale->text('Payments') . qq| |
-
+
+ | . $locale->text('Payments') . qq| |
+
|;
my @column_index;
@@ -1086,9 +1081,11 @@ sub post {
}
# /saving the history
remove_draft() if $form->{remove_draft};
+ # Dieser Text wird niemals ausgegeben: Probleme beim redirect?
$form->redirect($locale->text('Transaction posted!'));
+ } else {
+ $form->error($locale->text('Cannot post transaction!'));
}
- $form->error($locale->text('Cannot post transaction!'));
$main::lxdebug->leave_sub();
}
@@ -1105,8 +1102,8 @@ sub post_as_new {
# saving the history
if(!exists $form->{addition} && $form->{id} ne "") {
$form->{snumbers} = qq|invnumber_| . $form->{invnumber};
- $form->{addition} = "POSTED AS NEW";
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->{addition} = "POSTED AS NEW";
+ $form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
&post;
@@ -1188,7 +1185,7 @@ sub yes {
# saving the history
if(!exists $form->{addition}) {
$form->{snumbers} = qq|invnumber_| . $form->{invnumber};
- $form->{addition} = "DELETED";
+ $form->{addition} = "DELETED";
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
@@ -1202,234 +1199,29 @@ sub yes {
sub search {
$main::lxdebug->enter_sub();
+ $main::auth->assert('general_ledger | invoice_edit');
+
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cgi = $main::cgi;
- $main::auth->assert('general_ledger | vendor_invoice_edit');
-
- # setup vendor selection
+ # setup customer selection
$form->all_vc(\%myconfig, "vendor", "AP");
- my $vendor;
- if (@{ $form->{all_vendor} || [] }) {
- map { $vendor .= "\n";
-
- map {
- $form->{selectdepartment} .=
- "$_->{description}--$_->{id}\n"
- } (@{ $form->{all_departments} || [] });
- }
-
- my $department = qq|
-
- | . $locale->text('Department') . qq| |
- |
-
-| if $form->{selectdepartment};
-
- $form->{title} = $locale->text('AP Transactions');
-
- # use JavaScript Calendar or not
+ $form->{title} = $locale->text('AP Transactions');
+ $form->{fokus} = "search.vendor";
$form->{jsscript} = 1;
- my $jsscript = "";
- my ($button1, $button2);
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
-
- text('button') . qq|> |
- |;
- $button2 = qq|
-
- text('button') . qq|> |
- |;
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger1",
- "transdateto", "BL", "trigger2");
- } else {
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 },
+ "departments" => "ALL_DEPARTMENTS",
+ "vendors" => "ALL_VC");
- # without JavaScript Calendar
- $button1 = qq|
- | |;
- $button2 = qq|
- | |;
- }
+ # constants and subs for template
+ $form->{jsscript} = 1;
+ $form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" };
- $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
- "all" => 1 });
-
- my %labels = ();
- my @values = ("");
- foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
- push(@values, $item->{"id"});
- $labels{$item->{"id"}} = $item->{"projectnumber"};
- }
- my $projectnumber =
- NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values,
- '-labels' => \%labels));
- $form->{javascript} .= qq||;
$form->header;
- my $onload = qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
- $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
- print qq|
-
-
-
-
-
- |