From: Moritz Bunkus Date: Fri, 2 Sep 2011 14:05:47 +0000 (+0200) Subject: Merge branch 'master' of lx-office.linet-services.de:lx-office-erp X-Git-Tag: release-2.7.0beta1~313^2 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/62ffcb1aa838fa3d4e266aef02918574bc7ca6be?hp=5074cc502811728e2bbaf42cfd5ea39974ba6e2a Merge branch 'master' of lx-office.linet-services.de:lx-office-erp --- diff --git a/SL/AP.pm b/SL/AP.pm index 79a93fe3a..7b0bc12b7 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -288,7 +288,7 @@ sub post_transaction { $form->{payables} = $amount; # add payment - my $gldate = (conv_date($form->{"gldate_$i"}))? conv_date($form->{"gldate_$i"}) : conv_date($form->{"gldate"}); + my $gldate = (conv_date($form->{"gldate_$i"}))? conv_date($form->{"gldate_$i"}) : conv_date($form->current_date($myconfig)); $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, gldate, source, memo, project_id, taxkey) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, ?, | . diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index d90b06209..bc2986c27 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -684,12 +684,13 @@ $jsscript # format amounts if ($form->{"paid_$i"}) { $form->{"paid_$i"} = - $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); + $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); } - $form->{"exchangerate_$i"} = - $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); if ($form->{"exchangerate_$i"} == 0) { $form->{"exchangerate_$i"} = ""; + } else { + $form->{"exchangerate_$i"} = + $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); } print qq|{"gldate_$i"}>\n|; diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 8a04ac517..8ec365ada 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -727,11 +727,11 @@ $jsscript $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); } - $form->{"exchangerate_$i"} = - $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); - if ($form->{"exchangerate_$i"} == 0) { $form->{"exchangerate_$i"} = ""; + } else { + $form->{"exchangerate_$i"} = + $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); } $exchangerate = qq| |; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index fc4e6e1dd..80faa1b06 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -181,7 +181,8 @@ sub edit { my ($language_id, $printer_id); if ($form->{print_and_save}) { - $form->{action} = "print"; + $form->{action} = "dispatcher"; + $form->{action_print} = "1"; $form->{resubmit} = 1; $language_id = $form->{language_id}; $printer_id = $form->{printer_id}; @@ -388,11 +389,19 @@ sub form_header { } } - my $onload = ($form->{resubmit} && ($form->{format} eq "html")) ? "window.open('about:blank','Beleg'); document.oe.target = 'Beleg';document.oe.submit()" - : ($form->{resubmit}) ? "document.oe.submit()" - : ($creditwarning) ? "alert('$credittext')" - : ""; + my $onload = ""; + if ($form->{resubmit} && ($form->{format} eq "html")) { + $onload = "window.open('about:blank','Beleg'); document.oe.target = 'Beleg';"; + $onload .= "document.do.submit();"; + } elsif ($form->{resubmit}) { + # emulate click for resubmitting actions + $onload = "document.oe.${_}.click(); " for grep { /^action_/ } keys %$form; + $onload .= "document.oe.submit();"; + } elsif ($creditwarning) { + $onload = "alert('$credittext')"; + } + $TMPL_VAR{onload} = $onload; $TMPL_VAR{dateformat} = $myconfig{dateformat}; $TMPL_VAR{numberformat} = $myconfig{numberformat}; @@ -522,8 +531,6 @@ sub update { check_oe_access(); -# $main::lxdebug->message(0, Dumper($form)); - set_headings($form->{"id"} ? "edit" : "add"); map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate) unless $recursive_call; @@ -2025,7 +2032,6 @@ sub dispatcher { foreach my $action (qw(delete delivery_order e_mail invoice print purchase_order purchase_order quotation request_for_quotation sales_order sales_order save save_and_close save_as_new ship_to update)) { if ($::form->{"action_${action}"}) { - $::form->{dispatched_action} = $action; call_sub($action); return; } diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html index a04676141..20c25ce89 100644 --- a/templates/webpages/oe/form_header.html +++ b/templates/webpages/oe/form_header.html @@ -2,7 +2,7 @@ [%- USE HTML %] [%- USE LxERP %] [%- USE L %] - +
@@ -26,10 +26,6 @@ -[%- IF resubmit %] -[%# in case of resubmits, restore enough information for dispatcher to work %] - [% L.hidden_tag('action_' _ dispatched_action, 1) %] -[%- END %]
[% title %]