history - Vereinheitlichung von what_done für is/ir/ap/gl
authorG. Richardson <information@kivitendo-premium.de>
Thu, 25 Jun 2015 15:21:22 +0000 (17:21 +0200)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 29 Jun 2015 08:00:59 +0000 (10:00 +0200)
Es wird nun immer "invoice" dort gespeichert.

bin/mozilla/ap.pl
bin/mozilla/ar.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl

index 44ad4b3..0460483 100644 (file)
@@ -679,8 +679,9 @@ sub post {
   if (AP->post_transaction(\%myconfig, \%$form)) {
     # saving the history
     if(!exists $form->{addition} && $form->{id} ne "") {
-      $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-      $form->{addition} = "POSTED";
+      $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+      $form->{addition}  = "POSTED";
+      $form->{what_done} = "invoice";
       $form->save_history;
     }
     # /saving the history
@@ -705,8 +706,12 @@ sub post_as_new {
   $form->{postasnew} = 1;
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "POSTED AS NEW";
+    # does this work? post_as_new for ap doesn't immediately save the
+    # invoice, because the invnumber has to be entered by hand.
+    # And the value of $form->{postasnew} isn't checked when calling post
+    $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+    $form->{addition}  = "POSTED AS NEW";
+    $form->{what_done} = "invoice";
     $form->save_history;
   }
   # /saving the history
@@ -783,8 +788,9 @@ sub yes {
   if (AP->delete_transaction(\%myconfig, \%$form)) {
     # saving the history
     if(!exists $form->{addition}) {
-      $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-      $form->{addition} = "DELETED";
+      $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+      $form->{addition}  = "DELETED";
+      $form->{what_done} = "invoice";
       $form->save_history;
     }
     # /saving the history
@@ -1028,8 +1034,9 @@ sub storno {
 
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
-    $form->{snumbers} = "invnumber_$form->{invnumber}";
-    $form->{addition} = "STORNO";
+    $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+    $form->{addition}  = "STORNO";
+    $form->{what_done} = "invoice";
     $form->save_history;
   }
   # /saving the history
index 25ef7ce..7bcbe4c 100644 (file)
@@ -713,8 +713,9 @@ sub post {
 
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
-    $form->{snumbers} = "invnumber_$form->{invnumber}";
-    $form->{addition} = "POSTED";
+    $form->{snumbers}  = "invnumber_$form->{invnumber}";
+    $form->{what_done} = "invoice";
+    $form->{addition}  = "POSTED";
     $form->save_history;
   }
   # /saving the history
@@ -736,8 +737,9 @@ sub post_as_new {
   $form->{postasnew} = 1;
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "POSTED AS NEW";
+    $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+    $form->{what_done} = "invoice";
+    $form->{addition}  = "POSTED AS NEW";
     $form->save_history;
   }
   # /saving the history
@@ -814,8 +816,9 @@ sub yes {
   if (AR->delete_transaction(\%myconfig, \%$form)) {
     # saving the history
     if(!exists $form->{addition}) {
-      $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-      $form->{addition} = "DELETED";
+      $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+      $form->{what_done} = "invoice";
+      $form->{addition}  = "DELETED";
       $form->save_history;
     }
     # /saving the history
@@ -1127,8 +1130,9 @@ sub storno {
 
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "STORNO";
+    $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+    $form->{addition}  = "STORNO";
+    $form->{what_done} = "invoice";
     $form->save_history;
   }
   # /saving the history
index 3571bbf..2a3c59f 100644 (file)
@@ -599,8 +599,9 @@ sub storno {
 
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "CANCELED";
+    $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+    $form->{what_done} = "invoice";
+    $form->{addition}  = "CANCELED";
     $form->save_history;
   }
   # /saving the history
@@ -771,9 +772,9 @@ sub post {
   if (IR->post_invoice(\%myconfig, \%$form)){
     # saving the history
     if(!exists $form->{addition} && $form->{id} ne "") {
-      $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-      $form->{addition} = "POSTED";
-      #$form->{what_done} = $locale->text("Rechnungsnummer") . qq| | . $form->{invnumber};
+      $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+      $form->{addition}  = "POSTED";
+      $form->{what_done} = 'invoice';
       $form->save_history;
     }
     # /saving the history
index c2fc22b..00c96e5 100644 (file)
@@ -691,7 +691,7 @@ sub post_payment {
   relink_accounts();
   if ( IS->post_payment(\%myconfig, \%$form) ) {
     $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
-    $form->{what_done} = $form->{type};
+    $form->{what_done} = 'invoice';
     $form->{addition}  = "PAYMENT POSTED";
     $form->save_history;
     $form->redirect($locale->text('Payment posted!'))
@@ -829,10 +829,11 @@ sub post {
   remove_draft() if $form->{remove_draft};
 
   if(!exists $form->{addition}) {
-    $form->{snumbers} =  'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
-    $form->{addition} = $form->{print_and_post} ? "PRINTED AND POSTED" :
-                        $form->{storno}         ? "STORNO"             :
-                                                  "POSTED";
+    $form->{snumbers}  =  'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
+    $form->{what_done} = 'invoice';
+    $form->{addition}  = $form->{print_and_post} ? "PRINTED AND POSTED" :
+                         $form->{storno}         ? "STORNO"             :
+                                                   "POSTED";
     $form->save_history;
   }
 
@@ -911,8 +912,9 @@ sub storno {
   }
 
   # save the history of invoice being stornoed
-  $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-  $form->{addition} = "STORNO";
+  $form->{snumbers}  = qq|invnumber_| . $form->{invnumber};
+  $form->{what_done} = 'invoice';
+  $form->{addition}  = "STORNO";
   $form->save_history;
 
   map({ my $key = $_; delete($form->{$key}) unless (grep({ $key eq $_ } qw(id login password type))); } keys(%{ $form }));
@@ -1076,8 +1078,9 @@ sub yes {
   if (IS->delete_invoice(\%myconfig, \%$form)) {
     # saving the history
     if(!exists $form->{addition}) {
-      $form->{snumbers} = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
-      $form->{addition} = "DELETED";
+      $form->{snumbers}  = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
+      $form->{what_done} = 'invoice';
+      $form->{addition}  = "DELETED";
       $form->save_history;
     }
     # /saving the history