X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=fa3be49a20f02ff7f3d0def9e84c92c879432294;hb=0d295843fa8bdcc543e9c68d8b6de056fb4f092e;hp=a43da17ed1feb8a8fe28c7bffeca7e42617daf07;hpb=f404e52525ddcbfca571073a62b08c4cac420164;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index a43da17ed..fa3be49a2 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -48,12 +48,12 @@ require "bin/mozilla/reportgenerator.pl"; use strict; +my $print_post; + 1; # end of main -my $print_post; - sub check_do_access { $main::auth->assert($main::form->{type} . '_edit'); } @@ -359,7 +359,7 @@ sub update_delivery_order { my $rows = scalar @{ $form->{item_list} }; if ($rows) { - $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"}); + $form->{"qty_$i"} = 1 unless $form->parse_amount(\%myconfig, $form->{"qty_$i"}); if ($rows > 1) { @@ -466,7 +466,7 @@ sub orders { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber - transaction_description transdatefrom transdateto type vc employee_id salesman_id); + transaction_description transdatefrom transdateto type vc employee_id salesman_id project_id); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -609,6 +609,7 @@ sub save { # $locale->text('Customer missing!'); # $locale->text('Vendor missing!'); + remove_emptied_rows(); validate_items(); # if the name changed get new values @@ -618,14 +619,28 @@ sub save { } $form->{id} = 0 if $form->{saveasnew}; - + # best case fix für bug 1079. Einkaufsrabatt wird nicht richtig + # aus Lieferantenauftrag -> Lieferschein -> Rechnung übernommen + # Tritt nur auf, wenn man direkt über Lieferschein -> speichern -> + # Workflow Rechnung geht (beim Aufruf über edit() i.O.) + # Gut. DO-save() speichert den Discount im DB-Format 0.12 für + # 12%, die Konvertierung wird leider in $form gemacht und daher + # wird die Maske mit dem falschen Rabatt wieder aufgebaut. + # Wie immer: backup_vars verwenden um nichts anderes kaputt zu + # machen. jan 03.03.2010 + for my $i (1 .. $form->{rowcount}) { + $form->{"backup_discount_$i"} = $form->{"discount_$i"}; + }; DO->save(); - + for my $i (1 .. $form->{rowcount}) { + $form->{"discount_$i"} = $form->{"backup_discount_$i"}; + delete $form->{"backup_discount_$i"}; + }; # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|donumber_| . $form->{donumber}; - $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history @@ -670,8 +685,8 @@ sub delete_delivery_order { # saving the history if(!exists $form->{addition}) { $form->{snumbers} = qq|donumber_| . $form->{donumber}; - $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history @@ -725,7 +740,8 @@ sub invoice { $form->{type} = "invoice"; # locale messages - $locale = new Locale "$myconfig{countrycode}", "$script"; + $main::locale = new Locale "$myconfig{countrycode}", "$script"; + $locale = $main::locale; require "bin/mozilla/$form->{script}"; @@ -798,7 +814,7 @@ sub invoice_multi { # zwischenspeichern (DO.pm) und als ' '-separierte Liste wieder zurueckschreiben # Hinweis: delete gibt den wert zurueck und loescht danach das element (nett und einfach) # $shell: perldoc perlunc; /delete EXPR - $form->{donumber} = delete $form->{donumber_array}; + $form->{donumber} = delete $form->{donumber_array}; $form->{deliverydate} = $form->{transdate}; $form->{transdate} = $form->current_date(\%myconfig); $form->{duedate} = $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1); @@ -828,9 +844,9 @@ sub invoice_multi { $ref->{reqdate} ||= $ref->{dord_transdate}; # copy transdates into each invoice row map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{ $ref }; map { $form->{"${_}_$form->{rowcount}"} = $form->format_amount(\%myconfig, $ref->{$_}) } qw(qty sellprice discount lastcost); - $form->{"discount_$form->{rowcount}"} = $form->{"discount_$form->{rowcount}"} * 100; #s.a. Bug 1151 - # Anm.: Eine Änderung des discounts in der SL/DO.pm->retrieve (select (doi.discount * 100) as discount) ergibt in psql einen - # Wert von 10.0000001490116. Ferner ist der Rabatt in der Rechnung dann bei 1.0 (?). Deswegen lasse ich das hier. jb 10.10.09 + $form->{"discount_$form->{rowcount}"} = $form->{"discount_$form->{rowcount}"} * 100; #s.a. Bug 1151 + # Anm.: Eine Änderung des discounts in der SL/DO.pm->retrieve (select (doi.discount * 100) as discount) ergibt in psql einen + # Wert von 10.0000001490116. Ferner ist der Rabatt in der Rechnung dann bei 1.0 (?). Deswegen lasse ich das hier. jb 10.10.09 } delete $form->{form_details};