["customer_vendor_edit", $locale->text("Create and edit customers and vendors")],
["part_service_assembly_edit", $locale->text("Create and edit parts, services, assemblies")],
["project_edit", $locale->text("Create and edit projects")],
- ["license_edit", $locale->text("Manage license keys")],
["--ar", $locale->text("AR")],
["sales_quotation_edit", $locale->text("Create and edit sales quotations")],
["sales_order_edit", $locale->text("Create and edit sales orders")],
use SL::DB::Invoice;
use SL::DB::InvoiceItem;
use SL::DB::Language;
-use SL::DB::License;
-use SL::DB::LicenseInvoice;
use SL::DB::MakeModel;
use SL::DB::Note;
use SL::DB::Order;
inventory => 'inventory',
invoice => 'invoice_item',
language => 'language',
- license => 'license',
- licenseinvoice => 'license_invoice',
makemodel => 'make_model',
notes => 'note',
orderitems => 'order_item',
+++ /dev/null
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
-package SL::DB::License;
-
-use strict;
-
-use SL::DB::MetaSetup::License;
-
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
-
-1;
+++ /dev/null
-# This file has been auto-generated only because it didn't exist.
-# Feel free to modify it at will; it will not be overwritten automatically.
-
-package SL::DB::LicenseInvoice;
-
-use strict;
-
-use SL::DB::MetaSetup::LicenseInvoice;
-
-# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all.
-__PACKAGE__->meta->make_manager_class;
-
-1;
+++ /dev/null
-# This file has been auto-generated. Do not modify it; it will be overwritten
-# by rose_auto_create_model.pl automatically.
-package SL::DB::Licemse;
-
-use strict;
-
-use base qw(SL::DB::Object);
-
-__PACKAGE__->meta->setup(
- table => 'license',
-
- columns => [
- id => { type => 'integer', not_null => 1, sequence => 'id' },
- parts_id => { type => 'integer' },
- customer_id => { type => 'integer' },
- comment => { type => 'text' },
- validuntil => { type => 'date' },
- issuedate => { type => 'date', default => 'now' },
- quantity => { type => 'integer' },
- licensenumber => { type => 'text' },
- ],
-
- primary_key_columns => [ 'id' ],
-);
-
-1;
-;
+++ /dev/null
-# This file has been auto-generated. Do not modify it; it will be overwritten
-# by rose_auto_create_model.pl automatically.
-package SL::DB::License;
-
-use strict;
-
-use base qw(SL::DB::Object);
-
-__PACKAGE__->meta->setup(
- table => 'license',
-
- columns => [
- id => { type => 'integer', not_null => 1, sequence => 'id' },
- parts_id => { type => 'integer' },
- customer_id => { type => 'integer' },
- comment => { type => 'text' },
- validuntil => { type => 'date' },
- issuedate => { type => 'date', default => 'now' },
- quantity => { type => 'integer' },
- licensenumber => { type => 'text' },
- ],
-
- primary_key_columns => [ 'id' ],
-);
-
-1;
-;
+++ /dev/null
-# This file has been auto-generated. Do not modify it; it will be overwritten
-# by rose_auto_create_model.pl automatically.
-package SL::DB::LicenseInvoice;
-
-use strict;
-
-use base qw(SL::DB::Object);
-
-__PACKAGE__->meta->setup(
- table => 'licenseinvoice',
-
- columns => [
- trans_id => { type => 'integer' },
- license_id => { type => 'integer' },
- id => { type => 'serial', not_null => 1 },
- ],
-
- primary_key_columns => [ 'id' ],
-);
-
-1;
-;
$additional_params->{"conf_dbcharset"} = $::lx_office_conf{system}->{dbcharset};
$additional_params->{"conf_webdav"} = $::lx_office_conf{features}->{webdav};
- $additional_params->{"conf_lizenzen"} = $::lx_office_conf{features}->{lizenzen};
$additional_params->{"conf_latex_templates"} = $::lx_office_conf{print_templates}->{latex};
$additional_params->{"conf_opendocument_templates"} = $::lx_office_conf{print_templates}->{opendocument};
$additional_params->{"conf_vertreter"} = $::lx_office_conf{features}->{vertreter};
my %columns = ( "assembly" => "id", "parts" => "id" );
- for my $table (qw(prices partstax makemodel inventory assembly license translation parts)) {
+ for my $table (qw(prices partstax makemodel inventory assembly translation parts)) {
my $column = defined($columns{$table}) ? $columns{$table} : "parts_id";
do_query($form, $dbh, qq|DELETE FROM $table WHERE $column = ?|, @values);
}
my @arrays =
qw(runningnumber number description longdescription qty ship unit bin
- deliverydate_oe ordnumber_oe transdate_oe licensenumber validuntil
+ deliverydate_oe ordnumber_oe transdate_oe validuntil
partnotes serialnumber reqdate sellprice listprice netprice
discount p_discount discount_sub nodiscount_sub
linetotal nodiscount_linetotal tax_rate projectnumber projectdescription
push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description};
push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} }, $form->{"partsgroup_$i"};
push @{ $form->{TEMPLATE_ARRAYS}->{reqdate} }, $form->{"reqdate_$i"};
-
- if ($form->{lizenzen}) {
- if ($form->{"licensenumber_$i"}) {
- $query = qq|SELECT licensenumber, validuntil FROM license WHERE id = ?|;
- my ($licensenumber, $validuntil) = selectrow_query($form, $dbh, $query, conv_i($form->{"licensenumber_$i"}));
- push(@{ $form->{TEMPLATE_ARRAYS}->{licensenumber} }, $licensenumber);
- push(@{ $form->{TEMPLATE_ARRAYS}->{validuntil} }, $locale->date($myconfig, $validuntil, 0));
-
- } else {
- push(@{ $form->{TEMPLATE_ARRAYS}->{licensenumber} }, "");
- push(@{ $form->{TEMPLATE_ARRAYS}->{validuntil} }, "");
- }
- }
-
- # listprice
- push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"});
+ push(@{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->{"listprice_$i"});
my $sellprice = $form->parse_amount($myconfig, $form->{"sellprice_$i"});
my ($dec) = ($sellprice =~ /\.(\d+)/);
conv_i($form->{"marge_price_factor_$i"}));
do_query($form, $dbh, $query, @values);
- if ($form->{lizenzen} && $form->{"licensenumber_$i"}) {
- $query =
- qq|INSERT INTO licenseinvoice (trans_id, license_id)
- VALUES ((SELECT id FROM invoice WHERE trans_id = ? ORDER BY oid DESC LIMIT 1), ?)|;
- @values = (conv_i($form->{"id"}), conv_i($form->{"licensenumber_$i"}));
- do_query($form, $dbh, $query, @values);
- }
-
CVar->save_custom_variables(module => 'IC',
sub_module => 'invoice',
trans_id => $invoice_id,
my @values = (conv_i($form->{id}));
do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE trans_id = ?|, @values);
do_query($form, $dbh, qq|DELETE FROM invoice WHERE trans_id = ?|, @values);
-
- if ($form->{lizenzen}) {
- $query =
- qq|DELETE FROM licenseinvoice
- WHERE trans_id in (SELECT id FROM invoice WHERE trans_id = ?)|;
- do_query($form, $dbh, $query, @values);
- }
-
do_query($form, $dbh, qq|DELETE FROM shipto WHERE (trans_id = ?) AND (module = 'AR')|, @values);
$main::lxdebug->leave_sub();
}
- if ($form->{lizenzen}) {
- $query = qq|SELECT l.licensenumber, l.id AS licenseid FROM license l, licenseinvoice li WHERE l.id = li.license_id AND li.trans_id = ?|;
- my ($licensenumber, $licenseid) = selectrow_query($form, $dbh, $query, conv_i($ref->{invoice_pos}));
- $ref->{lizenzen} = "<option value=\"$licenseid\">$licensenumber</option>";
- }
-
$ref->{qty} *= -1 if $form->{type} eq "credit_note";
chop $ref->{taxaccounts};
$ref->{onhand} *= 1;
push @{ $form->{item_list} }, $ref;
-
- if ($form->{lizenzen}) {
- if ($ref->{inventory_accno} > 0) {
- $query =
- qq|SELECT l.*
- FROM license l
- WHERE l.parts_id = ? AND NOT l.id IN (SELECT li.license_id FROM licenseinvoice li)|;
- my $stw = prepare_execute_query($form, $dbh, $query, conv_i($ref->{id}));
- while (my $ptr = $stw->fetchrow_hashref('NAME_lc')) {
- push @{ $form->{LIZENZEN}{ $ref->{id} } }, $ptr;
- }
- $stw->finish;
- }
- }
}
$sth->finish;
$_->[1]->finish for @translation_queries;
+++ /dev/null
-#=====================================================================
-# LX-Office ERP
-# Copyright (C) 2004
-# Based on SQL-Ledger Version 2.1.9
-# Web http://www.lx-office.org
-#
-#=====================================================================
-# SQL-Ledger Accounting
-# Copyright (c) 2002
-#
-# Author: Philip Reetz
-# Email: p.reetz@linet-services.de
-# Web: http://www.linet-services.de/
-#
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#======================================================================
-#
-# Software license module
-# Backend routines
-#======================================================================
-
-package LICENSES;
-
-use SL::Form;
-
-use strict;
-
-sub save_license {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- my $dbh = $form->dbconnect($myconfig);
-
- my $query =
- qq| INSERT INTO license (licensenumber) VALUES ('$form->{licensenumber}')|;
- my $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
- $sth->finish();
-
- $query =
- qq|SELECT l.id FROM license l WHERE l.licensenumber = '$form->{licensenumber}'|;
- $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
- my ($license_id) = $sth->fetchrow_array;
- $sth->finish();
-
- # save license
- $query = qq|UPDATE license SET
- validuntil = '$form->{validuntil}',
- licensenumber = '$form->{licensenumber}',
- parts_id = $form->{parts_id},
- customer_id = $form->{customer_id},
- comment = '$form->{comment}',
- quantity = $form->{quantity}
- WHERE id=$license_id|;
- $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
- $sth->finish();
-
- $dbh->disconnect();
-
- $main::lxdebug->leave_sub();
-
- return $license_id;
-}
-
-sub get_customers {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
-
- my $ref;
- my $dbh = $form->dbconnect($myconfig);
-
- my $f = $dbh->quote('%' . $form->{"customer_name"} . '%');
- my $query = qq|SELECT * FROM customer WHERE name ilike $f|;
- my $sth = $dbh->prepare($query);
- $sth->execute || $form->dberror($query);
- $form->{"all_customers"} = [];
- while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
- push(@{ $form->{"all_customers"} }, $ref);
- }
- $sth->finish();
- $dbh->disconnect();
- $main::lxdebug->leave_sub();
-}
-
-sub search {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
- my ($ref, $sth, $f, $s, $query);
- my $dbh = $form->dbconnect($myconfig);
-
- if ($form->{"partnumber"} || $form->{"description"}) {
- $f = "(parts_id IN (SELECT id FROM parts WHERE ";
- if ($form->{"partnumber"}) {
- $f .=
- "(partnumber ILIKE "
- . $dbh->quote('%' . $form->{"partnumber"} . '%') . ")";
- }
- if ($form->{"description"}) {
- $f .= " AND " if ($form->{"partnumber"});
- $f .=
- "(description ILIKE "
- . $dbh->quote('%' . $form->{"description"} . '%') . ")";
- }
- $f .= "))";
- }
-
- if ($form->{"customer_name"}) {
- $f .= " AND " if ($f);
- $f .=
- "(l.customer_id IN (SELECT id FROM customer WHERE name ILIKE "
- . $dbh->quote('%' . $form->{"customer_name"} . '%') . "))";
- }
-
- if (!$form->{"all"} && $form->{"expiring_in"}) {
- $f .= " AND " if ($f);
- $f .=
- "(validuntil < now() + "
- . $dbh->quote("" . $form->{"expiring_in"} . " months") . ")";
- }
-
- if (!$form->{"show_expired"}) {
- $f .= " AND " if ($f);
- $f .= "(validuntil >= now())";
- }
-
- if ($f) {
- $f = "WHERE (inventory_accno_id notnull) AND $f";
- } else {
- $f = "WHERE (inventory_accno_id notnull)";
- }
-
- if ($form->{"sortby"} eq "partnumber") {
- $s = "p.partnumber";
- } elsif ($form->{"sortby"} eq "description") {
- $s = "p.description";
- } elsif ($form->{"sortby"} eq "name") {
- $s = "c.name";
- } elsif ($form->{"sortby"} eq "validuntil") {
- $s = "l.validuntil";
- } else {
- $s = "l.validuntil";
- }
- if ($form->{"sortasc"}) {
- $s .= " ASC";
- } else {
- $s .= " DESC";
- }
-
- $query =
- "SELECT l.*, p.partnumber, p.description, c.name, a.invnumber "
- . "FROM license l "
- . "LEFT JOIN parts p ON (p.id = l.parts_id) "
- . "LEFT JOIN customer c ON (c.id = l.customer_id) "
- . "LEFT JOIN ar a ON "
- . "(a.id = (SELECT i.trans_id FROM invoice i WHERE i.id = "
- . "(SELECT li.trans_id FROM licenseinvoice li WHERE li.license_id = l.id))) "
- . "$f ORDER BY $s";
-
- $sth = $dbh->prepare($query);
- $sth->execute() || $form->dberror($query);
- $form->{"licenses"} = [];
- while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
- push(@{ $form->{"licenses"} }, $ref);
- }
-
- $sth->finish();
- $dbh->disconnect();
- $main::lxdebug->leave_sub();
-}
-
-sub get_license {
- $main::lxdebug->enter_sub();
-
- my ($self, $myconfig, $form) = @_;
- my ($ref, $sth, $query);
- my $dbh = $form->dbconnect($myconfig);
-
- $query =
- "SELECT l.*, p.partnumber, p.description, c.name, c.street, "
- . "c.zipcode, c.city, c.country, c.contact, c.phone, c.fax, c.homepage, "
- . "c.email, c.notes, c.customernumber, c.language, a.invnumber "
- . "FROM license l "
- . "LEFT JOIN parts p ON (p.id = l.parts_id) "
- . "LEFT JOIN customer c ON (c.id = l.customer_id) "
- . "LEFT JOIN ar a ON "
- . "(a.id = (SELECT i.trans_id FROM invoice i WHERE i.id = "
- . "(SELECT li.trans_id FROM licenseinvoice li WHERE li.license_id = l.id))) "
- . "LEFT JOIN invoice i ON "
- . "(i.id = "
- . "(SELECT li.trans_id FROM licenseinvoice li WHERE li.license_id = l.id)) "
- . "WHERE l.id = "
- . $form->{"id"};
- $sth = $dbh->prepare($query);
- $sth->execute() || $form->dberror($query);
- $form->{"license"} = $sth->fetchrow_hashref("NAME_lc");
- $sth->finish();
- $dbh->disconnect();
- $main::lxdebug->leave_sub();
-}
-
-1;
{ id => 'qty', width => 5, value => $locale->text('Qty'), display => 1, },
{ id => 'price_factor', width => 5, value => $locale->text('Price Factor'), display => !$is_delivery_order, },
{ id => 'unit', width => 5, value => $locale->text('Unit'), display => 1, },
- { id => 'license', width => 10, value => $locale->text('License'), display => 0, },
{ id => 'serialnr', width => 10, value => $locale->text('Serial No.'), display => 0, },
{ id => 'projectnr', width => 10, value => $locale->text('Project'), display => 0, },
{ id => 'sellprice', width => 15, value => $locale->text('Price'), display => !$is_delivery_order, },
partsgroup formel longdescription not_discountable partnotes lastcost
price_factor_id price_factor);
- push @new_fields, 'lizenzen' if $::lx_office_conf{features}->{lizenzen};
-
my $ic_cvar_configs = CVar->get_configs(module => 'IC');
push @new_fields, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
$main::lxdebug->leave_sub();
}
-sub new_license {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
-
- _check_io_auth();
-
- my $row = shift;
-
- # change callback
- $form->{old_callback} = $form->escape($form->{callback}, 1);
- $form->{callback} = $form->escape("$form->{script}?action=display_form", 1);
- $form->{old_callback} = $form->escape($form->{old_callback}, 1);
-
- # delete action
- delete $form->{action};
- my $customer = $form->{customer};
- map { $form->{"old_$_"} = $form->{"${_}_$row"} } qw(partnumber description);
-
- # save all other form variables in a previousform variable
- $form->{row} = $row;
- my $previousform;
- foreach my $key (keys %$form) {
- next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
-
- # escape ampersands
- $form->{$key} =~ s/&/%26/g;
- $previousform .= qq|$key=$form->{$key}&|;
- }
- chop $previousform;
- $previousform = $form->escape($previousform, 1);
-
- $form->{script} = "licenses.pl";
-
- map { $form->{$_} = $form->{"old_$_"} } qw(partnumber description);
- map { $form->{$_} = $form->escape($form->{$_}, 1) }
- qw(partnumber description);
- $form->{callback} =
- qq|$form->{script}?action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$form->{name}&type=$form->{type}&customer=$customer&partnumber=$form->{partnumber}&description=$form->{description}&previousform="$previousform"&initial=1|;
- $form->redirect;
-
- $main::lxdebug->leave_sub();
-}
-
sub relink_accounts {
$main::lxdebug->enter_sub();
# create links
$form->{webdav} = $::lx_office_conf{features}->{webdav};
- $form->{lizenzen} = $::lx_office_conf{features}->{lizenzen};
$form->create_links("AR", \%myconfig, "customer");
$form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
- if ($::lx_office_conf{features}->{lizenzen}) {
- if ($form->{"inventory_accno_$i"} ne "") {
- $form->{"lizenzen_$i"} = qq|<option></option>|;
- foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) {
- $form->{"lizenzen_$i"} .= qq|<option value="$item->{"id"}">$item->{"licensenumber"}</option>|;
- }
- $form->{"lizenzen_$i"} .= qq|<option value=-1>Neue Lizenz</option>|;
- }
- }
-
# get pricegroups for parts
IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+++ /dev/null
-#=====================================================================
-# LX-Office ERP
-# Copyright (C) 2004
-# Based on SQL-Ledger Version 2.1.9
-# Web http://www.lx-office.org
-#
-#=====================================================================
-# SQL-Ledger Accounting
-# Copyright (c) 2002
-#
-# Author: Moritz Bunkus
-# Email: m.bunkus@linet-services.de
-# Web: http://www.linet-services.de/
-#
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#======================================================================
-#
-# Software license module
-#
-#======================================================================
-
-use SL::IC;
-use SL::IS;
-use SL::LICENSES;
-
-require "bin/mozilla/common.pl";
-
-use strict;
-
-sub quot {
- $main::lxdebug->enter_sub();
- $_[0] =~ s/\"/\"/g;
- $main::lxdebug->leave_sub();
- return $_[0];
-}
-
-sub form_header {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
-
- $form->{jsscript} = 1;
- $form->header();
-
- print(
- qq|<body>
-
-<form method=post action=$form->{script}>|);
- $main::lxdebug->leave_sub();
-}
-
-sub form_footer {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
-
- my @items = qw(old_callback previousform);
- push @items, @{ $form->{"hidden"} } if ref $form->{hidden} eq 'ARRAY';
- map({
- print("<input type=hidden name=$_ value=\"" . quot($form->{$_}) . "\">\n"
- );
- } @items);
-
- print(
- qq|<input type="hidden" name="cursor_field" value='$form->{cursor_field}'></form>
-</body>
-</html>
-|);
- $main::lxdebug->leave_sub();
-}
-
-sub set_std_hidden {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
-
- $form->{"hidden"} = ["comment", "validuntil", "quantity", @_];
- $main::lxdebug->leave_sub();
-}
-
-sub print_part_selection {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- form_header();
- set_std_hidden("business");
-
- print(
- qq|
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=5>|
- . $locale->text('Select from one of the items below') . qq|</th>
- </tr>
- <tr height="5"></tr>
- <tr class=listheading>
- <th> </th>
- <th class=listheading>| . $locale->text('Part Number') . qq|</th>
- <th class=listheading>| . $locale->text('Description') . qq|</th>
- </tr>
- |);
-
- my $j = 1;
- for (my $i = 1; $i <= scalar(@{ $form->{"parts"} }); $i++) {
- my %p = %{ $form->{"parts"}->[$i - 1] };
- my $checked;
- if ($i == 1) {
- $checked = "checked";
- } else {
- $checked = "";
- }
-
- print(
- qq|<tr class=listrow$j>
- <td><input name=ndx class=radio type=radio value=$i $checked></td>
- <td><input name=\"new_partnumber_$i\" type=hidden value=\"|
- . $p{"partnumber"} . qq|\">| . $p{"partnumber"} . qq|</td>
- <td><input name=\"new_description_$i\" type=hidden value=\"|
- . $p{"description"} . qq|\">| . $p{"description"} . qq|</td>
- <input name=\"new_parts_id_$i\" type=hidden value=\"| . $p{"id"} . qq|\">
- </tr>|);
-
- $j = ($j + 1) % 2;
- }
-
- print(
- qq|<tr><td colspan=3><hr size=3 noshade></td></tr>
-</table>
-
-<input type=hidden name=nextsub value=\"do_add\">
-<input type=submit name=action value=| . $locale->text('Continue') . qq|>|);
-
- form_footer();
- $main::lxdebug->leave_sub();
-}
-
-sub print_customer_selection {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- form_header();
- set_std_hidden("parts_id", "partnumber", "description");
-
- print(
- qq|
-<table width=100%>
- <tr>
- <th class=listtop colspan=5>|
- . $locale->text('Select from one of the names below') . qq|</th>
- </tr>
- <tr height="5"></tr>
- <tr class=listheading>
- <th> </th>
- <th class=listheading>| . $locale->text('Customer Number') . qq|</th>
- <th class=listheading>| . $locale->text('Company Name') . qq|</th>
- <th class=listheading>| . $locale->text('Street') . qq|</th>
- <th class=listheading>| . $locale->text('Zipcode') . qq|</th>
- <th class=listheading>| . $locale->text('City') . qq|</th>
- </tr>
- |);
-
- print(qq|<tr><td colspan=6><hr size=3 noshade></td></tr>|);
-
- my $j = 1;
- for (my $i = 1; $i <= scalar(@{ $form->{"all_customers"} }); $i++) {
- my %c = %{ $form->{"all_customers"}->[$i - 1] };
- my $checked;
- if ($i == 1) {
- $checked = "checked";
- } else {
- $checked = "";
- }
-
- print(
- qq|<tr class=listrow$j>
- <td><input name=ndx class=radio type=radio value=$i $checked></td>
- <td><input name=\"new_customer_id_$i\" type=hidden value=\"|
- . $c{"id"} . qq|\">$c{"customernumber"}</td>
- <td><input name=\"new_customer_name_$i\" type=hidden value=\"|
- . $c{"name"} . qq|\">$c{"name"}</td>
- <td>$c{"street"}</td>
- <td>$c{"zipcode"}</td>
- <td>$c{"city"}</td>
- </tr>|);
-
- $j = ($j + 1) % 2;
- }
-
- print(
- qq|
-</table>
-
-<input type=hidden name=nextsub value=\"do_add\">
-<input type=submit name=action value=| . $locale->text('Continue') . qq|>|);
-
- form_footer();
- $main::lxdebug->leave_sub();
-}
-
-sub print_license_form {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- print(
- qq|
-<table width=100%>
- <tr>
- <th class=listtop>| . $locale->text("Add License") . qq|</th>
- </tr>
- <tr>
- <table>
- <tr>
- <th align=right>| . $locale->text('Part Number') . qq|</th>
- <td><input name=partnumber value=\"|
- . quot($form->{"partnumber"}) . qq|\"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Description') . qq|</th>
- <td><input name=description value=\"|
- . quot($form->{"description"}) . qq|\"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Company Name') . qq|</th>|);
- if ($form->{"all_customer"}) {
- print(qq|<td><select name=\"customer\">|);
- foreach (@{ $form->{"all_customer"} }) {
- if (!defined($form->{"customer_id"})) {
- $form->{"customer_id"} = $_->{"id"};
- }
- my $selected = ($_->{"id"} * 1) == $form->{"customer_id"} ? "selected" : "";
- print(qq|<option $selected> $_->{"name"}--$_->{"id"}</option>|);
- }
- print(qq|</select></td>|);
- } else {
- print( qq|<td><input name=customer_name value=\"|
- . quot($form->{"customer_name"})
- . qq|\"></td>|);
- }
- print(
- qq|</tr>
- <tr>
- <th align=right>| . $locale->text('Comment') . qq|</th>
- <td><input name=comment value=\"|
- . quot($form->{"comment"}) . qq|\"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Valid until') . qq|</th>
- <td><input id=validuntil name=validuntil value=\"|
- . quot($form->{"validuntil"}) . qq|\">
- <input type="button" name="validuntil" id="trigger_validuntil" value="?"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Quantity') . qq|</th>
- <td><input name=quantity value=\"|
- . quot($form->{"quantity"}) . qq|\"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('License key') . qq|</th>
- <td><input name=licensenumber value=\"|
- . quot($form->{"licensenumber"}) . qq|\"></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Own Product') . qq|</th>
- <td><input type=checkbox name=own_product value=1 checked></td>
- </tr>
- </table>
-
- <input type=submit name=action value=\"| . $locale->text('Update') . qq|\">
- |);
-
- if ($_[0]) {
- print(
- qq|
- <input type=submit name=action value=\"|
- . $locale->text('Save') . qq|\">\n|);
- }
- print(
- qq|
- </tr>
-
-</table>| .
- $form->write_trigger(\%myconfig, 1, "validuntil", "BL",
- "trigger_validuntil"));
-
- $main::lxdebug->leave_sub();
-}
-
-sub add {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $form->{title} = $locale->text('Add License');
-
- if (!$::lx_office_conf{features}->{lizenzen}) {
- $form->error(
- $locale->text(
- 'The licensing module has been deactivated in the configuration.')
- );
- }
-
- $form->{"initial"} = 1;
-
- do_add();
- $main::lxdebug->leave_sub();
-}
-
-sub do_add {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- $form->{"hidden"} = ["parts_id"];
- form_header();
-
- if ($form->{"ndx"}) {
- my $ndx = $form->{"ndx"};
- foreach (keys(%{$form})) {
- next unless (/^new_.*_${ndx}$/);
- s/^new_//;
- s/_${ndx}$//;
- $form->{$_} = $form->{"new_${_}_${ndx}"};
- }
- }
-
- if ($form->{"customer"}) {
- $form->{"customer_id"} = (split(/--/, $form->{"customer"}))[1];
- }
-
- if ($form->{"customer_name"}) {
- LICENSES->get_customers(\%myconfig, $form);
- if (scalar(@{ $form->{"all_customers"} }) == 1) {
- my %c = %{ $form->{"all_customers"}->[0] };
- $form->{"customer_id"} = $c{"id"};
- $form->{"customer_name"} = $c{"name"};
- } elsif (scalar(@{ $form->{"all_customers"} }) == 0) {
- $form->{"customer_name"} = "";
- delete($form->{"customer_id"});
- } else {
- print_customer_selection();
- return;
- }
- } elsif (defined($form->{"customer_name"})) {
- delete($form->{"customer_id"});
- }
-
- if ($form->{"partnumber"} || $form->{"description"}) {
- $form->{"sort"} = "p.partnumber";
- $form->{searchitems} = "part";
- IC->all_parts(\%myconfig, $form);
- 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"));
-
- } else {
- print_part_selection();
- return;
- }
- } else {
- delete($form->{"parts_id"});
- }
-
- $form->all_vc(\%myconfig, "customer", "");
-
- print_license_form($form->{"parts_id"} && $form->{"customer_id"});
-
- form_footer();
- $main::lxdebug->leave_sub();
-}
-
-sub update {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
-
- do_add();
-
- $main::lxdebug->leave_sub();
-}
-
-sub continue {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
-
- call_sub($form->{"nextsub"});
- $main::lxdebug->leave_sub();
-}
-
-sub save {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- ($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) {
- $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.'));
- }
-
- my $rc = LICENSES->save_license(\%myconfig, \%$form);
-
- # load previous variables
- if ($form->{previousform}) {
-
- # save the new form variables before splitting previousform
- my %newform;
- map { $newform{$_} = $form->{$_} } keys %$form;
-
- my $previousform = $form->unescape($form->{previousform});
-
- # don't trample on previous variables
- map { delete $form->{$_} } keys %newform;
-
- # now take it apart and restore original values
- foreach my $item (split /&/, $previousform) {
- my ($key, $value) = split /=/, $item, 2;
- $value =~ s/%26/&/g;
- $form->{$key} = $value;
- }
-
- $form->{"lizenzen_$form->{row}"} =
- "<option value=$rc>$newform{licensenumber}</option>";
- $form->{rowcount}--;
-
- delete $form->{action};
-
- # restore original callback
- my $callback = $form->unescape($form->{callback});
- $form->{callback} = $form->unescape($form->{old_callback});
- delete $form->{old_callback};
-
- # put callback together
- foreach my $key (keys %$form) {
- next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
-
- # do single escape for Apache 2.0
- my $value = $form->escape($form->{$key}, 1);
- $callback .= qq|&$key=$value|;
- }
- $form->{callback} = $callback;
-
- # redirect
- $form->redirect;
-
- } else {
- form_header();
-
- print("Die Lizenz wurde gespeichert.\n");
- form_footer();
- }
-
- $main::lxdebug->leave_sub();
-}
-
-sub search {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $form->{title} = $locale->text('Licenses');
-
- if (!$::lx_office_conf{features}->{lizenzen}) {
- $form->error(
- $locale->text(
- 'The licensing module has been deactivated in the configuration.')
- );
- }
-
- form_header();
-
- print(
- qq|
-<table width=100%>
- <tr>
- <th class=listtop>| . $locale->text("Licenses") . qq|</th>
- </tr>
- <tr>
- <table>
- <tr>
- <th align=right>| . $locale->text('Part Number') . qq|</th>
- <td><input name=partnumber></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Description') . qq|</th>
- <td><input name=description></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Company Name') . qq|</th>
- <td><input name=customer_name></td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Include in Report') . qq|</th>
- <td><input type=radio name=all value=1 checked>|
- . $locale->text('All')
- . qq| <input type=radio name=all value=0>|
- . $locale->text('Expiring in x month(s)')
- . qq| <input size=4 name=expiring_in value="1"><br>
- <input type=checkbox name=show_expired value=1>|
- . $locale->text('Expired licenses') . qq|</td>
- </tr>
- </table>
- </tr>
- <tr><td colspan=4><hr size=3 noshade></td></tr>
-</table>
-
-<input type=hidden name=nextsub value=\"do_search\">
-<input type=submit name=action value=\"| . $locale->text('Continue') . qq|\">
-
- |);
-
- form_footer();
- $main::lxdebug->leave_sub();
-}
-
-sub do_search {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- LICENSES->search(\%myconfig, $form);
-
- my $callback = "";
- map { $callback .= "\&${_}=" . $form->escape($form->{$_}, 1) }
- qw(db partnumber description customer_name all expiring_in show_expired);
- my $details = $form->{"script"} . "?action=details" . $callback . "\&id=";
- my $invdetails = "is.pl?action=edit" . $callback . "\&id=";
- $callback = $form->{"script"} . "?action=do_search" . $callback;
-
- $form->{"sortby"} = "validuntil" unless ($form->{"sortby"});
- $form->{"sortasc"} *= 1;
- my %columns;
- foreach (("partnumber", "description", "name", "validuntil", "invnumber")) {
- $columns{$_} = $callback . "\&sortby=${_}\&sortasc=";
- if ($form->{"sortby"} eq $_) {
- $columns{$_} .= (1 - $form->{"sortasc"});
- } else {
- $columns{$_} .= "1";
- }
- }
-
- form_header();
-
- print(
- qq|
-<table width=100%>
- <tr>
- <th class=listtop>| . $locale->text("Licenses") . qq|</th>
- </tr>
- |);
- if (scalar(@{ $form->{"licenses"} }) == 0) {
- print(qq|</table>|
- . $locale->text(
- "No licenses were found that match the search criteria.")
- . qq|</body></html>|);
- ::end_of_request();
- }
-
- print(
- qq|
- <tr>
- <table>
- <tr>
- <th class=listtop><a class=listheading href=\"|
- . $columns{"partnumber"} . "\">"
- . $locale->text('Part Number')
- . qq|</a></th>
- <th class=listtop><a class=listheading href=\"|
- . $columns{"description"} . "\">"
- . $locale->text('Description')
- . qq|</a></th>
- <th class=listtop><a class=listheading href=\"|
- . $columns{"name"} . "\">" . $locale->text('Company Name') . qq|</a></th>
- <th class=listtop><a class=listheading href=\"|
- . $columns{"validuntil"} . "\">"
- . $locale->text('Valid until')
- . qq|</a></th>
- <th class=listtop><a class=listheading href=\"|
- . $columns{"invnumber"} . "\">"
- . $locale->text('Invoice Number')
- . qq|</a></th>
- </tr>
- |);
-
- my $j = 1;
- for (my $i = 0; $i < scalar(@{ $form->{"licenses"} }); $i++) {
- my $ref = $form->{"licenses"}->[$i];
- print(
- qq|
- <tr class=listrow$j>
- <td><input type=hidden name=id_$i value=| . $ref->{"id"} . qq|
- <a href=\"${details}$ref->{"id"}\">$ref->{"partnumber"}</a></td>
- <td><a href=\"${details}$ref->{"id"}\">$ref->{"description"}</a></td>
- <td><a href=\"${details}$ref->{"id"}\">$ref->{"name"}</a></td>
- <td><a href=\"${details}$ref->{"id"}\">$ref->{"validuntil"}</a></td>
- <td align=right>|
- . (
- $ref->{"invnumber"}
- ? qq|<a href=\"${invdetails}$ref->{"invnumber"}\">$ref->{"invnumber"}</a>|
- : qq| |
- )
- . qq|</td>
- </tr>|);
- $j = ($j + 1) % 2;
- }
-
- $form->{"num_licenses"} = scalar(@{ $form->{"licenses"} });
- push(@{ $form->{"hidden"} }, "num_licenses");
-
- print(
- qq|
- </table>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<p>
-
-<input type=submit name=action value=\"| . $locale->text("Add") . qq|\">
- |);
-
- form_footer();
- $main::lxdebug->leave_sub();
-}
-
-sub details {
- $main::lxdebug->enter_sub();
-
- $main::auth->assert('license_edit');
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- LICENSES->get_license(\%myconfig, $form);
- map(
- { $form->{$_} = $form->{"license"}->{$_}; } keys(%{ $form->{"license"} }));
-
- form_header();
-
- print(
- qq|
-<table width=100%>
- <tr>
- <th class=listtop>| . $locale->text("View License") . qq|</th>
- </tr>
- <tr>
- <table>
- <tr>
- <th align=right>| . $locale->text('Part Number') . qq|</th>
- <td>$form->{"partnumber"}</td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Description') . qq|</th>
- <td>$form->{"description"}</td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Company Name') . qq|</th>
- <td>$form->{"name"}</td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Comment') . qq|</th>
- <td>$form->{"comment"}</td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Valid until') . qq|</th>
- <td>$form->{"validuntil"}</td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('Quantity') . qq|</th>
- <td>$form->{"quantity"}</td>
- </tr>
- <tr>
- <th align=right>| . $locale->text('License key') . qq|</th>
- <td>$form->{"licensenumber"}</td>
- </tr>
- </table>
- </tr>
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<input type=submit name=action value=\"| . $locale->text("Add") . qq|\">
- |);
-
- form_footer();
- $main::lxdebug->leave_sub();
-}
-
-1;
[features]
# Activate certain optional features and modules.
webdav = 0
-lizenzen = 1
vertreter = 0
# Show fields used for the best before date
'Expense/Asset' => 'Aufwand/Anlagen',
'Expenses EU with UStId' => 'Aufwand EU m. UStId',
'Expenses EU without UStId' => 'Aufwand EU o. UStId',
- 'Expired licenses' => 'Abgelaufene Lizenzen',
- 'Expiring in x month(s)' => 'Die in x Monat(en) ablaufen',
'Export Buchungsdaten' => 'Export Buchungsdaten',
'Export Stammdaten' => 'Export Stammdaten',
'Export as CSV' => 'Als CSV exportieren',
'Leave host and port field empty unless you want to make a remote connection.' => 'Für lokale Verbindungen "Rechner" und "Port" freilassen.',
'Left' => 'Links',
'Liability' => 'Passiva/Mittelherkunft',
- 'License' => 'Lizenz',
- 'License key' => 'Lizenzschlüssel',
'Licenses' => 'Lizenzen',
'Limit part selection' => 'Artikelauswahl eingrenzen',
'Line Total' => 'Zeilensumme',
'Make (with X being a number)' => 'Lieferant (X ist eine fortlaufende Zahl)',
'Make default profile' => 'Zu Standardprofil machen',
'Manage Custom Variables' => 'Benutzerdefinierte Variablen',
- 'Manage license keys' => 'Lizenzschlüssel verwalten',
'Mandantennummer' => 'Mandantennummer',
'Mandatory Departments' => 'Benutzer muss Abteilungen vergeben',
'Mar' => 'März',
'No file has been uploaded yet.' => 'Es wurde noch keine Datei hochgeladen.',
'No group has been selected, or the group does not exist anymore.' => 'Es wurde keine Gruppe ausgewählt, oder die Gruppe wurde in der Zwischenzeit gelöscht.',
'No groups have been added yet.' => 'Es wurden noch keine Gruppen angelegt.',
- 'No licenses were found that match the search criteria.' => 'Es wurden keine Lizenzen gefunden, auf die die Suchkriterien zutreffen.',
'No or an unknown authenticantion module specified in "config/lx_office.conf".' => 'Es wurde kein oder ein unbekanntes Authentifizierungsmodul in "config/lx_office.conf" angegeben.',
'No part was found matching the search parameters.' => 'Es wurde kein Artikel gefunden, auf den die Suchparameter zutreffen.',
'No payment term has been created yet.' => 'Es wurden noch keine Zahlungsbedingungen angelegt.',
'Output Number Format' => 'Zahlenformat (Ausgabe)',
'Outputformat' => 'Ausgabeformat',
'Overdue sales quotations and requests for quotations' => 'Überfällige Angebote und Preisanfragen',
- 'Own Product' => 'eigenes Produkt',
'PAYMENT POSTED' => 'Rechung gebucht',
'PDF' => 'PDF',
'PDF (OpenDocument/OASIS)' => 'PDF (OpenDocument/OASIS)',
'Please Check the bank information for each customer:' => 'Bitte überprüfen Sie die Bankinformationen der Kunden:',
'Please Check the bank information for each vendor:' => 'Bitte überprüfen Sie die Kontoinformationen der Lieferanten:',
'Please ask your administrator to create warehouses and bins.' => 'Bitten Sie Ihren Administrator, dass er Lager und Lagerplätze anlegt.',
- 'Please enter a license key.' => 'Bitte geben Sie einen Lizenzschlüssel an.',
- 'Please enter a number of licenses.' => 'Bitte geben Sie die Anzahl Lizenzschlüssel an.',
'Please enter a profile name.' => 'Bitte geben Sie einen Profilnamen an.',
'Please enter the login for the new user.' => 'Bitte geben Sie das Login für den neuen Benutzer ein.',
'Please enter the name of the database that will be used as the template for the new database:' => 'Bitte geben Sie den Namen der Datenbank an, die als Vorlage für die neue Datenbank benutzt wird:',
'The group has been saved.' => 'Die Gruppe wurde gespeichert.',
'The group memberships have been saved.' => 'Die Gruppenmitgliedschaften wurden gespeichert.',
'The group name is missing.' => 'Der Gruppenname fehlt.',
- 'The licensing module has been deactivated in the configuration.' => 'Das Lizenzverwaltungsmodul wurde in der Konfiguration deaktiviert.',
'The list has been printed.' => 'Die Liste wurde ausgedruckt.',
'The login is missing.' => 'Das Login fehlt.',
'The long description is missing.' => 'Der Langtext fehlt.',
'Vendors' => 'Lieferanten',
'Verrechnungseinheit' => 'Verrechnungseinheit',
'Version' => 'Version',
- 'View License' => 'Lizenz ansehen',
'View SEPA export' => 'SEPA-Export-Details ansehen',
'View warehouse content' => 'Lagerbestand ansehen',
'View/edit all employees sales documents' => 'Bearbeiten/ansehen der Verkaufsdokumente aller Mitarbeiter',
rm $i.pl 2> /dev/null
ln -s admin.pl $i.pl
done
-for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is licenses menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do
+for i in acctranscorrections amcvar amtemplates ap ar bankaccounts bp ca common cp ct datev dn do fu gl ic ir is menujs menunew menu menuv3 menuv4 menuXML oe pe projects rc rp sepa todo ustva wh vk; do
rm $i.pl 2> /dev/null
ln -s am.pl $i.pl
done
-rm generictranslations.pl 2> /dev/null
+rm generictranslations.pl licenses.pl 2> /dev/null
ln -s common.pl generictranslations.pl
rm dispatcher.fcgi 2> /dev/null
ln -s dispatcher.fpl dispatcher.fcgi
<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
<input type="hidden" name="follow_up_rowcount" value="1">
-<input type="hidden" name="lizenzen" value="[% lizenzen %]">
-
<p><div class="listtop" width="100%">[% title %]</div></p>
[%- INCLUDE 'common/flash.html' %]
<input type="hidden" name="follow_up_trans_info_1" value="[% HTML.escape(follow_up_trans_info) %]">
<input type="hidden" name="follow_up_rowcount" value="1">
-<input type="hidden" name="lizenzen" value="[% lizenzen %]">
-
<p><div class="listtop" width="100%">[% title %]</div></p>
<p>[% saved_message %]</p>