X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fir.pl;h=78a0333e326e929fcb4f6b7d91efe1326b08b2c2;hb=9fd46de37d7906b7c104c17112b34bae7d534d67;hp=6744764c66ffc9d30f69a058b98224816df4e189;hpb=cfc6a60d53597f6a879b28af37f84b4b5fa4cc6b;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 6744764c6..78a0333e3 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -37,6 +37,7 @@ use SL::PE; require "$form->{path}/io.pl"; require "$form->{path}/arap.pl"; require "$form->{path}/common.pl"; +require "bin/mozilla/drafts.pl"; 1; @@ -45,6 +46,8 @@ require "$form->{path}/common.pl"; sub add { $lxdebug->enter_sub(); + return $lxdebug->leave_sub() if (load_draft_maybe()); + $form->{title} = $locale->text('Add Vendor Invoice'); &invoice_links; @@ -56,7 +59,11 @@ sub add { sub edit { $lxdebug->enter_sub(); - + + # show history button + $form->{javascript} = qq||; + #/show hhistory button + $form->{title} = $locale->text('Edit Vendor Invoice'); &invoice_links; @@ -395,6 +402,8 @@ sub form_header { {storno}> {storno_id}> +| . ($form->{saved_message} ? qq|

$form->{saved_message}

| : "") . qq| + @@ -549,7 +558,8 @@ sub form_footer { $tax .= qq| - + |; @@ -590,7 +600,8 @@ sub form_footer { $tax .= qq| - + @@ -797,7 +808,9 @@ sub form_footer { if (!$form->{id} && ($invdate > $closedto)) { print qq| |; + . $locale->text('Post') . qq|"> | . + NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), + '-class' => 'submit')); } print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) . @@ -810,8 +823,22 @@ sub form_footer { {path}> {login}> {password}> +| + . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) + . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]); - + # button for saving history + if($form->{id} ne "") { + print qq| + |; + } + # /button for saving history + +print qq| @@ -989,8 +1016,16 @@ sub post_payment { ($form->{AP}) = split /--/, $form->{AP}; ($form->{AP_paid}) = split /--/, $form->{AP_paid}; - $form->redirect($locale->text(' Payment posted!')) - if (IR->post_payment(\%myconfig, \%$form)); + if (IR->post_payment(\%myconfig, \%$form)){ + + if(!exists $form->{addition} && $form->{id} ne "") { + # saving the history + $form->{addition} = "PAYMENT POSTED"; + $form->save_history($form->dbconnect(\%myconfig)); + # /saving the history + $form->redirect($locale->text(' Payment posted!')); + } + } $form->error($locale->text('Cannot post payment!')); @@ -1045,10 +1080,19 @@ sub post { relink_accounts(); - $form->redirect( $locale->text('Invoice') + if (IR->post_invoice(\%myconfig, \%$form)){ + # saving the history + if(!exists $form->{addition} && $form->{id} ne "") { + $form->{addition} = "POSTED"; + #$form->{what_done} = $locale->text("Rechnungsnummer") . qq| | . $form->{invnumber}; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + remove_draft() if $form->{remove_draft}; + $form->redirect( $locale->text('Invoice') . " $form->{invnumber} " - . $locale->text('posted!')) - if (IR->post_invoice(\%myconfig, \%$form)); + . $locale->text('posted!')); + } $form->error($locale->text('Cannot post invoice!')); $lxdebug->leave_sub(); @@ -1058,7 +1102,6 @@ sub delete { $lxdebug->enter_sub(); $form->header; - print qq| @@ -1090,9 +1133,15 @@ sub delete { sub yes { $lxdebug->enter_sub(); - - $form->redirect($locale->text('Invoice deleted!')) - if (IR->delete_invoice(\%myconfig, \%$form)); + if (IR->delete_invoice(\%myconfig, \%$form)) { + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + $form->redirect($locale->text('Invoice deleted!')); + } $form->error($locale->text('Cannot delete invoice!')); $lxdebug->leave_sub();
$form->{title}
$form->{"${item}_description"}$form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"}
Enthaltene $form->{"${item}_description"}Enthaltene $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"}