use strict;
-my $print_post;
-
1;
# end of main
$form->{"reqdate_$i"} = $form->{"deliverydate_$i"} unless $form->{"reqdate_$i"};
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
+ $form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces);
(my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
$dec_qty = length $dec_qty;
if ($rows > 1) {
select_item();
- exit;
+ ::end_of_request();
} else {
$form->{"marge_price_factor_$i"} = $form->{item_list}->[0]->{price_factor};
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
+ $form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"});
$form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
}
# if the name changed get new values
if (check_name($form->{vc})) {
update();
- exit;
+ ::end_of_request();
}
$form->{id} = 0 if $form->{saveasnew};
if(!exists $form->{addition}) {
$form->{snumbers} = qq|donumber_| . $form->{donumber};
$form->{addition} = "SAVED";
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->save_history;
}
# /saving the history
if(!$form->{print_and_save}) {
set_headings("edit");
update();
- exit;
+ ::end_of_request();
}
$main::lxdebug->leave_sub();
}
if(!exists $form->{addition}) {
$form->{snumbers} = qq|donumber_| . $form->{donumber};
$form->{addition} = "DELETED";
- $form->save_history($form->dbconnect(\%myconfig));
+ $form->save_history;
}
# /saving the history
$form->info($locale->text('Delivery Order deleted!'));
- exit();
+ ::end_of_request();
}
$form->error($locale->text('Cannot delete delivery order!'));
for my $i (1 .. $form->{rowcount}) {
# für bug 1284
- if ($form->{discount}){ # Falls wir einen Kundenrabatt haben
+ if ($form->{discount}){ # Falls wir einen Kundenrabatt haben
# und keinen anderen discount wert an $i ...
$form->{"discount_$i"} ||= $form->{discount}*100; # ... nehmen wir den kundenrabatt
}
- map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice basefactor);
+ map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if $form->{"${_}_${i}"} } qw(ship qty sellprice listprice lastcost basefactor);
}
$form->{type} = "invoice";
$form->{"deliverydate_$i"} = $form->{"reqdate_$i"}
unless $form->{"deliverydate_$i"};
+
$form->{"sellprice_$i"} =
$form->format_amount(\%myconfig, $form->{"sellprice_$i"},
$decimalplaces);
+ $form->{"lastcost_$i"} =
+ $form->format_amount(\%myconfig, $form->{"lastcost_$i"},
+ $decimalplaces);
+
(my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
$dec_qty = length $dec_qty;
$form->{"qty_$i"} =
$form->{print_and_save} = 1;
- $print_post = 1;
-
my $saved_form = save_form();
save();
update();
$main::lxdebug->leave_sub();
- exit 0;
+ ::end_of_request();
}
}
update();
$main::lxdebug->leave_sub();
- exit 0;
+ ::end_of_request();
}
}