From d946f59b7c4c8069ecb83834ed34251056155e53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 23 Mar 2007 15:29:16 +0000 Subject: [PATCH] is.pl->post entwirrt. emails speichern/buchen nun rechnungen/auftraege vor dem aufrufen der maske --- bin/mozilla/io.pl | 2 +- bin/mozilla/is.pl | 58 ++++++++++++++++++++++------------------------- bin/mozilla/oe.pl | 23 +++++++++++++++++++ locale/de/dn | 2 +- locale/de/ic | 2 +- locale/de/io | 2 +- locale/de/ir | 2 +- locale/de/is | 2 +- locale/de/oe | 1 + 9 files changed, 57 insertions(+), 37 deletions(-) diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 5b2b55c41..56cdd2f84 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1291,7 +1291,7 @@ sub request_for_quotation { quotation(); } -sub e_mail { +sub edit_e_mail { $lxdebug->enter_sub(); if ($form->{second_run}) { $form->{print_and_post} = 0; diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 863280555..c2bfd97d4 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -1452,38 +1452,19 @@ sub post { } relink_accounts(); - if ($print_post) { - if (!(IS->post_invoice(\%myconfig, \%$form))) { - $form->error($locale->text('Cannot post invoice!')); - } - remove_draft() if $form->{remove_draft}; - # saving the history - if(!exists $form->{addition}) { - $form->{addition} = "PRINTED AND POSTED"; - $form->save_history($form->dbconnect(\%myconfig)); - } - # /saving the history - - } else { - if (IS->post_invoice(\%myconfig, \%$form)){ - remove_draft() if $form->{remove_draft}; - # 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!')); + $form->error($locale->text('Cannot post invoice!')) + unless IS->post_invoice(\%myconfig, \%$form); + remove_draft() if $form->{remove_draft}; + + if(!exists $form->{addition}) { + $form->{addition} = $print_post ? "PRINTED AND POSTED" : + $form->{storno} ? "STORNO" : + "POSTED"; + $form->save_history($form->dbconnect(\%myconfig)); } + + $form->redirect( $form->{label} . " $form->{invnumber} " . $locale->text('posted!')) + unless $print_post; $lxdebug->leave_sub(); } @@ -1662,3 +1643,18 @@ sub yes { $lxdebug->leave_sub(); } + +sub e_mail { + $lxdebug->enter_sub(); + + $form->{postasnew} = 1; + $print_post = 1; + + map { delete $form->{$_} } qw(printed emailed queued); + + &post; + + &edit_e_mail; + + $lxdebug->leave_sub(); +} diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index da5ab0067..abf4bf60e 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2509,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(); +} + diff --git a/locale/de/dn b/locale/de/dn index a3ad9dbf5..f1c8c2d01 100644 --- a/locale/de/dn +++ b/locale/de/dn @@ -241,8 +241,8 @@ $self->{subs} = { 'delivery_customer_selection' => 'delivery_customer_selection', 'display_form' => 'display_form', 'display_row' => 'display_row', - 'e_mail' => 'e_mail', 'edit_config' => 'edit_config', + 'edit_e_mail' => 'edit_e_mail', 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', 'gl_transaction' => 'gl_transaction', diff --git a/locale/de/ic b/locale/de/ic index 823eee174..50f9d303c 100644 --- a/locale/de/ic +++ b/locale/de/ic @@ -288,8 +288,8 @@ $self->{subs} = { 'display' => 'display', 'display_form' => 'display_form', 'display_row' => 'display_row', - 'e_mail' => 'e_mail', 'edit' => 'edit', + 'edit_e_mail' => 'edit_e_mail', 'employee_selection_internal' => 'employee_selection_internal', 'form_footer' => 'form_footer', 'form_header' => 'form_header', diff --git a/locale/de/io b/locale/de/io index f7215ee57..9ad8d6a86 100644 --- a/locale/de/io +++ b/locale/de/io @@ -176,7 +176,7 @@ $self->{subs} = { 'delivery_customer_selection' => 'delivery_customer_selection', 'display_form' => 'display_form', 'display_row' => 'display_row', - 'e_mail' => 'e_mail', + 'edit_e_mail' => 'edit_e_mail', 'employee_selection_internal' => 'employee_selection_internal', 'format_dates' => 'format_dates', 'invoicetotal' => 'invoicetotal', diff --git a/locale/de/ir b/locale/de/ir index c79f68856..facca96d5 100644 --- a/locale/de/ir +++ b/locale/de/ir @@ -253,8 +253,8 @@ $self->{subs} = { 'display_row' => 'display_row', 'dont_load_draft' => 'dont_load_draft', 'draft_action_dispatcher' => 'draft_action_dispatcher', - 'e_mail' => 'e_mail', 'edit' => 'edit', + 'edit_e_mail' => 'edit_e_mail', 'employee_selection_internal' => 'employee_selection_internal', 'form_footer' => 'form_footer', 'form_header' => 'form_header', diff --git a/locale/de/is b/locale/de/is index 502985d37..6332f6f4c 100644 --- a/locale/de/is +++ b/locale/de/is @@ -278,8 +278,8 @@ $self->{subs} = { 'display_row' => 'display_row', 'dont_load_draft' => 'dont_load_draft', 'draft_action_dispatcher' => 'draft_action_dispatcher', - 'e_mail' => 'e_mail', 'edit' => 'edit', + 'edit_e_mail' => 'edit_e_mail', 'employee_selection_internal' => 'employee_selection_internal', 'form_footer' => 'form_footer', 'form_header' => 'form_header', diff --git a/locale/de/oe b/locale/de/oe index 36e74f574..e70015936 100644 --- a/locale/de/oe +++ b/locale/de/oe @@ -288,6 +288,7 @@ $self->{subs} = { 'display_row' => 'display_row', 'e_mail' => 'e_mail', 'edit' => 'edit', + 'edit_e_mail' => 'edit_e_mail', 'employee_selection_internal' => 'employee_selection_internal', 'form_footer' => 'form_footer', 'form_header' => 'form_header', -- 2.20.1