Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ab7b0097

Von Tamino Steinert vor etwa 2 Jahren hinzugefügt

InvoiceItem: Datenstruktur fürs Überlagern von Konten und Steuer

Unterschiede anzeigen:

SL/DB/MetaSetup/InvoiceItem.pm
description => { type => 'text' },
discount => { type => 'float', precision => 4, scale => 4 },
donumber => { type => 'text' },
expense_chart_id => { type => 'integer' },
fxsellprice => { type => 'numeric', precision => 15, scale => 5 },
id => { type => 'integer', not_null => 1, sequence => 'invoiceid' },
inventory_chart_id => { type => 'integer' },
itime => { type => 'timestamp', default => 'now()' },
lastcost => { type => 'numeric', precision => 15, scale => 5 },
longdescription => { type => 'text' },
......
sellprice => { type => 'numeric', precision => 15, scale => 5 },
serialnumber => { type => 'text' },
subtotal => { type => 'boolean', default => 'false' },
tax_id => { type => 'integer' },
trans_id => { type => 'integer' },
transdate => { type => 'text' },
unit => { type => 'varchar', length => 20 },
......
__PACKAGE__->meta->allow_inline_column_values(1);
__PACKAGE__->meta->foreign_keys(
expense_chart => {
class => 'SL::DB::Chart',
key_columns => { expense_chart_id => 'id' },
},
inventory_chart => {
class => 'SL::DB::Chart',
key_columns => { inventory_chart_id => 'id' },
},
part => {
class => 'SL::DB::Part',
key_columns => { parts_id => 'id' },
......
key_columns => { project_id => 'id' },
},
tax => {
class => 'SL::DB::Tax',
key_columns => { tax_id => 'id' },
},
unit_obj => {
class => 'SL::DB::Unit',
key_columns => { unit => 'name' },
sql/Pg-upgrade2/add_charts_and_taxkey_to_invoice_items.sql
-- @tag: add_charts_and_tax_to_invoice_items
-- @description: Einkaufsrechnungspositionen mit Steuer und Gegenkonto überlagern
-- @depends: release_3_7_0
ALTER TABLE invoice ADD COLUMN inventory_chart_id INTEGER;
ALTER TABLE invoice ADD FOREIGN KEY (inventory_chart_id) REFERENCES chart(id);
ALTER TABLE invoice ADD COLUMN expense_chart_id INTEGER;
ALTER TABLE invoice ADD FOREIGN KEY (expense_chart_id) REFERENCES chart(id);
ALTER TABLE invoice ADD COLUMN tax_id INTEGER;
ALTER TABLE invoice ADD FOREIGN KEY (tax_id) REFERENCES tax(id);

Auch abrufbar als: Unified diff