]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 10 Dec 2013 14:49:59 +0000 (15:49 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 10 Dec 2013 14:49:59 +0000 (15:49 +0100)
67 files changed:
SL/CT.pm
SL/Common.pm
SL/Controller/CsvImport/Base.pm
SL/Controller/CsvImport/CustomerVendor.pm
SL/Controller/CsvImport/Helper/Consistency.pm [new file with mode: 0644]
SL/Controller/CsvImport/Order.pm
SL/Controller/CustomerVendor.pm
SL/Controller/DeliveryTerm.pm [new file with mode: 0644]
SL/DATEV.pm
SL/DB/DeliveryTerm.pm [new file with mode: 0644]
SL/DB/Helper/ALL.pm
SL/DB/Helper/FlattenToForm.pm
SL/DB/Invoice.pm
SL/DB/Manager/DeliveryTerm.pm [new file with mode: 0644]
SL/DB/MetaSetup/Customer.pm
SL/DB/MetaSetup/DeliveryOrder.pm
SL/DB/MetaSetup/DeliveryTerm.pm [new file with mode: 0644]
SL/DB/MetaSetup/Invoice.pm
SL/DB/MetaSetup/Order.pm
SL/DB/MetaSetup/PurchaseInvoice.pm
SL/DB/MetaSetup/Vendor.pm
SL/DO.pm
SL/IR.pm
SL/IS.pm
SL/OE.pm
bin/mozilla/ct.pl
bin/mozilla/do.pl
bin/mozilla/io.pl
bin/mozilla/ir.pl
bin/mozilla/is.pl
bin/mozilla/oe.pl
doc/changelog
doc/dokumentation.xml
doc/html/ch03s02.html
doc/html/ch04.html
doc/html/index.html
doc/kivitendo-Dokumentation.pdf
locale/de/all
locale/en/all
menus/erp.ini
sql/Pg-upgrade2/delivery_terms.sql [new file with mode: 0644]
templates/print/RB/deutsch.tex
templates/print/RB/english.tex
templates/print/RB/invoice.tex
templates/print/RB/purchase_delivery_order.tex
templates/print/RB/purchase_order.tex
templates/print/RB/request_quotation.tex
templates/print/RB/sales_delivery_order.tex
templates/print/RB/sales_order.tex
templates/print/RB/sales_quotation.tex
templates/webpages/common/show_vc_details.html
templates/webpages/ct/_contact.html [deleted file]
templates/webpages/ct/_shipto.html [deleted file]
templates/webpages/ct/ajax_autocomplete.html [deleted file]
templates/webpages/ct/form_footer.html [deleted file]
templates/webpages/ct/form_header.html [deleted file]
templates/webpages/ct/get_delivery.html [deleted file]
templates/webpages/ct/list_names_bottom.html
templates/webpages/ct/testpage.html [deleted file]
templates/webpages/customer_vendor/form.html
templates/webpages/customer_vendor/tabs/billing.html
templates/webpages/delivery_term/form.html [new file with mode: 0755]
templates/webpages/delivery_term/list.html [new file with mode: 0644]
templates/webpages/do/form_footer.html
templates/webpages/ir/form_footer.html
templates/webpages/is/form_footer.html
templates/webpages/oe/form_footer.html

index cae50f0fba7e18e7111a8e7522e670c77f7579eb..8ceab3aa6a31896331bbb9908cac66a73fdd7ea9 100644 (file)
--- a/SL/CT.pm
+++ b/SL/CT.pm
@@ -322,7 +322,8 @@ sub save_customer {
     qq|c_vendor_id = ?, | .
     qq|klass = ?, | .
     qq|currency_id = (SELECT id FROM currencies WHERE name = ?), | .
-    qq|taxincluded_checked = ? | .
+    qq|taxincluded_checked = ?, | .
+    qq|delivery_term_id = ? | .
     qq|WHERE id = ?|;
   my @values = (
     $form->{customernumber},
@@ -366,6 +367,7 @@ sub save_customer {
     conv_i($form->{klass}),
     $form->{currency},
     $form->{taxincluded_checked} ne '' ? $form->{taxincluded_checked} : undef,
+    conv_i($form->{delivery_term_id}),
     $form->{id}
     );
   do_query( $form, $dbh, $query, @values );
@@ -473,7 +475,8 @@ sub save_vendor {
     qq|  username = ?, | .
     qq|  user_password = ?, | .
     qq|  v_customer_id = ?, | .
-    qq|  currency_id = (SELECT id FROM currencies WHERE name = ?) | .
+    qq|  currency_id = (SELECT id FROM currencies WHERE name = ?), | .
+    qq|  delivery_term_id = ? | .
     qq|WHERE id = ?|;
   my @values = (
     $form->{vendornumber},
@@ -514,6 +517,7 @@ sub save_vendor {
     $form->{user_password},
     $form->{v_customer_id},
     $form->{currency},
+    conv_i($form->{delivery_term_id}),
     $form->{id}
     );
   do_query($form, $dbh, $query, @values);
index d6260251eb0040b8bb436660277ae52bec79833d..127209a7ff7975e56a521a96fc7beef70e215783 100644 (file)
@@ -397,11 +397,13 @@ sub get_vc_details {
          vc.*,
          pt.description AS payment_terms,
          b.description AS business,
-         l.description AS language
+         l.description AS language,
+         dt.description AS delivery_terms
        FROM ${vc} vc
        LEFT JOIN payment_terms pt ON (vc.payment_id = pt.id)
        LEFT JOIN business b ON (vc.business_id = b.id)
        LEFT JOIN language l ON (vc.language_id = l.id)
+       LEFT JOIN delivery_terms dt ON (vc.delivery_term_id = dt.id)
        WHERE vc.id = ?|;
   my $ref = selectfirst_hashref_query($form, $dbh, $query, $vc_id);
 
index a74acb66b6961ccd07dd945873c481d6785cc624..f8e9b591c6f2e3f08773db4da467215688646070 100644 (file)
@@ -8,6 +8,7 @@ use SL::Helper::Csv;
 use SL::DB::Customer;
 use SL::DB::Language;
 use SL::DB::PaymentTerm;
+use SL::DB::DeliveryTerm;
 use SL::DB::Vendor;
 use SL::DB::Contact;
 use SL::DB::History;
@@ -17,7 +18,7 @@ use parent qw(Rose::Object);
 use Rose::Object::MakeMethods::Generic
 (
  scalar                  => [ qw(controller file csv test_run save_with_cascade) ],
- 'scalar --get_set_init' => [ qw(profile displayable_columns existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by all_vc vc_by) ],
+ 'scalar --get_set_init' => [ qw(profile displayable_columns existing_objects class manager_class cvar_columns all_cvar_configs all_languages payment_terms_by delivery_terms_by all_vc vc_by) ],
 );
 
 sub run {
@@ -146,6 +147,13 @@ sub init_payment_terms_by {
   return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_payment_terms } } ) } qw(id description) };
 }
 
+sub init_delivery_terms_by {
+  my ($self) = @_;
+
+  my $all_delivery_terms = SL::DB::Manager::DeliveryTerm->get_all;
+  return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_delivery_terms } } ) } qw(id description) };
+}
+
 sub init_all_vc {
   my ($self) = @_;
 
@@ -382,6 +390,32 @@ sub check_payment {
   return 1;
 }
 
+sub check_delivery_term {
+  my ($self, $entry) = @_;
+
+  my $object = $entry->{object};
+
+  # Check whether or not delivery term ID is valid.
+  if ($object->delivery_term_id && !$self->delivery_terms_by->{id}->{ $object->delivery_term_id }) {
+    push @{ $entry->{errors} }, $::locale->text('Error: Invalid delivery terms');
+    return 0;
+  }
+
+  # Map name to ID if given.
+  if (!$object->delivery_term_id && $entry->{raw_data}->{delivery_term}) {
+    my $terms = $self->delivery_terms_by->{description}->{ $entry->{raw_data}->{delivery_term} };
+
+    if (!$terms) {
+      push @{ $entry->{errors} }, $::locale->text('Error: Invalid delivery terms');
+      return 0;
+    }
+
+    $object->delivery_term_id($terms->id);
+  }
+
+  return 1;
+}
+
 sub save_objects {
   my ($self, %params) = @_;
 
index 5f316148fa3c022b7ec485b8961a345b6e520245..14b67305fba9703cf1937c56c616f1b1d1604f9a 100644 (file)
@@ -3,7 +3,7 @@ package SL::Controller::CsvImport::CustomerVendor;
 use strict;
 
 use SL::Helper::Csv;
-use SL::Helper::Csv::Consistency;
+use SL::Controller::CsvImport::Helper::Consistency;
 use SL::DB::Business;
 use SL::DB::CustomVariable;
 use SL::DB::CustomVariableConfig;
@@ -66,7 +66,8 @@ sub check_objects {
     $self->check_language($entry);
     $self->check_business($entry);
     $self->check_payment($entry);
-    SL::Helper::Csv::Consistency->check_currency($entry, take_default => 1);
+    $self->check_delivery_term($entry);
+    $self->check_currency($entry, take_default => 1);
     $self->handle_cvars($entry);
 
     next if @{ $entry->{errors} };
@@ -99,7 +100,7 @@ sub check_objects {
     $i++;
   }
 
-  $self->add_columns(map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(language business payment));
+  $self->add_columns(map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(language business payment delivery_term));
   $self->add_cvar_raw_data_columns;
 }
 
@@ -231,7 +232,7 @@ sub init_profile {
   my ($self) = @_;
 
   my $profile = $self->SUPER::init_profile;
-  delete @{$profile}{qw(business datevexport language payment salesman salesman_id taxincluded terms)};
+  delete @{$profile}{qw(business datevexport language payment delivery_term salesman salesman_id taxincluded terms)};
 
   return $profile;
 }
@@ -260,6 +261,8 @@ sub setup_displayable_columns {
                                  { name => 'customernumber',    description => $::locale->text('Customer Number')                 },
                                  { name => 'department_1',      description => $::locale->text('Department 1')                    },
                                  { name => 'department_2',      description => $::locale->text('Department 2')                    },
+                                 { name => 'delivery_term_id',  description => $::locale->text('Delivery terms (database ID)')    },
+                                 { name => 'delivery_term',     description => $::locale->text('Delivery terms (name)')           },
                                  { name => 'direct_debit',      description => $::locale->text('direct debit')                    },
                                  { name => 'discount',          description => $::locale->text('Discount')                        },
                                  { name => 'email',             description => $::locale->text('E-mail')                          },
diff --git a/SL/Controller/CsvImport/Helper/Consistency.pm b/SL/Controller/CsvImport/Helper/Consistency.pm
new file mode 100644 (file)
index 0000000..a666e6f
--- /dev/null
@@ -0,0 +1,69 @@
+package SL::Controller::CsvImport::Helper::Consistency;
+
+use strict;
+
+use SL::DB::Default;
+use SL::DB::Currency;
+
+use SL::Helper::Csv::Error;
+
+use parent qw(Exporter);
+our @EXPORT = qw(check_currency);
+
+#
+# public functions
+#
+
+sub check_currency {
+  my ($self, $entry, %params) = @_;
+
+  my $object = $entry->{object};
+
+  # Check whether or not currency ID is valid.
+  if ($object->currency_id && ! _currencies_by($self)->{id}->{ $object->currency_id }) {
+    push @{ $entry->{errors} }, $::locale->text('Error: Invalid currency');
+    return 0;
+  }
+
+  # Map name to ID if given.
+  if (!$object->currency_id && $entry->{raw_data}->{currency}) {
+    my $currency = _currencies_by($self)->{name}->{  $entry->{raw_data}->{currency} };
+    if (!$currency) {
+      push @{ $entry->{errors} }, $::locale->text('Error: Invalid currency');
+      return 0;
+    }
+
+    $object->currency_id($currency->id);
+  }
+
+  # Set default currency if none was given and take_default is true.
+  $object->currency_id(_default_currency_id($self)) if !$object->currency_id and $params{take_default};
+
+  $entry->{raw_data}->{currency_id} = $object->currency_id;
+
+  return 1;
+}
+
+#
+# private functions
+#
+
+sub _currencies_by {
+  my ($self) = @_;
+
+  return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ _all_currencies($self) } } ) } qw(id name) };
+}
+
+sub _all_currencies {
+  my ($self) = @_;
+
+  return SL::DB::Manager::Currency->get_all;
+}
+
+sub _default_currency_id {
+  my ($self) = @_;
+
+  return SL::DB::Default->get->currency_id;
+}
+
+1;
index 10c3433b6f556029d4979011afa9ce6c5abc1a7c..fe7301936a43869ad18a745520bca6a30d120527 100644 (file)
@@ -6,6 +6,7 @@ use strict;
 use List::MoreUtils qw(any);
 
 use SL::Helper::Csv;
+use SL::Controller::CsvImport::Helper::Consistency;
 use SL::DB::Order;
 use SL::DB::OrderItem;
 use SL::DB::Part;
@@ -101,6 +102,8 @@ sub setup_displayable_columns {
                                  { name => 'currency_id',             description => $::locale->text('Currency (database ID)')                },
                                  { name => 'cusordnumber',            description => $::locale->text('Customer Order Number')                 },
                                  { name => 'delivered',               description => $::locale->text('Delivered')                             },
+                                 { name => 'delivery_term_id',        description => $::locale->text('Delivery terms (database ID)')          },
+                                 { name => 'delivery_term',           description => $::locale->text('Delivery terms (name)')                 },
                                  { name => 'employee_id',             description => $::locale->text('Employee (database ID)')                },
                                  { name => 'intnotes',                description => $::locale->text('Internal Notes')                        },
                                  { name => 'marge_percent',           description => $::locale->text('Margepercent')                          },
@@ -269,7 +272,7 @@ sub check_objects {
                           { header => $::locale->text('Customer/Vendor'), method => 'vc_name' });
   # Todo: access via ->[0] ok? Better: search first order column and use this
   $self->add_columns($self->_order_column,
-                     map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(payment language department globalproject taxzone cp currency));
+                     map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(payment delivery_term language department globalproject taxzone cp currency));
   $self->add_columns($self->_order_column, 'globalproject_id') if exists $self->controller->data->[0]->{raw_data}->{globalprojectnumber};
   $self->add_columns($self->_order_column, 'cp_id')            if exists $self->controller->data->[0]->{raw_data}->{contact};
 
@@ -320,11 +323,12 @@ sub handle_order {
   $self->check_contact($entry);
   $self->check_language($entry);
   $self->check_payment($entry);
+  $self->check_delivery_term($entry);
   $self->check_department($entry);
   $self->check_project($entry, global => 1);
   $self->check_ct_shipto($entry);
   $self->check_taxzone($entry);
-  SL::Helper::Csv::Consistency->check_currency($entry, take_default => 0);
+  $self->check_currency($entry, take_default => 0);
 
   if ($vc_obj) {
     # copy from customer if not given
index 0ffa2f5893c1971cb24c2e54e7f15c5f0e2e28e8..de7749037cc16b2f8f5e401df6ac01e222f5028b 100644 (file)
@@ -394,6 +394,8 @@ sub action_search_contact {
 sub action_get_delivery {
   my ($self) = @_;
 
+  $::auth->assert('sales_all_edit');
+
   my $dbh = $::form->get_standard_dbh();
 
   my ($arap, $db, $qty_sign);
@@ -810,6 +812,8 @@ sub _pre_render {
 
   $self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all();
 
+  $self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all();
+
   $self->{all_pricegroups} = SL::DB::Manager::Pricegroup->get_all();
 
   $query =
diff --git a/SL/Controller/DeliveryTerm.pm b/SL/Controller/DeliveryTerm.pm
new file mode 100644 (file)
index 0000000..4810d21
--- /dev/null
@@ -0,0 +1,123 @@
+package SL::Controller::DeliveryTerm;
+
+use strict;
+
+use parent qw(SL::Controller::Base);
+
+use SL::DB::DeliveryTerm;
+use SL::DB::Language;
+use SL::Helper::Flash;
+
+use Rose::Object::MakeMethods::Generic
+(
+ scalar => [ qw(delivery_term languages) ],
+);
+
+__PACKAGE__->run_before('check_auth');
+__PACKAGE__->run_before('load_delivery_term', only => [ qw(edit update destroy) ]);
+__PACKAGE__->run_before('load_languages',     only => [ qw(new list edit create update) ]);
+
+
+#
+# actions
+#
+
+sub action_list {
+  my ($self) = @_;
+
+  $self->render('delivery_term/list',
+                title          => $::locale->text('Delivery terms'),
+                DELIVERY_TERMS => SL::DB::Manager::DeliveryTerm->get_all_sorted);
+}
+
+sub action_new {
+  my ($self) = @_;
+
+  $self->{delivery_term} = SL::DB::DeliveryTerm->new;
+  $self->render('delivery_term/form', title => $::locale->text('Create a new delivery term'));
+}
+
+sub action_edit {
+  my ($self) = @_;
+  $self->render('delivery_term/form', title => $::locale->text('Edit delivery term'));
+}
+
+sub action_create {
+  my ($self) = @_;
+
+  $self->{delivery_term} = SL::DB::DeliveryTerm->new;
+  $self->create_or_update;
+}
+
+sub action_update {
+  my ($self) = @_;
+  $self->create_or_update;
+}
+
+sub action_destroy {
+  my ($self) = @_;
+
+  if (eval { $self->{delivery_term}->delete; 1; }) {
+    flash_later('info',  $::locale->text('The delivery term has been deleted.'));
+  } else {
+    flash_later('error', $::locale->text('The delivery term is in use and cannot be deleted.'));
+  }
+
+  $self->redirect_to(action => 'list');
+}
+
+sub action_reorder {
+  my ($self) = @_;
+
+  SL::DB::DeliveryTerm->reorder_list(@{ $::form->{delivery_term_id} || [] });
+
+  $self->render(\'', { type => 'json' });     # ' make Emacs happy
+}
+
+#
+# filters
+#
+
+sub check_auth {
+  $::auth->assert('config');
+}
+
+#
+# helpers
+#
+
+sub create_or_update {
+  my $self   = shift;
+  my $is_new = !$self->{delivery_term}->id;
+  my $params = delete($::form->{delivery_term}) || { };
+
+  $self->{delivery_term}->assign_attributes(%{ $params });
+
+  my @errors = $self->{delivery_term}->validate;
+
+  if (@errors) {
+    flash('error', @errors);
+    $self->render('delivery_term/form', title => $is_new ? $::locale->text('Create a new delivery term') : $::locale->text('Edit delivery term'));
+    return;
+  }
+
+  $self->{delivery_term}->save;
+  foreach my $language (@{ $self->{languages} }) {
+    $self->{delivery_term}->save_attribute_translation('description_long', $language, $::form->{"translation_" . $language->id});
+  }
+
+  flash_later('info', $is_new ? $::locale->text('The delivery term has been created.') : $::locale->text('The delivery term has been saved.'));
+  $self->redirect_to(action => 'list');
+}
+
+sub load_delivery_term {
+  my ($self) = @_;
+  $self->{delivery_term} = SL::DB::DeliveryTerm->new(id => $::form->{id})->load;
+}
+
+sub load_languages {
+  my ($self) = @_;
+  $self->{languages} = SL::DB::Manager::Language->get_all_sorted;
+}
+
+1;
index 0aec84897a406712996e7e1da951ebbf30d5b942..e79c08012a7fe07ef42fc89966f6325e3b490f6d 100644 (file)
@@ -366,7 +366,7 @@ sub _get_transactions {
   my $query    =
     qq|SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,ar.id, ac.amount, ac.taxkey,
          ar.invnumber, ar.duedate, ar.amount as umsatz, ar.deliverydate,
-         ct.name,
+         ct.name, ct.ustid,
          c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link,
          ar.invoice,
          t.rate AS taxrate
@@ -384,7 +384,7 @@ sub _get_transactions {
 
        SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,ap.id, ac.amount, ac.taxkey,
          ap.invnumber, ap.duedate, ap.amount as umsatz, ap.deliverydate,
-         ct.name,
+         ct.name,ct.ustid,
          c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link,
          ap.invoice,
          t.rate AS taxrate
@@ -402,7 +402,7 @@ sub _get_transactions {
 
        SELECT ac.acc_trans_id, ac.transdate, ac.trans_id,gl.id, ac.amount, ac.taxkey,
          gl.reference AS invnumber, gl.transdate AS duedate, ac.amount as umsatz, NULL as deliverydate,
-         gl.description AS name,
+         gl.description AS name, NULL as ustid,
          c.accno, c.taxkey_id as charttax, c.datevautomatik, c.id, ac.chart_link AS link,
          FALSE AS invoice,
          t.rate AS taxrate
@@ -810,6 +810,7 @@ sub kne_buchungsexport {
       my $datevautomatik = 0;
       my $taxkey         = 0;
       my $charttax       = 0;
+      my $ustid          ="";
       my ($haben, $soll);
       my $iconv          = $::locale->{iconv_utf8};
       my %umlaute = ($iconv->convert('ä') => 'ae',
@@ -844,7 +845,6 @@ sub kne_buchungsexport {
           $soll = $i;
         }
       }
-
       # Umwandlung von Umlauten und Sonderzeichen in erlaubte Zeichen bei Textfeldern
       foreach my $umlaut (keys(%umlaute)) {
         $transaction->[$haben]->{'invnumber'} =~ s/${umlaut}/${umlaute{$umlaut}}/g;
@@ -872,6 +872,9 @@ sub kne_buchungsexport {
         if ($transaction->[$haben]->{'name'} ne "") {
           $buchungstext = "\x1E" . $transaction->[$haben]->{'name'} . "\x1C";
         }
+        if ($transaction->[$haben]->{'ustid'} ne "") {
+          $ustid = "\xBA" . $transaction->[$haben]->{'ustid'} . "\x1C";
+        }
         if ($transaction->[$haben]->{'duedate'} ne "") {
           $belegfeld2 = "\xBE" . &datetofour($transaction->[$haben]->{'duedate'}, 1) . "\x1C";
         }
@@ -903,6 +906,7 @@ sub kne_buchungsexport {
       $kne_file->add_block($datum);
       $kne_file->add_block($konto);
       $kne_file->add_block($buchungstext);
+      $kne_file->add_block($ustid);
       $kne_file->add_block($waehrung . "\x79");
     }
 
diff --git a/SL/DB/DeliveryTerm.pm b/SL/DB/DeliveryTerm.pm
new file mode 100644 (file)
index 0000000..68c5d92
--- /dev/null
@@ -0,0 +1,24 @@
+# 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::DeliveryTerm;
+
+use strict;
+
+use SL::DB::MetaSetup::DeliveryTerm;
+use SL::DB::Manager::DeliveryTerm;
+use SL::DB::Helper::ActsAsList;
+use SL::DB::Helper::TranslatedAttributes;
+
+
+sub validate {
+  my ($self) = @_;
+
+  my @errors;
+  push @errors, $::locale->text('The description is missing.')      if !$self->description;
+  push @errors, $::locale->text('The long description is missing.') if !$self->description_long;
+
+  return @errors;
+}
+
+1;
index 325a96cc2015ad6de0b032acbf4fc156d52cd5a1..446356775337b555d247d152c56f4c55f80c3cf2 100644 (file)
@@ -36,6 +36,7 @@ use SL::DB::Default;
 use SL::DB::DeliveryOrder;
 use SL::DB::DeliveryOrderItem;
 use SL::DB::DeliveryOrderItemsStock;
+use SL::DB::DeliveryTerm;
 use SL::DB::Department;
 use SL::DB::Draft;
 use SL::DB::Dunning;
index 95152593bd3b94ca0a4256b33f76fb7221430d8f..105cf020f9265c9d09f30ea897eaf0ca38f4648b 100644 (file)
@@ -17,7 +17,7 @@ sub flatten_to_form {
   _copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes cp_id
                                     employee_id salesman_id closed department_id language_id payment_id delivery_customer_id delivery_vendor_id shipto_id proforma
                                     globalproject_id delivered transaction_description container_type accepted_by_customer invoice terms storno storno_id dunning_config_id
-                                    orddate quodate reqdate gldate duedate deliverydate datepaid transdate));
+                                    orddate quodate reqdate gldate duedate deliverydate datepaid transdate delivery_term_id));
   $form->{currency} = $form->{curr} = $self->currency_id ? $self->currency->name || '' : '';
 
   if (_has($self, 'transdate')) {
index 3842af6e76dddb84f47d1c99f309d50cfebae218..7f7269923833951288cd1ef1ab740f46888b2f3c 100644 (file)
@@ -117,7 +117,7 @@ sub new_from {
 
   my %args = ( map({ ( $_ => $source->$_ ) } qw(customer_id taxincluded shippingpoint shipvia notes intnotes salesman_id cusordnumber ordnumber quonumber
                                                 department_id cp_id language_id payment_id delivery_customer_id delivery_vendor_id taxzone_id shipto_id
-                                                globalproject_id transaction_description currency_id)),
+                                                globalproject_id transaction_description currency_id delivery_term_id)),
                transdate   => DateTime->today_local,
                gldate      => DateTime->today_local,
                duedate     => DateTime->today_local->add(days => $terms * 1),
diff --git a/SL/DB/Manager/DeliveryTerm.pm b/SL/DB/Manager/DeliveryTerm.pm
new file mode 100644 (file)
index 0000000..6ac2f0a
--- /dev/null
@@ -0,0 +1,21 @@
+package SL::DB::Manager::DeliveryTerm;
+
+use strict;
+
+use SL::DB::Helper::Manager;
+use base qw(SL::DB::Helper::Manager);
+
+use SL::DB::Helper::Sorted;
+
+sub object_class { 'SL::DB::DeliveryTerm' }
+
+__PACKAGE__->make_manager_methods;
+
+sub _sort_spec {
+  return ( default => [ 'sortkey', 1 ],
+           columns => { SIMPLE => 'ALL',
+                        map { ( $_ => "lower(delivery_terms.${_})" ) } qw(description description_long),
+                      });
+}
+
+1;
index 1752d2a162a4d9ce45b11df423cf6556e052b9a7..2d5a155b9b7578774b099dbcfbcbe564ca47ed07 100644 (file)
@@ -23,6 +23,7 @@ __PACKAGE__->meta->columns(
   creditlimit         => { type => 'numeric', default => '0', precision => 5, scale => 15 },
   currency_id         => { type => 'integer', not_null => 1 },
   customernumber      => { type => 'text' },
+  delivery_term_id    => { type => 'integer' },
   department_1        => { type => 'varchar', length => 75 },
   department_2        => { type => 'varchar', length => 75 },
   direct_debit        => { type => 'boolean', default => 'false' },
@@ -71,6 +72,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { currency_id => 'id' },
   },
 
+  delivery_term => {
+    class       => 'SL::DB::DeliveryTerm',
+    key_columns => { delivery_term_id => 'id' },
+  },
+
   language_obj => {
     class       => 'SL::DB::Language',
     key_columns => { language_id => 'id' },
index 92d45ae14860ea4ff6bd0aec81c8d90489d666c0..a1efe9a84ac25835fc73cca675f1ffc3ddb49fc3 100644 (file)
@@ -15,6 +15,7 @@ __PACKAGE__->meta->columns(
   cusordnumber            => { type => 'text' },
   customer_id             => { type => 'integer' },
   delivered               => { type => 'boolean', default => 'false' },
+  delivery_term_id        => { type => 'integer' },
   department_id           => { type => 'integer' },
   donumber                => { type => 'text', not_null => 1 },
   employee_id             => { type => 'integer' },
@@ -61,6 +62,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { customer_id => 'id' },
   },
 
+  delivery_term => {
+    class       => 'SL::DB::DeliveryTerm',
+    key_columns => { delivery_term_id => 'id' },
+  },
+
   department => {
     class       => 'SL::DB::Department',
     key_columns => { department_id => 'id' },
diff --git a/SL/DB/MetaSetup/DeliveryTerm.pm b/SL/DB/MetaSetup/DeliveryTerm.pm
new file mode 100644 (file)
index 0000000..ebcc7ea
--- /dev/null
@@ -0,0 +1,27 @@
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::DeliveryTerm;
+
+use strict;
+
+use base qw(SL::DB::Object);
+
+__PACKAGE__->meta->setup(
+  table   => 'delivery_terms',
+
+  columns => [
+    id               => { type => 'integer', not_null => 1, sequence => 'id' },
+    description      => { type => 'text' },
+    description_long => { type => 'text' },
+    sortkey          => { type => 'integer', not_null => 1 },
+    itime            => { type => 'timestamp', default => 'now()' },
+    mtime            => { type => 'timestamp' },
+  ],
+
+  primary_key_columns => [ 'id' ],
+
+  allow_inline_column_values => 1,
+);
+
+1;
+;
index eedecb4ad199a47b837c8d1aa36a3357b2918dac..1a8d1f00d4db9c115809f01933b80c21a5091cff 100644 (file)
@@ -16,6 +16,7 @@ __PACKAGE__->meta->columns(
   customer_id               => { type => 'integer' },
   datepaid                  => { type => 'date' },
   delivery_customer_id      => { type => 'integer' },
+  delivery_term_id          => { type => 'integer' },
   delivery_vendor_id        => { type => 'integer' },
   deliverydate              => { type => 'date' },
   department_id             => { type => 'integer' },
@@ -78,6 +79,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { customer_id => 'id' },
   },
 
+  delivery_term => {
+    class       => 'SL::DB::DeliveryTerm',
+    key_columns => { delivery_term_id => 'id' },
+  },
+
   department => {
     class       => 'SL::DB::Department',
     key_columns => { department_id => 'id' },
index 249ea62fc75cd50be97765b89845fae77f009666..3e4a3102fcbde6c9974c4e173af2bafdbed71269 100644 (file)
@@ -17,6 +17,7 @@ __PACKAGE__->meta->columns(
   customer_id             => { type => 'integer' },
   delivered               => { type => 'boolean', default => 'false' },
   delivery_customer_id    => { type => 'integer' },
+  delivery_term_id        => { type => 'integer' },
   delivery_vendor_id      => { type => 'integer' },
   department_id           => { type => 'integer' },
   employee_id             => { type => 'integer' },
@@ -72,6 +73,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { delivery_customer_id => 'id' },
   },
 
+  delivery_term => {
+    class       => 'SL::DB::DeliveryTerm',
+    key_columns => { delivery_term_id => 'id' },
+  },
+
   delivery_vendor => {
     class       => 'SL::DB::Vendor',
     key_columns => { delivery_vendor_id => 'id' },
index 4b89dca767a9dff7d59c2a0cf42d4738fe6aa56e..5aa2785668d2af22838ba1740e9e4e1905170971 100644 (file)
@@ -13,6 +13,7 @@ __PACKAGE__->meta->columns(
   cp_id                   => { type => 'integer' },
   currency_id             => { type => 'integer', not_null => 1 },
   datepaid                => { type => 'date' },
+  delivery_term_id        => { type => 'integer' },
   deliverydate            => { type => 'date' },
   department_id           => { type => 'integer' },
   direct_debit            => { type => 'boolean', default => 'false' },
@@ -61,6 +62,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { currency_id => 'id' },
   },
 
+  delivery_term => {
+    class       => 'SL::DB::DeliveryTerm',
+    key_columns => { delivery_term_id => 'id' },
+  },
+
   department => {
     class       => 'SL::DB::Department',
     key_columns => { department_id => 'id' },
index 1a691ff6d2c68076568bc5003c3399f442b3798f..f2988ad74de66e863790bd00252a8e42bce903ec 100644 (file)
@@ -9,49 +9,50 @@ use base qw(SL::DB::Object);
 __PACKAGE__->meta->table('vendor');
 
 __PACKAGE__->meta->columns(
-  account_number => { type => 'varchar', length => 15 },
-  bank           => { type => 'text' },
-  bank_code      => { type => 'varchar', length => 10 },
-  bcc            => { type => 'text' },
-  bic            => { type => 'varchar', length => 100 },
-  business_id    => { type => 'integer' },
-  cc             => { type => 'text' },
-  city           => { type => 'varchar', length => 75 },
-  contact        => { type => 'varchar', length => 75 },
-  country        => { type => 'varchar', length => 75 },
-  creditlimit    => { type => 'numeric', precision => 5, scale => 15 },
-  currency_id    => { type => 'integer', not_null => 1 },
-  department_1   => { type => 'varchar', length => 75 },
-  department_2   => { type => 'varchar', length => 75 },
-  direct_debit   => { type => 'boolean', default => 'false' },
-  discount       => { type => 'float', precision => 4 },
-  email          => { type => 'text' },
-  fax            => { type => 'varchar', length => 30 },
-  greeting       => { type => 'text' },
-  homepage       => { type => 'text' },
-  iban           => { type => 'varchar', length => 100 },
-  id             => { type => 'integer', not_null => 1, sequence => 'id' },
-  itime          => { type => 'timestamp', default => 'now()' },
-  language       => { type => 'varchar', length => 5 },
-  language_id    => { type => 'integer' },
-  mtime          => { type => 'timestamp' },
-  name           => { type => 'varchar', length => 75, not_null => 1 },
-  notes          => { type => 'text' },
-  obsolete       => { type => 'boolean', default => 'false' },
-  payment_id     => { type => 'integer' },
-  phone          => { type => 'text' },
-  salesman_id    => { type => 'integer' },
-  street         => { type => 'varchar', length => 75 },
-  taxincluded    => { type => 'boolean' },
-  taxnumber      => { type => 'text' },
-  taxzone_id     => { type => 'integer', default => '0', not_null => 1 },
-  terms          => { type => 'integer', default => '0' },
-  user_password  => { type => 'varchar', length => 12 },
-  username       => { type => 'varchar', length => 50 },
-  ustid          => { type => 'varchar', length => 14 },
-  v_customer_id  => { type => 'text' },
-  vendornumber   => { type => 'text' },
-  zipcode        => { type => 'varchar', length => 10 },
+  account_number   => { type => 'varchar', length => 15 },
+  bank             => { type => 'text' },
+  bank_code        => { type => 'varchar', length => 10 },
+  bcc              => { type => 'text' },
+  bic              => { type => 'varchar', length => 100 },
+  business_id      => { type => 'integer' },
+  cc               => { type => 'text' },
+  city             => { type => 'varchar', length => 75 },
+  contact          => { type => 'varchar', length => 75 },
+  country          => { type => 'varchar', length => 75 },
+  creditlimit      => { type => 'numeric', precision => 5, scale => 15 },
+  currency_id      => { type => 'integer', not_null => 1 },
+  delivery_term_id => { type => 'integer' },
+  department_1     => { type => 'varchar', length => 75 },
+  department_2     => { type => 'varchar', length => 75 },
+  direct_debit     => { type => 'boolean', default => 'false' },
+  discount         => { type => 'float', precision => 4 },
+  email            => { type => 'text' },
+  fax              => { type => 'varchar', length => 30 },
+  greeting         => { type => 'text' },
+  homepage         => { type => 'text' },
+  iban             => { type => 'varchar', length => 100 },
+  id               => { type => 'integer', not_null => 1, sequence => 'id' },
+  itime            => { type => 'timestamp', default => 'now()' },
+  language         => { type => 'varchar', length => 5 },
+  language_id      => { type => 'integer' },
+  mtime            => { type => 'timestamp' },
+  name             => { type => 'varchar', length => 75, not_null => 1 },
+  notes            => { type => 'text' },
+  obsolete         => { type => 'boolean', default => 'false' },
+  payment_id       => { type => 'integer' },
+  phone            => { type => 'text' },
+  salesman_id      => { type => 'integer' },
+  street           => { type => 'varchar', length => 75 },
+  taxincluded      => { type => 'boolean' },
+  taxnumber        => { type => 'text' },
+  taxzone_id       => { type => 'integer', default => '0', not_null => 1 },
+  terms            => { type => 'integer', default => '0' },
+  user_password    => { type => 'varchar', length => 12 },
+  username         => { type => 'varchar', length => 50 },
+  ustid            => { type => 'varchar', length => 14 },
+  v_customer_id    => { type => 'text' },
+  vendornumber     => { type => 'text' },
+  zipcode          => { type => 'varchar', length => 10 },
 );
 
 __PACKAGE__->meta->primary_key_columns([ 'id' ]);
@@ -69,6 +70,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { currency_id => 'id' },
   },
 
+  delivery_term => {
+    class       => 'SL::DB::DeliveryTerm',
+    key_columns => { delivery_term_id => 'id' },
+  },
+
   language_obj => {
     class       => 'SL::DB::Language',
     key_columns => { language_id => 'id' },
index 21f93d8137436342d67f64814456f136512caa47..d83c49b3ef1b46e57887e76a61270ab3a09b0f74 100644 (file)
--- a/SL/DO.pm
+++ b/SL/DO.pm
@@ -367,7 +367,8 @@ sub save {
          shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, closed = ?,
          delivered = ?, department_id = ?, language_id = ?, shipto_id = ?,
          globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?,
-         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?)
+         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?),
+         delivery_term_id = ?
        WHERE id = ?|;
 
   @values = ($form->{donumber}, $form->{ordnumber},
@@ -382,6 +383,7 @@ sub save {
              $form->{transaction_description},
              $form->{type} =~ /^sales/ ? 't' : 'f',
              conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{currency},
+             conv_i($form->{delivery_term_id}),
              conv_i($form->{id}));
   do_query($form, $dbh, $query, @values);
 
@@ -592,7 +594,8 @@ sub retrieve {
          d.description AS department, dord.language_id,
          dord.shipto_id,
          dord.globalproject_id, dord.delivered, dord.transaction_description,
-         dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency
+         dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency,
+         dord.delivery_term_id
        FROM delivery_orders dord
        JOIN ${vc} cv ON (dord.${vc}_id = cv.id)
        LEFT JOIN employee e ON (dord.employee_id = e.id)
@@ -891,6 +894,9 @@ sub order_details {
   $h_pg->finish();
   $h_bin_wh->finish();
 
+  $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
+  $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
+
   $form->{username} = $myconfig->{name};
 
   $main::lxdebug->leave_sub();
index 36f105ebdc7a1cff99d1336cf3f2a6b6eba5c1aa..84ce10a17cad00641faf270583387f9670b1f15d 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -686,7 +686,7 @@ sub post_invoice {
                 netamount    = ?, paid        = ?, duedate       = ?,
                 invoice      = ?, taxzone_id  = ?, notes         = ?, taxincluded = ?,
                 intnotes     = ?, storno_id   = ?, storno        = ?,
-                cp_id        = ?, employee_id = ?, department_id = ?,
+                cp_id        = ?, employee_id = ?, department_id = ?, delivery_term_id = ?,
                 globalproject_id = ?, direct_debit = ?
               WHERE id = ?|;
   @values = (
@@ -695,7 +695,7 @@ sub post_invoice {
                 $netamount,                  $form->{paid},      conv_date($form->{duedate}),
             '1',                             $taxzone_id,                  $form->{notes},          $form->{taxincluded} ? 't' : 'f',
                 $form->{intnotes},           conv_i($form->{storno_id}),     $form->{storno}      ? 't' : 'f',
-         conv_i($form->{cp_id}),      conv_i($form->{employee_id}), conv_i($form->{department_id}),
+         conv_i($form->{cp_id}),      conv_i($form->{employee_id}), conv_i($form->{department_id}), conv_i($form->{delivery_term_id}),
          conv_i($form->{globalproject_id}),
                 $form->{direct_debit} ? 't' : 'f',
          conv_i($form->{id})
@@ -941,7 +941,8 @@ sub retrieve_invoice {
   $query = qq|SELECT cp_id, invnumber, transdate AS invdate, duedate,
                 orddate, quodate, globalproject_id,
                 ordnumber, quonumber, paid, taxincluded, notes, taxzone_id, storno, gldate,
-                intnotes, (SELECT cu.name FROM currencies cu WHERE cu.id=ap.currency_id) AS currency, direct_debit
+                intnotes, (SELECT cu.name FROM currencies cu WHERE cu.id=ap.currency_id) AS currency, direct_debit,
+                delivery_term_id
               FROM ap
               WHERE id = ?|;
   $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id}));
@@ -1087,7 +1088,7 @@ sub get_vendor {
     qq|SELECT
          v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
          v.creditlimit, v.terms, v.notes AS intnotes,
-         v.email, v.cc, v.bcc, v.language_id, v.payment_id,
+         v.email, v.cc, v.bcc, v.language_id, v.payment_id, v.delivery_term_id,
          v.street, v.zipcode, v.city, v.country, v.taxzone_id, cu.name AS curr, v.direct_debit,
          $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
          b.description AS business
index cfaf730e8bc523e33efaea4365d3cc7c18969a10..23b6f80f74d881d30b935ea78b4f010bcaaa0633 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -429,6 +429,9 @@ sub invoice_details {
 
   $form->set_payment_options($myconfig, $form->{invdate});
 
+  $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
+  $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
+
   $form->{username} = $myconfig->{name};
 
   $main::lxdebug->leave_sub();
@@ -1104,7 +1107,8 @@ sub post_invoice {
                 cp_id       = ?, marge_total   = ?, marge_percent = ?,
                 globalproject_id               = ?, delivery_customer_id             = ?,
                 transaction_description        = ?, delivery_vendor_id               = ?,
-                donumber    = ?, invnumber_for_credit_note = ?,        direct_debit  = ?
+                donumber    = ?, invnumber_for_credit_note = ?,        direct_debit  = ?,
+                delivery_term_id = ?
               WHERE id = ?|;
   @values = (          $form->{"invnumber"},           $form->{"ordnumber"},             $form->{"quonumber"},          $form->{"cusordnumber"},
              conv_date($form->{"invdate"}),  conv_date($form->{"orddate"}),    conv_date($form->{"quodate"}),    conv_i($form->{"customer_id"}),
@@ -1118,6 +1122,7 @@ sub post_invoice {
                 conv_i($form->{"globalproject_id"}),                              conv_i($form->{"delivery_customer_id"}),
                        $form->{transaction_description},                          conv_i($form->{"delivery_vendor_id"}),
                        $form->{"donumber"}, $form->{"invnumber_for_credit_note"},        $form->{direct_debit} ? 't' : 'f',
+                conv_i($form->{delivery_term_id}),
                 conv_i($form->{"id"}));
   do_query($form, $dbh, $query, @values);
 
@@ -1593,7 +1598,7 @@ sub retrieve_invoice {
            a.employee_id, a.salesman_id, a.payment_id,
            a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type,
            a.transaction_description, a.donumber, a.invnumber_for_credit_note,
-           a.marge_total, a.marge_percent, a.direct_debit,
+           a.marge_total, a.marge_percent, a.direct_debit, a.delivery_term_id,
            e.name AS employee
          FROM ar a
          LEFT JOIN employee e ON (e.id = a.employee_id)
@@ -1763,7 +1768,7 @@ sub get_customer {
   $query =
     qq|SELECT
          c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms,
-         c.email, c.cc, c.bcc, c.language_id, c.payment_id,
+         c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.delivery_term_id,
          c.street, c.zipcode, c.city, c.country,
          c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, cu.name AS curr,
          c.taxincluded_checked, c.direct_debit,
index aaf0faece67a361fec4e57f157b9d542f80eeacb..0e5c05b467843c884db8dc20882795107e2f1f1f 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -518,7 +518,7 @@ sub save {
          customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?,
          shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, currency_id = (SELECT id FROM currencies WHERE name=?), closed = ?,
          delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?,
-         taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,
+         taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,delivery_term_id = ?,
          globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?
        WHERE id = ?|;
 
@@ -535,6 +535,7 @@ sub save {
              conv_i($form->{shipto_id}), conv_i($form->{payment_id}),
              conv_i($form->{delivery_vendor_id}),
              conv_i($form->{delivery_customer_id}),
+             conv_i($form->{delivery_term_id}),
              conv_i($form->{globalproject_id}), conv_i($form->{employee_id}),
              conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
              $form->{transaction_description},
@@ -768,7 +769,7 @@ sub retrieve {
            o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber,
            d.description AS department, o.payment_id, o.language_id, o.taxzone_id,
            o.delivery_customer_id, o.delivery_vendor_id, o.proforma, o.shipto_id,
-           o.globalproject_id, o.delivered, o.transaction_description
+           o.globalproject_id, o.delivered, o.transaction_description, o.delivery_term_id
          FROM oe o
          JOIN ${vc} cv ON (o.${vc}_id = cv.id)
          LEFT JOIN employee e ON (o.employee_id = e.id)
@@ -1334,6 +1335,9 @@ sub order_details {
 
   $dbh->disconnect;
 
+  $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
+  $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id};
+
   $main::lxdebug->leave_sub();
 }
 
index f3a90ae3dd1dbaff7bf656673578b61d9b8db3c4..845fc3ab4a0971e3a8683c27aaebeb9a90385671 100644 (file)
@@ -52,6 +52,7 @@ use SL::CVar;
 use SL::Request qw(flatten);
 use SL::DB::Business;
 use SL::DB::Default;
+use SL::DB::DeliveryTerm;
 use SL::Helper::Flash;
 use SL::ReportGenerator;
 use SL::MoreCommon qw(uri_encode);
@@ -64,20 +65,6 @@ use strict;
 
 # end of main
 
-sub add {
-  $main::lxdebug->enter_sub();
-
-  my $url = 'controller.pl?action=CustomerVendor/add&db='. ($::form->{db} eq 'vendor' ? 'vendor' : 'customer');
-
-  if ( $::form->{callback} ) {
-    $url .= '&callback='. uri_encode($::form->{callback});
-  }
-
-  print $::form->redirect_header($url);
-
-  $main::lxdebug->leave_sub();
-}
-
 sub search {
   $main::lxdebug->enter_sub();
 
@@ -411,530 +398,4 @@ sub list_contacts {
   $::lxdebug->leave_sub;
 }
 
-sub edit {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  # show history button
-  $form->{javascript} = qq|<script type=text/javascript src=js/show_history.js></script>|;
-  #/show hhistory button
-
-  CT->get_tuple(\%myconfig, \%$form);
-  CT->populate_drop_down_boxes(\%myconfig, \%$form);
-
-  $form->{title} = "Edit";
-
-  # format discount
-  $form->{discount} *= 100;
-  # format uri
-  $form->{homepage} = 'http://' . $form->{homepage} unless ((!$form->{homepage}) || $form->{homepage} =~ m|^https?://|);
-
-  &form_header;
-  &form_footer;
-
-  $main::lxdebug->leave_sub();
-}
-
-sub _shipto_label {
-  my $s = shift(@_);
-  join('; ', grep { $_ } map { $s->{"shipto$_"} } qw(name department_1 street city)) || ' '
-}
-
-sub _contacts_label {
-  join ", ", grep { $_ } $_[0]->{cp_name}, $_[0]->{cp_givenname};
-}
-
-sub form_header {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-  $form->get_lists(taxzones   => "ALL_TAXZONES",
-                   currencies => "ALL_CURRENCIES");
-  $form->get_pricegroup(\%myconfig, { all => 1 });
-
-  $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::instance_conf->get_vertreter;
-  $form->{ALL_EMPLOYEES}          = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{FU_created_for_user},  deleted => 0 ] ]);
-  $form->{ALL_SALESMEN}           = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
-  $form->{USER}                   = SL::DB::Manager::Employee->current;
-
-  $form->{taxincluded}    = ($form->{taxincluded}) ? "checked" : "";
-  $form->{is_customer}    = $form->{db}     eq 'customer';
-  $form->{shipto_label}   = \&_shipto_label;
-  $form->{contacts_label} = \&_contacts_label;
-  $form->{taxzone_id}     = 0                                                               if !$form->{id};
-  $form->{SHIPTO_ALL}     = [ +{ shipto_id => '0', shiptoname => $::locale->text('All') }, @{ $form->{SHIPTO} } ];
-
-  $form->{title} = $form->{title_save}
-                || $locale->text("$form->{title} " . ucfirst $form->{db}) . ($form->{title} eq "Edit" ? " $form->{name}" : '');
-
-  CT->query_titles_and_greetings(\%myconfig, \%$form);
-  map { $form->{"MB_$_"} = [ map +{ id => $_, description => $_ }, @{ $form->{$_} } ] } qw(COMPANY_GREETINGS);
-
-  $form->{NOTES} ||= [ ];
-
-  if (!$form->{'language_id'}) {
-    my $l_id = SL::DB::Default->get->{'language_id'};
-    if ($l_id) {
-      $form->{'default_language_id'} = $l_id;
-    }
-  }
-
-  if (!$form->{'id'}) {
-    $form->{'currency'} = $form->get_default_currency(\%myconfig);
-  } else {
-    $form->{currency} = $form->{curr};
-  }
-
-  $::form->{CUSTOM_VARIABLES} = { };
-  my %specs = ( CT       => { field => 'id',    name_prefix => '',   },
-                Contacts => { field => 'cp_id', name_prefix => 'cp', },
-              );
-
-  for my $module (keys %specs) {
-    my $spec = $specs{$module};
-
-    $::form->{CUSTOM_VARIABLES}->{$module} = CVar->get_custom_variables(module => $module, trans_id => $::form->{ $spec->{field} });
-    CVar->render_inputs(variables => $::form->{CUSTOM_VARIABLES}->{$module}, name_prefix => $spec->{name_prefix})
-      if scalar @{ $::form->{CUSTOM_VARIABLES}->{$module} };
-  }
-
-  $form->header;
-  print $form->parse_html_template('ct/form_header');
-
-  $main::lxdebug->leave_sub();
-}
-
-sub form_footer {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-
-  print $form->parse_html_template('ct/form_footer', { is_orphaned => $form->{status} eq 'orphaned',
-                                                       is_customer => $form->{db}     eq 'customer' });
-  $main::lxdebug->leave_sub();
-}
-
-sub _do_save {
-  $main::auth->assert('customer_vendor_edit');
-
-  $::form->isblank("name", $::locale->text("Name missing!"));
-
-  if ($::form->{new_salesman_id} && $::instance_conf->get_vertreter) {
-    $::form->{salesman_id} = $::form->{new_salesman_id};
-    delete $::form->{new_salesman_id};
-  }
-
-  my $res = $::form->{db} eq 'customer' ? CT->save_customer(\%::myconfig, $::form) : CT->save_vendor(\%::myconfig, $::form);
-
-  if (3 == $res) {
-    if ($::form->{"db"} eq "customer") {
-      $::form->error($::locale->text('This customer number is already in use.'));
-    } else {
-      $::form->error($::locale->text('This vendor number is already in use.'));
-    }
-  }
-}
-
-sub add_transaction {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit & ' .
-                '(general_ledger         | invoice_edit         | vendor_invoice_edit | ' .
-                ' request_quotation_edit | sales_quotation_edit | sales_order_edit    | purchase_order_edit)');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-#  # saving the history
-#  if(!exists $form->{addition}) {
-#    $form->{addition} = "ADD TRANSACTION";
-#    $form->save_history;
-#  }
-#  # /saving the history
-
-  _do_save();
-
-  $form->{callback} = $form->escape($form->{callback}, 1);
-  my $name = $form->escape("$form->{name}", 1);
-
-  $form->{callback} =
-    "$form->{script}?action=add&vc=$form->{db}&$form->{db}_id=$form->{id}&$form->{db}=$name&type=$form->{type}&callback=$form->{callback}";
-  $form->redirect;
-
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_ap_transaction {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit & general_ledger');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  $form->{script} = "ap.pl";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &add_transaction;
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_ar_transaction {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit & general_ledger');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  $form->{script} = "ar.pl";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &add_transaction;
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_invoice {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  if ($form->{db} eq 'customer') {
-    $main::auth->assert('customer_vendor_edit & invoice_edit');
-  } else {
-    $main::auth->assert('customer_vendor_edit & vendor_invoice_edit');
-  }
-
-  $form->{script} = ($form->{db} eq 'customer') ? "is.pl" : "ir.pl";
-  $form->{type} = "invoice";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|invnumber_| . $form->{invnumber};
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &add_transaction;
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_rfq {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit & request_quotation_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  $form->{script} = "oe.pl";
-  $form->{type}   = "request_quotation";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &add_transaction;
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_quotation {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit & sales_quotation_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  $form->{script} = "oe.pl";
-  $form->{type}   = "sales_quotation";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &add_transaction;
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_order {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  if ($form->{db} eq 'customer') {
-    $main::auth->assert('customer_vendor_edit & sales_order_edit');
-  } else {
-    $main::auth->assert('customer_vendor_edit & purchase_order_edit');
-  }
-
-  $form->{script} = "oe.pl";
-  $form->{type}   =
-    ($form->{db} eq 'customer') ? "sales_order" : "purchase_order";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &add_transaction;
-  $main::lxdebug->leave_sub();
-}
-
-sub save_and_close {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-  my $msg = ucfirst $form->{db};
-  $msg .= " saved!";
-
-  _do_save();
-
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  $form->redirect($locale->text($msg));
-
-  $main::lxdebug->leave_sub();
-}
-
-sub save {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-  my $msg = ucfirst $form->{db};
-  $msg .= " saved!";
-
-  _do_save();
-
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
-    $form->{addition} = "SAVED";
-    $form->save_history;
-  }
-  # /saving the history
-  &edit;
-
-  $main::lxdebug->leave_sub();
-  ::end_of_request();
-}
-
-sub delete {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-  CT->delete(\%myconfig, \%$form);
-
-  my $msg = ucfirst $form->{db};
-  $msg .= " deleted!";
-  # saving the history
-  if(!exists $form->{addition}) {
-    $form->{snumbers} = ($form->{"db"} eq "customer" ? qq|customernumber_| . $form->{customernumber} : qq|vendornumber_| . $form->{vendornumber});
-    $form->{addition} = "DELETED";
-    $form->save_history;
-  }
-  # /saving the history
-  $form->redirect($locale->text($msg));
-
-  $main::lxdebug->leave_sub();
-}
-
-sub display {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-
-  &form_header();
-  &form_footer();
-
-  $main::lxdebug->leave_sub();
-}
-
-sub update {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  my $form     = $main::form;
-
-  &display();
-  $main::lxdebug->leave_sub();
-}
-
-sub get_contact {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  CT->populate_drop_down_boxes(\%::myconfig, $::form);
-  CT->query_titles_and_greetings(\%::myconfig, $::form);
-  CT->get_contact(\%::myconfig, $::form) if $::form->{cp_id};
-
-  $::form->{CUSTOM_VARIABLES}{Contacts} = CVar->get_custom_variables(module => 'Contacts', trans_id => $::form->{cp_id});
-  CVar->render_inputs(variables => $::form->{CUSTOM_VARIABLES}{Contacts}, name_prefix => 'cp')
-    if scalar @{ $::form->{CUSTOM_VARIABLES}->{Contacts} };
-
-  $::form->{contacts_label} = \&_contacts_label;
-
-  print $::form->ajax_response_header(), $::form->parse_html_template('ct/_contact');
-
-  $main::lxdebug->leave_sub();
-}
-
-sub get_shipto {
-  $main::lxdebug->enter_sub();
-
-  $main::auth->assert('customer_vendor_edit');
-
-  CT->populate_drop_down_boxes(\%::myconfig, $::form);
-  CT->get_shipto(\%::myconfig, $::form) if $::form->{shipto_id};
-
-  $::form->{shipto_label} = \&_shipto_label;
-
-  print $::form->ajax_response_header(), $::form->parse_html_template('ct/_shipto');
-
-  $main::lxdebug->leave_sub();
-}
-
-sub get_delivery {
-  $::lxdebug->enter_sub;
-
-  $::auth->assert('customer_vendor_edit');
-  $::auth->assert('sales_all_edit');
-
-  CT->get_delivery(\%::myconfig, $::form );
-
-  print $::form->ajax_response_header,
-        $::form->parse_html_template('ct/get_delivery', {
-          is_customer =>  $::form->{db} eq 'customer',
-        });
-
-  $::lxdebug->leave_sub;
-}
-
-sub delete_shipto {
-  $::lxdebug->enter_sub;
-  $::auth->assert('customer_vendor_edit');
-
-  if (!$::form->{shipto_id}) {
-    flash('error', $::locale->text('No shipto selected to delete'));
-  } else {
-
-    CT->get_shipto(\%::myconfig, $::form);
-
-    my $shipto = SL::DB::Manager::Shipto->find_by(shipto_id => $::form->{shipto_id});
-
-    if ($shipto->used) {
-      $shipto->detach->save;
-      flash('info', $::locale->text('Shipto is in use and was flagged invalid.'));
-    } else {
-      $shipto->delete;
-      flash('info', $::locale->text('Shipto deleted.'));
-    }
-    delete $::form->{$_} for grep /^shipto/, keys %$::form;
-  }
-
-  edit();
-
-  $::lxdebug->leave_sub;
-}
-
-sub delete_contact {
-  $::lxdebug->enter_sub;
-  $::auth->assert('customer_vendor_edit');
-
-  if (!$::form->{cp_id}) {
-    flash('error', $::locale->text('No contact selected to delete'));
-  } else {
-
-    CT->get_contact(\%::myconfig, $::form);
-
-    my $contact = SL::DB::Manager::Contact->find_by(cp_id => $::form->{cp_id});
-
-    if ($contact->used) {
-      $contact->detach->save;
-      flash('info', $::locale->text('Contact is in use and was flagged invalid.'));
-    } else {
-      $contact->delete;
-      flash('info', $::locale->text('Contact deleted.'));
-    }
-    delete $::form->{$_} for grep /^cp_/, keys %$::form;
-  }
-
-  edit();
-
-  $::lxdebug->leave_sub;
-}
-
-sub ajax_autocomplete {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-
-  $form->{column}          = 'name'     unless $form->{column} =~ /^name$/;
-  $form->{vc}              = 'customer' unless $form->{vc} =~ /^customer|vendor$/;
-  $form->{db}              = $form->{vc}; # CT expects this
-  $form->{$form->{column}} = $form->{q}           || '';
-  $form->{limit}           = ($form->{limit} * 1) || 10;
-  $form->{searchitems}   ||= '';
-
-  CT->search(\%myconfig, $form);
-
-  print $form->ajax_response_header(),
-        $form->parse_html_template('ct/ajax_autocomplete');
-
-  $main::lxdebug->leave_sub();
-}
-
 sub continue { call_sub($main::form->{nextsub}); }
index 06b4c4ef15f77bf8363d0e0560683c29f50ba437..3e54c1ed8531caf3ea87bf23af4222d744638822 100644 (file)
@@ -172,7 +172,7 @@ sub order_links {
   DO->retrieve('vc'  => $form->{vc},
                'ids' => $form->{id});
 
-  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes currency));
+  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes delivery_term_id currency));
   $form->{shipto} = 1 if $form->{id} || $form->{convert_from_oe_ids};
 
   # get customer / vendor
@@ -184,7 +184,7 @@ sub order_links {
     $form->{discount} = $form->{customer_discount};
   }
 
-  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id));
+  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id delivery_term_id));
   $form->restore_vars(qw(currency)) if ($form->{id} || $form->{convert_from_oe_ids});
   $form->restore_vars(qw(taxincluded)) if $form->{id};
   $form->restore_vars(qw(salesman_id)) if $editing;
@@ -335,6 +335,7 @@ sub form_footer {
   my $form     = $main::form;
 
   $form->{PRINT_OPTIONS} = print_options('inline' => 1);
+  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
 
   print $form->parse_html_template('do/form_footer',
     {transfer_default         => ($::instance_conf->get_transfer_default)});
index 0756448015938fe6addca9f62199c7d8730f605e..c1bc770326eda2b03e7ddc9802c8fdd1ffcd4c16 100644 (file)
@@ -1365,6 +1365,7 @@ sub print_form {
 
   my $language_saved = $form->{language_id};
   my $payment_id_saved = $form->{payment_id};
+  my $delivery_term_id_saved = $form->{delivery_term_id};
   my $salesman_id_saved = $form->{salesman_id};
   my $cp_id_saved = $form->{cp_id};
   my $taxzone_id_saved = $form->{taxzone_id};
@@ -1374,6 +1375,7 @@ sub print_form {
 
   $form->{language_id} = $language_saved;
   $form->{payment_id} = $payment_id_saved;
+  $form->{delivery_term_id} = $delivery_term_id_saved;
   $form->{taxzone_id} = $taxzone_id_saved;
   $form->{currency} = $currency_saved;
 
index 3653891f925c4f5b2fbc455cb010905e73d40be1..30124cf6459768bbccf2f2c86e1b5d11db213ecc 100644 (file)
@@ -116,7 +116,7 @@ sub invoice_links {
     }
   }
 
-  my ($payment_id, $language_id, $taxzone_id, $currency);
+  my ($payment_id, $language_id, $taxzone_id, $currency, $delivery_term_id);
   if ($form->{payment_id}) {
     $payment_id = $form->{payment_id};
   }
@@ -129,6 +129,9 @@ sub invoice_links {
   if ($form->{currency}) {
     $currency = $form->{currency};
   }
+  if ($form->{delivery_term_id}) {
+    $delivery_term_id = $form->{delivery_term_id};
+  }
 
   my $cp_id = $form->{cp_id};
   IR->get_vendor(\%myconfig, \%$form);
@@ -147,6 +150,9 @@ sub invoice_links {
   if ($currency) {
     $form->{currency} = $currency;
   }
+  if ($delivery_term_id) {
+    $form->{delivery_term_id} = $delivery_term_id;
+  }
 
   my @curr = $form->get_all_currencies();
   map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
@@ -431,6 +437,8 @@ sub form_footer {
     $totalpaid += $form->{"paid_$i"};
   }
 
+  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
+
   print $form->parse_html_template('ir/form_footer', {
     is_type_credit_note => ($form->{type} eq "credit_note"),
     totalpaid           => $totalpaid,
index ecc5f5577ca7836a8398c98c2b71c1421fc65f9d..b8851ff6a3ec2a63fd3c44e790e9404987f2c9eb 100644 (file)
@@ -149,7 +149,9 @@ sub invoice_links {
 
   my $editing = $form->{id};
 
-  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded currency cp_id intnotes id shipto_id));
+  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id
+                        taxincluded currency cp_id intnotes id shipto_id
+                        delivery_term_id));
 
   IS->get_customer(\%myconfig, \%$form);
 
@@ -161,7 +163,8 @@ sub invoice_links {
   $form->restore_vars(qw(id));
 
   IS->retrieve_invoice(\%myconfig, \%$form);
-  $form->restore_vars(qw(payment_id language_id taxzone_id currency intnotes cp_id shipto_id));
+  $form->restore_vars(qw(payment_id language_id taxzone_id currency intnotes
+                         cp_id shipto_id delivery_term_id));
   $form->restore_vars(qw(taxincluded)) if $form->{id};
   $form->restore_vars(qw(salesman_id)) if $editing;
 
@@ -460,6 +463,8 @@ sub form_footer {
 
   $form->{oldinvtotal} = $form->{invtotal};
 
+  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
+
   print $form->parse_html_template('is/form_footer', {
     is_type_credit_note => ($form->{type} eq "credit_note"),
     totalpaid           => $totalpaid,
index 1c1135c2f66384ffbbea382c86bb56bfa4d8ca05..883507aa9c5a563a65e642954f4e4d804268b59c 100644 (file)
@@ -245,14 +245,14 @@ sub order_links {
 
   $form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"};
 
-  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id currency));
+  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id delivery_term_id currency));
   $form->{shipto} = 1 if $form->{id} || $form->{convert_from_oe_ids};
 
   # get customer / vendor
   IR->get_vendor(\%myconfig, \%$form)   if $form->{type} =~ /(purchase_order|request_quotation)/;
   IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/;
 
-  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id));
+  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id delivery_term_id));
   $form->restore_vars(qw(currency))    if $form->{id};
   $form->restore_vars(qw(taxincluded)) if $form->{id};
   $form->restore_vars(qw(salesman_id)) if $editing;
@@ -523,6 +523,8 @@ sub form_footer {
 
   $form->{oldinvtotal} = $form->{invtotal};
 
+  $TMPL_VAR{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
+
   print $form->parse_html_template("oe/form_footer", {
      %TMPL_VAR,
      webdav          => $::instance_conf->get_webdav,
index 8f16f6e90bb66e98af3d0f97113ddedf8da84360..ef3f98aca8ebb12ceda83f38a400d483d49ebcb0 100644 (file)
@@ -39,6 +39,10 @@ Größere neue Features:
 
 Kleinere neue Features und Detailverbesserungen:
 
+- Lieferbedingungen analog zu Zahlungsbedingungen eingeführt.
+  Sie können angelegt, beim Benutzer voreingestellt und in allen Ein- und Ver-
+  kaufsmasken gesetzt werden.
+
 - Rechte für die Anzeige von Debitoren- und Kreditorenbuchungen in Berichten
 __Es kann sinnvoll sein, den Standardeinkäufern und Verkäufern keinen Zugriff
 __auf Debitoren- oder Kreditorenbuchungen zu geben. Debitorenbuchungen werden 
index 801814342b362b6762a9c62d7ad5c5bd463746c7..d8dba3df77d2939d8f91f7322f1c07f969328160 100644 (file)
@@ -3219,7 +3219,7 @@ ln -s $(pwd)/kivitendo-task-server.service /etc/systemd/system/</programlisting>
         </sect3>
 
         <sect3 id="dokumentenvorlagen-und-variablen.allgemein-verkaeufer">
-          <title>Informationen Ã¼ber den Bearbeiter</title>
+          <title>Informationen Ã¼ber den Verkäufer</title>
 
           <variablelist>
             <varlistentry>
@@ -3349,6 +3349,25 @@ ln -s $(pwd)/kivitendo-task-server.service /etc/systemd/system/</programlisting>
             </varlistentry>
           </variablelist>
         </sect3>
+
+        <sect3 id="dokumentenvorlagen-und-variablen.allgemein-lieferbedingungen">
+          <title>Variablen für Lieferbedingungen</title>
+
+          <variablelist>
+            <varlistentry>
+              <term><varname>delivery_term</varname></term>
+              <listitem><para>Datenbank-Objekt der Lieferbedingung</para></listitem>
+            </varlistentry>
+            <varlistentry>
+              <term><varname>delivery_term.description</varname></term>
+              <listitem><para>Beschreibung der Lieferbedingung</para></listitem>
+            </varlistentry>
+            <varlistentry>
+              <term><varname>delivery_term.long_description</varname></term>
+              <listitem><para>Langtext bzw. Ã¼bersetzter Langtext der Lieferbedingung</para></listitem>
+            </varlistentry>
+          </variablelist>
+        </sect3>
       </sect2>
 
       <sect2 id="dokumentenvorlagen-und-variablen.invoice">
index 5763062d35d0945848135f83a28679408fcd39d4..e8667b4c326a98c062fdc15fd215293c5533b985 100644 (file)
                         <code class="varname">employee_taxnumber</code>
                      </span></dt><dd><p>Steuernummer</p></dd><dt><span class="term">
                         <code class="varname">employee_tel</code>
-                     </span></dt><dd><p>Telefonnummer</p></dd></dl></div></div><div class="sect3" title="3.2.7.4. Informationen Ã¼ber den Bearbeiter"><div class="titlepage"><div><div><h4 class="title"><a name="dokumentenvorlagen-und-variablen.allgemein-verkaeufer"></a>3.2.7.4. Informationen Ã¼ber den Bearbeiter</h4></div></div></div><div class="variablelist"><dl><dt><span class="term">
+                     </span></dt><dd><p>Telefonnummer</p></dd></dl></div></div><div class="sect3" title="3.2.7.4. Informationen Ã¼ber den Verkäufer"><div class="titlepage"><div><div><h4 class="title"><a name="dokumentenvorlagen-und-variablen.allgemein-verkaeufer"></a>3.2.7.4. Informationen Ã¼ber den Verkäufer</h4></div></div></div><div class="variablelist"><dl><dt><span class="term">
                         <code class="varname">salesman_address</code>
                      </span></dt><dd><p>Adressfeld</p></dd><dt><span class="term">
                         <code class="varname">salesman_businessnumber</code>
                         <code class="varname">taxdescription</code>
                      </span></dt><dd><p>Name der Steuer</p></dd><dt><span class="term">
                         <code class="varname">taxrate</code>
-                     </span></dt><dd><p>Steuersatz</p></dd></dl></div></div></div><div class="sect2" title="3.2.8. Variablen in Rechnungen"><div class="titlepage"><div><div><h3 class="title"><a name="dokumentenvorlagen-und-variablen.invoice"></a>3.2.8. Variablen in Rechnungen</h3></div></div></div><div class="sect3" title="3.2.8.1. Allgemeine Variablen"><div class="titlepage"><div><div><h4 class="title"><a name="dokumentenvorlagen-und-variablen.invoice-allgemein"></a>3.2.8.1. Allgemeine Variablen</h4></div></div></div><div class="variablelist"><dl><dt><span class="term">
+                     </span></dt><dd><p>Steuersatz</p></dd></dl></div></div><div class="sect3" title="3.2.7.6. Variablen für Lieferbedingungen"><div class="titlepage"><div><div><h4 class="title"><a name="dokumentenvorlagen-und-variablen.allgemein-lieferbedingungen"></a>3.2.7.6. Variablen für Lieferbedingungen</h4></div></div></div><div class="variablelist"><dl><dt><span class="term">
+                        <code class="varname">delivery_term</code>
+                     </span></dt><dd><p>Datenbank-Objekt der Lieferbedingung</p></dd><dt><span class="term">
+                        <code class="varname">delivery_term.description</code>
+                     </span></dt><dd><p>Beschreibung der Lieferbedingung</p></dd><dt><span class="term">
+                        <code class="varname">delivery_term.long_description</code>
+                     </span></dt><dd><p>Langtext bzw. Ã¼bersetzter Langtext der Lieferbedingung</p></dd></dl></div></div></div><div class="sect2" title="3.2.8. Variablen in Rechnungen"><div class="titlepage"><div><div><h3 class="title"><a name="dokumentenvorlagen-und-variablen.invoice"></a>3.2.8. Variablen in Rechnungen</h3></div></div></div><div class="sect3" title="3.2.8.1. Allgemeine Variablen"><div class="titlepage"><div><div><h4 class="title"><a name="dokumentenvorlagen-und-variablen.invoice-allgemein"></a>3.2.8.1. Allgemeine Variablen</h4></div></div></div><div class="variablelist"><dl><dt><span class="term">
                         <code class="varname">creditremaining</code>
                      </span></dt><dd><p>Verbleibender Kredit</p></dd><dt><span class="term">
                         <code class="varname">currency</code>
                         <code class="varname">invdate</code>
                      </span></dt><dd><p>Rechnungsdatum</p></dd><dt><span class="term">
                         <code class="varname">invnumber</code>
-                     </span></dt><dd><p>Rechnungsnummer</p></dd></dl></div></div></div><div class="sect2" title="3.2.10. Variablen in anderen Vorlagen"><div class="titlepage"><div><div><h3 class="title"><a name="dokumentenvorlagen-und-variablen.andere-vorlagen"></a>3.2.10. Variablen in anderen Vorlagen</h3></div></div></div><div class="sect3" title="3.2.10.1. Einführung"><div class="titlepage"><div><div><h4 class="title"><a name="d0e4654"></a>3.2.10.1. Einführung</h4></div></div></div><p>Die Variablen in anderen Vorlagen sind Ã¤hnlich wie in der
+                     </span></dt><dd><p>Rechnungsnummer</p></dd></dl></div></div></div><div class="sect2" title="3.2.10. Variablen in anderen Vorlagen"><div class="titlepage"><div><div><h3 class="title"><a name="dokumentenvorlagen-und-variablen.andere-vorlagen"></a>3.2.10. Variablen in anderen Vorlagen</h3></div></div></div><div class="sect3" title="3.2.10.1. Einführung"><div class="titlepage"><div><div><h4 class="title"><a name="d0e4685"></a>3.2.10.1. Einführung</h4></div></div></div><p>Die Variablen in anderen Vorlagen sind Ã¤hnlich wie in der
           Rechnung. Allerdings heißen die Variablen, die mit
           <code class="varname">inv</code> beginnen, jetzt anders. Bei den Angeboten
           fangen sie mit <code class="varname">quo</code> für "quotation" an:
index f6518edfe71816ab4fdd362532e85dc5e53cbbd9..8c7b140937bf5d88ef914727da477af8e3d6ea3e 100644 (file)
@@ -1,6 +1,6 @@
 <html><head>
       <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-   <title>Kapitel 4. Entwicklerdokumentation</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1-RC2"><link rel="home" href="index.html" title="kivitendo 3.0.0: Installation, Konfiguration, Entwicklung"><link rel="up" href="index.html" title="kivitendo 3.0.0: Installation, Konfiguration, Entwicklung"><link rel="prev" href="ch03s03.html" title="3.3. Excel-Vorlagen"><link rel="next" href="ch04s02.html" title="4.2. Entwicklung unter FastCGI"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Kapitel 4. Entwicklerdokumentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s03.html">Zurück</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch04s02.html">Weiter</a></td></tr></table><hr></div><div class="chapter" title="Kapitel 4. Entwicklerdokumentation"><div class="titlepage"><div><div><h2 class="title"><a name="d0e5261"></a>Kapitel 4. Entwicklerdokumentation</h2></div></div></div><div class="sect1" title="4.1. Globale Variablen"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="devel.globals"></a>4.1. Globale Variablen</h2></div></div></div><div class="sect2" title="4.1.1. Wie sehen globale Variablen in Perl aus?"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5267"></a>4.1.1. Wie sehen globale Variablen in Perl aus?</h3></div></div></div><p>Globale Variablen liegen in einem speziellen namespace namens
+   <title>Kapitel 4. Entwicklerdokumentation</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1-RC2"><link rel="home" href="index.html" title="kivitendo 3.0.0: Installation, Konfiguration, Entwicklung"><link rel="up" href="index.html" title="kivitendo 3.0.0: Installation, Konfiguration, Entwicklung"><link rel="prev" href="ch03s03.html" title="3.3. Excel-Vorlagen"><link rel="next" href="ch04s02.html" title="4.2. Entwicklung unter FastCGI"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Kapitel 4. Entwicklerdokumentation</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s03.html">Zurück</a>&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch04s02.html">Weiter</a></td></tr></table><hr></div><div class="chapter" title="Kapitel 4. Entwicklerdokumentation"><div class="titlepage"><div><div><h2 class="title"><a name="d0e5292"></a>Kapitel 4. Entwicklerdokumentation</h2></div></div></div><div class="sect1" title="4.1. Globale Variablen"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="devel.globals"></a>4.1. Globale Variablen</h2></div></div></div><div class="sect2" title="4.1.1. Wie sehen globale Variablen in Perl aus?"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5298"></a>4.1.1. Wie sehen globale Variablen in Perl aus?</h3></div></div></div><p>Globale Variablen liegen in einem speziellen namespace namens
         "main", der von Ã¼berall erreichbar ist. Darüber hinaus sind bareword
         globs global und die meisten speziellen Variablen sind...
         speziell.</p><p>Daraus ergeben sich folgende Formen:</p><div class="variablelist"><dl><dt><span class="term">
@@ -25,7 +25,7 @@
               <code class="varname">$PACKAGE::form</code>.</p></dd><dt><span class="term">
                      <code class="literal">local $form</code>
                   </span></dt><dd><p>Alle Ã„nderungen an <code class="varname">$form</code> werden am Ende
-              des scopes zurückgesetzt</p></dd></dl></div></div><div class="sect2" title="4.1.2. Warum sind globale Variablen ein Problem?"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5368"></a>4.1.2. Warum sind globale Variablen ein Problem?</h3></div></div></div><p>Das erste Problem ist <span class="productname">FCGI</span>â„¢.</p><p>
+              des scopes zurückgesetzt</p></dd></dl></div></div><div class="sect2" title="4.1.2. Warum sind globale Variablen ein Problem?"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5399"></a>4.1.2. Warum sind globale Variablen ein Problem?</h3></div></div></div><p>Das erste Problem ist <span class="productname">FCGI</span>â„¢.</p><p>
                <span class="productname">SQL-Ledger</span>â„¢ hat fast alles im globalen
         namespace abgelegt, und erwartet, dass es da auch wiederzufinden ist.
         Unter <span class="productname">FCGI</span>â„¢ müssen diese Sachen aber wieder
@@ -39,7 +39,7 @@
         dies hat, seit der Einführung, u.a. schon so manche langwierige
         Bug-Suche verkürzt. Da globale Variablen aber implizit mit Package
         angegeben werden, werden die nicht geprüft, und somit kann sich
-        schnell ein Tippfehler einschleichen.</p></div><div class="sect2" title="4.1.3. Kanonische globale Variablen"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5401"></a>4.1.3. Kanonische globale Variablen</h3></div></div></div><p>Um dieses Problem im Griff zu halten gibt es einige wenige
+        schnell ein Tippfehler einschleichen.</p></div><div class="sect2" title="4.1.3. Kanonische globale Variablen"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5432"></a>4.1.3. Kanonische globale Variablen</h3></div></div></div><p>Um dieses Problem im Griff zu halten gibt es einige wenige
         globale Variablen, die kanonisch sind, d.h. sie haben bestimmte
         vorgegebenen Eigenschaften, und alles andere sollte anderweitig
         umhergereicht werden.</p><p>Diese Variablen sind im Moment die folgenden neun:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
@@ -62,7 +62,7 @@
                      <code class="varname">$::request</code>
                   </p></li></ul></div><p>Damit diese nicht erneut als Müllhalde missbraucht werden, im
         Folgenden eine kurze Erläuterung der bestimmten vorgegebenen
-        Eigenschaften (Konventionen):</p><div class="sect3" title="4.1.3.1. $::form"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5465"></a>4.1.3.1. $::form</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Ist ein Objekt der Klasse
+        Eigenschaften (Konventionen):</p><div class="sect3" title="4.1.3.1. $::form"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5496"></a>4.1.3.1. $::form</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Ist ein Objekt der Klasse
               "<code class="classname">Form</code>"</p></li><li class="listitem"><p>Wird nach jedem Request gelöscht</p></li><li class="listitem"><p>Muss auch in Tests und Konsolenscripts vorhanden
               sein.</p></li><li class="listitem"><p>Enthält am Anfang eines Requests die Requestparameter vom
               User</p></li><li class="listitem"><p>Kann zwar intern Ã¼ber Requestgrenzen ein Datenbankhandle
   push @{ $form-&gt;{TEMPLATE_ARRAYS}{number} },          $form-&gt;{"partnumber_$i"};
   push @{ $form-&gt;{TEMPLATE_ARRAYS}{description} },     $form-&gt;{"description_$i"};
   # ...
-}</pre></div><div class="sect3" title="4.1.3.2. %::myconfig"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5549"></a>4.1.3.2. %::myconfig</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Das einzige Hash unter den globalen Variablen</p></li><li class="listitem"><p>Wird spätestens benötigt wenn auf die Datenbank
+}</pre></div><div class="sect3" title="4.1.3.2. %::myconfig"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5580"></a>4.1.3.2. %::myconfig</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Das einzige Hash unter den globalen Variablen</p></li><li class="listitem"><p>Wird spätestens benötigt wenn auf die Datenbank
               zugegriffen wird</p></li><li class="listitem"><p>Wird bei jedem Request neu erstellt.</p></li><li class="listitem"><p>Enthält die Userdaten des aktuellen Logins</p></li><li class="listitem"><p>Sollte nicht ohne Filterung irgendwo gedumpt werden oder
               extern serialisiert werden, weil da auch der Datenbankzugriff
               für diesen user drinsteht.</p></li><li class="listitem"><p>Enthält unter anderem Listenbegrenzung vclimit,
           Ã¼berwiegend die Daten, die sich unter <span class="guimenu">Programm</span>
           -&gt; <span class="guimenuitem">Einstellungen</span> befinden, bzw. die
           Informationen Ã¼ber den Benutzer die Ã¼ber die
-          Administrator-Schnittstelle eingegeben wurden.</p></div><div class="sect3" title="4.1.3.3. $::locale"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5588"></a>4.1.3.3. $::locale</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse "Locale"</p></li><li class="listitem"><p>Wird pro Request erstellt</p></li><li class="listitem"><p>Muss auch für Tests und Scripte immer verfügbar
+          Administrator-Schnittstelle eingegeben wurden.</p></div><div class="sect3" title="4.1.3.3. $::locale"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5619"></a>4.1.3.3. $::locale</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse "Locale"</p></li><li class="listitem"><p>Wird pro Request erstellt</p></li><li class="listitem"><p>Muss auch für Tests und Scripte immer verfügbar
               sein.</p></li><li class="listitem"><p>Cached intern Ã¼ber Requestgrenzen hinweg benutzte
               Locales</p></li></ul></div><p>Lokalisierung für den aktuellen User. Alle Ãœbersetzungen,
-          Zahlen- und Datumsformatierungen laufen Ã¼ber dieses Objekt.</p></div><div class="sect3" title="4.1.3.4. $::lxdebug"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5606"></a>4.1.3.4. $::lxdebug</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse "LXDebug"</p></li><li class="listitem"><p>Wird global gecached</p></li><li class="listitem"><p>Muss immer verfügbar sein, in nahezu allen
+          Zahlen- und Datumsformatierungen laufen Ã¼ber dieses Objekt.</p></div><div class="sect3" title="4.1.3.4. $::lxdebug"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5637"></a>4.1.3.4. $::lxdebug</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse "LXDebug"</p></li><li class="listitem"><p>Wird global gecached</p></li><li class="listitem"><p>Muss immer verfügbar sein, in nahezu allen
               Funktionen</p></li></ul></div><p>
                   <code class="varname">$::lxdebug</code> stellt Debuggingfunktionen
           bereit, wie "<code class="function">enter_sub</code>" und
           "<code class="function">message</code>" und "<code class="function">dump</code>" mit
           denen man flott Informationen ins Log (tmp/kivitendo-debug.log)
           packen kann.</p><p>Beispielsweise so:</p><pre class="programlisting">$main::lxdebug-&gt;message(0, 'Meine Konfig:' . Dumper (%::myconfig));
-$main::lxdebug-&gt;message(0, 'Wer bin ich? Kunde oder Lieferant:' . $form-&gt;{vc});</pre></div><div class="sect3" title="4.1.3.5. $::auth"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5643"></a>4.1.3.5. $::auth</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse "SL::Auth"</p></li><li class="listitem"><p>Wird global gecached</p></li><li class="listitem"><p>Hat eine permanente DB Verbindung zur Authdatenbank</p></li><li class="listitem"><p>Wird nach jedem Request resettet.</p></li></ul></div><p>
+$main::lxdebug-&gt;message(0, 'Wer bin ich? Kunde oder Lieferant:' . $form-&gt;{vc});</pre></div><div class="sect3" title="4.1.3.5. $::auth"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5674"></a>4.1.3.5. $::auth</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse "SL::Auth"</p></li><li class="listitem"><p>Wird global gecached</p></li><li class="listitem"><p>Hat eine permanente DB Verbindung zur Authdatenbank</p></li><li class="listitem"><p>Wird nach jedem Request resettet.</p></li></ul></div><p>
                   <code class="varname">$::auth</code> stellt Funktionen bereit um die
           Rechte des aktuellen Users abzufragen. Obwohl diese Informationen
           vom aktuellen User abhängen wird das Objekt aus
           Geschwindigkeitsgründen nur einmal angelegt und dann nach jedem
           Request kurz resettet.</p><p>Dieses Objekt kapselt auch den gerade aktiven Mandanten. Dessen Einstellungen können Ã¼ber
           <code class="literal">$::auth-&gt;client</code> abgefragt werden; Rückgabewert ist ein Hash mit den Werten aus der Tabelle
-          <code class="literal">auth.clients</code>.</p></div><div class="sect3" title="4.1.3.6. $::lx_office_conf"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5672"></a>4.1.3.6. $::lx_office_conf</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse
+          <code class="literal">auth.clients</code>.</p></div><div class="sect3" title="4.1.3.6. $::lx_office_conf"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5703"></a>4.1.3.6. $::lx_office_conf</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse
               "<code class="classname">SL::LxOfficeConf</code>"</p></li><li class="listitem"><p>Global gecached</p></li><li class="listitem"><p>Repräsentation der
               <code class="filename">config/kivitendo.conf[.default]</code>-Dateien</p></li></ul></div><p>Globale Konfiguration. Configdateien werden zum Start gelesen
           und danach nicht mehr angefasst. Es ist derzeit nicht geplant, dass
@@ -152,16 +152,16 @@ $main::lxdebug-&gt;message(0, 'Wer bin ich? Kunde oder Lieferant:' . $form-&gt;{
 file = /tmp/kivitendo-debug.log</pre><p>ist der Key <code class="varname">file</code> im Programm als
           <code class="varname">$::lx_office_conf-&gt;{debug}{file}</code>
           erreichbar.</p><div class="warning" title="Warnung" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Warning"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Warnung]" src="system/docbook-xsl/images/warning.png"></td><th align="left">Warnung</th></tr><tr><td align="left" valign="top"><p>Zugriff auf die Konfiguration erfolgt im Moment Ã¼ber
-            Hashkeys, sind also nicht gegen Tippfehler abgesichert.</p></td></tr></table></div></div><div class="sect3" title="4.1.3.7. $::instance_conf"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5708"></a>4.1.3.7. $::instance_conf</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse
+            Hashkeys, sind also nicht gegen Tippfehler abgesichert.</p></td></tr></table></div></div><div class="sect3" title="4.1.3.7. $::instance_conf"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5739"></a>4.1.3.7. $::instance_conf</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse
               "<code class="classname">SL::InstanceConfiguration</code>"</p></li><li class="listitem"><p>wird pro Request neu erstellt</p></li></ul></div><p>Funktioniert wie <code class="varname">$::lx_office_conf</code>,
           speichert aber Daten die von der Instanz abhängig sind. Eine Instanz
           ist hier eine Mandantendatenbank. Beispielsweise Ã¼berprüft
           </p><pre class="programlisting">$::instance_conf-&gt;get_inventory_system eq 'perpetual'</pre><p>
-          ob die berüchtigte Bestandsmethode zur Anwendung kommt.</p></div><div class="sect3" title="4.1.3.8. $::dispatcher"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5729"></a>4.1.3.8. $::dispatcher</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse
+          ob die berüchtigte Bestandsmethode zur Anwendung kommt.</p></div><div class="sect3" title="4.1.3.8. $::dispatcher"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5760"></a>4.1.3.8. $::dispatcher</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Objekt der Klasse
               "<code class="varname">SL::Dispatcher</code>"</p></li><li class="listitem"><p>wird pro Serverprozess erstellt.</p></li><li class="listitem"><p>enthält Informationen Ã¼ber die technische Verbindung zum
               Server</p></li></ul></div><p>Der dritte Punkt ist auch der einzige Grund warum das Objekt
           global gespeichert wird. Wird vermutlich irgendwann in einem anderen
-          Objekt untergebracht.</p></div><div class="sect3" title="4.1.3.9. $::request"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5747"></a>4.1.3.9. $::request</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Hashref (evtl später Objekt)</p></li><li class="listitem"><p>Wird pro Request neu initialisiert.</p></li><li class="listitem"><p>Keine Unterstruktur garantiert.</p></li></ul></div><p>
+          Objekt untergebracht.</p></div><div class="sect3" title="4.1.3.9. $::request"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5778"></a>4.1.3.9. $::request</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>Hashref (evtl später Objekt)</p></li><li class="listitem"><p>Wird pro Request neu initialisiert.</p></li><li class="listitem"><p>Keine Unterstruktur garantiert.</p></li></ul></div><p>
                   <code class="varname">$::request</code> ist ein generischer Platz um
           Daten "für den aktuellen Request" abzulegen. Sollte nicht für action
           at a distance benutzt werden, sondern um lokales memoizing zu
@@ -174,20 +174,20 @@ file = /tmp/kivitendo-debug.log</pre><p>ist der Key <code class="varname">file</
               <code class="varname">$::request</code>
                      </p></li><li class="listitem"><p>Muss ich von anderen Teilen des Programms lesend drauf
               zugreifen? Dann <code class="varname">$::request</code>, aber Zugriff Ã¼ber
-              Wrappermethode</p></li></ul></div></div></div><div class="sect2" title="4.1.4. Ehemalige globale Variablen"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5789"></a>4.1.4. Ehemalige globale Variablen</h3></div></div></div><p>Die folgenden Variablen waren einmal im Programm, und wurden
-        entfernt.</p><div class="sect3" title="4.1.4.1. $::cgi"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5794"></a>4.1.4.1. $::cgi</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>war nötig, weil cookie Methoden nicht als
+              Wrappermethode</p></li></ul></div></div></div><div class="sect2" title="4.1.4. Ehemalige globale Variablen"><div class="titlepage"><div><div><h3 class="title"><a name="d0e5820"></a>4.1.4. Ehemalige globale Variablen</h3></div></div></div><p>Die folgenden Variablen waren einmal im Programm, und wurden
+        entfernt.</p><div class="sect3" title="4.1.4.1. $::cgi"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5825"></a>4.1.4.1. $::cgi</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>war nötig, weil cookie Methoden nicht als
               Klassenfunktionen funktionieren</p></li><li class="listitem"><p>Aufruf als Klasse erzeugt Dummyobjekt was im
               Klassennamespace gehalten wird und Ã¼ber Requestgrenzen
               leaked</p></li><li class="listitem"><p>liegt jetzt unter
               <code class="varname">$::request-&gt;{cgi}</code>
-                     </p></li></ul></div></div><div class="sect3" title="4.1.4.2. $::all_units"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5810"></a>4.1.4.2. $::all_units</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>war nötig, weil einige Funktionen in Schleifen zum Teil
+                     </p></li></ul></div></div><div class="sect3" title="4.1.4.2. $::all_units"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5841"></a>4.1.4.2. $::all_units</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>war nötig, weil einige Funktionen in Schleifen zum Teil
               ein paar hundert mal pro Request eine Liste der Einheiten
               brauchen, und de als Parameter durch einen Riesenstack von
               Funktionen geschleift werden müssten.</p></li><li class="listitem"><p>Liegt jetzt unter
               <code class="varname">$::request-&gt;{cache}{all_units}</code>
                      </p></li><li class="listitem"><p>Wird nur in
               <code class="function">AM-&gt;retrieve_all_units()</code> gesetzt oder
-              gelesen.</p></li></ul></div></div><div class="sect3" title="4.1.4.3. %::called_subs"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5829"></a>4.1.4.3. %::called_subs</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>wurde benutzt um callsub deep recursions
+              gelesen.</p></li></ul></div></div><div class="sect3" title="4.1.4.3. %::called_subs"><div class="titlepage"><div><div><h4 class="title"><a name="d0e5860"></a>4.1.4.3. %::called_subs</h4></div></div></div><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>wurde benutzt um callsub deep recursions
               abzufangen.</p></li><li class="listitem"><p>Wurde entfernt, weil callsub nur einen Bruchteil der
               möglichen Rekursioenen darstellt, und da nie welche
               auftreten.</p></li><li class="listitem"><p>komplette recursion protection wurde entfernt.</p></li></ul></div></div></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s03.html">Zurück</a>&nbsp;</td><td width="20%" align="center">&nbsp;</td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch04s02.html">Weiter</a></td></tr><tr><td width="40%" align="left" valign="top">3.3. Excel-Vorlagen&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Zum Anfang</a></td><td width="40%" align="right" valign="top">&nbsp;4.2. Entwicklung unter FastCGI</td></tr></table></div></body></html>
\ No newline at end of file
index 627d461e0fc48c52463c4712b717b40d56efef92..c97f3d396ffce8beab17bb2fbdd43fbbbd3ec8e6 100644 (file)
@@ -3,7 +3,7 @@
    <title>kivitendo 3.0.0: Installation, Konfiguration, Entwicklung</title><link rel="stylesheet" type="text/css" href="style.css"><meta name="generator" content="DocBook XSL Stylesheets V1.76.1-RC2"><link rel="home" href="index.html" title="kivitendo 3.0.0: Installation, Konfiguration, Entwicklung"><link rel="next" href="ch01.html" title="Kapitel 1. Aktuelle Hinweise"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">kivitendo 3.0.0: Installation, Konfiguration, Entwicklung</th></tr><tr><td width="20%" align="left">&nbsp;</td><th width="60%" align="center">&nbsp;</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="ch01.html">Weiter</a></td></tr></table><hr></div><div lang="de" class="book" title="kivitendo 3.0.0: Installation, Konfiguration, Entwicklung"><div class="titlepage"><div><div><h1 class="title"><a name="kivitendo-documentation"></a>kivitendo 3.0.0: Installation, Konfiguration, Entwicklung</h1></div></div><hr></div><div class="toc"><p><b>Inhaltsverzeichnis</b></p><dl><dt><span class="chapter"><a href="ch01.html">1. Aktuelle Hinweise</a></span></dt><dt><span class="chapter"><a href="ch02.html">2. Installation und Grundkonfiguration</a></span></dt><dd><dl><dt><span class="sect1"><a href="ch02.html#Installation-%C3%9Cbersicht">2.1. Ãœbersicht</a></span></dt><dt><span class="sect1"><a href="ch02s02.html">2.2. Benötigte Software und Pakete</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s02.html#Betriebssystem">2.2.1. Betriebssystem</a></span></dt><dt><span class="sect2"><a href="ch02s02.html#Pakete">2.2.2. Benötigte Perl-Pakete installieren</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s03.html">2.3. Manuelle Installation des Programmpaketes</a></span></dt><dt><span class="sect1"><a href="ch02s04.html">2.4. kivitendo-Konfigurationsdatei</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s04.html#config.config-file.introduction">2.4.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch02s04.html#config.config-file.sections-parameters">2.4.2. Abschnitte und Parameter</a></span></dt><dt><span class="sect2"><a href="ch02s04.html#config.config-file.prior-versions">2.4.3. Versionen vor 2.6.3</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s05.html">2.5. Anpassung der PostgreSQL-Konfiguration</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s05.html#Zeichens%C3%A4tze-die-Verwendung-von-UTF-8">2.5.1. Zeichensätze/die Verwendung von Unicode/UTF-8</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#%C3%84nderungen-an-Konfigurationsdateien">2.5.2. Ã„nderungen an Konfigurationsdateien</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#Erweiterung-f%C3%BCr-servergespeicherte-Prozeduren">2.5.3. Erweiterung für servergespeicherte Prozeduren</a></span></dt><dt><span class="sect2"><a href="ch02s05.html#Datenbankbenutzer-anlegen">2.5.4. Datenbankbenutzer anlegen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s06.html">2.6. Webserver-Konfiguration</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s06.html#d0e697">2.6.1. Grundkonfiguration mittels CGI</a></span></dt><dt><span class="sect2"><a href="ch02s06.html#Apache-Konfiguration.FCGI">2.6.2. Konfiguration für FastCGI/FCGI</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s07.html">2.7. Der Task-Server</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s07.html#Konfiguration-des-Task-Servers">2.7.1. Verfügbare und notwendige Konfigurationsoptionen</a></span></dt><dt><span class="sect2"><a href="ch02s07.html#Einbinden-in-den-Boot-Prozess">2.7.2. Automatisches Starten des Task-Servers beim Booten</a></span></dt><dt><span class="sect2"><a href="ch02s07.html#Prozesskontrolle">2.7.3. Wie der Task-Server gestartet und beendet wird</a></span></dt><dt><span class="sect2"><a href="ch02s07.html#Prozesskontrolle2">2.7.4. Task-Server mit mehreren Mandanten</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s08.html">2.8. Benutzerauthentifizierung und Administratorpasswort</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s08.html#Grundlagen-zur-Benutzerauthentifizierung">2.8.1. Grundlagen zur Benutzerauthentifizierung</a></span></dt><dt><span class="sect2"><a href="ch02s08.html#Administratorpasswort">2.8.2. Administratorpasswort</a></span></dt><dt><span class="sect2"><a href="ch02s08.html#Authentifizierungsdatenbank">2.8.3. Authentifizierungsdatenbank</a></span></dt><dt><span class="sect2"><a href="ch02s08.html#Passwort%C3%BCberpr%C3%BCfung">2.8.4. Passwortüberprüfung</a></span></dt><dt><span class="sect2"><a href="ch02s08.html#Name-des-Session-Cookies">2.8.5. Name des Session-Cookies</a></span></dt><dt><span class="sect2"><a href="ch02s08.html#Anlegen-der-Authentifizierungsdatenbank">2.8.6. Anlegen der Authentifizierungsdatenbank</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s09.html">2.9. Mandanten-, Benutzer- und Gruppenverwaltung</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s09.html#Zusammenh%C3%A4nge">2.9.1. Zusammenhänge</a></span></dt><dt><span class="sect2"><a href="ch02s09.html#Mandanten-Benutzer-Gruppen">2.9.2. Mandanten, Benutzer und Gruppen</a></span></dt><dt><span class="sect2"><a href="ch02s09.html#Datenbanken-anlegen">2.9.3. Datenbanken anlegen</a></span></dt><dt><span class="sect2"><a href="ch02s09.html#Gruppen-anlegen">2.9.4. Gruppen anlegen</a></span></dt><dt><span class="sect2"><a href="ch02s09.html#Benutzer-anlegen">2.9.5. Benutzer anlegen</a></span></dt><dt><span class="sect2"><a href="ch02s09.html#Mandanten-anlegen">2.9.6. Mandanten anlegen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s10.html">2.10. E-Mail-Versand aus kivitendo heraus</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s10.html#config.sending-email.sendmail">2.10.1. Versand Ã¼ber lokalen E-Mail-Server</a></span></dt><dt><span class="sect2"><a href="ch02s10.html#config.sending-email.smtp">2.10.2. Versand Ã¼ber einen SMTP-Server</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s11.html">2.11. Drucken mit kivitendo</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s11.html#Vorlagenverzeichnis-anlegen">2.11.1. Vorlagenverzeichnis anlegen</a></span></dt><dt><span class="sect2"><a href="ch02s11.html#Vorlagen-Standard">2.11.2. Standard</a></span></dt><dt><span class="sect2"><a href="ch02s11.html#f-tex">2.11.3. f-tex</a></span></dt><dt><span class="sect2"><a href="ch02s11.html#Vorlagen-RB">2.11.4. RB</a></span></dt><dt><span class="sect2"><a href="ch02s11.html#allgemeine-hinweise-zu-latex">2.11.5. Allgemeine Hinweise zu LaTeX Vorlagen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s12.html">2.12. OpenDocument-Vorlagen</a></span></dt><dt><span class="sect1"><a href="ch02s13.html">2.13. Konfiguration zur Einnahmenüberschussrechnung/Bilanzierung:
       EUR</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s13.html#config.eur.introduction">2.13.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch02s13.html#config.eur.parameters">2.13.2. Konfigurationsparameter</a></span></dt><dt><span class="sect2"><a href="ch02s13.html#config.eur.setting-parameters">2.13.3. Festlegen der Parameter</a></span></dt><dt><span class="sect2"><a href="ch02s13.html#config.eur.inventory-system-perpetual">2.13.4. Bemerkungen zu Bestandsmethode</a></span></dt><dt><span class="sect2"><a href="ch02s13.html#config.eur.knonw-issues">2.13.5. Bekannte Probleme</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s14.html">2.14. SKR04 19% Umstellung für innergemeinschaftlichen Erwerb</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch02s14.html#config.skr04-update-3804.introduction">2.14.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch02s14.html#config.skr04-update-3804.create-chart">2.14.2. Konto 3804 manuell anlegen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch02s15.html">2.15. Einstellungen pro Mandant</a></span></dt><dt><span class="sect1"><a href="ch02s16.html">2.16. kivitendo ERP verwenden</a></span></dt></dl></dd><dt><span class="chapter"><a href="ch03.html">3. Features und Funktionen</a></span></dt><dd><dl><dt><span class="sect1"><a href="ch03.html#features.periodic-invoices">3.1. Wiederkehrende Rechnungen</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03.html#features.periodic-invoices.introduction">3.1.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch03.html#features.periodic-invoices.configuration">3.1.2. Konfiguration</a></span></dt><dt><span class="sect2"><a href="ch03.html#features.periodic-invoices.variables">3.1.3. Spezielle Variablen</a></span></dt><dt><span class="sect2"><a href="ch03.html#features.periodic-invoices.reports">3.1.4. Auflisten</a></span></dt><dt><span class="sect2"><a href="ch03.html#features.periodic-invoices.task-server">3.1.5. Erzeugung der eigentlichen Rechnungen</a></span></dt><dt><span class="sect2"><a href="ch03.html#features.periodic-invoices.create-for-current-month">3.1.6. Erste Rechnung für aktuellen Monat erstellen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s02.html">3.2. Dokumentenvorlagen und verfügbare Variablen</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.einf%C3%BChrung">3.2.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.variablen-ausgeben">3.2.2. Variablen ausgeben</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.verwendung-in-druckbefehlen">3.2.3. Verwendung in Druckbefehlen</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.tag-style">3.2.4. Anfang und Ende der Tags verändern</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.zuordnung-dateinamen">3.2.5. Zuordnung von den Dateinamen zu den Funktionen</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.dateinamen-erweitert">3.2.6. Sprache, Drucker und E-Mail</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.allgemeine-variablen">3.2.7. Allgemeine Variablen, die in allen Vorlagen vorhanden
         sind</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.invoice">3.2.8. Variablen in Rechnungen</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.dunning">3.2.9. Variablen in Mahnungen und Rechnungen Ã¼ber Mahngebühren</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.andere-vorlagen">3.2.10. Variablen in anderen Vorlagen</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.bloecke">3.2.11. Blöcke, bedingte Anweisungen und Schleifen</a></span></dt><dt><span class="sect2"><a href="ch03s02.html#dokumentenvorlagen-und-variablen.markup">3.2.12. Markup-Code zur Textformatierung innerhalb von
-        Formularen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s03.html">3.3. Excel-Vorlagen</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s03.html#excel-templates.summary">3.3.1. Zusammenfassung</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#excel-templates.usage">3.3.2. Bedienung</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#excel-templates.syntax">3.3.3. Variablensyntax</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#excel-templates.limitations">3.3.4. Einschränkungen</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ch04.html">4. Entwicklerdokumentation</a></span></dt><dd><dl><dt><span class="sect1"><a href="ch04.html#devel.globals">4.1. Globale Variablen</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04.html#d0e5267">4.1.1. Wie sehen globale Variablen in Perl aus?</a></span></dt><dt><span class="sect2"><a href="ch04.html#d0e5368">4.1.2. Warum sind globale Variablen ein Problem?</a></span></dt><dt><span class="sect2"><a href="ch04.html#d0e5401">4.1.3. Kanonische globale Variablen</a></span></dt><dt><span class="sect2"><a href="ch04.html#d0e5789">4.1.4. Ehemalige globale Variablen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s02.html">4.2. Entwicklung unter FastCGI</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.general">4.2.1. Allgemeines</a></span></dt><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.exiting">4.2.2. Programmende und Ausnahmen</a></span></dt><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.globals">4.2.3. Globale Variablen</a></span></dt><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.performance">4.2.4. Performance und Statistiken</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s03.html">4.3. SQL-Upgradedateien</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.introduction">4.3.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.format">4.3.2. Format der Kontrollinformationen</a></span></dt><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.format-perl-files">4.3.3. Format von in Perl geschriebenen Datenbankupgradescripten</a></span></dt><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.dbupgrade-tool">4.3.4. Hilfsscript dbupgrade2_tool.pl</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s04.html">4.4. Translations and languages</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s04.html#translations-languages.introduction">4.4.1. Introduction</a></span></dt><dt><span class="sect2"><a href="ch04s04.html#translations-languages.character-set">4.4.2. Character set</a></span></dt><dt><span class="sect2"><a href="ch04s04.html#translations-languages.file-structure">4.4.3. File structure</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s05.html">4.5. Die kivitendo-Test-Suite</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.intro">4.5.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.prerequisites">4.5.2. Voraussetzungen</a></span></dt><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.execution">4.5.3. 
+        Formularen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch03s03.html">3.3. Excel-Vorlagen</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch03s03.html#excel-templates.summary">3.3.1. Zusammenfassung</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#excel-templates.usage">3.3.2. Bedienung</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#excel-templates.syntax">3.3.3. Variablensyntax</a></span></dt><dt><span class="sect2"><a href="ch03s03.html#excel-templates.limitations">3.3.4. Einschränkungen</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="ch04.html">4. Entwicklerdokumentation</a></span></dt><dd><dl><dt><span class="sect1"><a href="ch04.html#devel.globals">4.1. Globale Variablen</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04.html#d0e5298">4.1.1. Wie sehen globale Variablen in Perl aus?</a></span></dt><dt><span class="sect2"><a href="ch04.html#d0e5399">4.1.2. Warum sind globale Variablen ein Problem?</a></span></dt><dt><span class="sect2"><a href="ch04.html#d0e5432">4.1.3. Kanonische globale Variablen</a></span></dt><dt><span class="sect2"><a href="ch04.html#d0e5820">4.1.4. Ehemalige globale Variablen</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s02.html">4.2. Entwicklung unter FastCGI</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.general">4.2.1. Allgemeines</a></span></dt><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.exiting">4.2.2. Programmende und Ausnahmen</a></span></dt><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.globals">4.2.3. Globale Variablen</a></span></dt><dt><span class="sect2"><a href="ch04s02.html#devel.fcgi.performance">4.2.4. Performance und Statistiken</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s03.html">4.3. SQL-Upgradedateien</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.introduction">4.3.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.format">4.3.2. Format der Kontrollinformationen</a></span></dt><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.format-perl-files">4.3.3. Format von in Perl geschriebenen Datenbankupgradescripten</a></span></dt><dt><span class="sect2"><a href="ch04s03.html#db-upgrade-files.dbupgrade-tool">4.3.4. Hilfsscript dbupgrade2_tool.pl</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s04.html">4.4. Translations and languages</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s04.html#translations-languages.introduction">4.4.1. Introduction</a></span></dt><dt><span class="sect2"><a href="ch04s04.html#translations-languages.character-set">4.4.2. Character set</a></span></dt><dt><span class="sect2"><a href="ch04s04.html#translations-languages.file-structure">4.4.3. File structure</a></span></dt></dl></dd><dt><span class="sect1"><a href="ch04s05.html">4.5. Die kivitendo-Test-Suite</a></span></dt><dd><dl><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.intro">4.5.1. Einführung</a></span></dt><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.prerequisites">4.5.2. Voraussetzungen</a></span></dt><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.execution">4.5.3. 
           Existierende Tests ausführen
         </a></span></dt><dt><span class="sect2"><a href="ch04s05.html#devel.testsuite.meaning_of_scripts">4.5.4. 
           Bedeutung der verschiedenen Test-Scripte
index 8ab41566e87af081476ffbf0019dd5e9e92d8431..6b364908d355f288460a53b4fbfddd98a5d24d68 100644 (file)
Binary files a/doc/kivitendo-Dokumentation.pdf and b/doc/kivitendo-Dokumentation.pdf differ
index c7803bc179c96147774aea19f1005393a302e16c..ecaa55c2d512bcda69f799ab424b31b51286e14c 100755 (executable)
@@ -221,6 +221,7 @@ $self->{texts} = {
   'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
   'Are you sure you want to delete this background job?' => 'Sind Sie sicher, dass Sie diesen Hintergrund-Job löschen möchten?',
   'Are you sure you want to delete this business?' => 'Sind Sie sicher, dass Sie diesen Kunden-/Lieferantentyp löschen wollen?',
+  'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?',
   'Are you sure you want to delete this department?' => 'Sind Sie sicher, dass Sie diese Abteilung löschen wollen?',
   'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
   'Are you sure you want to remove the marked entries from the queue?' => 'Sind Sie sicher, dass die markierten Einträge von der Warteschlange gelöscht werden sollen?',
@@ -502,6 +503,7 @@ $self->{texts} = {
   'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen',
   'Create a new business'       => 'Einen neuen Kunden-/Lieferantentyp erfassen',
   'Create a new client'         => 'Einen neuen Mandanten anlegen',
+  'Create a new delivery term'  => 'Neue Lieferbedingungen anlegen',
   'Create a new department'     => 'Eine neue Abteilung erfassen',
   'Create a new group'          => 'Neue Benutzergruppe erfassen',
   'Create a new payment term'   => 'Neue Zahlungsbedingungen anlegen',
@@ -531,6 +533,7 @@ $self->{texts} = {
   'Create new background job'   => 'Neuen Hintergrund-Job anlegen',
   'Create new business'         => 'Kunden-/Lieferantentyp erfassen',
   'Create new client #1'        => 'Neuen Mandanten #1 anlegen',
+  'Create new delivery term'    => 'Neue Lieferbedingungen anlegen',
   'Create new department'       => 'Neue Abteilung erfassen',
   'Create new payment term'     => 'Neue Zahlungsbedingung anlegen',
   'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
@@ -683,6 +686,10 @@ $self->{texts} = {
   'Delivery Orders'             => 'Lieferscheine',
   'Delivery Plan'               => 'Lieferplan',
   'Delivery Plan for currently outstanding sales orders' => 'Lieferplan für offene Verkaufsaufträge',
+  'Delivery Terms'              => 'Lieferbedingungen',
+  'Delivery terms'              => 'Lieferbedingungen',
+  'Delivery terms (database ID)' => 'Lieferbedingungen (Datenbank-ID)',
+  'Delivery terms (name)'       => 'Lieferbedingungen (Name)',
   'Department'                  => 'Abteilung',
   'Department (database ID)'    => 'Abeilung (Datenbank-ID)',
   'Department (description)'    => 'Abteilung (Beschreibung)',
@@ -827,6 +834,7 @@ $self->{texts} = {
   'Edit bank account'           => 'Bankkonto bearbeiten',
   'Edit business'               => 'Kunden-/Lieferantentyp bearbeiten',
   'Edit custom variable'        => 'Benutzerdefinierte Variable bearbeiten',
+  'Edit delivery term'          => 'Lieferbedingungen bearbeiten',
   'Edit department'             => 'Abteilung bearbeiten',
   'Edit file'                   => 'Datei bearbeiten',
   'Edit greetings'              => 'Anreden bearbeiten',
@@ -877,6 +885,7 @@ $self->{texts} = {
   'Error: Invalid business'     => 'Fehler: Kunden-/Lieferantentyp ungültig',
   'Error: Invalid contact'      => 'Fehler: Ansprechperson ungültig',
   'Error: Invalid currency'     => 'Fehler: ungültige Währung',
+  'Error: Invalid delivery terms' => 'Fehler: Lieferbedingungen ungültig',
   'Error: Invalid department'   => 'Fehler: Abteilung ungültig',
   'Error: Invalid language'     => 'Fehler: Sprache ungültig',
   'Error: Invalid order for this order item' => 'Fehler: Auftrag für diese Position ungültig',
@@ -1358,6 +1367,7 @@ $self->{texts} = {
   'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
   'No data was found.'          => 'Es wurden keine Daten gefunden.',
   'No default currency'         => 'Keine Standardwährung',
+  'No delivery term has been created yet.' => 'Es wurden noch keine Lieferbedingungen angelegt',
   'No department has been created yet.' => 'Es wurde noch keine Abteilung erfasst.',
   'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgew&auml;hlt.',
   'No file has been uploaded yet.' => 'Es wurde noch keine Datei hochgeladen.',
@@ -1498,7 +1508,7 @@ $self->{texts} = {
   'Password'                    => 'Passwort',
   'Payables'                    => 'Verbindlichkeiten',
   'Payment'                     => 'Zahlungsausgang',
-  'Payment Options'             => 'Zahlungsoptionen',
+  'Payment / Delivery Options'  => 'Zahlungs- und Lieferoptionen',
   'Payment Reminder'            => 'Zahlungserinnerung',
   'Payment Terms'               => 'Zahlungsbedingungen',
   'Payment Terms missing in row ' => 'Zahlungsfrist fehlt in Zeile ',
@@ -2100,6 +2110,10 @@ $self->{texts} = {
   'The deductible amount'       => 'Der abziehbare Skontobetrag',
   'The default value depends on the variable type:' => 'Die Bedeutung des Standardwertes h&auml;ngt vom Variablentypen ab:',
   'The delivery order has not been marked as delivered. The warehouse contents have not changed.' => 'Der Lieferschein wurde nicht als geliefert markiert. Der Lagerinhalt wurde nicht verändert.',
+  'The delivery term has been created.' => 'Die Lieferbedingungen wurden angelegt.',
+  'The delivery term has been deleted.' => 'Die Lieferbedingungen wurden gelöscht.',
+  'The delivery term has been saved.' => 'Die Lieferbedingungen wurden gespeichert.',
+  'The delivery term is in use and cannot be deleted.' => 'Die Lieferbedingungen werden bereits verwendet und können nicht gelöscht werden.',
   'The department has been created.' => 'Die Abteilung wurde angelegt.',
   'The department has been deleted.' => 'Die Abteiltung wurde gelöscht.',
   'The department has been saved.' => 'Die abteilung wurde gespeichert.',
index 0dde75a996aa7178c444e5402a1e920875f482e0..b5faacac26ca4a320a7d0571544ffae494e4893c 100644 (file)
@@ -221,6 +221,7 @@ $self->{texts} = {
   'Are you sure you want to delete Transaction' => '',
   'Are you sure you want to delete this background job?' => '',
   'Are you sure you want to delete this business?' => '',
+  'Are you sure you want to delete this delivery term?' => '',
   'Are you sure you want to delete this department?' => '',
   'Are you sure you want to delete this payment term?' => '',
   'Are you sure you want to remove the marked entries from the queue?' => '',
@@ -502,6 +503,7 @@ $self->{texts} = {
   'Create a new background job' => '',
   'Create a new business'       => '',
   'Create a new client'         => '',
+  'Create a new delivery term'  => '',
   'Create a new department'     => '',
   'Create a new group'          => '',
   'Create a new payment term'   => '',
@@ -683,6 +685,10 @@ $self->{texts} = {
   'Delivery Orders'             => '',
   'Delivery Plan'               => '',
   'Delivery Plan for currently outstanding sales orders' => '',
+  'Delivery Terms'              => '',
+  'Delivery terms'              => '',
+  'Delivery terms (database ID)' => '',
+  'Delivery terms (name)'       => '',
   'Department'                  => '',
   'Department (database ID)'    => '',
   'Department (description)'    => '',
@@ -827,6 +833,7 @@ $self->{texts} = {
   'Edit bank account'           => '',
   'Edit business'               => '',
   'Edit custom variable'        => '',
+  'Edit delivery term'          => '',
   'Edit department'             => '',
   'Edit file'                   => '',
   'Edit greetings'              => '',
@@ -877,6 +884,7 @@ $self->{texts} = {
   'Error: Invalid business'     => '',
   'Error: Invalid contact'      => '',
   'Error: Invalid currency'     => '',
+  'Error: Invalid delivery terms' => '',
   'Error: Invalid department'   => '',
   'Error: Invalid language'     => '',
   'Error: Invalid order for this order item' => '',
@@ -1358,6 +1366,7 @@ $self->{texts} = {
   'No customer has been selected yet.' => '',
   'No data was found.'          => '',
   'No default currency'         => '',
+  'No delivery term has been created yet.' => '',
   'No department has been created yet.' => '',
   'No dunnings have been selected for printing.' => '',
   'No file has been uploaded yet.' => '',
@@ -1498,7 +1507,7 @@ $self->{texts} = {
   'Password'                    => '',
   'Payables'                    => '',
   'Payment'                     => '',
-  'Payment Options'             => '',
+  'Payment / Delivery Options'  => '',
   'Payment Reminder'            => '',
   'Payment Terms'               => '',
   'Payment Terms missing in row ' => '',
@@ -2099,6 +2108,10 @@ $self->{texts} = {
   'The deductible amount'       => '',
   'The default value depends on the variable type:' => '',
   'The delivery order has not been marked as delivered. The warehouse contents have not changed.' => '',
+  'The delivery term has been created.' => '',
+  'The delivery term has been deleted.' => '',
+  'The delivery term has been saved.' => '',
+  'The delivery term is in use and cannot be deleted.' => '',
   'The department has been created.' => '',
   'The department has been deleted.' => '',
   'The department has been saved.' => '',
index ee7082499170b82ff3202b139cd084c31d048fc3..b49a851a54484fa8d256ede43c428fd230a736b1 100644 (file)
@@ -597,6 +597,10 @@ action=edit_sepa_strings
 module=controller.pl
 action=PaymentTerm/list
 
+[System--Delivery Terms]
+module=controller.pl
+action=DeliveryTerm/list
+
 [System--Manage Custom Variables]
 module=controller.pl
 action=CustomVariableConfig/list
diff --git a/sql/Pg-upgrade2/delivery_terms.sql b/sql/Pg-upgrade2/delivery_terms.sql
new file mode 100644 (file)
index 0000000..fa7400c
--- /dev/null
@@ -0,0 +1,39 @@
+-- @tag: delivery_terms
+-- @description: Neue Tabelle und Spalten für Lieferbedingungen
+-- @depends: release_3_0_0
+-- @encoding: utf-8
+
+CREATE TABLE delivery_terms (
+       id                        integer        NOT NULL DEFAULT nextval('id'),
+       description               text,
+       description_long          text,
+       sortkey                   integer        NOT NULL,
+       itime                     timestamp      DEFAULT now(),
+       mtime                     timestamp,
+
+       PRIMARY KEY (id)
+);
+
+CREATE TRIGGER mtime_delivery_terms
+    BEFORE UPDATE ON delivery_terms
+    FOR EACH ROW
+    EXECUTE PROCEDURE set_mtime();
+
+
+ALTER TABLE oe                ADD COLUMN delivery_term_id integer;
+ALTER TABLE oe                ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
+
+ALTER TABLE delivery_orders   ADD COLUMN delivery_term_id integer;
+ALTER TABLE delivery_orders   ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
+
+ALTER TABLE ar                ADD COLUMN delivery_term_id integer;
+ALTER TABLE ar                ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
+
+ALTER TABLE ap                ADD COLUMN delivery_term_id integer;
+ALTER TABLE ap                ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
+
+ALTER TABLE customer          ADD COLUMN delivery_term_id integer;
+ALTER TABLE customer          ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
+
+ALTER TABLE vendor            ADD COLUMN delivery_term_id integer;
+ALTER TABLE vendor            ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
index 94270209393b8c2932cb35d09d171d7e80618a0b..75bee25b483aab7388c39ebc84a594b5b5f09945 100644 (file)
@@ -40,6 +40,7 @@
 \newcommand{\weiteraufnaechsterseite} {weiter auf der nächsten Seite ...}
 
 \newcommand{\zahlung} {Zahlungsbedingungen:}
+\newcommand{\lieferung} {Lieferbedingungen:}
 \newcommand{\textTelefon} {Tel.:}
 \newcommand{\textFax} {Fax:}
 
index efed0a7d8f2ead1fd218c6a86bafeaa54dafb0b6..2812389610b0f89c58e005ef2de2d12cc5c35841 100644 (file)
@@ -39,6 +39,7 @@
 \newcommand{\weiteraufnaechsterseite} {to be continued on next page  ..}
 
 \newcommand{\zahlung} {Payment terms:}
+\newcommand{\lieferung} {Delivery terms:}
 \newcommand{\textTelefon} {Tel.:}
 \newcommand{\textFax} {Fax:}
 
index 097f90da5d9104fe6515786dad356697d5ce0bd4..9959c452f53b86f3ce67f746fb750035362678c2 100644 (file)
   \zahlung ~<%payment_terms%>\\
 <%end payment_terms%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 <%if ustid%>\ihreustid ~<%ustid%>.\\<%end if%>
 
 \ifthenelse{\equal{<%taxzone_id%>}{1}}
index 5f4a674e4cbca0aaef724e95df93dc8f832822e1..09833b88e7b91b37856d1752db00909855f9a942 100644 (file)
         \vspace{5mm}
 <%end if%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 \end{document}
 
index e1a737ab25b00c53ddad882826a0a3d0d5b989c8..bd820eed677a66f3f9dc139c40aa8fc3704392f8 100644 (file)
         \vspace{5mm}
 <%end if%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 \gruesse \\ \\ \\
   <%employee_name%>
 
index ceb554b5cd3af195ac46642da76960e0a19d804a..5e0268272bf357592f49c87227581c3879f3e5e6 100644 (file)
         \vspace{5mm}
 <%end if%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 <%if reqdate%>
 \anfrageBenoetigtBis~<%reqdate%>.
 <%end if%>
index 690fd137f1e46e7fcc22c31b3b76f69a40c8cb84..2f18eef274aa442ad53f68ba31bbd591057838c2 100644 (file)
         \vspace{5mm}
 <%end if%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 \end{document}
 
index 0e15a1aae4386c4e86ec069b977be72bc5836542..b86f1594d6cf938337a020b74bfce8aa30623e3c 100644 (file)
         \vspace{5mm}
 <%end if%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 <%if reqdate%>
 \lieferungErfolgtAm ~<%reqdate%>. \\
 <%end if%>
index 277eb076192f36883a106313a9ffe4e60e5a4e2b..8ef6b5ba7b984fa068b3e7d13cee72fc50aeb5f8 100644 (file)
         \vspace{5mm}
 <%end if%>
 
+<%if delivery_term%>
+  \lieferung ~<%delivery_term.description_long%>\\
+<%end delivery_term%>
+
 \angebotdanke\\
 <%if reqdate%>
 \angebotgueltig~<%reqdate%>.
index e173bee50ec7aa8eeb03b522acc56b08b3cd1bd4..e2c6e672f4ad50f84c0ad3bdfb4cd62623716643 100644 (file)
    <td>[% HTML.escape(payment_terms) %]</td>
   </tr>
 
+  <tr>
+   <td align="right">[% 'Delivery Terms' | $T8 %]</td>
+   <td>[% HTML.escape(delivery_terms) %]</td>
+  </tr>
+
   <tr>
    <td align="right">[% 'Tax Number' | $T8 %]</td>
    <td>[% HTML.escape(taxnumber) %]</td>
diff --git a/templates/webpages/ct/_contact.html b/templates/webpages/ct/_contact.html
deleted file mode 100644 (file)
index a7d395e..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-[% USE L %][% USE HTML %][% USE T8 %][% USE LxERP %]
-    <table>
-     <input type="hidden" name="cp_id" value="[% HTML.escape(cp_id) %]">
-     <tr>
-      <th align="left">[% 'Contacts' | $T8 %]</th>
-      <td>
-       [%- L.select_tag('cp_id', CONTACTS, default = cp_id, with_empty = 1, empty_title = LxERP.t8('New contact'), value_key = 'cp_id', title_sub = \contacts_label,
-                        onchange = "\$('#contacts').load('ct.pl?action=get_contact&id=' + \$('#cvid').val() + '&db=' + \$('#db').val() + '&cp_id=' + \$('#cp_id').val())") %]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Gender' | $T8 %]</th>
-      <td>
-       <select id="cp_gender" name="cp_gender">
-        <option value="m"[% IF cp_gender == 'm' %] selected[% END %]>[% 'male' | $T8 %]</option>
-        <option value="f"[% IF cp_gender == 'f' %] selected[% END %]>[% 'female' | $T8 %]</option>
-       </select>
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Title' | $T8 %]</th>
-      <td>
-       <input id="cp_title" name="cp_title" size="40" maxlength="75" value="[% HTML.escape(cp_title) %]">&nbsp;
-       [% L.select_tag('selected_cp_title', TITLES, with_empty = 1) %]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Department' | $T8 %]</th>
-      <td>
-       <input id="cp_abteilung" name="cp_abteilung" size="40" value="[% HTML.escape(cp_abteilung) %]">&nbsp;
-       [% L.select_tag('selected_cp_abteilung', DEPARTMENT, with_empty = 1) %]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Function/position' | $T8 %]</th>
-      <td>[% L.input_tag('cp_position', cp_position, size=40, maxlength=75) %]</td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Given Name' | $T8 %]</th>
-      <td><input id="cp_givenname" name="cp_givenname" size="40" maxlength="75" value="[% HTML.escape(cp_givenname) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Name' | $T8 %]</th>
-      <td><input id="cp_name" name="cp_name" size="40" maxlength="75" value="[% HTML.escape(cp_name) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'E-mail' | $T8 %]</th>
-      <td><input id="cp_email" name="cp_email" size="40" value="[% HTML.escape(cp_email) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Phone1' | $T8 %]</th>
-      <td><input id="cp_phone1" name="cp_phone1" size="40" maxlength="75" value="[% HTML.escape(cp_phone1) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Phone2' | $T8 %]</th>
-      <td><input id="cp_phone2" name="cp_phone2" size="40" maxlength="75" value="[% HTML.escape(cp_phone2) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Fax' | $T8 %]</th>
-      <td><input id="cp_fax" name="cp_fax" size="40" value="[% HTML.escape(cp_fax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Mobile1' | $T8 %]</th>
-      <td><input id="cp_mobile1" name="cp_mobile1" size="40" value="[% HTML.escape(cp_mobile1) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Mobile2' | $T8 %]</th>
-      <td><input id="cp_mobile2" name="cp_mobile2" size="40" value="[% HTML.escape(cp_mobile2) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Sat. Phone' | $T8 %]</th>
-      <td><input id="cp_satphone" name="cp_satphone" size="40" value="[% HTML.escape(cp_satphone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Sat. Fax' | $T8 %]</th>
-      <td><input id="cp_satfax" name="cp_satfax" size="40" value="[% HTML.escape(cp_satfax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Project' | $T8 %]</th>
-      <td><input id="cp_project" name="cp_project" size="40" value="[% HTML.escape(cp_project) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Street' | $T8 %]</th>
-      <td><input id="cp_street" name="cp_street" size="40" maxlength="75" value="[% HTML.escape(cp_street) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Zip, City' | $T8 %]</th>
-      <td>
-       <input id="cp_zipcode" name="cp_zipcode" size="5" maxlength="10" value="[% HTML.escape(cp_zipcode) %]">
-       <input id="cp_city" name="cp_city" size="25" maxlength="75" value="[% HTML.escape(cp_city) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Private Phone' | $T8 %]</th>
-      <td><input id="cp_privatphone" name="cp_privatphone" size="40" value="[% HTML.escape(cp_privatphone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Private E-mail' | $T8 %]</th>
-      <td><input id="cp_privatemail" name="cp_privatemail" size="40" value="[% HTML.escape(cp_privatemail) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="left" nowrap>[% 'Birthday' | $T8 %]</th>
-      <td>
-        [% L.date_tag('cp_birthday', cp_birthday) %]
-      </td>
-     </tr>
-
-     [% IF CUSTOM_VARIABLES.Contacts.size %]
-     <tr>
-      <td colspan="2"><hr></td>
-     </tr>
-
-     [%- FOREACH var = CUSTOM_VARIABLES.Contacts %]
-     <tr>
-      <th align="left" valign="top" nowrap>[% HTML.escape(var.description) %]</th>
-      <td valign="top">[% var.HTML_CODE %]</td>
-     </tr>
-     [%- END %]
-     [%- END %]
-
-    </table>
-
-    [% IF cp_id %]
-      <input type="button" id="delete_contact" onclick="submitInputButton(this);" name="action" value="[% 'Delete Contact' | $T8 %]">
-    [% END %]
diff --git a/templates/webpages/ct/_shipto.html b/templates/webpages/ct/_shipto.html
deleted file mode 100644 (file)
index 47eacee..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-[% USE L %][% USE HTML %][% USE T8 %][% USE LxERP %]
-    <table width="100%" id="shipto_table">
-     <tr>
-      <th align="right">[% 'Shipping Address' | $T8 %]</th>
-      <td>
-       [% L.select_tag('shipto_id', SHIPTO, default = shipto_id, value_key = 'shipto_id', title_sub = \shipto_label, with_empty = 1, empty_title = LxERP.t8('New shipto'),
-                       onchange = "\$('#shipto').load('ct.pl?action=get_shipto&id=' + \$('#cvid').val() + '&db=' + \$('#db').val() + '&shipto_id=' + this.value)") %]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Name' | $T8 %]</th>
-      <td><input id="shiptoname" name="shiptoname" size="35" maxlength="75" value="[% HTML.escape(shiptoname) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Abteilung' | $T8 %]</th>
-      <td>
-       <input id="shiptodepartment_1" name="shiptodepartment_1" size="16" maxlength="75" value="[% HTML.escape(shiptodepartment_1) %]">
-       <input id="shiptodepartment_2" name="shiptodepartment_2" size="16" maxlength="75" value="[% HTML.escape(shiptodepartment_2) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Street' | $T8 %]</th>
-      <td><input id="shiptostreet" name="shiptostreet" size="35" maxlength="75" value="[% HTML.escape(shiptostreet) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
-      <td>
-       <input id="shiptozipcode" name="shiptozipcode" size="5" maxlength="75" value="[% HTML.escape(shiptozipcode) %]">
-       <input id="shiptocity" name="shiptocity" size="30" maxlength="75" value="[% HTML.escape(shiptocity) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Country' | $T8 %]</th>
-      <td><input id="shiptocountry" name="shiptocountry" size="35" maxlength="75" value="[% HTML.escape(shiptocountry) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
-      <td><input id="shiptocontact" name="shiptocontact" size="30" maxlength="75" value="[% HTML.escape(shiptocontact) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
-      <td><input id="shiptophone" name="shiptophone" size="30" maxlength="30" value="[% HTML.escape(shiptophone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
-      <td><input id="shiptofax" name="shiptofax" size="30" maxlength="30" value="[% HTML.escape(shiptofax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
-      <td><input id="shiptoemail" name="shiptoemail" size="45" value="[% HTML.escape(shiptoemail) %]"></td>
-     </tr>
-    </table>
-
-[%- IF shipto_id %]
-    <input type="submit" id="delete_shipto" name="action" value="[% 'Delete Shipto' | $T8 %]">
-[%- END %]
diff --git a/templates/webpages/ct/ajax_autocomplete.html b/templates/webpages/ct/ajax_autocomplete.html
deleted file mode 100644 (file)
index 25ab8c3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-[%- USE HTML %]
-[%- FOREACH vc = CT %]
-[%- IF loop.count < limit %]
-[% vc.$column %]
-[%- END %]
-[%- END %]
diff --git a/templates/webpages/ct/form_footer.html b/templates/webpages/ct/form_footer.html
deleted file mode 100644 (file)
index 8df9c7e..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-[%- USE T8 %]
-[% USE HTML %]
-[% USE LxERP %]
-[% USE L %]
-<input name="id" type="hidden" id="cvid" value="[% HTML.escape(id) %]">
-<input name="business_save" type="hidden" value="[% HTML.escape(selectbusiness) %]">
-<input name="title_save" type="hidden" value="[% HTML.escape(title) %]">
-
-<input type="hidden" name="callback" value="[% HTML.escape(callback) %]">
-<input type="hidden" name="db" id="db" value="[% HTML.escape(db) %]">
-
-<br>
-  <input class="submit" type="submit" name="action" accesskey="s" value="[% 'Save' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  <input class="submit" type="submit" name="action" accesskey="s" value="[% 'Save and Close' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  [%- IF is_customer %]
-  <input class="submit" type="submit" name="action" value="[% 'Save and AR Transaction' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  [%- ELSE %]
-  <input class="submit" type="submit" name="action" value="[% 'Save and AP Transaction' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  [%- END %]
-  <input class="submit" type="submit" name="action" value="[% 'Save and Invoice' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  <input class="submit" type="submit" name="action" value="[% 'Save and Order' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  [%- IF is_customer %]
-  <input class="submit" type="submit" name="action" value="[% 'Save and Quotation' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  [%- ELSE %]
-  <input class="submit" type="submit" name="action" value="[% 'Save and RFQ' | $T8 %]" onclick="return check_taxzone_and_ustid()">
-  [%- END %]
-[%- IF id AND is_orphaned %]
-  [% L.submit_tag('action', LxERP.t8('Delete'), id => 'action_delete', confirm => LxERP.t8('Do you really want to delete this object?')) %]
-[%- END %]
-[%- IF id %]
-  <input type="button" class="submit" onclick="set_history_window([% HTML.escape(id) %]);" name="history" id="history" value="[% 'history' | $T8 %]">
-[%- END %]
-
-  </form>
-
- <script type="text/javascript">
-  <!--
-      function enable_delete_shipto(used) { var s=document.getElementById('delete_shipto');  if (s) s.disabled = (used > 0 ? true : false); }
-      function enable_delete_contact(used){ var s=document.getElementById('delete_contact'); if (s) s.disabled = (used > 0 ? true : false); }
-
-      function submitInputButton(button)
-      {
-        var hidden = document.createElement("input");
-        hidden.setAttribute("type", "hidden");
-
-        if( button.hasAttribute("name") )
-          hidden.setAttribute("name", button.getAttribute("name"));
-
-        if( button.hasAttribute("value") )
-          hidden.setAttribute("value", button.getAttribute("value"));
-
-
-        button.form.appendChild(hidden);
-
-        button.disabled = true;
-
-        button.form.submit();
-      }
-
-      function check_taxzone_and_ustid() {
-        if (($('#taxzone_id').val() == '1') && ($('#ustid').val() == '')) {
-          alert('[% LxERP.t8('Please enter the sales tax identification number.') %]');
-          return false;
-        }
-        return true;
-      }
-
-    -->
- </script>
diff --git a/templates/webpages/ct/form_header.html b/templates/webpages/ct/form_header.html
deleted file mode 100644 (file)
index cd5f610..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-[%- USE T8 %]
-[% USE HTML %][% USE LxERP %]
-[% USE L %]
-
- <h1>[% title %]</h1>
-
- [% PROCESS 'common/flash.html' %]
-
- <form method="post" name="ct" action="ct.pl" >
-
-  <div class="tabwidget">
-   <ul>
-    <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
-    <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
-    <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
-[%- IF id %]
-    <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
-[%- END %]
-    <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
-[%- IF CUSTOM_VARIABLES.CT.size %]
-    <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
-[%- END %]
-   </ul>
-
-   <div id="billing">
-
-    <table width="100%">
-     <tr height="5"></tr>
-     [% IF INSTANCE_CONF.get_vertreter %]
-      <tr>
-       <th align="right">[% IF is_customer %][% 'Type of Customer' | $T8 %][%- ELSE %][% 'Type of Vendor' | $T8 %][%- END %]</th>
-       <td>
-        [%- INCLUDE generic/multibox.html
-              name       = 'business',
-              DATA       = all_business,
-              show_empty = 1,
-              id_key     = 'id',
-              label_key  = 'description',
-        -%]
-       </td>
-      </tr>
-      [%- IF id %]
-      <tr>
-       <th align="right">[% 'Representative' | $T8 %]</th>
-       <td>
-        <input type="hidden" name="salesman_id" value="[%- HTML.escape(salesman_id) %]"%>
-        [%- HTML.escape(salesman) %]
-       </td>
-      </tr>
-      [%- END %]
-      <tr>
-       <th align="right">
-        [%- IF !id %]
-         [% 'Representative' | $T8 %]
-        [%- ELSE %]
-         [% 'Change representative to' | $T8 %]
-        [%- END %]
-       </th>
-       <td>
-        [%- INCLUDE generic/multibox.html
-              name       = 'new_salesman_id',
-              DATA       = ALL_SALESMAN_CUSTOMERS,
-              id_key     = 'id',
-              label_key  = 'name',
-              show_empty = id,
-        -%]
-       </td>
-      </tr>
-     [%- END %]
-     <tr>
-      [%- IF is_customer %]
-      <th align="right" nowrap>[% 'Customer Number' | $T8 %]</th>
-      <td><input name="customernumber" size="35" value="[% HTML.escape(customernumber) %]"></td>
-      [%- ELSE %]
-      <th align="right" nowrap>[% 'Vendor Number' | $T8 %]</th>
-      <td><input name="vendornumber" size="35" value="[% HTML.escape(vendornumber) %]"></td>
-      [%- END %]
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Greeting' | $T8 %]</th>
-      <td>
-       <input id="greeting" name="greeting" size="30" value="[% HTML.escape(greeting) %]" class="initial_focus">&nbsp;
-       [%- INCLUDE generic/multibox.html
-             name       = 'selected_company_greeting',
-             DATA       = MB_COMPANY_GREETINGS,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% IF is_customer %][% 'Customer Name' | $T8 %][%- ELSE %][% 'Vendor Name' | $T8 %][%- END %]</th>
-      <td><input name="name" size="35" maxlength="75" value="[% HTML.escape(name) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Department' | $T8 %]</th>
-      <td>
-       <input name="department_1" size="16" maxlength="75" value="[% HTML.escape(department_1) %]">
-       <input name="department_2" size="16" maxlength="75" value="[% HTML.escape(department_2) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Street' | $T8 %]</th>
-      <td>
-        <input name="street" size="35" maxlength="75" value="[% HTML.escape(street) %]">
-        <a
-          href="#"
-          onclick="window.open('https://maps.google.com/maps?q='+ encodeURIComponent($('#billing input[name=street]').val() +', '+ $('#billing input[name=zipcode]').val() +' '+ $('#billing input[name=city]').val() +', '+ $('#billing input[name=country]').val()), '_blank'); window.focus();"
-          title="[% 'Map' | $T8 %]"
-          >
-            <img src="image/map.png" alt="[% 'Map' | $T8 %]" />
-          </a>
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Zipcode' | $T8 %]/[% 'City' | $T8 %]</th>
-      <td>
-       <input name="zipcode" size="5" maxlength="10" value="[% HTML.escape(zipcode) %]">
-       <input name="city" size="30" maxlength="75" value="[% HTML.escape(city) %]">
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Country' | $T8 %]</th>
-      <td><input name="country" size="35" maxlength="75" value="[% HTML.escape(country) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Contact' | $T8 %]</th>
-      <td><input name="contact" size="28" maxlength="75" value="[% HTML.escape(contact) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Phone' | $T8 %]</th>
-      <td><input name="phone" size="30" value="[% HTML.escape(phone) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Fax' | $T8 %]</th>
-      <td><input name="fax" size="30" maxlength="30" value="[% HTML.escape(fax) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'E-mail' | $T8 %]</th>
-      <td><input name="email" size="45" value="[% HTML.escape(email) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Cc E-mail' | $T8 %]</th>
-      <td><input name="cc" size="45" value="[% HTML.escape(cc) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Bcc E-mail' | $T8 %]</th>
-      <td><input name="bcc" size="45" value="[% HTML.escape(bcc) %]"></td>
-     </tr>
-
-
-     <tr>
-      <th align="right" nowrap>
-      [% IF homepage %]<a href="[% HTML.escape(homepage) %]" title="[% 'Open this Website' | $T8 %]" target="_blank">[% 'Homepage' | $T8 %]</a>
-      [% ELSE %][% 'Homepage' | $T8 %]
-      [% END %]
-      </th>
-      <td><input name="homepage" size="45" title="[% 'Example: http://kivitendo.de' | $T8 %]" value="[% HTML.escape(homepage) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Username' | $T8 %]</th>
-      <td><input name="username" size="45" value="[% HTML.escape(username) %]"></td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'Password' | $T8 %]</th>
-      <td><input name="user_password" size="45" value="[% HTML.escape(user_password) %]"></td>
-     </tr>
-    </table>
-
-    <table>
-     <tr>
-      <th align="right">[% 'Credit Limit' | $T8 %]</th>
-      <td><input name="creditlimit" size="9" value="[% LxERP.format_amount(creditlimit, 0) %]"></td>
-      <input type="hidden" name="terms" value="[% HTML.escape(terms) %]">
-      <th align="right">[% 'Payment Terms' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'payment_id',
-             DATA       = payment_terms,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
-
-      <th align="right">[% 'Discount' | $T8 %]</th>
-      <td><input name="discount" size="4" value="[% LxERP.format_amount(discount) %]"> %</td>
-     </tr>
-
-     <tr>
-      <th align="right">[% 'Tax Number / SSN' | $T8 %]</th>
-      <td><input name="taxnumber" size="20" value="[% HTML.escape(taxnumber) %]"></td>
-      <!-- Anm.: R&B 15.11.2008     VAT Reg No ist Ust-ID in GB, aber generell sollte es laut Richardson die sales tax id sein -->
-      <th align="right">[% 'sales tax identification number' | $T8 %]</th>
-      <td>[% L.input_tag('ustid', ustid, maxlength=14, size=30) %]</td>
-      [%- IF is_customer %]
-      <th align="right">[% 'our vendor number at customer' | $T8 %]</th>
-      <td>[% L.input_tag('c_vendor_id', c_vendor_id, size=30) %]</td>
-      [%- ELSE %]
-      <th align="right">[% 'Customer Number' | $T8 %]</th>
-      <td>[% L.input_tag('v_customer_id', v_customer_id, size=30) %]</td>
-      [%- END %]
-     </tr>
-
-     <tr>
-      <th align="right">[% 'Account Number' | $T8 %]</th>
-      <td>[% L.input_tag('account_number', account_number, size=30) %]</td>
-      <th align="right">[% 'Bank Code Number' | $T8 %]</th>
-      <td>[% L.input_tag('bank_code', bank_code, size=30) %]</td>
-      <th align="right">[% 'Bank' | $T8 %]</th>
-      <td>[% L.input_tag('bank', bank, size=30) %]</td>
-     </tr>
-
-     <tr>
-      <th align="right">[% 'IBAN' | $T8 %]</th>
-      <td>[% L.input_tag('iban', iban, maxlength=100, size=30) %]</td>
-      <th align="right">[% 'BIC' | $T8 %]</th>
-      <td>[% L.input_tag('bic', bic, maxlength=100, size=30) %]</td>
-      [%- IF ALL_CURRENCIES.size %]
-        <th align="right">[% 'Currency' | $T8 %]</th>
-        <td>[% L.select_tag('currency', ALL_CURRENCIES, default = currency) %]</td>
-      [%- END %]
-     </tr>
-
-     <tr>
-      [% UNLESS INSTANCE_CONF.get_vertreter %]
-       <th align="right">[% IF is_customer %][% 'Type of Customer' | $T8 %][% ELSE %][% 'Type of Vendor' | $T8 %][%- END %]</th>
-       <td>
-        [%- INCLUDE generic/multibox.html
-              name       = 'business',
-              DATA       = all_business,
-              show_empty = 1,
-              id_key     = 'id',
-              label_key  = 'description',
-        -%]
-       </td>
-      [%- END %]
-      <th align="right">[% 'Language' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'language_id',
-             default    = default_language_id,
-             DATA       = languages,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
-
-      [%- IF is_customer %]
-      <th align="right">[% 'Preisklasse' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'klass',
-             DATA       = all_pricegroup,
-             show_empty = 1,
-             id_key     = 'id',
-             label_key  = 'pricegroup',
-       -%]
-      </td>
-      [%- END  %]
-     </tr>
-
-     <tr>
-      <td align="right"><label for="obsolete">[% 'Obsolete' | $T8 %]</label></td>
-      <td><input name="obsolete" id="obsolete" class="checkbox" type="checkbox" value="1" [% IF obsolete %]checked[% END %]></td>
-      <td align="right"><label for="direct_debit">[% 'direct debit' | $T8 %]</label></td>
-      <td><input name="direct_debit" id="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
-     </tr>
-
-     <tr>
-      <th align="right">[% 'Steuersatz' | $T8 %]</th>
-      <td>
-       [%- INCLUDE generic/multibox.html
-             name       = 'taxzone_id',
-             id         = 'taxzone_id',
-             DATA       = ALL_TAXZONES,
-             show_empty = 0,
-             id_key     = 'id',
-             label_key  = 'description',
-       -%]
-      </td>
-      [%- IF is_customer && !INSTANCE_CONF.get_vertreter %]
-      <th align="right">[% 'Salesman' | $T8 %]</th>
-      <td>[% L.select_tag('salesman_id', ALL_SALESMEN, default = salesman_id, with_empty = 1, title_key = 'safe_name') %]</td>
-      [%- END %]
-
-      <td>[% 'taxincluded checked' | $T8 %]</td>
-      <td>[% L.select_tag('taxincluded_checked', [[undef, LxERP.t8('use user config')], ['1', LxERP.t8('Yes')], ['0', LxERP.t8('No')]], default = taxincluded_checked) %]</td>
-     </tr>
-    </table>
-
-    <table>
-     <tr>
-      <th align="left" nowrap>[% 'Internal Notes' | $T8 %]</th>
-     </tr>
-
-     <tr>
-      <td><textarea name="notes" rows="3" cols="60" wrap="soft">[% HTML.escape(notes) %]</textarea></td>
-     </tr>
-    </table>
-   </div>
-
-   <div id="shipto">
-    [% INCLUDE 'ct/_shipto.html' %]
-   </div>
-
-   <div id="contacts">
-    [% INCLUDE 'ct/_contact.html' %]
-   </div>
-
-   <div id="deliveries">
-    <table>
-     <tr>
-      <th align="right">[% 'Shipping Address' | $T8 %]</th>
-      <td colspan="3">
-       [% L.select_tag('delivery_id', SHIPTO_ALL, value_key = 'shipto_id', title_sub = \shipto_label, with_empty = 1,
-                       onchange = "\$('#delivery').load('ct.pl?action=get_delivery&id=' + \$('#cvid').val() + '&db=' + \$('#db').val() + '&shipto_id=' + this.value)") %]
-      </td>
-     </tr>
-
-     <tr>
-      <th align="right" nowrap>[% 'From' | $T8 %]</th>
-      <td>
-        [% L.date_tag('from',
-                      from,
-                      onchange => "\$('#delivery').load('ct.pl?action=get_delivery&shipto_id='+ \$('#delivery_id').val() +'&from='+ \$('#from').val() +'&to='+ \$('#to').val() +'&id='+ \$('#cvid').val() +'&db='+ \$('#db').val())")
-        %]
-      </td>
-      <th align="right" nowrap>[% 'To (time)' | $T8 %]</th>
-      <td>
-       [% L.date_tag('to',
-                      to,
-                      onchange => "\$('#delivery').load('ct.pl?action=get_delivery&shipto_id='+ \$('#delivery_id').val() +'&from='+ \$('#from').val() +'&to='+ \$('#to').val() +'&id='+ \$('#cvid').val() +'&db='+ \$('#db').val())")
-       %]
-      </td>
-     </tr>
-
-     <tr>
-      <td colspan="4">
-       <div id="delivery">
-       </div>
-      </td>
-     </tr>
-    </table>
-   </div>
-
-   <div id="vcnotes">
-
-    [%- IF NOTES && NOTES.size %]
-    <p>
-     <table>
-      <tr>
-       <th class="listheading">[% 'Delete' | $T8 %]</th>
-       <th class="listheading">[% 'Subject' | $T8 %]</th>
-       <th class="listheading">[% 'Created on' | $T8 %]</th>
-       <th class="listheading">[% 'Created by' | $T8 %]</th>
-       <th class="listheading">[% 'Follow-Up Date' | $T8 %]</th>
-       <th class="listheading">[% 'Follow-Up for' | $T8 %]</th>
-       <th class="listheading">[% 'Follow-Up done' | $T8 %]</th>
-      </tr>
-
-      [%- FOREACH row = NOTES %]
-      <tr class="listrow[% loop.count % 2 %]">
-       <input type="hidden" name="NOTE_id_[% loop.count %]" value="[% HTML.escape(row.id) %]">
-       <td>[% UNLESS NOTE_id && (NOTE_id == row.id) %]<input type="checkbox" name="NOTE_delete_[% loop.count %]" value="1">[% END %]</td>
-       <td><a href="ct.pl?action=edit&db=[% HTML.url(db) %]&id=[% HTML.url(id) %]&edit_note_id=[% HTML.url(row.id) %]">[% HTML.escape(row.subject) %]</a></td>
-       <td>[% HTML.escape(row.created_on) %]</td>
-       <td>[% IF row.created_by_name %][% HTML.escape(row.created_by_name) %][% ELSE %][% HTML.escape(row.created_by_login) %][% END %]</td>
-       <td>[% HTML.escape(row.follow_up_date) %]</td>
-       <td>[% IF row.created_for_name %][% HTML.escape(row.created_for_name) %][% ELSE %][% HTML.escape(row.created_for_login) %][% END %]</td>
-       <td>[% IF row.follow_up_date %][% IF row.follow_up_done %][% 'Yes' | $T8 %][% ELSE %][% 'No' | $T8 %][% END %][% END %]</td>
-      </tr>
-      [%- END %]
-
-      <input type="hidden" name="NOTES_rowcount" value="[% NOTES.size %]">
-
-     </table>
-    </p>
-    [%- END %]
-
-    <div class="listtop">[% IF NOTE_id %][% 'Edit note' | $T8 %][% ELSE %][% 'Add note' | $T8 %][% END %]</div>
-
-    <input type="hidden" name="NOTE_id" value="[% HTML.escape(NOTE_id) %]">
-    <input type="hidden" name="FU_id" value="[% HTML.escape(FU_id) %]">
-
-    <p>
-     <table>
-      <tr>
-       <td valign="right">[% 'Subject' | $T8 %]</td>
-       <td><input name="NOTE_subject" value="[% HTML.escape(NOTE_subject) %]" size="50"></td>
-      </tr>
-
-      <tr>
-       <td valign="right" align="top">[% 'Body' | $T8 %]</td>
-       <td align="top"><textarea cols="50" rows="10" name="NOTE_body">[% HTML.escape(NOTE_body) %]</textarea></td>
-      </tr>
-
-      <tr>
-       <td valign="right">[% 'Follow-Up On' | $T8 %]</td>
-       <td>
-        [% L.date_tag('FU_date', FU_date) %]
-        [% 'for' | $T8 %]
-        [% L.select_tag('FU_created_for_user', ALL_EMPLOYEES, default = (FU_created_for_user ? FU_created_for_user : USER.id), title_key='safe_name') %]
-       </td>
-      </tr>
-
-      <tr>
-       <td>&nbsp;</td>
-       <td>
-        <input type="checkbox" name="FU_done" id="FU_done" value="1"[% IF FU_done %] checked[% END %]>
-        <label for="FU_done">[% 'Follow-Up done' | $T8 %]</label>
-       </td>
-      </tr>
-     </table>
-    </p>
-   </div>
-
-   [%- IF CUSTOM_VARIABLES.CT.size %]
-   <div id="custom_variables">
-
-    <p>
-     <table>
-      [%- FOREACH var = CUSTOM_VARIABLES.CT %]
-      <tr>
-       <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
-       <td valign="top">[% var.HTML_CODE %]</td>
-      </tr>
-      [%- END %]
-     </table>
-    </p>
-   </div>
-   [%- END %]
-
-  </div>
-
-  <script type="text/javascript">
-   <!--
-   function set_gender(gender) {
-     var s = document.getElementById('cp_gender');
-     if (s) {
-       s.selectedIndex = (gender == 'f') ? 1 : 0;
-     }
-   }
-  -->
-
-  </script>
diff --git a/templates/webpages/ct/get_delivery.html b/templates/webpages/ct/get_delivery.html
deleted file mode 100644 (file)
index 921aaba..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-[%- USE T8 %]
-[% USE HTML %][% USE LxERP %]
-<div id="delivery">
-<table width="100%">
-  <tr>
-    <td>
-      <table width="100%">
-        <tr class="listheading">
-          <th class="listheading">[% 'Shipping Address' | $T8 %]</th>
-          <th class="listheading">[% 'Invoice' | $T8 %]</th>
-          <th class="listheading">[% 'Order' | $T8 %]</th>
-          <th class="listheading">[% 'Invdate' | $T8 %]</th>
-          <th class="listheading">[% 'Description' | $T8 %]</th>
-          <th class="listheading">[% 'Qty' | $T8 %]</th>
-          <th class="listheading">[% 'Unit' | $T8 %]</th>
-[%- IF is_customer %]
-          <th class="listheading">[% 'Sell Price' | $T8 %]</th>
-[%- ELSE %]
-          <th class="listheading">[% 'Last Cost' | $T8 %]</th>
-[%- END %]
-        </tr>
-[%- FOREACH row = DELIVERY %]
-[%-
-    row.script = is_customer ?  ( row.invoice ? 'is' : 'ar' )
-                             :  ( row.invoice ? 'ir' : 'ap' )
--%]
-        <tr class="listrow[% loop.count % 2 %]">
-          <td>[% HTML.escape(row.shiptoname) UNLESS loop.prev.shiptoname == row.shiptoname %]&nbsp;</td>
-          <td>[% IF row.id %]<a href='[% row.script %].pl?action=edit&id=[% HTML.escape(row.id) %]'>[% END %][% HTML.escape(row.invnumber)   || '&nbsp;' %][% IF row.id %]</a>[% END %]</td>
-          <td>[% IF row.oe_id %]<a href='oe.pl?action=edit&type=[% IF is_customer %]sales_order[% ELSE %]purchase_order[% END %]&vc=customer&id=[% HTML.escape(row.oe_id) %]'>[% END %][% HTML.escape(row.ordnumber)   || '&nbsp;' %][% IF row.oe_id %]</a>[% END %]</td>
-          <td>[% HTML.escape(row.transdate)   || '&nbsp;' %]</td>
-          <td>[% HTML.escape(row.description) || '&nbsp;' %]</td>
-          <td>[% HTML.escape(row.qty)         || '&nbsp;' %]</td>
-          <td>[% HTML.escape(row.unit)        || '&nbsp;' %]</td>
-          <td>[% LxERP.format_amount(row.sellprice, 2) || '&nbsp;' %]</td>
-        </tr>
-[%- END %]
-
-     </table>
-[%- IF DELIVERY.size == 15 %]
-     <p>[% 'This list is capped at 15 items to keep it fast. If you need a full list, please use reports.' | $T8 %]</p>
-[%- END %]
-</div>
index 7faabc3118367ee66859a038d76a849cbb7cfcca..9546101fa86ba4405a64e8f43bca04cf1d246290 100644 (file)
@@ -1,10 +1,10 @@
-[% USE T8 %][% USE HTML %]<form method="post" action="dispatcher.pl?M=ct">
+[% USE T8 %][% USE HTML %]
 
- <input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
- <input name="db" type="hidden" value="[% HTML.escape(db) %]">
+<form method="post" action="controller.pl?action=CustomerVendor/add">
+  <input name="callback" type="hidden" value="[% HTML.escape(callback) %]">
+  <input name="db" type="hidden" value="[% HTML.escape(db) %]">
 
- [% IF IS_CUSTOMER %][% 'New customer' | $T8 %][% ELSE %][% 'New vendor' | $T8 %][% END %]<br>
-
- <input class="submit" type="submit" name="A_add" value="[%- 'Add' | $T8 %]">
+  [% IF IS_CUSTOMER %][% 'New customer' | $T8 %][% ELSE %][% 'New vendor' | $T8 %][% END %]<br>
 
+  <input class="submit" type="submit" value="[%- 'Add' | $T8 %]">
 </form>
diff --git a/templates/webpages/ct/testpage.html b/templates/webpages/ct/testpage.html
deleted file mode 100644 (file)
index e8ba838..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-[% USE L %]
-[% USE T8 %]
-[% USE LxERP %]
-[% L.javascript_tag('jquery-ui') %]
-<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.12.custom.css" type="text/css" />
-
-<p>Pick a customer</p>
-id: [% L.input_tag('customer_id', '') %]
-nr: [% L.input_tag('customer_customernumber', '') %]
-desc: [% L.input_tag('customer_name', '') %]
-
-<script type='text/javascript'>
-function autocomplete_customer (selector, column) {
-  $(function(){ $(selector).autocomplete({
-    source: function(req, rsp) {
-      $.ajax({
-        url: 'controller.pl?action=Customer/ajax_autocomplete',
-        dataType: "json",
-        data: {
-          column: column,
-          term: req.term,
-          current: function() { $('#customer_id').val() },
-          obsolete: 0,
-        },
-        success: function (data){ rsp(data) }
-      });
-    },
-    limit: 20,
-    delay: 50,
-    select: function(event, ui) {
-      $('#customer_id').val(ui.item.id);
-      $('#customer_customernumber').val(ui.item.customernumber);
-      $('#customer_name').val(ui.item.name);
-    },
-  })});
-}
-//autocomplete_customer('#customer_customernumber', 'customernumber');
-autocomplete_customer('#customer_name', '');
-</script>
-
index c8ec6b02e6b24ab377d3011d29fd12e2cebb96d5..a0d1ab9517dfed0794fe1b4d326eb18f67aade87 100644 (file)
@@ -18,7 +18,7 @@
       <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
       <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
       <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
-      [% IF ( SELF.cv.id ) %]
+      [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
         <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
       [% END %]
       <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
@@ -31,7 +31,7 @@
     [% PROCESS "customer_vendor/tabs/billing.html" %]
     [% PROCESS "customer_vendor/tabs/shipto.html" %]
     [% PROCESS "customer_vendor/tabs/contacts.html" %]
-    [% IF ( SELF.cv.id ) %]
+    [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
       [% PROCESS "customer_vendor/tabs/deliveries.html" %]
     [% END %]
     [% PROCESS "customer_vendor/tabs/vcnotes.html" %]
index 516b5a05fc34a53172c7eec8d404755a14b4f678..5c036e070e096a9d1d82905bcfff0a2568757058 100644 (file)
         [% L.select_tag('cv.language_id', SELF.all_languages, default = SELF.cv.language_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
       </td>
 
-      [% IF ( SELF.is_customer() ) %]
-        <th align="right">[% 'Preisklasse' | $T8 %]</th>
+      <th align="right">[% 'Delivery Terms' | $T8 %]</th>
+
+      <td>
+        [% L.select_tag('cv.delivery_term_id', SELF.all_delivery_terms, default = SELF.cv.delivery_term_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
+      </td>
 
-        <td>
-          [% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
-        </td>
-      [% END  %]
     </tr>
 
     <tr>
       <td>
         [% L.checkbox_tag('cv.direct_debit', checked = SELF.cv.direct_debit, for_submit=1) %]
       </td>
+
+      [% IF ( SELF.is_customer() ) %]
+        <th align="right">[% 'Preisklasse' | $T8 %]</th>
+
+        <td>
+          [% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
+        </td>
+      [% END  %]
+
     </tr>
 
     <tr>
diff --git a/templates/webpages/delivery_term/form.html b/templates/webpages/delivery_term/form.html
new file mode 100755 (executable)
index 0000000..92d98c2
--- /dev/null
@@ -0,0 +1,44 @@
+[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
+
+ <form method="post" action="controller.pl">
+  <div class="listtop">[% FORM.title %]</div>
+
+[%- INCLUDE 'common/flash.html' %]
+
+  <table>
+   <tr>
+    <td>[%- 'Description' | $T8 %]</td>
+    <td>
+     <input name="delivery_term.description" value="[%- HTML.escape(SELF.delivery_term.description) %]">
+    </td>
+   </tr>
+
+   <tr>
+    <td>[%- 'Long Description' | $T8 %]</td>
+    <td>
+     <input name="delivery_term.description_long" value="[%- HTML.escape(SELF.delivery_term.description_long) %]" size="60">
+    </td>
+   </tr>
+
+   [%- FOREACH language = SELF.languages %]
+    <tr>
+     <td>[%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %])</td>
+     <td>
+      <input name="translation_[% language.id %]" value="[%- HTML.escape(SELF.delivery_term.translated_attribute('description_long', language, 1)) %]" size="60">
+     </td>
+    </tr>
+   [%- END %]
+
+  <p>
+   <input type="hidden" name="id" value="[% SELF.delivery_term.id %]">
+   <input type="hidden" name="action" value="DeliveryTerm/dispatch">
+   <input type="submit" class="submit" name="action_[% IF SELF.delivery_term.id %]update[% ELSE %]create[% END %]" value="[% 'Save' | $T8 %]">
+   [%- IF SELF.delivery_term.id %]
+    <input type="submit" class="submit" name="action_destroy" value="[% 'Delete' | $T8 %]"
+           onclick="if (confirm('[% 'Are you sure you want to delete this delivery term?' | $T8 %]')) return true; else return false;">
+   [%- END %]
+   <a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a>
+  </p>
+
+ </form>
+
diff --git a/templates/webpages/delivery_term/list.html b/templates/webpages/delivery_term/list.html
new file mode 100644 (file)
index 0000000..b47f9d1
--- /dev/null
@@ -0,0 +1,45 @@
+[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
+
+ <div class="listtop">[% FORM.title %]</div>
+
+[%- INCLUDE 'common/flash.html' %]
+
+ <form method="post" action="controller.pl">
+  [% IF !DELIVERY_TERMS.size %]
+   <p>
+    [%- 'No delivery term has been created yet.' | $T8 %]
+   </p>
+
+  [%- ELSE %]
+   <table id="delivery_term_list">
+    <thead>
+    <tr class="listheading">
+     <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
+     <th>[%- 'Description' | $T8 %]</th>
+     <th>[%- 'Long Description' | $T8 %]</th>
+    </tr>
+    </thead>
+
+    <tbody>
+    [%- FOREACH delivery_term = DELIVERY_TERMS %]
+    <tr class="listrow[% loop.count % 2 %]" id="delivery_term_id_[% delivery_term.id %]">
+     <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
+     <td>
+      <a href="[% SELF.url_for(action => 'edit', id => delivery_term.id) %]">
+       [%- HTML.escape(delivery_term.description) %]
+      </a>
+     </td>
+     <td>[%- HTML.escape(delivery_term.description_long) %]</td>
+    </tr>
+    [%- END %]
+    </tbody>
+   </table>
+  [%- END %]
+
+  <p>
+   <a href="[% SELF.url_for(action => 'new') %]">[%- 'Create new delivery term' | $T8 %]</a>
+  </p>
+ </form>
+
+ [% L.sortable_element('#delivery_term_list tbody', url => 'controller.pl?action=DeliveryTerm/reorder', with => 'delivery_term_id') %]
+
index d02a1e52d6eeeb52881602cb7f21eb9f7a3f3005..eea92171aa8f12fc06b47883e50b6064b6bc67c3 100644 (file)
         <td><textarea name="notes" rows="[% LxERP.numtextrows(notes, 25, 8, 2) %]" cols="25" wrap="soft"[% RO %]>[% HTML.escape(notes) %]</textarea></td>
         <td><textarea name="intnotes" rows="[% LxERP.numtextrows(intnotes, 35, 8, 2) %]" cols="35" wrap="soft"[% RO %]>[% HTML.escape(intnotes) %]</textarea></td>
        </tr>
+
+       <tr>
+         <th align="right">[% 'Delivery Terms' | $T8 %]</th>
+         <td>[% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description') %]</td>
+       </tr>
       </table>
 
      </td>
index 6d3b643392ee67a54eb178b5c11aa06fdd936b8d..e979a807ed323f6f574346b09b40ec8d879f41d7 100644 (file)
@@ -11,7 +11,7 @@
         <tr>
          <th align="left">[% 'Notes' | $T8 %]</th>
          <th align="left">[% 'Internal Notes' | $T8 %]</th>
-         <th align="left">[% 'Payment Options' | $T8 %]</th>
+         <th align="right">[% 'Payment / Delivery Options' | $T8 %]</th>
         </tr>
         <tr valign="top">
          <td>
           <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
          </td>
          <td>
-          [%- L.checkbox_tag('direct_debit', 'checked', direct_debit, 'label', LxERP.t8('direct debit')) %]
+           <table>
+             <tr>
+               <th align="right">[% 'Delivery Terms' | $T8 %] </th>
+               <td>
+                 [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', style = 'width: 250px') %]
+               </td>
+             </tr>
+             <tr>
+               <th align="right">[% 'direct debit' | $T8 %]</th>
+               <td>
+                 [%- L.checkbox_tag('direct_debit', 'checked', direct_debit) %]
+               </td>
+             </tr>
+           </table>
          </td>
         </tr>
 [%- IF id && follow_ups.size %]
index 28fafaa09d1ef1049759b4a67f81d5412ce69924..45664520d663be31c1e3b1124f2323f4271e59e8 100644 (file)
@@ -11,7 +11,7 @@
         <tr>
          <th align="left">[% 'Notes (will appear on hard copy)' | $T8 %]</th>
          <th align="left">[% 'Internal Notes' | $T8 %]</th>
-         <th align="right">[% 'Payment Terms' | $T8 %]</th>
+         <th align="right">[% 'Payment / Delivery Options' | $T8 %]</th>
         </tr>
         <tr valign="top">
          <td>
           <textarea name="intnotes" rows="[% rows %]" cols="35">[% intnotes %]</textarea>
          </td>
          <td>
-            [%- INCLUDE 'generic/multibox.html'
-                 name          = 'payment_id',
-                 style         = 'width: 250px',
-                 DATA          = payment_terms,
-                 id_key        = 'id',
-                 label_key     = 'description',
-                 show_empty    = 1
-                 allow_textbox = 0 -%]
-          <script type='text/javascript'>$('#payment_id').change(function(){ if (this.value) set_duedate()})</script>
-          <br>
-          [%- L.checkbox_tag('direct_debit', 'checked', direct_debit, 'label', LxERP.t8('direct debit')) %]
+           <table>
+             <tr>
+               <th align="right">[% 'Payment Terms' | $T8 %]</th>
+               <td>
+                 [%- INCLUDE 'generic/multibox.html'
+                   name          = 'payment_id',
+                   style         = 'width: 250px',
+                   DATA          = payment_terms,
+                   id_key        = 'id',
+                   label_key     = 'description',
+                   show_empty    = 1
+                   allow_textbox = 0 -%]
+                 <script type='text/javascript'>$('#payment_id').change(function(){ if (this.value) set_duedate()})</script>
+               </td>
+             </tr>
+             <tr>
+               <th align="right">[% 'Delivery Terms' | $T8 %] </th>
+               <td>
+                 [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', style = 'width: 250px') %]
+               </td>
+             </tr>
+             <tr>
+               <th align="right">[% 'direct debit' | $T8 %]</th>
+               <td>
+                 [%- L.checkbox_tag('direct_debit', 'checked', direct_debit) %]
+               </td>
+             </tr>
+           </table>
          </td>
         </tr>
 [%- IF id && follow_ups.size %]
index c9281ac66d4f8a406f44571098565749eeeba1aa..7c72a452e52eb150f6260a7abfc800aaafa40262 100644 (file)
                            label_key  = 'description',
                            show_empty = 1 -%]
                 </td>
-            </tr>
+              </tr>
+              <tr>
+                <th align="right">[% 'Delivery Terms' | $T8 %]</th>
+                <td>[% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', style = 'width: 250px') %]</td>
+              </tr>
 
 [%- IF is_sales_ord %]
             <tr>