X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=a6d5cdc5c1073cfbf6c21b9e956e7101fe66fa8d;hb=dc8f62cf5df4a7f8473e7d76fdd98846cea5721f;hp=49dc1589e3f52229edda09a8e923badeef1a1614;hpb=1f110e87bcff32f06ba76d8d4fae5e851d094e94;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 49dc1589e..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 { - - +
- - - - - - - - - - - - - - - - - {defaultcurrency}> - {fxgain_accno}> - {fxloss_accno}> - $exchangerate - - $department - $taxincluded -
| . $locale->text('Vendor') . qq|$vendor
- - - - - - - {creditlimit}> - {creditremaining}> - -
| . $locale->text('Credit Limit') . qq|$form->{creditlimit}| . $locale->text('Remaining') . qq|$form->{creditremaining}
-
| . $locale->text('Currency') . qq|
-
- - - - - - - - - - - + + - + +
| . $locale->text('Invoice Number') . qq|
| . $locale->text('Order Number') . qq|
| . $locale->text('Invoice Date') . qq| + + + + + + + + + + + + + + + + + {defaultcurrency}> + {fxgain_accno}> + {fxloss_accno}> + $exchangerate + + $department + $taxincluded +
| . $locale->text('Vendor') . qq|$vendor
+ + + + + + + {creditlimit}> + {creditremaining}> + +
| . $locale->text('Credit Limit') . qq|$form->{creditlimit}| . $locale->text('Remaining') . qq|$form->{creditremaining}
+
| . $locale->text('Currency') . qq|
+
+ + + + + + + + + + + $button1 - - - + + + $button2 - -
| . $locale->text('Invoice Number') . qq|
| . $locale->text('Order Number') . qq|
| . $locale->text('Invoice Date') . qq|
| . $locale->text('Due Date') . qq|
| . $locale->text('Due Date') . qq|
-
+
@@ -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|
+ + + + + + + + |; my $amount = $locale->text('Amount'); @@ -578,13 +573,13 @@ $jsscript '-default' => $form->{"project_id_$i"} )); print qq| - + $tax - + |; $amount = ""; $project = ""; @@ -610,37 +605,37 @@ $jsscript - - + + - {oldinvtotal}> - {oldtotalpaid}> + {oldinvtotal}> + {oldtotalpaid}> - + - + -
| . $locale->text('Account') . qq|| . $locale->text('Amount') . qq|| . $locale->text('Tax') . qq|| . $locale->text('Taxkey') . qq|| . $locale->text('Project') . qq|
$selectAP_amount {"amount_$i"}> $form->{"tax_$i"}$projectnumber
${APselected}$form->{invtotal}${APselected}$form->{invtotal}
-
+ - - - + + +
| . $locale->text('Notes') . qq|$notes
| . $locale->text('Notes') . qq|$notes
- - - + + + |; my @column_index; @@ -1070,8 +1065,8 @@ sub post { my ($debitaccno, $debittaxkey) = split /--/, $form->{AP_amountselected}; my ($taxkey, $NULL) = split /--/, $form->{taxchartselected}; my ($payablesaccno, $payablestaxkey) = split /--/, $form->{APselected}; - $form->{AP}{amount_1} = $debitaccno; - $form->{AP}{payables} = $payablesaccno; +# $form->{AP_amount_1} = $debitaccno; + $form->{AP_payables} = $payablesaccno; $form->{taxkey} = $taxkey; $form->{storno} = 0; @@ -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 .= " - - - -| 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| - - |; - $button2 = 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| - - -{script}> - -
| . $locale->text('Payments') . qq|
| . $locale->text('Payments') . qq|
| . $locale->text('Department') . qq|
- text('button') . qq|> - text('button') . qq|>
- - - - - - - - - - - - - -
$form->{title}
- - - - - - $department - - - - - - - - - - - - - - - - - - - $button1 - - $button2 - - -
| . $locale->text('Vendor') . qq|$vendor
| . $locale->text('Invoice Number') . qq|
| . $locale->text('Order Number') . qq|
| . $locale->text('Notes') . qq|
| . $locale->text("Project Number") . qq|$projectnumber
| . $locale->text('From') . qq|| . $locale->text('Bis') . qq|
-
- - - - - -
| . $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}> - - - - - - -|; + print $form->parse_html_template('ap/search', { %myconfig }); $main::lxdebug->leave_sub(); }