From 281696eb5e8c1a2ca203907cbff7d18052037b2f Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Thu, 25 Jun 2015 17:21:22 +0200 Subject: [PATCH] =?utf8?q?history=20-=20Vereinheitlichung=20von=20what=5Fd?= =?utf8?q?one=20f=C3=BCr=20is/ir/ap/gl?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Es wird nun immer "invoice" dort gespeichert. --- bin/mozilla/ap.pl | 23 +++++++++++++++-------- bin/mozilla/ar.pl | 20 ++++++++++++-------- bin/mozilla/ir.pl | 11 ++++++----- bin/mozilla/is.pl | 21 ++++++++++++--------- 4 files changed, 45 insertions(+), 30 deletions(-) diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 44ad4b3fe..04604831e 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -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 diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 25ef7cee2..7bcbe4c1e 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -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 diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 3571bbfbb..2a3c59f41 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -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 diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index c2fc22b34..00c96e5a6 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -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 -- 2.20.1