X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=ee8eddf17c07924b9880aad6eeca873b20eba555;hb=834bd183522a3b20f8c3e24d3f39c6669543c0fc;hp=e2fb8a2aaeada8b5f6363e9ef7614d59c037a998;hpb=59f8f1fad78635c084328f8bf726f107cbb5bba2;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index e2fb8a2aa..ee8eddf17 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -110,6 +110,9 @@ sub add { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button $form->{simple_save} = 0; @@ -407,11 +410,15 @@ sub form_header { #quote select[customer|vendor] Bug 133 $form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"}); + 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", "projects" => { "key" => "ALL_PROJECTS", "all" => 0, - "old_id" => $form->{"globalproject_id"} }); + "old_id" => \@old_project_ids }); my (%labels, @values); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { @@ -420,8 +427,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 = (""); @@ -431,6 +438,13 @@ sub form_header { $item->{"shiptoname"} . " " . $item->{"shiptodepartment_1"}; } + my $shipto = qq| + | . $locale->text('Shipping Address') . qq| + | . + NTI($cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, + '-labels' => \%labels, '-default' => $form->{"shipto_id"})) + . qq||; + %labels = (); @values = (""); foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { @@ -438,16 +452,9 @@ sub form_header { $labels{$item->{"id"}} = $item->{"projectnumber"}; } my $globalprojectnumber = - $cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values, - '-labels' => \%labels, - '-default' => $form->{"globalproject_id"}); - - my $shipto = qq| - | . $locale->text('Shipping Address') . qq| - | . - $cgi->popup_menu('-name' => 'shipto_id', '-values' => \@values, - '-labels' => \%labels, '-default' => $form->{"shipto_id"}) - . qq||; + NTI($cgi->popup_menu('-name' => 'globalproject_id', '-values' => \@values, + '-labels' => \%labels, + '-default' => $form->{"globalproject_id"})); $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -1107,7 +1114,17 @@ sub form_footer { {path}> {login}> {password}> - +|; +# button for saving history +print qq| + {id} + . qq|); name=history id=history value=| + . $locale->text('history') + . qq|>|; +# /button for saving history + +qq| @@ -1127,8 +1144,6 @@ sub update { &check_name($form->{vc}); - &check_project; - $buysell = 'buy'; $buysell = 'sell' if ($form->{vc} eq 'vendor'); $form->{exchangerate} = $exchangerate @@ -1373,6 +1388,19 @@ sub search { |; } + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }); + + my %labels = (); + my @values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"projectnumber"}; + } + my $projectnumber = + NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values, + '-labels' => \%labels)); + $form->header; print qq| @@ -1397,6 +1425,10 @@ sub search { $ordlabel + + | . $locale->text("Project Number") . qq| + $projectnumber + | . $locale->text('From') . qq| $button1 @@ -1424,6 +1456,7 @@ sub search { $employee | . $locale->text('Ship via') . qq| + $employee | @@ -1432,6 +1465,8 @@ sub search { . $locale->text('Tax') . qq| | . $locale->text('Total') . qq| + | + . $locale->text('Project Number') . qq| | @@ -1497,8 +1532,8 @@ sub orders { @columns = $form->sort_columns("transdate", "reqdate", "id", "$ordnumber", "name", "netamount", "tax", "amount", - "curr", "employee", "shipvia", "open", - "closed", "delivered"); + "curr", "employee", "shipvia", "globalprojectnumber", + "open", "closed", "delivered"); $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}); @@ -1582,6 +1617,8 @@ sub orders { qq|| . $locale->text('Ship via') . qq||; + $column_header{globalprojectnumber} = + qq|| . $locale->text('Project Number') . qq||; $column_header{open} = qq|| . $locale->text('O') . qq||; $column_header{closed} = @@ -1698,6 +1735,7 @@ sub orders { $column_data{employee} = "$oe->{employee} "; $column_data{shipvia} = "$oe->{shipvia} "; + $column_data{globalprojectnumber} = "" . H($oe->{globalprojectnumber}) . ""; if ($oe->{closed}) { $column_data{closed} = "X"; @@ -1896,6 +1934,12 @@ sub save_and_close { } relink_accounts(); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->redirect( $form->{label} . " $form->{$ordnumber} " . $locale->text('saved!')) @@ -1970,6 +2014,12 @@ sub save { unless $form->{$ordnumber}; relink_accounts(); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history OE->save(\%myconfig, \%$form); $form->{simple_save} = 1; @@ -2034,8 +2084,15 @@ sub yes { $msg = $locale->text('Quotation deleted!'); $err = $locale->text('Cannot delete quotation!'); } - - $form->redirect($msg) if (OE->delete(\%myconfig, \%$form, $spool)); + if (OE->delete(\%myconfig, \%$form, $spool)){ + $form->redirect($msg); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + } $form->error($err); $lxdebug->leave_sub();