]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of git@lx-office.linet-services.de:lx-office-erp
authorJan Büren <jan@lx-office-hosting.de>
Fri, 4 Mar 2011 07:51:14 +0000 (08:51 +0100)
committerJan Büren <jan@lx-office-hosting.de>
Fri, 4 Mar 2011 07:51:14 +0000 (08:51 +0100)
19 files changed:
SL/Common.pm
SL/DB/Helper/ALL.pm
SL/DB/Helper/Mappings.pm
SL/DB/Manager/Pricegroup.pm [new file with mode: 0644]
SL/DB/MetaSetup/Price.pm [new file with mode: 0644]
SL/DB/MetaSetup/Prices.pm [deleted file]
SL/DB/Part.pm
SL/DB/Price.pm [new file with mode: 0644]
SL/DB/Pricegroup.pm
SL/DB/Prices.pm [deleted file]
SL/Form.pm
bin/mozilla/am.pl
bin/mozilla/ct.pl
bin/mozilla/do.pl
bin/mozilla/io.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl
templates/webpages/ic/form_header.html

index 09f9468d87a7b08170101df22e1cd3f3c8471522..dae75322f3f76717ca965cf4f2803e26068288fd 100644 (file)
@@ -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);
 
index f5973b3b7cf6d1e4655022d0f4cee56c4d0bf54a..c030bed92f420fca4fedf74dad201267c4bdaac0 100644 (file)
@@ -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;
index 47719044825d0fa9d36c2cb0f9e71c3484e585bd..7f7c475fd8dca363642c64908628c4e13ce499db 100644 (file)
@@ -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 (file)
index 0000000..6da4f21
--- /dev/null
@@ -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 (file)
index 0000000..bb6f0fd
--- /dev/null
@@ -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 (file)
index 819d14c..0000000
+++ /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;
-;
index 8ec7b3b1bff99223de7452ab60f2ea8ee3df1afa..fd55e02072e7653960fa20fbb599e761d39ae1fa 100644 (file)
@@ -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 (file)
index 0000000..9029dff
--- /dev/null
@@ -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;
index 8c9c3727e9dc6e4983a3223c6a0781043e0d5c62..329dc41b2563f5bd3c7b97494a2ee9497f7fa168 100644 (file)
@@ -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 (file)
index 45d54a0..0000000
+++ /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;
index 23dd5be50303f14be1440080ef08c3c35222a749..b2cb1dead91686ace4d8c6f10c06f2a9bbeef520 100644 (file)
@@ -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};
index bcf934ed1ac1fc624df7dd9553d559caa94eb122..7fd49d07aa5b52d32633bc600b16dede6636b7a0 100644 (file)
@@ -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|<th class=listheading width=60%>|
@@ -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|
   <tr>
     <th align="right">| . $locale->text('Representative') . qq|</th>
index a05158289fc80f6fa46837884c91c2152f828ae8..16077a8b95a11d7318d80acfb5aa80f55e9974c6 100644 (file)
@@ -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};
   }
index 2bd7f6b42a09cc297f9bb5310325d10e40f39a69..10fdf22271d6a448550d139dfc29c0fc05d73615 100644 (file)
@@ -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};
index be7062ad2db787e731b2e1f3ba6c8e4832a6ac39..3d236e87b8120a227b5fd7834bc9c32416f65739 100644 (file)
@@ -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|<option></option>|;
         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);
   }
 
index 4ef488626b1e213a0775e4cbc1381e59937d04a2..00d85443c9d9a88c2eb0c97b7182baeb7a19c139 100644 (file)
@@ -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");
index 07b40d4d5b8cd5025a7add8d2d475a040b42e662..51c7def7588836d90fe7af0d608f7a720102ee14 100644 (file)
@@ -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|<option></option>|;
             foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) {
index 97cc38896c986b0d3f3072ff59b12f05f78fff88..563e94bcce2ea7cdccf262802c3501f152ef2e35 100644 (file)
@@ -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}"),
index 9183c6bb21c72f2aa245dc2c3bf4244d96b2fe57..de1a79681eeb3fff75a25baa76bff8ea39db2577 100644 (file)
           </tr>
         [%- END %]
           <tr>
-           <th align="right" nowrap><label for="shop">[% 'Has serial number' | $T8 %]</label></th>
+           <th align="right" nowrap><label for="has_sernumber">[% 'Has serial number' | $T8 %]</label></th>
            <td><input class="checkbox" type="checkbox" name="has_sernumber" id="has_sernumber" value="1" [% IF has_sernumber %]checked[% END %]></td>
           </tr>
           <tr>