Merge branch 'test' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / SL / DB / MetaSetup / DeliveryOrder.pm
index a1efe9a..994fa96 100644 (file)
@@ -4,11 +4,12 @@ package SL::DB::DeliveryOrder;
 
 use strict;
 
-use base qw(SL::DB::Object);
+use parent qw(SL::DB::Object);
 
 __PACKAGE__->meta->table('delivery_orders');
 
 __PACKAGE__->meta->columns(
+  billing_address_id      => { type => 'integer' },
   closed                  => { type => 'boolean', default => 'false' },
   cp_id                   => { type => 'integer' },
   currency_id             => { type => 'integer', not_null => 1 },
@@ -22,21 +23,22 @@ __PACKAGE__->meta->columns(
   globalproject_id        => { type => 'integer' },
   id                      => { type => 'integer', not_null => 1, sequence => 'id' },
   intnotes                => { type => 'text' },
-  is_sales                => { type => 'boolean' },
   itime                   => { type => 'timestamp', default => 'now()' },
   language_id             => { type => 'integer' },
   mtime                   => { type => 'timestamp' },
   notes                   => { type => 'text' },
+  order_type              => { type => 'text', not_null => 1 },
   ordnumber               => { type => 'text' },
   oreqnumber              => { type => 'text' },
+  payment_id              => { type => 'integer' },
   reqdate                 => { type => 'date' },
   salesman_id             => { type => 'integer' },
   shippingpoint           => { type => 'text' },
   shipto_id               => { type => 'integer' },
   shipvia                 => { type => 'text' },
+  tax_point               => { type => 'date' },
   taxincluded             => { type => 'boolean' },
-  taxzone_id              => { type => 'integer' },
-  terms                   => { type => 'integer' },
+  taxzone_id              => { type => 'integer', not_null => 1 },
   transaction_description => { type => 'text' },
   transdate               => { type => 'date', default => 'now()' },
   vendor_id               => { type => 'integer' },
@@ -47,6 +49,11 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]);
 __PACKAGE__->meta->allow_inline_column_values(1);
 
 __PACKAGE__->meta->foreign_keys(
+  billing_address => {
+    class       => 'SL::DB::AdditionalBillingAddress',
+    key_columns => { billing_address_id => 'id' },
+  },
+
   contact => {
     class       => 'SL::DB::Contact',
     key_columns => { cp_id => 'cp_id' },
@@ -87,6 +94,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { language_id => 'id' },
   },
 
+  payment => {
+    class       => 'SL::DB::PaymentTerm',
+    key_columns => { payment_id => 'id' },
+  },
+
   salesman => {
     class       => 'SL::DB::Employee',
     key_columns => { salesman_id => 'id' },
@@ -97,6 +109,11 @@ __PACKAGE__->meta->foreign_keys(
     key_columns => { shipto_id => 'shipto_id' },
   },
 
+  taxzone => {
+    class       => 'SL::DB::TaxZone',
+    key_columns => { taxzone_id => 'id' },
+  },
+
   vendor => {
     class       => 'SL::DB::Vendor',
     key_columns => { vendor_id => 'id' },