}
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};
($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);
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();"
}
'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
$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";
$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);
}