Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 03d3d025

Von Bernd Bleßmann vor etwa 11 Jahren hinzugefügt

  • ID 03d3d025ea4c8bea085fc7cdf1fe7be0b513eb63
  • Vorgänger 228dfbdc
  • Nachfolger 002517b4

Lieferbedingungen analog zu Zahlungsbedingungen eingeführt.

Sie können angelegt werden, beim Benutzer voreingestellt werden
und in allen Ein- und Verkaufsmasken gesetzt werden.

Unterschiede anzeigen:

SL/CT.pm
322 322
    qq|c_vendor_id = ?, | .
323 323
    qq|klass = ?, | .
324 324
    qq|currency_id = (SELECT id FROM currencies WHERE name = ?), | .
325
    qq|taxincluded_checked = ? | .
325
    qq|taxincluded_checked = ?, | .
326
    qq|delivery_term_id = ? | .
326 327
    qq|WHERE id = ?|;
327 328
  my @values = (
328 329
    $form->{customernumber},
......
366 367
    conv_i($form->{klass}),
367 368
    $form->{currency},
368 369
    $form->{taxincluded_checked} ne '' ? $form->{taxincluded_checked} : undef,
370
    conv_i($form->{delivery_term_id}),
369 371
    $form->{id}
370 372
    );
371 373
  do_query( $form, $dbh, $query, @values );
......
473 475
    qq|  username = ?, | .
474 476
    qq|  user_password = ?, | .
475 477
    qq|  v_customer_id = ?, | .
476
    qq|  currency_id = (SELECT id FROM currencies WHERE name = ?) | .
478
    qq|  currency_id = (SELECT id FROM currencies WHERE name = ?), | .
479
    qq|  delivery_term_id = ? | .
477 480
    qq|WHERE id = ?|;
478 481
  my @values = (
479 482
    $form->{vendornumber},
......
514 517
    $form->{user_password},
515 518
    $form->{v_customer_id},
516 519
    $form->{currency},
520
    conv_i($form->{delivery_term_id}),
517 521
    $form->{id}
518 522
    );
519 523
  do_query($form, $dbh, $query, @values);
SL/Common.pm
397 397
         vc.*,
398 398
         pt.description AS payment_terms,
399 399
         b.description AS business,
400
         l.description AS language
400
         l.description AS language,
401
         dt.description AS delivery_terms
401 402
       FROM ${vc} vc
402 403
       LEFT JOIN payment_terms pt ON (vc.payment_id = pt.id)
403 404
       LEFT JOIN business b ON (vc.business_id = b.id)
404 405
       LEFT JOIN language l ON (vc.language_id = l.id)
406
       LEFT JOIN delivery_terms dt ON (vc.delivery_term_id = dt.id)
405 407
       WHERE vc.id = ?|;
406 408
  my $ref = selectfirst_hashref_query($form, $dbh, $query, $vc_id);
407 409

  
SL/Controller/CsvImport/Base.pm
8 8
use SL::DB::Customer;
9 9
use SL::DB::Language;
10 10
use SL::DB::PaymentTerm;
11
use SL::DB::DeliveryTerm;
11 12
use SL::DB::Vendor;
12 13
use SL::DB::Contact;
13 14
use SL::DB::History;
......
17 18
use Rose::Object::MakeMethods::Generic
18 19
(
19 20
 scalar                  => [ qw(controller file csv test_run save_with_cascade) ],
20
 '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) ],
21
 '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) ],
21 22
);
22 23

  
23 24
sub run {
......
146 147
  return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_payment_terms } } ) } qw(id description) };
147 148
}
148 149

  
150
sub init_delivery_terms_by {
151
  my ($self) = @_;
152

  
153
  my $all_delivery_terms = SL::DB::Manager::DeliveryTerm->get_all;
154
  return { map { my $col = $_; ( $col => { map { ( $_->$col => $_ ) } @{ $all_delivery_terms } } ) } qw(id description) };
155
}
156

  
149 157
sub init_all_vc {
150 158
  my ($self) = @_;
151 159

  
......
382 390
  return 1;
383 391
}
384 392

  
393
sub check_delivery_term {
394
  my ($self, $entry) = @_;
395

  
396
  my $object = $entry->{object};
397

  
398
  # Check whether or not delivery term ID is valid.
399
  if ($object->delivery_term_id && !$self->delivery_terms_by->{id}->{ $object->delivery_term_id }) {
400
    push @{ $entry->{errors} }, $::locale->text('Error: Invalid delivery terms');
401
    return 0;
402
  }
403

  
404
  # Map name to ID if given.
405
  if (!$object->delivery_term_id && $entry->{raw_data}->{delivery_term}) {
406
    my $terms = $self->delivery_terms_by->{description}->{ $entry->{raw_data}->{delivery_term} };
407

  
408
    if (!$terms) {
409
      push @{ $entry->{errors} }, $::locale->text('Error: Invalid delivery terms');
410
      return 0;
411
    }
412

  
413
    $object->delivery_term_id($terms->id);
414
  }
415

  
416
  return 1;
417
}
418

  
385 419
sub save_objects {
386 420
  my ($self, %params) = @_;
387 421

  
SL/Controller/CsvImport/CustomerVendor.pm
66 66
    $self->check_language($entry);
67 67
    $self->check_business($entry);
68 68
    $self->check_payment($entry);
69
    $self->check_delivery_term($entry);
69 70
    $self->check_currency($entry, take_default => 1);
70 71
    $self->handle_cvars($entry);
71 72

  
......
99 100
    $i++;
100 101
  }
101 102

  
102
  $self->add_columns(map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(language business payment));
103
  $self->add_columns(map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(language business payment delivery_term));
103 104
  $self->add_cvar_raw_data_columns;
104 105
}
105 106

  
......
231 232
  my ($self) = @_;
232 233

  
233 234
  my $profile = $self->SUPER::init_profile;
234
  delete @{$profile}{qw(business datevexport language payment salesman salesman_id taxincluded terms)};
235
  delete @{$profile}{qw(business datevexport language payment delivery_term salesman salesman_id taxincluded terms)};
235 236

  
236 237
  return $profile;
237 238
}
......
260 261
                                 { name => 'customernumber',    description => $::locale->text('Customer Number')                 },
261 262
                                 { name => 'department_1',      description => $::locale->text('Department 1')                    },
262 263
                                 { name => 'department_2',      description => $::locale->text('Department 2')                    },
264
                                 { name => 'delivery_term_id',  description => $::locale->text('Delivery terms (database ID)')    },
265
                                 { name => 'delivery_term',     description => $::locale->text('Delivery terms (name)')           },
263 266
                                 { name => 'direct_debit',      description => $::locale->text('direct debit')                    },
264 267
                                 { name => 'discount',          description => $::locale->text('Discount')                        },
265 268
                                 { name => 'email',             description => $::locale->text('E-mail')                          },
SL/Controller/CsvImport/Order.pm
102 102
                                 { name => 'currency_id',             description => $::locale->text('Currency (database ID)')                },
103 103
                                 { name => 'cusordnumber',            description => $::locale->text('Customer Order Number')                 },
104 104
                                 { name => 'delivered',               description => $::locale->text('Delivered')                             },
105
                                 { name => 'delivery_term_id',        description => $::locale->text('Delivery terms (database ID)')          },
106
                                 { name => 'delivery_term',           description => $::locale->text('Delivery terms (name)')                 },
105 107
                                 { name => 'employee_id',             description => $::locale->text('Employee (database ID)')                },
106 108
                                 { name => 'intnotes',                description => $::locale->text('Internal Notes')                        },
107 109
                                 { name => 'marge_percent',           description => $::locale->text('Margepercent')                          },
......
270 272
                          { header => $::locale->text('Customer/Vendor'), method => 'vc_name' });
271 273
  # Todo: access via ->[0] ok? Better: search first order column and use this
272 274
  $self->add_columns($self->_order_column,
273
                     map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(payment language department globalproject taxzone cp currency));
275
                     map { "${_}_id" } grep { exists $self->controller->data->[0]->{raw_data}->{$_} } qw(payment delivery_term language department globalproject taxzone cp currency));
274 276
  $self->add_columns($self->_order_column, 'globalproject_id') if exists $self->controller->data->[0]->{raw_data}->{globalprojectnumber};
275 277
  $self->add_columns($self->_order_column, 'cp_id')            if exists $self->controller->data->[0]->{raw_data}->{contact};
276 278

  
......
321 323
  $self->check_contact($entry);
322 324
  $self->check_language($entry);
323 325
  $self->check_payment($entry);
326
  $self->check_delivery_term($entry);
324 327
  $self->check_department($entry);
325 328
  $self->check_project($entry, global => 1);
326 329
  $self->check_ct_shipto($entry);
SL/Controller/CustomerVendor.pm
810 810

  
811 811
  $self->{all_payment_terms} = SL::DB::Manager::PaymentTerm->get_all();
812 812

  
813
  $self->{all_delivery_terms} = SL::DB::Manager::DeliveryTerm->get_all();
814

  
813 815
  $self->{all_pricegroups} = SL::DB::Manager::Pricegroup->get_all();
814 816

  
815 817
  $query =
SL/Controller/DeliveryTerm.pm
1
package SL::Controller::DeliveryTerm;
2

  
3
use strict;
4

  
5
use parent qw(SL::Controller::Base);
6

  
7
use SL::DB::DeliveryTerm;
8
use SL::Helper::Flash;
9

  
10
use Rose::Object::MakeMethods::Generic
11
(
12
 scalar => [ qw(delivery_term) ],
13
);
14

  
15
__PACKAGE__->run_before('check_auth');
16
__PACKAGE__->run_before('load_delivery_term', only => [ qw(edit update destroy) ]);
17

  
18

  
19
#
20
# actions
21
#
22

  
23
sub action_list {
24
  my ($self) = @_;
25

  
26
  $self->render('delivery_term/list',
27
                title          => $::locale->text('Delivery terms'),
28
                DELIVERY_TERMS => SL::DB::Manager::DeliveryTerm->get_all_sorted);
29
}
30

  
31
sub action_new {
32
  my ($self) = @_;
33

  
34
  $self->{delivery_term} = SL::DB::DeliveryTerm->new;
35
  $self->render('delivery_term/form', title => $::locale->text('Create a new delivery term'));
36
}
37

  
38
sub action_edit {
39
  my ($self) = @_;
40
  $self->render('delivery_term/form', title => $::locale->text('Edit delivery term'));
41
}
42

  
43
sub action_create {
44
  my ($self) = @_;
45

  
46
  $self->{delivery_term} = SL::DB::DeliveryTerm->new;
47
  $self->create_or_update;
48
}
49

  
50
sub action_update {
51
  my ($self) = @_;
52
  $self->create_or_update;
53
}
54

  
55
sub action_destroy {
56
  my ($self) = @_;
57

  
58
  if (eval { $self->{delivery_term}->delete; 1; }) {
59
    flash_later('info',  $::locale->text('The delivery term has been deleted.'));
60
  } else {
61
    flash_later('error', $::locale->text('The delivery term is in use and cannot be deleted.'));
62
  }
63

  
64
  $self->redirect_to(action => 'list');
65
}
66

  
67
sub action_reorder {
68
  my ($self) = @_;
69

  
70
  SL::DB::DeliveryTerm->reorder_list(@{ $::form->{delivery_term_id} || [] });
71

  
72
  $self->render(\'', { type => 'json' });     # ' make Emacs happy
73
}
74

  
75
#
76
# filters
77
#
78

  
79
sub check_auth {
80
  $::auth->assert('config');
81
}
82

  
83
#
84
# helpers
85
#
86

  
87
sub create_or_update {
88
  my $self   = shift;
89
  my $is_new = !$self->{delivery_term}->id;
90
  my $params = delete($::form->{delivery_term}) || { };
91

  
92
  $self->{delivery_term}->assign_attributes(%{ $params });
93

  
94
  my @errors = $self->{delivery_term}->validate;
95

  
96
  if (@errors) {
97
    flash('error', @errors);
98
    $self->render('delivery_term/form', title => $is_new ? $::locale->text('Create a new delivery term') : $::locale->text('Edit delivery term'));
99
    return;
100
  }
101

  
102
  $self->{delivery_term}->save;
103
  foreach my $language (@{ $self->{languages} }) {
104
    $self->{delivery_term}->save_attribute_translation('description_long', $language, $::form->{"translation_" . $language->id});
105
  }
106

  
107
  flash_later('info', $is_new ? $::locale->text('The delivery term has been created.') : $::locale->text('The delivery term has been saved.'));
108
  $self->redirect_to(action => 'list');
109
}
110

  
111
sub load_delivery_term {
112
  my ($self) = @_;
113
  $self->{delivery_term} = SL::DB::DeliveryTerm->new(id => $::form->{id})->load;
114
}
115

  
116
1;
SL/DB/DeliveryTerm.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::DeliveryTerm;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::DeliveryTerm;
9
use SL::DB::Manager::DeliveryTerm;
10
use SL::DB::Helper::ActsAsList;
11

  
12

  
13
sub validate {
14
  my ($self) = @_;
15

  
16
  my @errors;
17
  push @errors, $::locale->text('The description is missing.')      if !$self->description;
18
  push @errors, $::locale->text('The long description is missing.') if !$self->description_long;
19

  
20
  return @errors;
21
}
22

  
23
1;
SL/DB/Helper/ALL.pm
36 36
use SL::DB::DeliveryOrder;
37 37
use SL::DB::DeliveryOrderItem;
38 38
use SL::DB::DeliveryOrderItemsStock;
39
use SL::DB::DeliveryTerm;
39 40
use SL::DB::Department;
40 41
use SL::DB::Draft;
41 42
use SL::DB::Dunning;
SL/DB/Helper/FlattenToForm.pm
17 17
  _copy($self, $form, '', '', 0, qw(id type taxzone_id ordnumber quonumber invnumber donumber cusordnumber taxincluded shippingpoint shipvia notes intnotes cp_id
18 18
                                    employee_id salesman_id closed department_id language_id payment_id delivery_customer_id delivery_vendor_id shipto_id proforma
19 19
                                    globalproject_id delivered transaction_description container_type accepted_by_customer invoice terms storno storno_id dunning_config_id
20
                                    orddate quodate reqdate gldate duedate deliverydate datepaid transdate));
20
                                    orddate quodate reqdate gldate duedate deliverydate datepaid transdate delivery_term_id));
21 21
  $form->{currency} = $form->{curr} = $self->currency_id ? $self->currency->name || '' : '';
22 22

  
23 23
  if (_has($self, 'transdate')) {
SL/DB/Invoice.pm
117 117

  
118 118
  my %args = ( map({ ( $_ => $source->$_ ) } qw(customer_id taxincluded shippingpoint shipvia notes intnotes salesman_id cusordnumber ordnumber quonumber
119 119
                                                department_id cp_id language_id payment_id delivery_customer_id delivery_vendor_id taxzone_id shipto_id
120
                                                globalproject_id transaction_description currency_id)),
120
                                                globalproject_id transaction_description currency_id delivery_term_id)),
121 121
               transdate   => DateTime->today_local,
122 122
               gldate      => DateTime->today_local,
123 123
               duedate     => DateTime->today_local->add(days => $terms * 1),
SL/DB/Manager/DeliveryTerm.pm
1
package SL::DB::Manager::DeliveryTerm;
2

  
3
use strict;
4

  
5
use SL::DB::Helper::Manager;
6
use base qw(SL::DB::Helper::Manager);
7

  
8
use SL::DB::Helper::Sorted;
9

  
10
sub object_class { 'SL::DB::DeliveryTerm' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
sub _sort_spec {
15
  return ( default => [ 'sortkey', 1 ],
16
           columns => { SIMPLE => 'ALL',
17
                        map { ( $_ => "lower(delivery_terms.${_})" ) } qw(description description_long),
18
                      });
19
}
20

  
21
1;
SL/DB/MetaSetup/Customer.pm
23 23
  creditlimit         => { type => 'numeric', default => '0', precision => 5, scale => 15 },
24 24
  currency_id         => { type => 'integer', not_null => 1 },
25 25
  customernumber      => { type => 'text' },
26
  delivery_term_id    => { type => 'integer' },
26 27
  department_1        => { type => 'varchar', length => 75 },
27 28
  department_2        => { type => 'varchar', length => 75 },
28 29
  direct_debit        => { type => 'boolean', default => 'false' },
......
71 72
    key_columns => { currency_id => 'id' },
72 73
  },
73 74

  
75
  delivery_term => {
76
    class       => 'SL::DB::DeliveryTerm',
77
    key_columns => { delivery_term_id => 'id' },
78
  },
79

  
74 80
  language_obj => {
75 81
    class       => 'SL::DB::Language',
76 82
    key_columns => { language_id => 'id' },
SL/DB/MetaSetup/DeliveryOrder.pm
15 15
  cusordnumber            => { type => 'text' },
16 16
  customer_id             => { type => 'integer' },
17 17
  delivered               => { type => 'boolean', default => 'false' },
18
  delivery_term_id        => { type => 'integer' },
18 19
  department_id           => { type => 'integer' },
19 20
  donumber                => { type => 'text', not_null => 1 },
20 21
  employee_id             => { type => 'integer' },
......
61 62
    key_columns => { customer_id => 'id' },
62 63
  },
63 64

  
65
  delivery_term => {
66
    class       => 'SL::DB::DeliveryTerm',
67
    key_columns => { delivery_term_id => 'id' },
68
  },
69

  
64 70
  department => {
65 71
    class       => 'SL::DB::Department',
66 72
    key_columns => { department_id => 'id' },
SL/DB/MetaSetup/DeliveryTerm.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::DeliveryTerm;
4

  
5
use strict;
6

  
7
use base qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->setup(
10
  table   => 'delivery_terms',
11

  
12
  columns => [
13
    id               => { type => 'integer', not_null => 1, sequence => 'id' },
14
    description      => { type => 'text' },
15
    description_long => { type => 'text' },
16
    sortkey          => { type => 'integer', not_null => 1 },
17
    itime            => { type => 'timestamp', default => 'now()' },
18
    mtime            => { type => 'timestamp' },
19
  ],
20

  
21
  primary_key_columns => [ 'id' ],
22

  
23
  allow_inline_column_values => 1,
24
);
25

  
26
1;
27
;
SL/DB/MetaSetup/Invoice.pm
16 16
  customer_id               => { type => 'integer' },
17 17
  datepaid                  => { type => 'date' },
18 18
  delivery_customer_id      => { type => 'integer' },
19
  delivery_term_id          => { type => 'integer' },
19 20
  delivery_vendor_id        => { type => 'integer' },
20 21
  deliverydate              => { type => 'date' },
21 22
  department_id             => { type => 'integer' },
......
78 79
    key_columns => { customer_id => 'id' },
79 80
  },
80 81

  
82
  delivery_term => {
83
    class       => 'SL::DB::DeliveryTerm',
84
    key_columns => { delivery_term_id => 'id' },
85
  },
86

  
81 87
  department => {
82 88
    class       => 'SL::DB::Department',
83 89
    key_columns => { department_id => 'id' },
SL/DB/MetaSetup/Order.pm
17 17
  customer_id             => { type => 'integer' },
18 18
  delivered               => { type => 'boolean', default => 'false' },
19 19
  delivery_customer_id    => { type => 'integer' },
20
  delivery_term_id        => { type => 'integer' },
20 21
  delivery_vendor_id      => { type => 'integer' },
21 22
  department_id           => { type => 'integer' },
22 23
  employee_id             => { type => 'integer' },
......
72 73
    key_columns => { delivery_customer_id => 'id' },
73 74
  },
74 75

  
76
  delivery_term => {
77
    class       => 'SL::DB::DeliveryTerm',
78
    key_columns => { delivery_term_id => 'id' },
79
  },
80

  
75 81
  delivery_vendor => {
76 82
    class       => 'SL::DB::Vendor',
77 83
    key_columns => { delivery_vendor_id => 'id' },
SL/DB/MetaSetup/PurchaseInvoice.pm
13 13
  cp_id                   => { type => 'integer' },
14 14
  currency_id             => { type => 'integer', not_null => 1 },
15 15
  datepaid                => { type => 'date' },
16
  delivery_term_id        => { type => 'integer' },
16 17
  deliverydate            => { type => 'date' },
17 18
  department_id           => { type => 'integer' },
18 19
  direct_debit            => { type => 'boolean', default => 'false' },
......
61 62
    key_columns => { currency_id => 'id' },
62 63
  },
63 64

  
65
  delivery_term => {
66
    class       => 'SL::DB::DeliveryTerm',
67
    key_columns => { delivery_term_id => 'id' },
68
  },
69

  
64 70
  department => {
65 71
    class       => 'SL::DB::Department',
66 72
    key_columns => { department_id => 'id' },
SL/DB/MetaSetup/Vendor.pm
9 9
__PACKAGE__->meta->table('vendor');
10 10

  
11 11
__PACKAGE__->meta->columns(
12
  account_number => { type => 'varchar', length => 15 },
13
  bank           => { type => 'text' },
14
  bank_code      => { type => 'varchar', length => 10 },
15
  bcc            => { type => 'text' },
16
  bic            => { type => 'varchar', length => 100 },
17
  business_id    => { type => 'integer' },
18
  cc             => { type => 'text' },
19
  city           => { type => 'varchar', length => 75 },
20
  contact        => { type => 'varchar', length => 75 },
21
  country        => { type => 'varchar', length => 75 },
22
  creditlimit    => { type => 'numeric', precision => 5, scale => 15 },
23
  currency_id    => { type => 'integer', not_null => 1 },
24
  department_1   => { type => 'varchar', length => 75 },
25
  department_2   => { type => 'varchar', length => 75 },
26
  direct_debit   => { type => 'boolean', default => 'false' },
27
  discount       => { type => 'float', precision => 4 },
28
  email          => { type => 'text' },
29
  fax            => { type => 'varchar', length => 30 },
30
  greeting       => { type => 'text' },
31
  homepage       => { type => 'text' },
32
  iban           => { type => 'varchar', length => 100 },
33
  id             => { type => 'integer', not_null => 1, sequence => 'id' },
34
  itime          => { type => 'timestamp', default => 'now()' },
35
  language       => { type => 'varchar', length => 5 },
36
  language_id    => { type => 'integer' },
37
  mtime          => { type => 'timestamp' },
38
  name           => { type => 'varchar', length => 75, not_null => 1 },
39
  notes          => { type => 'text' },
40
  obsolete       => { type => 'boolean', default => 'false' },
41
  payment_id     => { type => 'integer' },
42
  phone          => { type => 'text' },
43
  salesman_id    => { type => 'integer' },
44
  street         => { type => 'varchar', length => 75 },
45
  taxincluded    => { type => 'boolean' },
46
  taxnumber      => { type => 'text' },
47
  taxzone_id     => { type => 'integer', default => '0', not_null => 1 },
48
  terms          => { type => 'integer', default => '0' },
49
  user_password  => { type => 'varchar', length => 12 },
50
  username       => { type => 'varchar', length => 50 },
51
  ustid          => { type => 'varchar', length => 14 },
52
  v_customer_id  => { type => 'text' },
53
  vendornumber   => { type => 'text' },
54
  zipcode        => { type => 'varchar', length => 10 },
12
  account_number   => { type => 'varchar', length => 15 },
13
  bank             => { type => 'text' },
14
  bank_code        => { type => 'varchar', length => 10 },
15
  bcc              => { type => 'text' },
16
  bic              => { type => 'varchar', length => 100 },
17
  business_id      => { type => 'integer' },
18
  cc               => { type => 'text' },
19
  city             => { type => 'varchar', length => 75 },
20
  contact          => { type => 'varchar', length => 75 },
21
  country          => { type => 'varchar', length => 75 },
22
  creditlimit      => { type => 'numeric', precision => 5, scale => 15 },
23
  currency_id      => { type => 'integer', not_null => 1 },
24
  delivery_term_id => { type => 'integer' },
25
  department_1     => { type => 'varchar', length => 75 },
26
  department_2     => { type => 'varchar', length => 75 },
27
  direct_debit     => { type => 'boolean', default => 'false' },
28
  discount         => { type => 'float', precision => 4 },
29
  email            => { type => 'text' },
30
  fax              => { type => 'varchar', length => 30 },
31
  greeting         => { type => 'text' },
32
  homepage         => { type => 'text' },
33
  iban             => { type => 'varchar', length => 100 },
34
  id               => { type => 'integer', not_null => 1, sequence => 'id' },
35
  itime            => { type => 'timestamp', default => 'now()' },
36
  language         => { type => 'varchar', length => 5 },
37
  language_id      => { type => 'integer' },
38
  mtime            => { type => 'timestamp' },
39
  name             => { type => 'varchar', length => 75, not_null => 1 },
40
  notes            => { type => 'text' },
41
  obsolete         => { type => 'boolean', default => 'false' },
42
  payment_id       => { type => 'integer' },
43
  phone            => { type => 'text' },
44
  salesman_id      => { type => 'integer' },
45
  street           => { type => 'varchar', length => 75 },
46
  taxincluded      => { type => 'boolean' },
47
  taxnumber        => { type => 'text' },
48
  taxzone_id       => { type => 'integer', default => '0', not_null => 1 },
49
  terms            => { type => 'integer', default => '0' },
50
  user_password    => { type => 'varchar', length => 12 },
51
  username         => { type => 'varchar', length => 50 },
52
  ustid            => { type => 'varchar', length => 14 },
53
  v_customer_id    => { type => 'text' },
54
  vendornumber     => { type => 'text' },
55
  zipcode          => { type => 'varchar', length => 10 },
55 56
);
56 57

  
57 58
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
......
69 70
    key_columns => { currency_id => 'id' },
70 71
  },
71 72

  
73
  delivery_term => {
74
    class       => 'SL::DB::DeliveryTerm',
75
    key_columns => { delivery_term_id => 'id' },
76
  },
77

  
72 78
  language_obj => {
73 79
    class       => 'SL::DB::Language',
74 80
    key_columns => { language_id => 'id' },
SL/DO.pm
367 367
         shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, closed = ?,
368 368
         delivered = ?, department_id = ?, language_id = ?, shipto_id = ?,
369 369
         globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?,
370
         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?)
370
         is_sales = ?, taxzone_id = ?, taxincluded = ?, terms = ?, currency_id = (SELECT id FROM currencies WHERE name = ?),
371
         delivery_term_id = ?
371 372
       WHERE id = ?|;
372 373

  
373 374
  @values = ($form->{donumber}, $form->{ordnumber},
......
382 383
             $form->{transaction_description},
383 384
             $form->{type} =~ /^sales/ ? 't' : 'f',
384 385
             conv_i($form->{taxzone_id}), $form->{taxincluded} ? 't' : 'f', conv_i($form->{terms}), $form->{currency},
386
             conv_i($form->{delivery_term_id}),
385 387
             conv_i($form->{id}));
386 388
  do_query($form, $dbh, $query, @values);
387 389

  
......
592 594
         d.description AS department, dord.language_id,
593 595
         dord.shipto_id,
594 596
         dord.globalproject_id, dord.delivered, dord.transaction_description,
595
         dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency
597
         dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency,
598
         dord.delivery_term_id
596 599
       FROM delivery_orders dord
597 600
       JOIN ${vc} cv ON (dord.${vc}_id = cv.id)
598 601
       LEFT JOIN employee e ON (dord.employee_id = e.id)
......
891 894
  $h_pg->finish();
892 895
  $h_bin_wh->finish();
893 896

  
897
  $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
898

  
894 899
  $form->{username} = $myconfig->{name};
895 900

  
896 901
  $main::lxdebug->leave_sub();
SL/IR.pm
686 686
                netamount    = ?, paid        = ?, duedate       = ?,
687 687
                invoice      = ?, taxzone_id  = ?, notes         = ?, taxincluded = ?,
688 688
                intnotes     = ?, storno_id   = ?, storno        = ?,
689
                cp_id        = ?, employee_id = ?, department_id = ?,
689
                cp_id        = ?, employee_id = ?, department_id = ?, delivery_term_id = ?,
690 690
                globalproject_id = ?, direct_debit = ?
691 691
              WHERE id = ?|;
692 692
  @values = (
......
695 695
                $netamount,                  $form->{paid},      conv_date($form->{duedate}),
696 696
            '1',                             $taxzone_id,                  $form->{notes},          $form->{taxincluded} ? 't' : 'f',
697 697
                $form->{intnotes},           conv_i($form->{storno_id}),     $form->{storno}      ? 't' : 'f',
698
         conv_i($form->{cp_id}),      conv_i($form->{employee_id}), conv_i($form->{department_id}),
698
         conv_i($form->{cp_id}),      conv_i($form->{employee_id}), conv_i($form->{department_id}), conv_i($form->{delivery_term_id}),
699 699
         conv_i($form->{globalproject_id}),
700 700
                $form->{direct_debit} ? 't' : 'f',
701 701
         conv_i($form->{id})
......
941 941
  $query = qq|SELECT cp_id, invnumber, transdate AS invdate, duedate,
942 942
                orddate, quodate, globalproject_id,
943 943
                ordnumber, quonumber, paid, taxincluded, notes, taxzone_id, storno, gldate,
944
                intnotes, (SELECT cu.name FROM currencies cu WHERE cu.id=ap.currency_id) AS currency, direct_debit
944
                intnotes, (SELECT cu.name FROM currencies cu WHERE cu.id=ap.currency_id) AS currency, direct_debit,
945
                delivery_term_id
945 946
              FROM ap
946 947
              WHERE id = ?|;
947 948
  $ref = selectfirst_hashref_query($form, $dbh, $query, conv_i($form->{id}));
......
1087 1088
    qq|SELECT
1088 1089
         v.id AS vendor_id, v.name AS vendor, v.discount as vendor_discount,
1089 1090
         v.creditlimit, v.terms, v.notes AS intnotes,
1090
         v.email, v.cc, v.bcc, v.language_id, v.payment_id,
1091
         v.email, v.cc, v.bcc, v.language_id, v.payment_id, v.delivery_term_id,
1091 1092
         v.street, v.zipcode, v.city, v.country, v.taxzone_id, cu.name AS curr, v.direct_debit,
1092 1093
         $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
1093 1094
         b.description AS business
SL/IS.pm
429 429

  
430 430
  $form->set_payment_options($myconfig, $form->{invdate});
431 431

  
432
  $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
433

  
432 434
  $form->{username} = $myconfig->{name};
433 435

  
434 436
  $main::lxdebug->leave_sub();
......
1104 1106
                cp_id       = ?, marge_total   = ?, marge_percent = ?,
1105 1107
                globalproject_id               = ?, delivery_customer_id             = ?,
1106 1108
                transaction_description        = ?, delivery_vendor_id               = ?,
1107
                donumber    = ?, invnumber_for_credit_note = ?,        direct_debit  = ?
1109
                donumber    = ?, invnumber_for_credit_note = ?,        direct_debit  = ?,
1110
                delivery_term_id = ?
1108 1111
              WHERE id = ?|;
1109 1112
  @values = (          $form->{"invnumber"},           $form->{"ordnumber"},             $form->{"quonumber"},          $form->{"cusordnumber"},
1110 1113
             conv_date($form->{"invdate"}),  conv_date($form->{"orddate"}),    conv_date($form->{"quodate"}),    conv_i($form->{"customer_id"}),
......
1118 1121
                conv_i($form->{"globalproject_id"}),                              conv_i($form->{"delivery_customer_id"}),
1119 1122
                       $form->{transaction_description},                          conv_i($form->{"delivery_vendor_id"}),
1120 1123
                       $form->{"donumber"}, $form->{"invnumber_for_credit_note"},        $form->{direct_debit} ? 't' : 'f',
1124
                conv_i($form->{delivery_term_id}),
1121 1125
                conv_i($form->{"id"}));
1122 1126
  do_query($form, $dbh, $query, @values);
1123 1127

  
......
1593 1597
           a.employee_id, a.salesman_id, a.payment_id,
1594 1598
           a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type,
1595 1599
           a.transaction_description, a.donumber, a.invnumber_for_credit_note,
1596
           a.marge_total, a.marge_percent, a.direct_debit,
1600
           a.marge_total, a.marge_percent, a.direct_debit, a.delivery_term_id,
1597 1601
           e.name AS employee
1598 1602
         FROM ar a
1599 1603
         LEFT JOIN employee e ON (e.id = a.employee_id)
......
1763 1767
  $query =
1764 1768
    qq|SELECT
1765 1769
         c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.terms,
1766
         c.email, c.cc, c.bcc, c.language_id, c.payment_id,
1770
         c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.delivery_term_id,
1767 1771
         c.street, c.zipcode, c.city, c.country,
1768 1772
         c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, cu.name AS curr,
1769 1773
         c.taxincluded_checked, c.direct_debit,
SL/OE.pm
518 518
         customer_id = ?, amount = ?, netamount = ?, reqdate = ?, taxincluded = ?,
519 519
         shippingpoint = ?, shipvia = ?, notes = ?, intnotes = ?, currency_id = (SELECT id FROM currencies WHERE name=?), closed = ?,
520 520
         delivered = ?, proforma = ?, quotation = ?, department_id = ?, language_id = ?,
521
         taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,
521
         taxzone_id = ?, shipto_id = ?, payment_id = ?, delivery_vendor_id = ?, delivery_customer_id = ?,delivery_term_id = ?,
522 522
         globalproject_id = ?, employee_id = ?, salesman_id = ?, cp_id = ?, transaction_description = ?, marge_total = ?, marge_percent = ?
523 523
       WHERE id = ?|;
524 524

  
......
535 535
             conv_i($form->{shipto_id}), conv_i($form->{payment_id}),
536 536
             conv_i($form->{delivery_vendor_id}),
537 537
             conv_i($form->{delivery_customer_id}),
538
             conv_i($form->{delivery_term_id}),
538 539
             conv_i($form->{globalproject_id}), conv_i($form->{employee_id}),
539 540
             conv_i($form->{salesman_id}), conv_i($form->{cp_id}),
540 541
             $form->{transaction_description},
......
768 769
           o.closed, o.reqdate, o.quonumber, o.department_id, o.cusordnumber,
769 770
           d.description AS department, o.payment_id, o.language_id, o.taxzone_id,
770 771
           o.delivery_customer_id, o.delivery_vendor_id, o.proforma, o.shipto_id,
771
           o.globalproject_id, o.delivered, o.transaction_description
772
           o.globalproject_id, o.delivered, o.transaction_description, o.delivery_term_id
772 773
         FROM oe o
773 774
         JOIN ${vc} cv ON (o.${vc}_id = cv.id)
774 775
         LEFT JOIN employee e ON (o.employee_id = e.id)
......
1334 1335

  
1335 1336
  $dbh->disconnect;
1336 1337

  
1338
  $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef);
1339

  
1337 1340
  $main::lxdebug->leave_sub();
1338 1341
}
1339 1342

  
bin/mozilla/ct.pl
52 52
use SL::Request qw(flatten);
53 53
use SL::DB::Business;
54 54
use SL::DB::Default;
55
use SL::DB::DeliveryTerm;
55 56
use SL::Helper::Flash;
56 57
use SL::ReportGenerator;
57 58
use SL::MoreCommon qw(uri_encode);
......
466 467
  $form->{ALL_SALESMEN}           = SL::DB::Manager::Employee->get_all(query => [ or => [ id => $::form->{salesman_id},  deleted => 0 ] ]);
467 468
  $form->{USER}                   = SL::DB::Manager::Employee->current;
468 469

  
470
  $form->{ALL_DELIVERY_TERMS}     = SL::DB::Manager::DeliveryTerm->get_all_sorted();
471

  
469 472
  $form->{taxincluded}    = ($form->{taxincluded}) ? "checked" : "";
470 473
  $form->{is_customer}    = $form->{db}     eq 'customer';
471 474
  $form->{shipto_label}   = \&_shipto_label;
bin/mozilla/do.pl
172 172
  DO->retrieve('vc'  => $form->{vc},
173 173
               'ids' => $form->{id});
174 174

  
175
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes currency));
175
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes delivery_term_id currency));
176 176
  $form->{shipto} = 1 if $form->{id} || $form->{convert_from_oe_ids};
177 177

  
178 178
  # get customer / vendor
......
184 184
    $form->{discount} = $form->{customer_discount};
185 185
  }
186 186

  
187
  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id));
187
  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id delivery_term_id));
188 188
  $form->restore_vars(qw(currency)) if ($form->{id} || $form->{convert_from_oe_ids});
189 189
  $form->restore_vars(qw(taxincluded)) if $form->{id};
190 190
  $form->restore_vars(qw(salesman_id)) if $editing;
......
335 335
  my $form     = $main::form;
336 336

  
337 337
  $form->{PRINT_OPTIONS} = print_options('inline' => 1);
338
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
338 339

  
339 340
  print $form->parse_html_template('do/form_footer',
340 341
    {transfer_default         => ($::instance_conf->get_transfer_default)});
bin/mozilla/io.pl
1365 1365

  
1366 1366
  my $language_saved = $form->{language_id};
1367 1367
  my $payment_id_saved = $form->{payment_id};
1368
  my $delivery_term_id_saved = $form->{delivery_term_id};
1368 1369
  my $salesman_id_saved = $form->{salesman_id};
1369 1370
  my $cp_id_saved = $form->{cp_id};
1370 1371
  my $taxzone_id_saved = $form->{taxzone_id};
......
1374 1375

  
1375 1376
  $form->{language_id} = $language_saved;
1376 1377
  $form->{payment_id} = $payment_id_saved;
1378
  $form->{delivery_term_id} = $delivery_term_id_saved;
1377 1379
  $form->{taxzone_id} = $taxzone_id_saved;
1378 1380
  $form->{currency} = $currency_saved;
1379 1381

  
bin/mozilla/ir.pl
116 116
    }
117 117
  }
118 118

  
119
  my ($payment_id, $language_id, $taxzone_id, $currency);
119
  my ($payment_id, $language_id, $taxzone_id, $currency, $delivery_term_id);
120 120
  if ($form->{payment_id}) {
121 121
    $payment_id = $form->{payment_id};
122 122
  }
......
129 129
  if ($form->{currency}) {
130 130
    $currency = $form->{currency};
131 131
  }
132
  if ($form->{delivery_term_id}) {
133
    $delivery_term_id = $form->{delivery_term_id};
134
  }
132 135

  
133 136
  my $cp_id = $form->{cp_id};
134 137
  IR->get_vendor(\%myconfig, \%$form);
......
147 150
  if ($currency) {
148 151
    $form->{currency} = $currency;
149 152
  }
153
  if ($delivery_term_id) {
154
    $form->{delivery_term_id} = $delivery_term_id;
155
  }
150 156

  
151 157
  my @curr = $form->get_all_currencies();
152 158
  map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
......
431 437
    $totalpaid += $form->{"paid_$i"};
432 438
  }
433 439

  
440
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
441

  
434 442
  print $form->parse_html_template('ir/form_footer', {
435 443
    is_type_credit_note => ($form->{type} eq "credit_note"),
436 444
    totalpaid           => $totalpaid,
bin/mozilla/is.pl
149 149

  
150 150
  my $editing = $form->{id};
151 151

  
152
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded currency cp_id intnotes id shipto_id));
152
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id
153
                        taxincluded currency cp_id intnotes id shipto_id
154
                        delivery_term_id));
153 155

  
154 156
  IS->get_customer(\%myconfig, \%$form);
155 157

  
......
161 163
  $form->restore_vars(qw(id));
162 164

  
163 165
  IS->retrieve_invoice(\%myconfig, \%$form);
164
  $form->restore_vars(qw(payment_id language_id taxzone_id currency intnotes cp_id shipto_id));
166
  $form->restore_vars(qw(payment_id language_id taxzone_id currency intnotes
167
                         cp_id shipto_id delivery_term_id));
165 168
  $form->restore_vars(qw(taxincluded)) if $form->{id};
166 169
  $form->restore_vars(qw(salesman_id)) if $editing;
167 170

  
......
460 463

  
461 464
  $form->{oldinvtotal} = $form->{invtotal};
462 465

  
466
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
467

  
463 468
  print $form->parse_html_template('is/form_footer', {
464 469
    is_type_credit_note => ($form->{type} eq "credit_note"),
465 470
    totalpaid           => $totalpaid,
bin/mozilla/oe.pl
245 245

  
246 246
  $form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"};
247 247

  
248
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id currency));
248
  $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes shipto_id delivery_term_id currency));
249 249
  $form->{shipto} = 1 if $form->{id} || $form->{convert_from_oe_ids};
250 250

  
251 251
  # get customer / vendor
252 252
  IR->get_vendor(\%myconfig, \%$form)   if $form->{type} =~ /(purchase_order|request_quotation)/;
253 253
  IS->get_customer(\%myconfig, \%$form) if $form->{type} =~ /sales_(order|quotation)/;
254 254

  
255
  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id));
255
  $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id delivery_term_id));
256 256
  $form->restore_vars(qw(currency))    if $form->{id};
257 257
  $form->restore_vars(qw(taxincluded)) if $form->{id};
258 258
  $form->restore_vars(qw(salesman_id)) if $editing;
......
523 523

  
524 524
  $form->{oldinvtotal} = $form->{invtotal};
525 525

  
526
  $TMPL_VAR{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
527

  
526 528
  print $form->parse_html_template("oe/form_footer", {
527 529
     %TMPL_VAR,
528 530
     webdav          => $::instance_conf->get_webdav,
locale/de/all
221 221
  'Are you sure you want to delete Transaction' => 'Buchung wirklich löschen?',
222 222
  'Are you sure you want to delete this background job?' => 'Sind Sie sicher, dass Sie diesen Hintergrund-Job löschen möchten?',
223 223
  'Are you sure you want to delete this business?' => 'Sind Sie sicher, dass Sie diesen Kunden-/Lieferantentyp löschen wollen?',
224
  'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?',
224 225
  'Are you sure you want to delete this department?' => 'Sind Sie sicher, dass Sie diese Abteilung löschen wollen?',
225 226
  'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
226 227
  '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 503
  'Create a new background job' => 'Einen neuen Hintergrund-Job anlegen',
503 504
  'Create a new business'       => 'Einen neuen Kunden-/Lieferantentyp erfassen',
504 505
  'Create a new client'         => 'Einen neuen Mandanten anlegen',
506
  'Create a new delivery term'  => 'Neue Lieferbedingungen anlegen',
505 507
  'Create a new department'     => 'Eine neue Abteilung erfassen',
506 508
  'Create a new group'          => 'Neue Benutzergruppe erfassen',
507 509
  'Create a new payment term'   => 'Neue Zahlungsbedingungen anlegen',
......
531 533
  'Create new background job'   => 'Neuen Hintergrund-Job anlegen',
532 534
  'Create new business'         => 'Kunden-/Lieferantentyp erfassen',
533 535
  'Create new client #1'        => 'Neuen Mandanten #1 anlegen',
536
  'Create new delivery term'    => 'Neue Lieferbedingungen anlegen',
534 537
  'Create new department'       => 'Neue Abteilung erfassen',
535 538
  'Create new payment term'     => 'Neue Zahlungsbedingung anlegen',
536 539
  'Create new templates from master templates' => 'Neue Druckvorlagen aus Vorlagensatz erstellen',
......
683 686
  'Delivery Orders'             => 'Lieferscheine',
684 687
  'Delivery Plan'               => 'Lieferplan',
685 688
  'Delivery Plan for currently outstanding sales orders' => 'Lieferplan für offene Verkaufsaufträge',
689
  'Delivery Terms'              => 'Lieferbedingungen',
690
  'Delivery terms'              => 'Lieferbedingungen',
691
  'Delivery terms (database ID)' => 'Lieferbedingungen (Datenbank-ID)',
692
  'Delivery terms (name)'       => 'Lieferbedingungen (Name)',
686 693
  'Department'                  => 'Abteilung',
687 694
  'Department (database ID)'    => 'Abeilung (Datenbank-ID)',
688 695
  'Department (description)'    => 'Abteilung (Beschreibung)',
......
827 834
  'Edit bank account'           => 'Bankkonto bearbeiten',
828 835
  'Edit business'               => 'Kunden-/Lieferantentyp bearbeiten',
829 836
  'Edit custom variable'        => 'Benutzerdefinierte Variable bearbeiten',
837
  'Edit delivery term'          => 'Lieferbedingungen bearbeiten',
830 838
  'Edit department'             => 'Abteilung bearbeiten',
831 839
  'Edit file'                   => 'Datei bearbeiten',
832 840
  'Edit greetings'              => 'Anreden bearbeiten',
......
877 885
  'Error: Invalid business'     => 'Fehler: Kunden-/Lieferantentyp ungültig',
878 886
  'Error: Invalid contact'      => 'Fehler: Ansprechperson ungültig',
879 887
  'Error: Invalid currency'     => 'Fehler: ungültige Währung',
888
  'Error: Invalid delivery terms' => 'Fehler: Lieferbedingungen ungültig',
880 889
  'Error: Invalid department'   => 'Fehler: Abteilung ungültig',
881 890
  'Error: Invalid language'     => 'Fehler: Sprache ungültig',
882 891
  'Error: Invalid order for this order item' => 'Fehler: Auftrag für diese Position ungültig',
......
1358 1367
  'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgewählt.',
1359 1368
  'No data was found.'          => 'Es wurden keine Daten gefunden.',
1360 1369
  'No default currency'         => 'Keine Standardwährung',
1370
  'No delivery term has been created yet.' => 'Es wurden noch keine Lieferbedingungen angelegt',
1361 1371
  'No department has been created yet.' => 'Es wurde noch keine Abteilung erfasst.',
1362 1372
  'No dunnings have been selected for printing.' => 'Es wurden keine Mahnungen zum Drucken ausgew&auml;hlt.',
1363 1373
  'No file has been uploaded yet.' => 'Es wurde noch keine Datei hochgeladen.',
......
1498 1508
  'Password'                    => 'Passwort',
1499 1509
  'Payables'                    => 'Verbindlichkeiten',
1500 1510
  'Payment'                     => 'Zahlungsausgang',
1501
  'Payment Options'             => 'Zahlungsoptionen',
1511
  'Payment / Delivery Options'  => 'Zahlungs- und Lieferoptionen',
1502 1512
  'Payment Reminder'            => 'Zahlungserinnerung',
1503 1513
  'Payment Terms'               => 'Zahlungsbedingungen',
1504 1514
  'Payment Terms missing in row ' => 'Zahlungsfrist fehlt in Zeile ',
......
2100 2110
  'The deductible amount'       => 'Der abziehbare Skontobetrag',
2101 2111
  'The default value depends on the variable type:' => 'Die Bedeutung des Standardwertes h&auml;ngt vom Variablentypen ab:',
2102 2112
  '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.',
2113
  'The delivery term has been created.' => 'Die Lieferbedingungen wurden angelegt.',
2114
  'The delivery term has been deleted.' => 'Die Lieferbedingungen wurden gelöscht.',
2115
  'The delivery term has been saved.' => 'Die Lieferbedingungen wurden gespeichert.',
2116
  'The delivery term is in use and cannot be deleted.' => 'Die Lieferbedingungen werden bereits verwendet und können nicht gelöscht werden.',
2103 2117
  'The department has been created.' => 'Die Abteilung wurde angelegt.',
2104 2118
  'The department has been deleted.' => 'Die Abteiltung wurde gelöscht.',
2105 2119
  'The department has been saved.' => 'Die abteilung wurde gespeichert.',
locale/en/all
221 221
  'Are you sure you want to delete Transaction' => '',
222 222
  'Are you sure you want to delete this background job?' => '',
223 223
  'Are you sure you want to delete this business?' => '',
224
  'Are you sure you want to delete this delivery term?' => '',
224 225
  'Are you sure you want to delete this department?' => '',
225 226
  'Are you sure you want to delete this payment term?' => '',
226 227
  'Are you sure you want to remove the marked entries from the queue?' => '',
......
502 503
  'Create a new background job' => '',
503 504
  'Create a new business'       => '',
504 505
  'Create a new client'         => '',
506
  'Create a new delivery term'  => '',
505 507
  'Create a new department'     => '',
506 508
  'Create a new group'          => '',
507 509
  'Create a new payment term'   => '',
......
683 685
  'Delivery Orders'             => '',
684 686
  'Delivery Plan'               => '',
685 687
  'Delivery Plan for currently outstanding sales orders' => '',
688
  'Delivery Terms'              => '',
689
  'Delivery terms'              => '',
690
  'Delivery terms (database ID)' => '',
691
  'Delivery terms (name)'       => '',
686 692
  'Department'                  => '',
687 693
  'Department (database ID)'    => '',
688 694
  'Department (description)'    => '',
......
827 833
  'Edit bank account'           => '',
828 834
  'Edit business'               => '',
829 835
  'Edit custom variable'        => '',
836
  'Edit delivery term'          => '',
830 837
  'Edit department'             => '',
831 838
  'Edit file'                   => '',
832 839
  'Edit greetings'              => '',
......
877 884
  'Error: Invalid business'     => '',
878 885
  'Error: Invalid contact'      => '',
879 886
  'Error: Invalid currency'     => '',
887
  'Error: Invalid delivery terms' => '',
880 888
  'Error: Invalid department'   => '',
881 889
  'Error: Invalid language'     => '',
882 890
  'Error: Invalid order for this order item' => '',
......
1358 1366
  'No customer has been selected yet.' => '',
1359 1367
  'No data was found.'          => '',
1360 1368
  'No default currency'         => '',
1369
  'No delivery term has been created yet.' => '',
1361 1370
  'No department has been created yet.' => '',
1362 1371
  'No dunnings have been selected for printing.' => '',
1363 1372
  'No file has been uploaded yet.' => '',
......
1498 1507
  'Password'                    => '',
1499 1508
  'Payables'                    => '',
1500 1509
  'Payment'                     => '',
1501
  'Payment Options'             => '',
1510
  'Payment / Delivery Options'  => '',
1502 1511
  'Payment Reminder'            => '',
1503 1512
  'Payment Terms'               => '',
1504 1513
  'Payment Terms missing in row ' => '',
......
2099 2108
  'The deductible amount'       => '',
2100 2109
  'The default value depends on the variable type:' => '',
2101 2110
  'The delivery order has not been marked as delivered. The warehouse contents have not changed.' => '',
2111
  'The delivery term has been created.' => '',
2112
  'The delivery term has been deleted.' => '',
2113
  'The delivery term has been saved.' => '',
2114
  'The delivery term is in use and cannot be deleted.' => '',
2102 2115
  'The department has been created.' => '',
2103 2116
  'The department has been deleted.' => '',
2104 2117
  'The department has been saved.' => '',
menus/erp.ini
597 597
module=controller.pl
598 598
action=PaymentTerm/list
599 599

  
600
[System--Delivery Terms]
601
module=controller.pl
602
action=DeliveryTerm/list
603

  
600 604
[System--Manage Custom Variables]
601 605
module=controller.pl
602 606
action=CustomVariableConfig/list
sql/Pg-upgrade2/delivery_terms.sql
1
-- @tag: delivery_terms
2
-- @description: Neue Tabelle und Spalten für Lieferbedingungen
3
-- @depends: release_3_0_0
4
-- @encoding: utf-8
5

  
6
CREATE TABLE delivery_terms (
7
       id                        integer        NOT NULL DEFAULT nextval('id'),
8
       description               text,
9
       description_long          text,
10
       sortkey                   integer        NOT NULL,
11
       itime                     timestamp      DEFAULT now(),
12
       mtime                     timestamp,
13

  
14
       PRIMARY KEY (id)
15
);
16

  
17
CREATE TRIGGER mtime_delivery_terms
18
    BEFORE UPDATE ON delivery_terms
19
    FOR EACH ROW
20
    EXECUTE PROCEDURE set_mtime();
21

  
22

  
23
ALTER TABLE oe                ADD COLUMN delivery_term_id integer;
24
ALTER TABLE oe                ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
25

  
26
ALTER TABLE delivery_orders   ADD COLUMN delivery_term_id integer;
27
ALTER TABLE delivery_orders   ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
28

  
29
ALTER TABLE ar                ADD COLUMN delivery_term_id integer;
30
ALTER TABLE ar                ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
31

  
32
ALTER TABLE ap                ADD COLUMN delivery_term_id integer;
33
ALTER TABLE ap                ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
34

  
35
ALTER TABLE customer          ADD COLUMN delivery_term_id integer;
36
ALTER TABLE customer          ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
37

  
38
ALTER TABLE vendor            ADD COLUMN delivery_term_id integer;
39
ALTER TABLE vendor            ADD FOREIGN KEY (delivery_term_id) REFERENCES delivery_terms(id);
templates/webpages/common/show_vc_details.html
117 117
   <td>[% HTML.escape(payment_terms) %]</td>
118 118
  </tr>
119 119

  
120
  <tr>
121
   <td align="right">[% 'Delivery Terms' | $T8 %]</td>
122
   <td>[% HTML.escape(delivery_terms) %]</td>
123
  </tr>
124

  
120 125
  <tr>
121 126
   <td align="right">[% 'Tax Number' | $T8 %]</td>
122 127
   <td>[% HTML.escape(taxnumber) %]</td>
templates/webpages/ct/form_header.html
261 261
             label_key  = 'description',
262 262
       -%]
263 263
      </td>
264
      <th align="right">[% 'Delivery Terms' | $T8 %]</th>
265
      <td>[% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description') %]</td>
266
     </tr>
267

  
268
     <tr>
269
      <td align="right"><label for="obsolete">[% 'Obsolete' | $T8 %]</label></td>
270
      <td><input name="obsolete" id="obsolete" class="checkbox" type="checkbox" value="1" [% IF obsolete %]checked[% END %]></td>
271
      <td align="right"><label for="direct_debit">[% 'direct debit' | $T8 %]</label></td>
272
      <td><input name="direct_debit" id="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
264 273

  
265 274
      [%- IF is_customer %]
266 275
      <th align="right">[% 'Preisklasse' | $T8 %]</th>
......
276 285
      [%- END  %]
277 286
     </tr>
278 287

  
279
     <tr>
280
      <td align="right"><label for="obsolete">[% 'Obsolete' | $T8 %]</label></td>
281
      <td><input name="obsolete" id="obsolete" class="checkbox" type="checkbox" value="1" [% IF obsolete %]checked[% END %]></td>
282
      <td align="right"><label for="direct_debit">[% 'direct debit' | $T8 %]</label></td>
283
      <td><input name="direct_debit" id="direct_debit" class="checkbox" type="checkbox" value="1" [% IF direct_debit %]checked[% END %]></td>
284
     </tr>
285

  
286 288
     <tr>
287 289
      <th align="right">[% 'Steuersatz' | $T8 %]</th>
288 290
      <td>
templates/webpages/customer_vendor/tabs/billing.html
313 313
        [% L.select_tag('cv.language_id', SELF.all_languages, default = SELF.cv.language_id, value_key = 'id', title_key = 'description', with_empty = 1) %]
314 314
      </td>
315 315

  
316
      [% IF ( SELF.is_customer() ) %]
317
        <th align="right">[% 'Preisklasse' | $T8 %]</th>
316
      <th align="right">[% 'Delivery Terms' | $T8 %]</th>
317

  
318
      <td>
319
        [% 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) %]
320
      </td>
318 321

  
319
        <td>
320
          [% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
321
        </td>
322
      [% END  %]
323 322
    </tr>
324 323

  
325 324
    <tr>
......
339 338
      <td>
340 339
        [% L.checkbox_tag('cv.direct_debit', checked = SELF.cv.direct_debit, for_submit=1) %]
341 340
      </td>
341

  
342
      [% IF ( SELF.is_customer() ) %]
343
        <th align="right">[% 'Preisklasse' | $T8 %]</th>
344

  
345
        <td>
346
          [% L.select_tag('cv.klass', SELF.all_pricegroups, default = SELF.cv.klass, value_key = 'id', title_key = 'pricegroup', with_empty = 1) %]
347
        </td>
348
      [% END  %]
349

  
342 350
    </tr>
343 351

  
344 352
    <tr>
templates/webpages/delivery_term/form.html
1
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
2

  
3
 <form method="post" action="controller.pl">
4
  <div class="listtop">[% FORM.title %]</div>
5

  
6
[%- INCLUDE 'common/flash.html' %]
7

  
8
  <table>
9
   <tr>
10
    <td>[%- 'Description' | $T8 %]</td>
11
    <td>
12
     <input name="delivery_term.description" value="[%- HTML.escape(SELF.delivery_term.description) %]">
13
    </td>
14
   </tr>
15

  
16
   <tr>
17
    <td>[%- 'Long Description' | $T8 %]</td>
18
    <td>
19
     <input name="delivery_term.description_long" value="[%- HTML.escape(SELF.delivery_term.description_long) %]" size="60">
20
    </td>
21
   </tr>
22

  
23
  <p>
24
   <input type="hidden" name="id" value="[% SELF.delivery_term.id %]">
25
   <input type="hidden" name="action" value="DeliveryTerm/dispatch">
26
   <input type="submit" class="submit" name="action_[% IF SELF.delivery_term.id %]update[% ELSE %]create[% END %]" value="[% 'Save' | $T8 %]">
27
   [%- IF SELF.delivery_term.id %]
28
    <input type="submit" class="submit" name="action_destroy" value="[% 'Delete' | $T8 %]"
29
           onclick="if (confirm('[% 'Are you sure you want to delete this delivery term?' | $T8 %]')) return true; else return false;">
30
   [%- END %]
31
   <a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a>
32
  </p>
33

  
34
 </form>
35

  
templates/webpages/delivery_term/list.html
1
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %]
2

  
3
 <div class="listtop">[% FORM.title %]</div>
4

  
5
[%- INCLUDE 'common/flash.html' %]
6

  
7
 <form method="post" action="controller.pl">
8
  [% IF !DELIVERY_TERMS.size %]
9
   <p>
10
    [%- 'No delivery term has been created yet.' | $T8 %]
11
   </p>
12

  
13
  [%- ELSE %]
14
   <table id="delivery_term_list">
15
    <thead>
16
    <tr class="listheading">
17
     <th align="center"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></th>
18
     <th>[%- 'Description' | $T8 %]</th>
19
     <th>[%- 'Long Description' | $T8 %]</th>
20
    </tr>
21
    </thead>
22

  
23
    <tbody>
24
    [%- FOREACH delivery_term = DELIVERY_TERMS %]
25
    <tr class="listrow[% loop.count % 2 %]" id="delivery_term_id_[% delivery_term.id %]">
26
     <td align="center" class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
27
     <td>
28
      <a href="[% SELF.url_for(action => 'edit', id => delivery_term.id) %]">
29
       [%- HTML.escape(delivery_term.description) %]
30
      </a>
31
     </td>
32
     <td>[%- HTML.escape(delivery_term.description_long) %]</td>
33
    </tr>
34
    [%- END %]
35
    </tbody>
36
   </table>
37
  [%- END %]
38

  
39
  <p>
40
   <a href="[% SELF.url_for(action => 'new') %]">[%- 'Create new delivery term' | $T8 %]</a>
41
  </p>
42
 </form>
43

  
44
 [% L.sortable_element('#delivery_term_list tbody', url => 'controller.pl?action=DeliveryTerm/reorder', with => 'delivery_term_id') %]
45

  
templates/webpages/do/form_footer.html
16 16
        <td><textarea name="notes" rows="[% LxERP.numtextrows(notes, 25, 8, 2) %]" cols="25" wrap="soft"[% RO %]>[% HTML.escape(notes) %]</textarea></td>
17 17
        <td><textarea name="intnotes" rows="[% LxERP.numtextrows(intnotes, 35, 8, 2) %]" cols="35" wrap="soft"[% RO %]>[% HTML.escape(intnotes) %]</textarea></td>
18 18
       </tr>
19

  
20
       <tr>
21
         <th align="right">[% 'Delivery Terms' | $T8 %]</th>
22
         <td>[% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description') %]</td>
23
       </tr>
19 24
      </table>
20 25

  
21 26
     </td>
templates/webpages/ir/form_footer.html
11 11
        <tr>
12 12
         <th align="left">[% 'Notes' | $T8 %]</th>
13 13
         <th align="left">[% 'Internal Notes' | $T8 %]</th>
14
         <th align="left">[% 'Payment Options' | $T8 %]</th>
14
         <th align="right">[% 'Payment / Delivery Options' | $T8 %]</th>
15 15
        </tr>
16 16
        <tr valign="top">
17 17
         <td>
......
21 21
          <textarea name="intnotes" rows="[% rows %]" cols="35" wrap="soft">[% intnotes %]</textarea>
22 22
         </td>
23 23
         <td>
24
          [%- L.checkbox_tag('direct_debit', 'checked', direct_debit, 'label', LxERP.t8('direct debit')) %]
24
           <table>
25
             <tr>
26
               <th align="right">[% 'Delivery Terms' | $T8 %] </th>
27
               <td>
28
                 [% L.select_tag('delivery_term_id', ALL_DELIVERY_TERMS, default = delivery_term_id, with_empty = 1, title_key = 'description', style = 'width: 250px') %]
29
               </td>
30
             </tr>
31
             <tr>
32
               <th align="right">[% 'direct debit' | $T8 %]</th>
33
               <td>
34
                 [%- L.checkbox_tag('direct_debit', 'checked', direct_debit) %]
35
               </td>
36
             </tr>
37
           </table>
25 38
         </td>
26 39
        </tr>
27 40
[%- IF id && follow_ups.size %]
templates/webpages/is/form_footer.html
11 11
        <tr>
12 12
         <th align="left">[% 'Notes (will appear on hard copy)' | $T8 %]</th>
... Dieser Diff wurde abgeschnitten, weil er die maximale Anzahl anzuzeigender Zeilen überschreitet.

Auch abrufbar als: Unified diff