X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=0654d860b90a2b49b92354f3b05ca4e970879fbf;hb=e958a6f7392a515a4a9d9e24358c5a082015d370;hp=2bf801787f737789e17e757fdd109b4b4e1c2749;hpb=3686bb31d623aaef632060fbdd9d7447c310e279;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 2bf801787..0654d860b 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -40,6 +40,7 @@ use SL::IR; use SL::IS; use SL::PE; use SL::ReportGenerator; +use SL::DB::Default; require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; @@ -152,9 +153,6 @@ sub create_links { # build the popup menus $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked"; - # notes - $form->{notes} = $form->{intnotes} unless $form->{notes}; - # currencies $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); @@ -238,7 +236,9 @@ sub form_header { } my $readonly = ($form->{id}) ? "readonly" : ""; - $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0; + $form->{radier} = ($::instance_conf->get_ap_changeable == 2) + ? ($form->current_date(\%myconfig) eq $form->{gldate}) + : ($::instance_conf->get_ap_changeable == 1); $readonly = ($form->{radier}) ? "" : $readonly; $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell'); @@ -284,6 +284,7 @@ sub form_header { } my $notes = qq||; + my $intnotes = qq||; my $department; $department = qq| @@ -410,8 +411,6 @@ sub form_header { $form->header; print qq| - -
{script}> {id}> @@ -626,6 +625,9 @@ $jsscript | . $locale->text('Notes') . qq| $notes + + | . $locale->text('Notes for vendor') . qq| + $intnotes @@ -695,11 +697,11 @@ $jsscript print qq|{"acc_trans_id_$i"}>\n|; print qq|{"gldate_$i"}>\n|; my $changeable = 1; - if ($::lx_office_conf{features}->{payments_changeable} == 0) { + if (SL::DB::Default->get->payments_changeable == 0) { # never $changeable = ($form->{"acc_trans_id_$i"})? 0 : 1; } - if ($::lx_office_conf{features}->{payments_changeable} == 2) { + if (SL::DB::Default->get->payments_changeable == 2) { # on the same day $changeable = (($form->{"gldate_$i"} eq '') || $form->current_date(\%myconfig) eq $form->{"gldate_$i"}); } @@ -854,10 +856,10 @@ sub form_footer { $::form->header; print $::form->parse_html_template('ap/form_footer', { - num_due => $num_due, - num_follow_ups => $num_follow_ups, - show_post_draft => ($transdate > $closedto) && !$::form->{id}, - show_storno => $storno, + num_due => $num_due, + num_follow_ups => $num_follow_ups, + show_post_draft => ($transdate > $closedto) && !$::form->{id}, + show_storno => $storno, }); $::lxdebug->leave_sub; @@ -928,7 +930,7 @@ sub update { $form->{exchangerate} = $form->{forex} if $form->{forex}; $form->{invdate} = $form->{transdate}; - my %saved_variables = map +( $_ => $form->{$_} ), qw(AP AP_amount_1 taxchart_1); + my %saved_variables = map +( $_ => $form->{$_} ), qw(AP AP_amount_1 taxchart_1 notes); my $vendor_changed = &check_name("vendor"); @@ -965,9 +967,6 @@ sub update { $form->{oldinvtotal} = $form->{invtotal}; $form->{oldtotalpaid} = $totalpaid; - # notes - $form->{notes} = $form->{intnotes} if $vendor_changed; - &display_form; $main::lxdebug->leave_sub(); @@ -1223,7 +1222,7 @@ sub search { $form->all_vc(\%myconfig, "vendor", "AP"); $form->{title} = $locale->text('AP Transactions'); - $form->{fokus} = "search.vendor"; + $::request->{layout}->focus('#vendor'); $form->{jsscript} = 1; $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 },