|);
@@ -265,7 +290,9 @@ sub print_license_form {
sub add {
$lxdebug->enter_sub();
if (!$lizenzen) {
- $form->error($locale->text('The licensing module has been deactivated in lx-erp.conf.'));
+ $form->error(
+ $locale->text('The licensing module has been deactivated in lx-erp.conf.')
+ );
}
$form->{"initial"} = 1;
@@ -295,11 +322,11 @@ sub do_add {
if ($form->{"customer_name"}) {
LICENSES->get_customers(\%myconfig, $form);
- if (scalar(@{$form->{"all_customers"}}) == 1) {
- %c = %{$form->{"all_customers"}->[0]};
- $form->{"customer_id"} = $c{"id"};
+ if (scalar(@{ $form->{"all_customers"} }) == 1) {
+ %c = %{ $form->{"all_customers"}->[0] };
+ $form->{"customer_id"} = $c{"id"};
$form->{"customer_name"} = $c{"name"};
- } elsif (scalar(@{$form->{"all_customers"}}) == 0) {
+ } elsif (scalar(@{ $form->{"all_customers"} }) == 0) {
$form->{"customer_name"} = "";
delete($form->{"customer_id"});
} else {
@@ -314,13 +341,13 @@ sub do_add {
$form->{"sort"} = "p.partnumber";
$form->{searchitems} = "part";
IC->all_parts(\%myconfig, $form);
- if (scalar(@{$form->{"parts"}}) == 1) {
+ if (scalar(@{ $form->{"parts"} }) == 1) {
map({ $form->{$_} = $form->{"parts"}->[0]->{$_}; }
("partnumber", "description"));
$form->{"parts_id"} = $form->{"parts"}->[0]->{"id"};
- } elsif (scalar(@{$form->{"parts"}}) == 0) {
- map({ $form->{$_} = ""; } ("partnumber", "description", "parts_id"));
+ } elsif (scalar(@{ $form->{"parts"} }) == 0) {
+ map({ $form->{$_} = ""; }("partnumber", "description", "parts_id"));
} else {
print_part_selection();
@@ -352,23 +379,27 @@ sub continue {
sub save {
$lxdebug->enter_sub();
-
- ($form->{customername}, $form->{customer_id}) = split /--/, $form->{customer};
+
+ ($form->{customername}, $form->{customer_id}) = split /--/,
+ $form->{customer};
$form->isblank("customer", $locale->text('Customer missing!'));
-
- if ($form->{quantity} eq "" || $form->{quantity} !~ /^[0-9]*$/ || $form->{quantity} < 1) {
+
+ if ( $form->{quantity} eq ""
+ || $form->{quantity} !~ /^[0-9]*$/
+ || $form->{quantity} < 1) {
$form->error($locale->text('Please enter a number of licenses.'));
}
if (!$form->{licensenumber} || $form->{licensenumber} eq "") {
$form->error($locale->text('Please enter a license key.'));
}
-
+
$rc = LICENSES->save_license(\%myconfig, \%$form);
- # load previous variables
+ # load previous variables
if ($form->{previousform}) {
+
# save the new form variables before splitting previousform
map { $newform{$_} = $form->{$_} } keys %$form;
@@ -383,32 +414,33 @@ sub save {
$value =~ s/%26/&/g;
$form->{$key} = $value;
}
-
- $form->{"lizenzen_$form->{row}"} = "