X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FMetaSetup%2FInvoiceItem.pm;h=85b8876be8712bc0488583dea19c2ddce3612bbd;hb=ae32e420b4016d27bd80f866a28bfdbcf20ebe2f;hp=9a851e0570da6f55414616ab37b9b221112331ff;hpb=6cf3f7762efd40bee49a2b8f11bb4ab6915d9071;p=kivitendo-erp.git diff --git a/SL/DB/MetaSetup/InvoiceItem.pm b/SL/DB/MetaSetup/InvoiceItem.pm index 9a851e057..85b8876be 100644 --- a/SL/DB/MetaSetup/InvoiceItem.pm +++ b/SL/DB/MetaSetup/InvoiceItem.pm @@ -4,53 +4,75 @@ package SL::DB::InvoiceItem; use strict; -use base qw(SL::DB::Object); - -__PACKAGE__->meta->setup( - table => 'invoice', - - columns => [ - id => { type => 'integer', not_null => 1, sequence => 'invoiceid' }, - trans_id => { type => 'integer' }, - parts_id => { type => 'integer' }, - description => { type => 'text' }, - qty => { type => 'float', precision => 4 }, - allocated => { type => 'float', precision => 4 }, - sellprice => { type => 'numeric', precision => 5, scale => 15 }, - fxsellprice => { type => 'numeric', precision => 5, scale => 15 }, - discount => { type => 'float', precision => 4 }, - assemblyitem => { type => 'boolean', default => 'false' }, - project_id => { type => 'integer' }, - deliverydate => { type => 'date' }, - serialnumber => { type => 'text' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - pricegroup_id => { type => 'integer' }, - ordnumber => { type => 'text' }, - transdate => { type => 'text' }, - cusordnumber => { type => 'text' }, - unit => { type => 'varchar', length => 20 }, - base_qty => { type => 'float', precision => 4 }, - subtotal => { type => 'boolean', default => 'false' }, - longdescription => { type => 'text' }, - marge_total => { type => 'numeric', precision => 5, scale => 15 }, - marge_percent => { type => 'numeric', precision => 5, scale => 15 }, - lastcost => { type => 'numeric', precision => 5, scale => 15 }, - price_factor_id => { type => 'integer' }, - price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, - marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, - ], - - primary_key_columns => [ 'id' ], - - allow_inline_column_values => 1, - - foreign_keys => [ - parts => { - class => 'SL::DB::Part', - key_columns => { parts_id => 'id' }, - }, - ], +use parent qw(SL::DB::Object); + +__PACKAGE__->meta->table('invoice'); + +__PACKAGE__->meta->columns( + active_discount_source => { type => 'text', default => '', not_null => 1 }, + active_price_source => { type => 'text', default => '', not_null => 1 }, + allocated => { type => 'float', precision => 4, scale => 4 }, + assemblyitem => { type => 'boolean', default => 'false' }, + base_qty => { type => 'float', precision => 4, scale => 4 }, + cusordnumber => { type => 'text' }, + deliverydate => { type => 'date' }, + description => { type => 'text' }, + discount => { type => 'float', precision => 4, scale => 4 }, + donumber => { type => 'text' }, + fxsellprice => { type => 'numeric', precision => 15, scale => 5 }, + id => { type => 'integer', not_null => 1, sequence => 'invoiceid' }, + itime => { type => 'timestamp', default => 'now()' }, + lastcost => { type => 'numeric', precision => 15, scale => 5 }, + longdescription => { type => 'text' }, + marge_percent => { type => 'numeric', precision => 15, scale => 5 }, + marge_price_factor => { type => 'numeric', default => 1, precision => 15, scale => 5 }, + marge_total => { type => 'numeric', precision => 15, scale => 5 }, + mtime => { type => 'timestamp' }, + ordnumber => { type => 'text' }, + parts_id => { type => 'integer' }, + position => { type => 'integer', not_null => 1 }, + price_factor => { type => 'numeric', default => 1, precision => 15, scale => 5 }, + price_factor_id => { type => 'integer' }, + pricegroup_id => { type => 'integer' }, + project_id => { type => 'integer' }, + qty => { type => 'float', precision => 4, scale => 4 }, + sellprice => { type => 'numeric', precision => 15, scale => 5 }, + serialnumber => { type => 'text' }, + subtotal => { type => 'boolean', default => 'false' }, + trans_id => { type => 'integer' }, + transdate => { type => 'text' }, + unit => { type => 'varchar', length => 20 }, +); + +__PACKAGE__->meta->primary_key_columns([ 'id' ]); + +__PACKAGE__->meta->allow_inline_column_values(1); + +__PACKAGE__->meta->foreign_keys( + part => { + class => 'SL::DB::Part', + key_columns => { parts_id => 'id' }, + }, + + price_factor_obj => { + class => 'SL::DB::PriceFactor', + key_columns => { price_factor_id => 'id' }, + }, + + pricegroup => { + class => 'SL::DB::Pricegroup', + key_columns => { pricegroup_id => 'id' }, + }, + + project => { + class => 'SL::DB::Project', + key_columns => { project_id => 'id' }, + }, + + unit_obj => { + class => 'SL::DB::Unit', + key_columns => { unit => 'name' }, + }, ); 1;