Ersatzmuster für Lieferanten/Kundennamen, die \n und/oder \r enthalten eingefügt...
[kivitendo-erp.git] / bin / mozilla / ar.pl
index 9f003d3..7f67058 100644 (file)
@@ -89,8 +89,10 @@ sub add {
     "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}"
     unless $form->{callback};
 
-  &create_links;
   AR->get_transdate(\%myconfig, $form);
+  $form->{initial_transdate} = $form->{transdate};
+  &create_links;
+  $form->{transdate} = $form->{initial_transdate};
   &display_form;
   $lxdebug->leave_sub();
 }
@@ -134,6 +136,9 @@ sub create_links {
   $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
   $form->{rowcount}    = 1;
 
+  # notes
+  $form->{notes} = $form->{intnotes} unless $form->{notes};
+
   # currencies
   @curr = split(/:/, $form->{currencies});
   chomp $curr[0];
@@ -257,8 +262,6 @@ sub create_links {
     }
   }
 
-  $lxdebug->message(0, "1 ARselected $form->{ARselected}");
-
   $form->{taxincluded}  = $taxincluded if ($form->{id});
   $form->{paidaccounts} = 1            if not defined $form->{paidaccounts};
 
@@ -359,8 +362,6 @@ sub form_header {
     }
   }
 
-  $taxincluded = "";
-
   $taxincluded = qq|
              <tr>
                <td align=right><input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}></td>
@@ -627,7 +628,6 @@ $jsscript
     if ($previous_accno &&
         ($previous_accno eq $selected_accno) &&
         ($previous_tax_id ne $selected_tax_id)) {
-      $lxdebug->message(0, "yeah");
       my $item = $taxcharts{$selected_tax_id};
       $selected_taxchart = "$item->{id}--$item->{rate}";
     }
@@ -849,6 +849,15 @@ sub form_footer {
 <br>
 |;
 
+  if (!$form->{id} && $form->{draft_id}) {
+    print(NTI($cgi->checkbox('-name' => 'remove_draft', '-id' => 'remove_draft',
+                             '-value' => 1, '-checked' => $form->{remove_draft},
+                             '-label' => '')) .
+          qq|&nbsp;<label for="remove_draft">| .
+          $locale->text("Remove draft when posting") .
+          qq|</label><br>|);
+  }
+
   $transdate = $form->datetonum($form->{transdate}, \%myconfig);
   $closedto  = $form->datetonum($form->{closedto},  \%myconfig);