From: Jan Büren Date: Fri, 4 Mar 2011 07:51:14 +0000 (+0100) Subject: Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp X-Git-Tag: release-2.6.3~58 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/commitdiff_plain/0bf9f21482c4581f8cea90cc8d847f876682302f?hp=0bbfb33b6aa8e38bb6c81d1684ab7d08e5b5c5af Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp --- diff --git a/SL/Common.pm b/SL/Common.pm index 09f9468d8..dae75322f 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -336,7 +336,7 @@ sub webdav_folder { my ($form) = @_; return $main::lxdebug->leave_sub() - unless ($::lx_office_conf{system}->{webdav} && $form->{id}); + unless ($::lx_office_conf{features}->{webdav} && $form->{id}); my ($path, $number); diff --git a/SL/DB/Helper/ALL.pm b/SL/DB/Helper/ALL.pm index f5973b3b7..c030bed92 100644 --- a/SL/DB/Helper/ALL.pm +++ b/SL/DB/Helper/ALL.pm @@ -56,7 +56,7 @@ use SL::DB::PeriodicInvoice; use SL::DB::PeriodicInvoicesConfig; use SL::DB::PriceFactor; use SL::DB::Pricegroup; -use SL::DB::Prices; +use SL::DB::Price; use SL::DB::Printer; use SL::DB::Project; use SL::DB::PurchaseInvoice; diff --git a/SL/DB/Helper/Mappings.pm b/SL/DB/Helper/Mappings.pm index 477190448..7f7c475fd 100644 --- a/SL/DB/Helper/Mappings.pm +++ b/SL/DB/Helper/Mappings.pm @@ -77,7 +77,7 @@ my %lxoffice_package_names = ( payment_terms => 'payment_term', periodic_invoices => 'periodic_invoice', periodic_invoices_configs => 'periodic_invoices_config', - prices => 'prices', + prices => 'price', price_factors => 'price_factor', pricegroup => 'pricegroup', printers => 'Printer', diff --git a/SL/DB/Manager/Pricegroup.pm b/SL/DB/Manager/Pricegroup.pm new file mode 100644 index 000000000..6da4f216b --- /dev/null +++ b/SL/DB/Manager/Pricegroup.pm @@ -0,0 +1,21 @@ +package SL::DB::Manager::Pricegroup; + +use strict; + +use SL::DB::Helper::Manager; +use base qw(SL::DB::Helper::Manager); + +use SL::DB::Helper::Sorted; + +sub object_class { 'SL::DB::Pricegroup' } + +__PACKAGE__->make_manager_methods; + +sub _sort_spec { + return ( default => [ 'pricegroup', 1 ], + columns => { SIMPLE => 'ALL', + map { ( $_ => "lower(pricegroup.${_})" ) } qw(pricegroup), + }); +} + +1; diff --git a/SL/DB/MetaSetup/Price.pm b/SL/DB/MetaSetup/Price.pm new file mode 100644 index 000000000..bb6f0fd38 --- /dev/null +++ b/SL/DB/MetaSetup/Price.pm @@ -0,0 +1,35 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Price; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'prices', + + columns => [ + parts_id => { type => 'integer' }, + pricegroup_id => { type => 'integer' }, + price => { type => 'numeric', precision => 5, scale => 15 }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + parts => { + class => 'SL::DB::Part', + key_columns => { parts_id => 'id' }, + }, + + pricegroup => { + class => 'SL::DB::Pricegroup', + key_columns => { pricegroup_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/Prices.pm b/SL/DB/MetaSetup/Prices.pm deleted file mode 100644 index 819d14c6f..000000000 --- a/SL/DB/MetaSetup/Prices.pm +++ /dev/null @@ -1,35 +0,0 @@ -# This file has been auto-generated. Do not modify it; it will be overwritten -# by rose_auto_create_model.pl automatically. -package SL::DB::Prices; - -use strict; - -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'prices', - - columns => [ - parts_id => { type => 'integer' }, - pricegroup_id => { type => 'integer' }, - price => { type => 'numeric', precision => 5, scale => 15 }, - id => { type => 'serial', not_null => 1 }, - ], - - primary_key_columns => [ 'id' ], - - foreign_keys => [ - parts => { - class => 'SL::DB::Part', - key_columns => { parts_id => 'id' }, - }, - - pricegroup => { - class => 'SL::DB::Pricegroup', - key_columns => { pricegroup_id => 'id' }, - }, - ], -); - -1; -; diff --git a/SL/DB/Part.pm b/SL/DB/Part.pm index 8ec7b3b1b..fd55e0207 100644 --- a/SL/DB/Part.pm +++ b/SL/DB/Part.pm @@ -31,6 +31,11 @@ __PACKAGE__->meta->add_relationships( class => 'SL::DB::PriceFactor', column_map => { price_factor_id => 'id' }, }, + prices => { + type => 'one to many', + class => 'SL::DB::Price', + column_map => { id => 'parts_id' }, + }, ); __PACKAGE__->meta->initialize; diff --git a/SL/DB/Price.pm b/SL/DB/Price.pm new file mode 100644 index 000000000..9029dff3c --- /dev/null +++ b/SL/DB/Price.pm @@ -0,0 +1,13 @@ +# 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::Price; + +use strict; + +use SL::DB::MetaSetup::Price; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Pricegroup.pm b/SL/DB/Pricegroup.pm index 8c9c3727e..329dc41b2 100644 --- a/SL/DB/Pricegroup.pm +++ b/SL/DB/Pricegroup.pm @@ -1,13 +1,8 @@ -# 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::Pricegroup; use strict; use SL::DB::MetaSetup::Pricegroup; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; +use SL::DB::Manager::Pricegroup; 1; diff --git a/SL/DB/Prices.pm b/SL/DB/Prices.pm deleted file mode 100644 index 45d54a0b2..000000000 --- a/SL/DB/Prices.pm +++ /dev/null @@ -1,13 +0,0 @@ -# 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::Prices; - -use strict; - -use SL::DB::MetaSetup::Prices; - -# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. -__PACKAGE__->meta->make_manager_class; - -1; diff --git a/SL/Form.pm b/SL/Form.pm index 23dd5be50..b2cb1dead 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -810,11 +810,11 @@ sub _prepare_html_template { } $additional_params->{"conf_dbcharset"} = $::lx_office_conf{system}->{dbcharset}; - $additional_params->{"conf_webdav"} = $::lx_office_conf{system}->{webdav}; - $additional_params->{"conf_lizenzen"} = $::lx_office_conf{system}->{lizenzen}; + $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{system}->{vertreter}; + $additional_params->{"conf_vertreter"} = $::lx_office_conf{features}->{vertreter}; $additional_params->{"conf_show_best_before"} = $::lx_office_conf{features}->{show_best_before}; $additional_params->{"conf_parts_image_css"} = $::lx_office_conf{features}->{parts_image_css}; $additional_params->{"conf_parts_listing_images"} = $::lx_office_conf{features}->{parts_listing_images}; diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index bcf934ed1..7fd49d07a 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -1111,7 +1111,7 @@ sub list_business { $form->{title} = $locale->text('Type of Business'); my @column_index = qw(description discount customernumberinit); - push @column_index, 'salesman' if $::lx_office_conf{system}->{vertreter}; + push @column_index, 'salesman' if $::lx_office_conf{features}->{vertreter}; my %column_header; $column_header{description} = qq|| @@ -1224,7 +1224,7 @@ sub business_header { $form->format_amount(\%myconfig, $form->{discount} * 100); my $salesman_code; - if ($::lx_office_conf{system}->{vertreter}) { + if ($::lx_office_conf{features}->{vertreter}) { $salesman_code = qq| | . $locale->text('Representative') . qq| diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index a05158289..16077a8b9 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -300,7 +300,7 @@ sub form_header { taxzones => "ALL_TAXZONES"); $form->get_pricegroup(\%myconfig, { all => 1 }); - $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{system}->{vertreter}; + $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{features}->{vertreter}; $form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES}; $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : ""; @@ -354,7 +354,7 @@ sub _do_save { $::form->isblank("name", $::locale->text("Name missing!")); - if ($::form->{new_salesman_id} && $::lx_office_conf{system}->{vertreter}) { + if ($::form->{new_salesman_id} && $::lx_office_conf{features}->{vertreter}) { $::form->{salesman_id} = $::form->{new_salesman_id}; delete $::form->{new_salesman_id}; } diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 2bd7f6b42..10fdf2227 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -165,7 +165,7 @@ sub order_links { $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); # retrieve order/quotation - $form->{webdav} = $::lx_office_conf{system}->{webdav}; + $form->{webdav} = $::lx_office_conf{features}->{webdav}; $form->{jsscript} = 1; my $editing = $form->{id}; diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index be7062ad2..3d236e87b 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -489,7 +489,7 @@ sub select_item { qw(bin listprice inventory_accno income_accno expense_accno unit weight assembly taxaccounts partsgroup formel longdescription not_discountable part_payment_id partnotes id lastcost price_factor_id price_factor); - push @new_fields, "lizenzen" if $::lx_office_conf{system}->{lizenzen}; + push @new_fields, "lizenzen" if $::lx_office_conf{features}->{lizenzen}; push @new_fields, grep { m/^ic_cvar_/ } keys %{ $form->{item_list}->[0] }; my $i = 0; @@ -497,7 +497,7 @@ sub select_item { foreach my $ref (@{ $form->{item_list} }) { my $checked = ($i++) ? "" : "checked"; - if ($::lx_office_conf{system}->{lizenzen}) { + if ($::lx_office_conf{features}->{lizenzen}) { if ($ref->{inventory_accno} > 0) { $ref->{"lizenzen"} = qq||; foreach my $item (@{ $form->{LIZENZEN}{ $ref->{"id"} } }) { @@ -622,7 +622,7 @@ sub item_selected { $form->{payment_id} = $form->{"part_payment_id_$i"}; } - if ($::lx_office_conf{system}->{lizenzen}) { + if ($::lx_office_conf{features}->{lizenzen}) { map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} } qw(lizenzen); } diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 4ef488626..00d85443c 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -100,7 +100,7 @@ sub invoice_links { $form->{vc} = 'vendor'; # create links - $form->{webdav} = $::lx_office_conf{system}->{webdav}; + $form->{webdav} = $::lx_office_conf{features}->{webdav}; $form->{jsscript} = 1; $form->create_links("AP", \%myconfig, "vendor"); diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 07b40d4d5..51c7def75 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -132,8 +132,8 @@ sub invoice_links { $form->{vc} = 'customer'; # create links - $form->{webdav} = $::lx_office_conf{system}->{webdav}; - $form->{lizenzen} = $::lx_office_conf{system}->{lizenzen}; + $form->{webdav} = $::lx_office_conf{features}->{webdav}; + $form->{lizenzen} = $::lx_office_conf{features}->{lizenzen}; $form->create_links("AR", \%myconfig, "customer"); @@ -561,7 +561,7 @@ sub update { $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); - if ($::lx_office_conf{system}->{lizenzen}) { + if ($::lx_office_conf{features}->{lizenzen}) { if ($form->{"inventory_accno_$i"} ne "") { $form->{"lizenzen_$i"} = qq||; foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) { diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 97cc38896..563e94bcc 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -222,7 +222,7 @@ sub order_links { $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); # retrieve order/quotation - $form->{webdav} = $::lx_office_conf{system}->{webdav}; + $form->{webdav} = $::lx_office_conf{features}->{webdav}; $form->{jsscript} = 1; my $editing = $form->{id}; @@ -498,7 +498,7 @@ sub form_footer { print $form->parse_html_template("oe/form_footer", { %TMPL_VAR, - webdav => $::lx_office_conf{system}->{webdav}, + webdav => $::lx_office_conf{features}->{webdav}, print_options => print_options(inline => 1), label_edit => $locale->text("Edit the $form->{type}"), label_workflow => $locale->text("Workflow $form->{type}"), diff --git a/templates/webpages/ic/form_header.html b/templates/webpages/ic/form_header.html index 9183c6bb2..de1a79681 100644 --- a/templates/webpages/ic/form_header.html +++ b/templates/webpages/ic/form_header.html @@ -256,7 +256,7 @@ [%- END %] - +