X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/c061f3073396865dc7ea45eda1214cf18746b50e..ddaf7f5082fe6e53015a8f3e6ea96ac8f600930a:/bin/mozilla/ap.pl?ds=inline diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index e593083d4..3852dad71 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -1202,234 +1202,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 .= "$_->{name}--$_->{id}\n" } - @{ $form->{all_vendor} }; - $vendor = qq|\n$vendor\n|; - } else { - $vendor = qq||; - } - - # departments - if (@{ $form->{all_departments} || [] }) { - $form->{selectdepartment} = "\n"; - - map { - $form->{selectdepartment} .= - "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} || [] }); - } - - my $department = qq| - - | . $locale->text('Department') . qq| - $form->{selectdepartment} - -| 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 { - - # without JavaScript Calendar - $button1 = qq| - |; - $button2 = qq| - |; - } + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, + "departments" => "ALL_DEPARTMENTS", + "vendors" => "ALL_VC"); - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1 }); + # constants and subs for template + $form->{jsscript} = 1; + $form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; - 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| - - -{script}> - - - - $form->{title} - - - - - - - | . $locale->text('Vendor') . qq| - $vendor - - $department - - | . $locale->text('Invoice Number') . qq| - - - - | . $locale->text('Order Number') . qq| - - - - | . $locale->text('Notes') . qq| - - - - | . $locale->text("Project Number") . qq| - $projectnumber - - - | . $locale->text('From') . qq| - $button1 - | . $locale->text('Bis') . qq| - $button2 - - - - - - - - - - | . $locale->text('Include in Report') . qq| - - - - - | . $locale->text('Open') . qq| - - | . $locale->text('Closed') . qq| - - - - | . $locale->text('ID') . qq| - - | . $locale->text('Invoice Number') . qq| - - | . $locale->text('Order Number') . qq| - - - - | . $locale->text('Vendor') . qq| - - | . $locale->text('Invoice Date') . qq| - - | . $locale->text('Amount') . qq| - - - - | . $locale->text('Tax') . qq| - - | . $locale->text('Total') . qq| - - | . $locale->text('Date Paid') . qq| - - - - | . $locale->text('Paid') . qq| - - | . $locale->text('Due Date') . qq| - - | . $locale->text('Amount Due') . qq| - - - - | . $locale->text('Notes') . qq| - - | . $locale->text('Employee') . qq| - - - - | . $locale->text('Subtotal') . qq| - - | . $locale->text('Project Number') . qq| - - - | . $locale->text('Vendor') . qq| - - - - | . $locale->text('Vendor Number') . qq| - - | . $locale->text('Country') . qq| - - | . $locale->text('USt-IdNr.') . qq| - - | . $locale->text('Steuersatz') . qq| - - - - | . $locale->text('Payment Terms') . qq| - - | . $locale->text('Buchungskonto') . qq| - - - - - - - - - - - - -$jsscript - - -{nextsub}> - - - - - -