X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=abf4bf60e4ad6f1f4e3a71ca5f6415d0b5b3bd50;hb=a751b16cead5e56b62e18ee616e04323919f5fe1;hp=ee8eddf17c07924b9880aad6eeca873b20eba555;hpb=2b89ec9756dc1d3525b6163fe4cf4f38af83f9d8;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index ee8eddf17..abf4bf60e 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -236,7 +236,7 @@ sub order_links { if ($taxzone_id) { $form->{taxzone_id} = $taxzone_id; } - $form->{intnotes} = $intnotes; + $form->{intnotes} = $intnotes if $intnotes; ($form->{ $form->{vc} }) = split /--/, $form->{ $form->{vc} }; $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|; @@ -698,7 +698,9 @@ sub form_header { } $form->{"javascript"} .= qq||; - + # show history button js + $form->{javascript} .= qq||; + #/show history button js $form->header; print qq| @@ -891,7 +893,8 @@ sub form_footer { $tax .= qq| - $form->{"${item}_description"} + $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} |; @@ -930,7 +933,8 @@ sub form_footer { $tax .= qq| - Enthaltene $form->{"${item}_description"} + Enthaltene $form->{"${item}_description"} | + . $form->{"${item}_rate"} * 100 .qq|% $form->{"${item}_total"} @@ -1048,6 +1052,12 @@ sub form_footer { if (($form->{id})) { print qq| + +
| . $locale->text("Workflow $form->{type}") . qq|
@@ -1105,6 +1115,8 @@ sub form_footer { |; } + $form->hide_form("saved_xyznumber"); + print qq| {rowcount}> @@ -1114,17 +1126,7 @@ 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| + @@ -1341,10 +1343,6 @@ sub search { | if $form->{selectdepartment}; - $openclosed = qq| - -|; - my $delivered; if (($form->{"type"} eq "sales_order") || ($form->{"type"} eq "purchase_order")) { @@ -1440,7 +1438,12 @@ sub search { | . $locale->text('Include in Report') . qq| - $openclosed + + + + $delivered
+ +
@@ -1934,17 +1937,18 @@ sub save_and_close { } relink_accounts(); + + $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 + # /saving the history - $form->redirect( - $form->{label} . " $form->{$ordnumber} " . $locale->text('saved!')) - if (OE->save(\%myconfig, \%$form)); - $form->error($err); + $form->redirect($form->{label} . " $form->{$ordnumber} " . + $locale->text('saved!')); $lxdebug->leave_sub(); } @@ -2014,6 +2018,9 @@ sub save { unless $form->{$ordnumber}; relink_accounts(); + + OE->save(\%myconfig, \%$form); + # saving the history if(!exists $form->{addition}) { $form->{addition} = "SAVED"; @@ -2021,7 +2028,6 @@ sub save { } # /saving the history - OE->save(\%myconfig, \%$form); $form->{simple_save} = 1; if(!$form->{print_and_save}) { set_headings("edit"); @@ -2106,11 +2112,9 @@ sub invoice { # these checks only apply if the items don't bring their own ordnumbers/transdates. # The if clause ensures that by searching for empty ordnumber_#/transdate_# fields. $form->isblank("ordnumber", $locale->text('Order Number missing!')) - if (+{ map { $form->{"ordnumber_$_"}, 1 } (1 .. $form->{rowcount} - 1) } - ->{''}); + if (+{ map { $form->{"ordnumber_$_"}, 1 } (1 .. $form->{rowcount} - 1) }->{''}); $form->isblank("transdate", $locale->text('Order Date missing!')) - if (+{ map { $form->{"transdate_$_"}, 1 } (1 .. $form->{rowcount} - 1) } - ->{''}); + if (+{ map { $form->{"transdate_$_"}, 1 } (1 .. $form->{rowcount} - 1) }->{''}); # also copy deliverydate from the order $form->{deliverydate} = $form->{reqdate} if $form->{reqdate}; @@ -2415,7 +2419,15 @@ sub save_as_new { $form->{saveasnew} = 1; $form->{closed} = 0; - map { delete $form->{$_} } qw(printed emailed queued ordnumber quonumber); + map { delete $form->{$_} } qw(printed emailed queued); + + # Let Lx-Office assign a new order number if the user hasn't changed the + # previous one. If it has been changed manually then use it as-is. + my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"; + if ($form->{saved_xyznumber} && + ($form->{saved_xyznumber} eq $form->{$idx})) { + delete($form->{$idx}); + } &save; @@ -2497,3 +2509,26 @@ sub poso { $lxdebug->leave_sub(); } +sub e_mail { + $lxdebug->enter_sub(); + + $form->{saveasnew} = 1; + $form->{closed} = 0; + $form->{print_and_save} = 1; + map { delete $form->{$_} } qw(printed emailed queued); + + # Let Lx-Office assign a new order number if the user hasn't changed the + # previous one. If it has been changed manually then use it as-is. + my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber"; + if ($form->{saved_xyznumber} && + ($form->{saved_xyznumber} eq $form->{$idx})) { + delete($form->{$idx}); + } + + &save; + + &edit_e_mail; + + $lxdebug->leave_sub(); +} +