Bug 528 solved. Better Taxbird export for USTVA.
[kivitendo-erp.git] / bin / mozilla / am.pl
index c9b5f54..09d2007 100644 (file)
@@ -177,10 +177,14 @@ sub account_header {
             76  => $locale->text('UStVA-Nr. 76'),
             77  => $locale->text('UStVA-Nr. 77'),
             80  => $locale->text('UStVA-Nr. 80'),
+            81  => $locale->text('UStVA-Nr. 81 left'),
+            811 => $locale->text('UStVA-Nr. 81 right'),
             84  => $locale->text('UStVA-Nr. 84'),
             85  => $locale->text('UStVA-Nr. 85'),
             86  => $locale->text('UStVA-Nr. 86 left'),
             861 => $locale->text('UStVA-Nr. 86 right'),
+            89  => $locale->text('UStVA-Nr. 89 left'),
+            891 => $locale->text('UStVA-Nr. 89 right'),
             91  => $locale->text('UStVA-Nr. 91'),
             93  => $locale->text('UStVA-Nr. 93 left'),
             931 => $locale->text('UStVA-Nr. 93 right'),
@@ -575,12 +579,11 @@ sub list_account {
       $ca->{link} .= qq|[| . $link . qq|] |;
     }
     
-    $ca->{startdate} =~ s/,/<br>/og;
-    $ca->{tk_ustva}  =~ s/,/<br>/og;
-
-    $ca->{taxkey_id}  =~ s/,/<br>/og;
-    $ca->{taxdescription}  =~ s/,/<br>/og;
-
+    $ca->{startdate}      =~ s/,/<br>/og;
+    $ca->{tk_ustva}       =~ s/,/<br>/og;
+    $ca->{taxkey}         =~ s/,/<br>/og;
+    $ca->{taxaccount}     =~ s/,/<br>/og;
+    $ca->{taxdescription} =~ s/,/<br>/og;
     $ca->{datevautomatik} = ($ca->{datevautomatik}) ? $locale->text('On'):q{};
 
     $ca->{category} = ($ca->{category} eq 'A') ? $locale->text('Account Category A')
@@ -595,7 +598,7 @@ sub list_account {
     $ca->{link_edit_account} = 
         qq|$form->{script}?action=edit_account&id=$ca->{id}|
        .qq|&path=$form->{path}&login=$form->{login}|
-       .qq|&password=$form->{password}&callback=$callback>$ca->{accno}|;
+       .qq|&password=$form->{password}&callback=$callback|;
   }
   
   my $parameters_ref = {
@@ -2326,6 +2329,10 @@ sub add_payment {
   $form->{terms_netto} = 0;
   $form->{terms_skonto} = 0;
   $form->{percent_skonto} = 0;
+  my @languages = AM->language(\%myconfig, $form, 1);
+  map({ $_->{"language"} = $_->{"description"};
+        $_->{"language_id"} = $_->{"id"}; } @languages);
+  $form->{"TRANSLATION"} = \@languages;
   &payment_header;
   &form_footer;
 
@@ -2337,7 +2344,7 @@ sub edit_payment {
 
   $form->{title} = "Edit";
 
-  AM->get_payment(\%myconfig, \%$form);
+  AM->get_payment(\%myconfig, $form);
   $form->{percent_skonto} =
     $form->format_amount(\%myconfig, $form->{percent_skonto} * 100);
 
@@ -2453,7 +2460,7 @@ sub list_payment {
       build_std_url("action=edit_payment", "id=$ref->{id}", "callback=$callback") .
       qq|">| . H($ref->{description}) . qq|</a></td>|;
     $column_data{description_long} =
-      qq|<td align=right>| . H($ref->{description_long}) . qq|</td>|;
+      qq|<td>| . H($ref->{description_long}) . qq|</td>|;
     $column_data{terms_netto} =
       qq|<td align=right>$ref->{terms_netto}</td>|;
     $column_data{terms_skonto} =
@@ -2537,6 +2544,22 @@ sub payment_header {
     <th align=right>| . $locale->text('Long Description') . qq|</th>
     <td><input name=description_long size=50 value="$form->{description_long}"></td>
   </tr>
+|;
+
+  foreach my $language (@{ $form->{"TRANSLATION"} }) {
+    print qq|
+  <tr>
+    <th align="right">| .
+    sprintf($locale->text('Translation (%s)'),
+            $language->{"language"})
+    . qq|</th>
+    <td><input name="description_long_$language->{language_id}" size="50"
+         value="| . Q($language->{"description_long"}) . qq|"></td>
+  </tr>
+|;
+  }
+
+  print qq|
   <tr>
     <th align=right>| . $locale->text('Netto Terms') . qq|</th>
     <td><input name=terms_netto size=10 value="$form->{terms_netto}"></td>
@@ -2552,7 +2575,38 @@ sub payment_header {
   <td colspan=2><hr size=3 noshade></td>
   </tr>
 </table>
-|;
+
+<p>| . $locale->text("You can use the following strings in the long " .
+                     "description and all translations. They will be " .
+                     "replaced by their actual values by Lx-Office " .
+                     "before they're output.")
+. qq|</p>
+
+<ul>
+  <li>| . $locale->text("&lt;%netto_date%&gt; -- Date the payment is due in " .
+                        "full")
+. qq|</li>
+  <li>| . $locale->text("&lt;%skonto_date%&gt; -- Date the payment is due " .
+                        "with discount")
+. qq|</li>
+  <li>| . $locale->text("&lt;%skonto_amount%&gt; -- The deductible amount")
+. qq|</li>
+  <li>| . $locale->text("&lt;%total%&gt; -- Amount payable")
+. qq|</li>
+  <li>| . $locale->text("&lt;%invtotal%&gt; -- Invoice total")
+. qq|</li>
+  <li>| . $locale->text("&lt;%currency%&gt; -- The selected currency")
+. qq|</li>
+  <li>| . $locale->text("&lt;%terms_netto%&gt; -- The number of days for " .
+                        "full payment")
+. qq|</li>
+  <li>| . $locale->text("&lt;%account_number%&gt; -- Your account number")
+. qq|</li>
+  <li>| . $locale->text("&lt;%bank%&gt; -- Your bank")
+. qq|</li>
+  <li>| . $locale->text("&lt;%bank_code%&gt; -- Your bank code")
+. qq|</li>
+</ul>|;
 
   $lxdebug->leave_sub();
 }
@@ -2990,19 +3044,6 @@ sub config {
   }
   $countrycodes = "<option>American English\n$countrycodes";
 
-  # use an other input number format than output numberformat
-  # look at Form.pm, sub parse_amount
-  my $in_numberformat = '';
-  $text1 = qq|value="0">| . $locale->text('equal Outputformat');
-  $text2 = qq|value="1">| . $locale->text('1000,00 or 1000.00');
-  @in_nf = ($text1, $text2);
-  foreach $item (@in_nf) {
-    $in_numberformat .=
-      (substr($item, 7, 1) eq $myconfig{in_numberformat})
-      ? "<option selected $item\n"
-      : "<option $item\n";
-  }
-
   foreach $key (keys %{ $form->{IC} }) {
     foreach $accno (sort keys %{ $form->{IC}{$key} }) {
       $myconfig{$key} .=
@@ -3097,10 +3138,6 @@ sub config {
          <th align=right>| . $locale->text('Output Number Format') . qq|</th>
          <td><select name=numberformat>$numberformat</select></td>
        </tr>
-       <tr>
-         <th align=right>| . $locale->text('Input Number Format') . qq|</th>
-         <td><select name=in_numberformat>$in_numberformat</select></td>
-       </tr>
 
        <tr>
          <th align=right>| . $locale->text('Dropdown Limit') . qq|</th>