X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdo.pl;h=7f83bf399b7398b0083096116fd3ae7819e96863;hb=34211d2356367e21aa8f624caa7b17ee4b8ec4ac;hp=11e3a4daa21d5830709d046e1975559755d3b769;hpb=015f7118b8398596eb3656a343b5cf0141929fb7;p=kivitendo-erp.git diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 11e3a4daa..7f83bf399 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -121,7 +121,8 @@ sub edit { } 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}; @@ -182,12 +183,8 @@ sub order_links { ($form->{ $form->{vc} }) = split /--/, $form->{ $form->{vc} }; $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|; - $form->{taxincluded} = $taxincluded if ($form->{id}); - $form->{employee} = "$form->{employee}--$form->{employee_id}"; - $form->{salesman_id} = $salesman_id if ($editing); - $lxdebug->leave_sub(); } @@ -274,10 +271,15 @@ sub form_header { if ($form->{format} eq "html") { $form->{onload} = "window.open('about:blank','Beleg'); document.do.target = 'Beleg';"; } + # emulate click for resubmitting actions + $form->{onload} .= "document.do.${_}.click(); " for grep { /^action_/ } keys %$form; $form->{onload} .= "document.do.submit();" } $form->header(); + # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID' + $form->{department} .= '--' . $form->{department_id}; + print $form->parse_html_template('do/form_header'); $lxdebug->leave_sub(); @@ -734,6 +736,7 @@ sub invoice_multi { 'back_button' => 1); } + my $source_type = $form->{type}; $form->{convert_from_do_ids} = join ' ', @do_ids; # bei der auswahl von mehreren Lieferscheinen fuer eine Rechnung, die einfach in donumber_array # zwischenspeichern (DO.pm) und als ' '-separierte Liste wieder zurueckschreiben @@ -748,7 +751,7 @@ sub invoice_multi { $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); my $buysell; - if ($form->{type} eq 'purchase_delivery_order') { + if ($source_type eq 'purchase_delivery_order') { $form->{title} = $locale->text('Add Vendor Invoice'); $form->{script} = 'ir.pl'; $script = "ir"; @@ -766,8 +769,12 @@ sub invoice_multi { $form->{rowcount} = 0; foreach my $ref (@{ $form->{form_details} }) { $form->{rowcount}++; + $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 } delete $form->{form_details};