X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=7b16657e578c9f11824bc7592df27be8345b46d3;hb=300dc61894ebcb800a69eae3e81195d3c337747d;hp=e566ea6f702ff2eb4c92e6f65ca0cf031f088c55;hpb=13fc241edb1b1a658eb818a106ec06e1e9dac005;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index e566ea6f7..7b16657e5 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -296,8 +296,6 @@ sub form_header { $taxcharts{$item->{id}} = $item; } - $form->{jsscript} = 1; - my $follow_up_vc = $form->{vendor}; $follow_up_vc =~ s/--.*?//; my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)"; @@ -377,6 +375,10 @@ sub form_header { if ( $form->{'paid_'. $form->{paidaccounts}} ) { $form->{paidaccounts}++; } + + # default account for current assets (i.e. 1801 - SKR04) + $form->{accno_arap} = IS->get_standard_accno_current_assets(\%myconfig, \%$form); + for my $i (1 .. $form->{paidaccounts}) { $form->{totalpaid} += $form->{"paid_$i"}; @@ -608,10 +610,11 @@ sub post { my ($inline) = @_; - # check if there is a vendor, invoice and due date + # check if there is a vendor, invoice, due date and invnumber $form->isblank("transdate", $locale->text("Invoice Date missing!")); $form->isblank("duedate", $locale->text("Due Date missing!")); $form->isblank("vendor", $locale->text('Vendor missing!')); + $form->isblank("invnumber", $locale->text('Invoice Number missing!')); if ($myconfig{mandatory_departments} && !$form->{department}) { $form->{saved_message} = $::locale->text('You have to specify a department.'); @@ -797,7 +800,7 @@ sub yes { sub search { $main::lxdebug->enter_sub(); - $main::auth->assert('general_ledger | vendor_invoice_edit'); + $main::auth->assert('vendor_invoice_edit'); my $form = $main::form; my %myconfig = %main::myconfig; @@ -807,15 +810,12 @@ sub search { $form->all_vc(\%myconfig, "vendor", "AP"); $form->{title} = $locale->text('AP Transactions'); - $::request->{layout}->focus('#vendor'); - $form->{jsscript} = 1; $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, "departments" => "ALL_DEPARTMENTS", "vendors" => "ALL_VC"); # constants and subs for template - $form->{jsscript} = 1; $form->{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" }; $form->header; @@ -852,7 +852,7 @@ sub ap_transactions { my %myconfig = %main::myconfig; my $locale = $main::locale; - $main::auth->assert('general_ledger | vendor_invoice_edit'); + $main::auth->assert('vendor_invoice_edit'); ($form->{vendor}, $form->{vendor_id}) = split(/--/, $form->{vendor});