X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fis.pl;h=2891634f005c312023173d28fedeb389a2fb82a4;hb=4e27e828de91b6f1252f3353f06edea72f13a0c1;hp=3b298f13d8891c21fa14b93e25fcf246dd3f521d;hpb=82c784869fbfc8a746a0ee0662947f189f021993;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 3b298f13d..2891634f0 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -77,7 +77,10 @@ sub add { sub edit { $lxdebug->enter_sub(); - + # show history button + $form->{javascript} = qq||; + #/show hhistory button + if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR") { $form->error("Access Denied"); @@ -353,8 +356,15 @@ sub form_header { |; + my @old_project_ids = ($form->{"globalproject_id"}); + map({ push(@old_project_ids, $form->{"project_id_$_"}) + if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"})); + $form->get_lists("contacts" => "ALL_CONTACTS", - "shipto" => "ALL_SHIPTO"); + "shipto" => "ALL_SHIPTO", + "projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }); my (%labels, @values); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { @@ -363,8 +373,8 @@ sub form_header { ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : ""); } my $contact = - $cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, - '-labels' => \%labels, '-default' => $form->{"cp_id"}); + NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{"cp_id"})); %labels = (); @values = (""); @@ -377,10 +387,21 @@ sub form_header { my $shipto = qq| | . $locale->text('Shipping Address') . qq| | . - $cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, - '-labels' => \%labels, '-default' => $form->{"shipto_id"}) + NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{"shipto_id"})) . qq||; + %labels = (); + @values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"projectnumber"}; + } + my $globalprojectnumber = + NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values, + '-labels' => \%labels, + '-default' => $form->{"globalproject_id"})); + # set option selected foreach $item (qw(AR customer currency department employee)) { $form->{"select$item"} =~ s/ selected//; @@ -556,7 +577,9 @@ sub form_header { $form->write_trigger(\%myconfig, 2, "orddate", "BL", "trigger_orddate", "quodate", "BL", "trigger_quodate"); - + # show history button js + $form->{javascript} .= qq||; + #/show history button js $form->header; print qq| @@ -743,11 +766,7 @@ print qq| | . $locale->text('Project Number') . qq| - - - - - + $globalprojectnumber @@ -834,7 +853,8 @@ sub form_footer { $tax .= qq| - $form->{"${item}_description"} + $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} |; @@ -873,7 +893,8 @@ sub form_footer { $tax .= qq| - Enthaltene $form->{"${item}_description"} + Enthaltene $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} @@ -1133,6 +1154,18 @@ if ($form->{type} eq "credit_note") { } } + # button for saving history + if($form->{id} ne "") { + print qq| + |; + } + # /button for saving history + + print $form->write_trigger(\%myconfig, scalar(@triggers) / 3, @triggers) . qq| @@ -1167,8 +1200,6 @@ sub update { &check_name(customer); - &check_project; - $form->{exchangerate} = $exchangerate if ( $form->{forex} = ( @@ -1319,6 +1350,7 @@ sub update { } $lxdebug->leave_sub(); } + sub post_payment { $lxdebug->enter_sub(); for $i (1 .. $form->{paidaccounts}) { @@ -1413,10 +1445,30 @@ sub post { if (!(IS->post_invoice(\%myconfig, \%$form))) { $form->error($locale->text('Cannot post invoice!')); } + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "PRINTED AND POSTED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + } else { - $form->redirect( - $form->{label} . " $form->{invnumber} " . $locale->text('posted!')) - if (IS->post_invoice(\%myconfig, \%$form)); + if (IS->post_invoice(\%myconfig, \%$form)){ + # saving the history + if(!exists $form->{addition}) { + if($form->{storno}) { + $form->{addition} = "STORNO"; + } + else { + $form->{addition} = "POSTED"; + } + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + + $form->redirect( + $form->{label} . " $form->{invnumber} " . $locale->text('posted!')); + } $form->error($locale->text('Cannot post invoice!')); } @@ -1572,9 +1624,15 @@ sub credit_note { sub yes { $lxdebug->enter_sub(); - - $form->redirect($locale->text('Invoice deleted!')) - if (IS->delete_invoice(\%myconfig, \%$form, $spool)); + if (IS->delete_invoice(\%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('Invoice deleted!')); + } $form->error($locale->text('Cannot delete invoice!')); $lxdebug->leave_sub();