Bug 528 solved. Better Taxbird export for USTVA.
[kivitendo-erp.git] / bin / mozilla / io.pl
index 820ad48..5588939 100644 (file)
@@ -670,6 +670,7 @@ sub select_item {
 <input name="new_longdescription_$i" type=hidden value="$ref->{longdescription}">
 <input name="new_not_discountable_$i" type=hidden value="$ref->{not_discountable}">
 <input name="new_part_payment_id_$i" type=hidden value="$ref->{part_payment_id}">
+<input name="new_partnotes_$i" type="hidden" value="| . Q($ref->{"partnotes"}) . qq|">
 
 <input name="new_id_$i" type=hidden value=$ref->{id}>
 
@@ -732,7 +733,9 @@ sub item_selected {
   $sellprice = $form->parse_amount(\%myconfig, $form->{"sellprice_$i"});
 
   map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} }
-    qw(id partnumber description sellprice listprice inventory_accno income_accno expense_accno bin unit weight assembly taxaccounts partsgroup formel longdescription not_discountable);
+    qw(id partnumber description sellprice listprice inventory_accno
+       income_accno expense_accno bin unit weight assembly taxaccounts
+       partsgroup formel longdescription not_discountable partnotes);
   if ($form->{"part_payment_id_$i"} ne "") {
     $form->{payment_id} = $form->{"part_payment_id_$i"};
   }
@@ -1177,6 +1180,10 @@ sub order {
   $form->{cp_id} *= 1;
 
   require "$form->{path}/$form->{script}";
+  my $script = $form->{"script"};
+  $script =~ s|.*/||;
+  $script =~ s|.pl$||;
+  $locale = new Locale($language, $script);
 
   map { $form->{"select$_"} = "" } ($form->{vc}, currency);
 
@@ -1474,8 +1481,6 @@ sub print_options {
     $myconfig{"default_media"} ? $myconfig{"default_media"} :
     "screen";
 
-  $lxdebug->message(0, "fm $form->{media}");
-
   $form->{"printer_id"} =
     defined($form->{"printer_id"}) ? $form->{"printer_id"} :
     $myconfig{"default_printer_id"} ? $myconfig{"default_printer_id"} :
@@ -1757,8 +1762,7 @@ sub print_form {
   if (($form->{type} eq 'invoice') && ($form->{formname} eq 'proforma') ) {
     $inv                  = "inv";
     $due                  = "due";
-    $form->{"${inv}date"} = $form->{transdate};
-    $form->{"invdate"}    = $form->{transdate};
+    $form->{"${inv}date"} = $form->{invdate};
     $form->{label}        = $locale->text('Proforma Invoice');
     $numberfld            = "sonumber";
     $order                = 0;
@@ -1822,7 +1826,7 @@ sub print_form {
     $inv                  = "quo";
     $due                  = "req";
     $form->{"${inv}date"} = $form->{transdate};
-    $form->{"invdate"} = $form->{transdate};
+    $form->{"invdate"}    = $form->{transdate};
     $form->{label}        = $locale->text('Proforma Invoice');
     $numberfld            = "sqnumber";
     $order                = 1;
@@ -1840,7 +1844,9 @@ sub print_form {
   $form->isblank("email", $locale->text('E-mail address missing!'))
     if ($form->{media} eq 'email');
   $form->isblank("${inv}date",
-                 $locale->text($form->{label} . ' Date missing!'));
+           $locale->text($form->{label}) 
+           . ": "
+           . $locale->text(' Date missing!'));
 
   # $locale->text('Invoice Number missing!')
   # $locale->text('Invoice Date missing!')