X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fap.pl;h=f5c6609528d4a8c8ad853c9b4040aa8bee6aeeb7;hb=834bd183522a3b20f8c3e24d3f39c6669543c0fc;hp=c4c513a34198c6ec0c9bd6f7e83b8a59c2659d50;hpb=5b4da8b54a5b66176d56b2ac574e30d75b29eb31;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index c4c513a34..f5c660952 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -88,6 +88,9 @@ sub add {
sub edit {
$lxdebug->enter_sub();
+ # show history button
+ $form->{javascript} = qq||;
+ #/show hhistory button
$form->{title} = "Edit";
@@ -193,6 +196,7 @@ sub create_links {
$form->{"forex_$j"} = $form->{"exchangerate_$i"} =
$form->{acc_trans}{$key}->[$i - 1]->{exchangerate};
$form->{"AP_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}";
+ $form->{"paid_project_id_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{project_id};
$form->{paidaccounts}++;
} else {
@@ -637,7 +641,7 @@ $jsscript
- | . $locale->text('Payments') . qq| |
+ | . $locale->text('Payments') . qq| |
|;
@@ -787,7 +791,16 @@ sub form_footer {
|;
}
-
+ # button for saving history
+ if($form->{id} ne "") {
+ print qq|
+ {id}
+ . qq|); name=history id=history value=|
+ . $locale->text('history')
+ . qq|>|;
+ }
+ # /button for saving history
print "
@@ -987,6 +1000,12 @@ sub post {
$form->{taxkey} = $taxkey;
$form->{id} = 0 if $form->{postasnew};
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "POSTED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
$form->redirect($locale->text('Transaction posted!'))
if (AP->post_transaction(\%myconfig, \%$form));
@@ -999,6 +1018,12 @@ sub post_as_new {
$lxdebug->enter_sub();
$form->{postasnew} = 1;
+ # saving the history
+ if(!exists $form->{addition} && $form->{id} ne "") {
+ $form->{addition} = "POSTED AS NEW";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
&post;
$lxdebug->leave_sub();
@@ -1056,9 +1081,15 @@ sub delete {
sub yes {
$lxdebug->enter_sub();
-
- $form->redirect($locale->text('Transaction deleted!'))
- if (AP->delete_transaction(\%myconfig, \%$form, $spool));
+ if (AP->delete_transaction(\%myconfig, \%$form, $spool)) {
+ # saving the history
+ if(!exists $form->{addition}) {
+ $form->{addition} = "DELETED";
+ $form->save_history($form->dbconnect(\%myconfig));
+ }
+ # /saving the history
+ $form->redirect($locale->text('Transaction deleted!'));
+ }
$form->error($locale->text('Cannot delete transaction!'));
$lxdebug->leave_sub();
|