X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=18924979618cdc15c056fadb24d48b3102857b87;hb=82ab26a0d201bf24aba85e058e1cb23928a4b44a;hp=c4c513a34198c6ec0c9bd6f7e83b8a59c2659d50;hpb=5b4da8b54a5b66176d56b2ac574e30d75b29eb31;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index c4c513a34..189249796 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -37,6 +37,7 @@ use SL::PE; require "$form->{path}/arap.pl"; require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; 1; @@ -73,6 +74,8 @@ require "bin/mozilla/common.pl"; sub add { $lxdebug->enter_sub(); + return $lxdebug->leave_sub() if (load_draft_maybe()); + $form->{title} = "Add"; $form->{callback} = @@ -88,6 +91,9 @@ sub add { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button $form->{title} = "Edit"; @@ -193,6 +199,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 { @@ -455,6 +462,8 @@ sub form_header { {locked}> +| . ($form->{saved_message} ? qq|

$form->{saved_message}

| : "") . qq| + @@ -637,7 +646,7 @@ $jsscript
$form->{title} - + |; @@ -753,6 +762,10 @@ sub form_footer { {path}> {login}> {password}> +| +. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) +. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]) +. qq|
|; @@ -785,9 +798,20 @@ sub form_footer { } elsif (($transdate > $closedto) && !$form->{id}) { print qq| |; + . $locale->text('Post') . qq|"> | . + NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), + '-class' => 'submit')); } - + # 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 " @@ -988,8 +1012,16 @@ sub post { $form->{id} = 0 if $form->{postasnew}; - $form->redirect($locale->text('Transaction posted!')) - if (AP->post_transaction(\%myconfig, \%$form)); + if (AP->post_transaction(\%myconfig, \%$form)) { + # saving the history + if(!exists $form->{addition} && $form->{id} ne "") { + $form->{addition} = "POSTED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + remove_draft() if $form->{remove_draft}; + $form->redirect($locale->text('Transaction posted!')); + } $form->error($locale->text('Cannot post transaction!')); $lxdebug->leave_sub(); @@ -999,6 +1031,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 +1094,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();
| . $locale->text('Payments') . qq|| . $locale->text('Payments') . qq|