my $rc = $dbh->commit;
$dbh->disconnect;
+ $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
+ "quonumber" : "ordnumber"};
+
Common::webdav_folder($form) if ($main::webdav);
$main::lxdebug->leave_sub();
$ref = $sth->fetchrow_hashref(NAME_lc);
map { $form->{$_} = $ref->{$_} } keys %$ref;
-
+ $form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
+ "quonumber" : "ordnumber"};
# set all entries for multiple ids blank that yield different information
while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
|;
}
+ $form->hide_form("saved_xyznumber");
+
print qq|
<input type=hidden name=rowcount value=$form->{rowcount}>
$form->{saveasnew} = 1;
$form->{closed} = 0;
- map { delete $form->{$_} } qw(printed emailed queued ordnumber quonumber);
+ map { delete $form->{$_} } qw(printed emailed queued);
+
+ # Let Lx-Office assign a new order number if the user hasn't changed the
+ # previous one. If it has been changed manually then use it as-is.
+ my $idx = $form->{type} =~ /_quotation$/ ? "quonumber" : "ordnumber";
+ if ($form->{saved_xyznumber} &&
+ ($form->{saved_xyznumber} eq $form->{$idx})) {
+ delete($form->{$idx});
+ }
&save;