|;
@@ -2699,9 +2715,12 @@ sub update {
sub save {
$lxdebug->enter_sub();
- # check if there is a part number
+ # check if there is a part number - commented out, cause there is an automatic allocation of numbers
# $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Part Number missing!"));
+ # check if there is a description
+ $form->isblank("description", $locale->text("Part Description missing!"));
+
if ($form->{obsolete}) {
$form->error(
$locale->text(
@@ -2718,7 +2737,8 @@ sub save {
# $locale->text('Assembly Number missing!')
# save part
- $lxdebug->message(LXDebug::DEBUG1, "ic.pl: sellprice in save = $form->{sellprice}\n");
+ $lxdebug->message(LXDebug::DEBUG1,
+ "ic.pl: sellprice in save = $form->{sellprice}\n");
$rc = IC->save(\%myconfig, \%$form);
if ($rc == 3) {
$form->error($locale->text('Partnumber not unique!'));
@@ -2776,7 +2796,9 @@ sub save {
if ($form->{exchangerate} != 0) {
$form->{"sellprice_$i"} /= $form->{exchangerate};
}
- $lxdebug->message(LXDebug::DEBUG1, qq|sellprice_$i in previousform 2 = |.$form->{"sellprice_$i"}.qq|\n|);
+ $lxdebug->message(LXDebug::DEBUG1,
+ qq|sellprice_$i in previousform 2 = |
+ . $form->{"sellprice_$i"} . qq|\n|);
map { $form->{"taxaccounts_$i"} .= "$_ " } split / /,
$newform{taxaccount};
chop $form->{"taxaccounts_$i"};
@@ -2797,10 +2819,12 @@ sub save {
$form->{creditremaining} -= $amount;
- # redo number formatting, because invoice parse them!
- $i = $form->{rowcount};
- map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}) }
- qw(weight listprice sellprice rop);
+ # redo number formatting, because invoice parse them!
+ $i = $form->{rowcount};
+ map {
+ $form->{"${_}_$i"} =
+ $form->format_amount(\%myconfig, $form->{"${_}_$i"})
+ } qw(weight listprice sellprice rop);
}
$form->{"id_$i"} = $parts_id;
@@ -2822,7 +2846,10 @@ sub save {
}
$form->{callback} = $callback;
}
- $lxdebug->message(LXDebug::DEBUG1, qq|ic.pl: sellprice_$i nach sub save = |.$form->{"sellprice_$i"}.qq|\n|);
+ $lxdebug->message(LXDebug::DEBUG1,
+ qq|ic.pl: sellprice_$i nach sub save = |
+ . $form->{"sellprice_$i"} . qq|\n|);
+
# redirect
$form->redirect;
@@ -3042,7 +3069,7 @@ sub price_row {
for $i (1 .. $numrows) {
print qq|