X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/434f88fb99625738aa890518309d51a95d611c19..e1cb00366d40cc3a1b07e065b51ad39c84baf7e6:/bin/mozilla/do.pl diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 6a8b94b55..ebaffc640 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,8 +183,6 @@ 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); @@ -274,6 +273,8 @@ 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();" } @@ -734,7 +735,13 @@ 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 + # 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->{deliverydate} = $form->{transdate}; $form->{transdate} = $form->current_date(\%myconfig); $form->{duedate} = $form->current_date(\%myconfig, $form->{invdate}, $form->{terms} * 1); @@ -743,7 +750,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"; @@ -761,6 +768,7 @@ 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); }