# if multiple rowcounts (== collective order) then check if the
# there were more than one customer (in that case OE::retrieve removes
# the content from the field)
- if ($form->{rowcount} && $form->{type} eq 'sales_order' && $form->{customer} eq '') {
+ if ($form->{rowcount} && $form->{type} eq 'sales_order' && defined $form->{customer} && $form->{customer} eq '') {
# $main::lxdebug->message(0, "Detected Edit order with concurrent customers");
$form->error($locale->text('Collective Orders only work for orders from one customer!'));
}
sub prepare_order {
$lxdebug->enter_sub();
- $form->{format} = "html";
+ $form->{format} = "pdf";
$form->{media} = "screen";
$form->{formname} = $form->{type};
$dec = length $dec;
$decimalplaces = ($dec > 2) ? $dec : 2;
+ # copy reqdate from deliverydate for invoice -> order conversion
+ $form->{"reqdate_$i"} = $form->{"deliverydate_$i"} unless $form->{"reqdate_$i"};
+
$form->{"sellprice_$i"} =
$form->format_amount(\%myconfig, $form->{"sellprice_$i"},
$decimalplaces);
$dec = length $dec;
$decimalplaces = ($dec > 2) ? $dec : 2;
+ # copy delivery date from reqdate for order -> invoice conversion
+ $form->{"deliverydate_$i"} = $form->{"reqdate_$i"} unless $form->{"deliverydate_$i"};
+
$form->{"sellprice_$i"} =
$form->format_amount(\%myconfig, $form->{"sellprice_$i"},
$decimalplaces);