Merge remote branch 'origin/master'
[kivitendo-erp.git] / bin / mozilla / ar.pl
index be080ea..6466aa2 100644 (file)
@@ -161,9 +161,6 @@ sub create_links {
   $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
   $form->{rowcount}    = 1;
 
-  # notes
-  $form->{notes} = $form->{intnotes} unless $form->{notes};
-
   # currencies
   $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
 
@@ -336,7 +333,7 @@ sub form_header {
     my $transaction = {
       amount     => $form->{"amount_$i"},
       tax        => $form->{"tax_$i"},
-      project_id => $form->{"project_id_$i"},
+      project_id => ($i==$form->{rowcount}) ? $form->{globalproject_id} : $form->{"project_id_$i"},
     };
 
     my $selected_accno_full;
@@ -512,7 +509,7 @@ $follow_ups_block
     }
     if ($transdate > $closedto) {
       print qq|
-        <input class=submit type=submit name=action value="| . $locale->text('Use As Template') . qq|"> |;
+        <input class=submit type=submit name=action value="| . $locale->text('Use As New') . qq|"> |;
     }
     print qq|
         <input class=submit type=submit name=action value="| . $locale->text('Post Payment') .    qq|">
@@ -617,13 +614,10 @@ sub update {
 
   $form->{invdate} = $form->{transdate};
 
-  my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1 customer_id);
+  my %saved_variables = map +( $_ => $form->{$_} ), qw(AR AR_amount_1 taxchart_1 customer_id notes);
 
   &check_name("customer");
 
-  # check_name loads customer notes into notes, but ar only knows intnotes, so copy them
-  $form->{notes} = $form->{intnotes} if $saved_variables{customer_id} != $form->{customer_id};
-
   $form->{AR} = $saved_variables{AR};
   if ($saved_variables{AR_amount_1} =~ m/.--./) {
     map { $form->{$_} = $saved_variables{$_} } qw(AR_amount_1 taxchart_1);
@@ -809,7 +803,7 @@ sub post_as_new {
   $main::lxdebug->leave_sub();
 }
 
-sub use_as_template {
+sub use_as_new {
   $main::lxdebug->enter_sub();
 
   $main::auth->assert('general_ledger');