X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=34870fea269936ec068bcee6bf99c08aad9f4df0;hb=15f549fdb43fba2d99817c659533dfa02638bf27;hp=0d0d8013151aa51f7159b0c38921bb616e510e48;hpb=e07e9534d0c611913e31bc620c65e46701e5f000;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 0d0d80131..34870fea2 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,8 +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"); + "shipto" => "ALL_SHIPTO", + "projects" => { "key" => "ALL_PROJECTS", + "all" => 0, + "old_id" => \@old_project_ids }); my (%labels, @values); foreach my $item (@{ $form->{"ALL_CONTACTS"} }) { @@ -417,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,10 +441,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"})); + $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate}); @@ -781,6 +802,10 @@ print qq| $openclosed $employee $ordnumber + + | . $locale->text('Project Number') . qq| + $globalprojectnumber + @@ -1023,6 +1048,12 @@ sub form_footer { if (($form->{id})) { print qq| + +
| . $locale->text("Workflow $form->{type}") . qq|
@@ -1109,8 +1140,6 @@ sub update { &check_name($form->{vc}); - &check_project; - $buysell = 'buy'; $buysell = 'sell' if ($form->{vc} eq 'vendor'); $form->{exchangerate} = $exchangerate @@ -1308,10 +1337,6 @@ sub search { | if $form->{selectdepartment}; - $openclosed = qq| - -|; - my $delivered; if (($form->{"type"} eq "sales_order") || ($form->{"type"} eq "purchase_order")) { @@ -1355,6 +1380,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| @@ -1379,6 +1417,10 @@ sub search { $ordlabel + + | . $locale->text("Project Number") . qq| + $projectnumber + | . $locale->text('From') . qq| $button1 @@ -1390,7 +1432,12 @@ sub search { | . $locale->text('Include in Report') . qq| - $openclosed + + + + $delivered + + |; + $column_header{globalprojectnumber} = + qq||; $column_header{open} = qq||; $column_header{closed} = @@ -1680,6 +1732,7 @@ sub orders { $column_data{employee} = ""; $column_data{shipvia} = ""; + $column_data{globalprojectnumber} = ""; if ($oe->{closed}) { $column_data{closed} = ""; @@ -1879,10 +1932,17 @@ sub save_and_close { relink_accounts(); - $form->redirect( - $form->{label} . " $form->{$ordnumber} " . $locale->text('saved!')) - if (OE->save(\%myconfig, \%$form)); - $form->error($err); + $form->error($err) if (!OE->save(\%myconfig, \%$form)); + + # 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!')); $lxdebug->leave_sub(); } @@ -1954,6 +2014,14 @@ sub save { relink_accounts(); OE->save(\%myconfig, \%$form); + + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + $form->{simple_save} = 1; if(!$form->{print_and_save}) { set_headings("edit"); @@ -2016,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();
+ +
@@ -1406,6 +1453,7 @@ sub search { $employee | . $locale->text('Ship via') . qq| $employee
| @@ -1414,6 +1462,8 @@ sub search { . $locale->text('Tax') . qq| | . $locale->text('Total') . qq| | + . $locale->text('Project Number') . qq|
| @@ -1479,8 +1529,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}); @@ -1564,6 +1614,8 @@ sub orders { qq|| . $locale->text('Ship via') . qq|| . $locale->text('Project Number') . qq|| . $locale->text('O') . qq|$oe->{employee} $oe->{shipvia} " . H($oe->{globalprojectnumber}) . "X