Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ab7b0097

Von Tamino Steinert vor fast 2 Jahren hinzugefügt

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

Unterschiede anzeigen:

SL/DB/MetaSetup/InvoiceItem.pm
19 19
  description            => { type => 'text' },
20 20
  discount               => { type => 'float', precision => 4, scale => 4 },
21 21
  donumber               => { type => 'text' },
22
  expense_chart_id       => { type => 'integer' },
22 23
  fxsellprice            => { type => 'numeric', precision => 15, scale => 5 },
23 24
  id                     => { type => 'integer', not_null => 1, sequence => 'invoiceid' },
25
  inventory_chart_id     => { type => 'integer' },
24 26
  itime                  => { type => 'timestamp', default => 'now()' },
25 27
  lastcost               => { type => 'numeric', precision => 15, scale => 5 },
26 28
  longdescription        => { type => 'text' },
......
39 41
  sellprice              => { type => 'numeric', precision => 15, scale => 5 },
40 42
  serialnumber           => { type => 'text' },
41 43
  subtotal               => { type => 'boolean', default => 'false' },
44
  tax_id                 => { type => 'integer' },
42 45
  trans_id               => { type => 'integer' },
43 46
  transdate              => { type => 'text' },
44 47
  unit                   => { type => 'varchar', length => 20 },
......
49 52
__PACKAGE__->meta->allow_inline_column_values(1);
50 53

  
51 54
__PACKAGE__->meta->foreign_keys(
55
  expense_chart => {
56
    class       => 'SL::DB::Chart',
57
    key_columns => { expense_chart_id => 'id' },
58
  },
59

  
60
  inventory_chart => {
61
    class       => 'SL::DB::Chart',
62
    key_columns => { inventory_chart_id => 'id' },
63
  },
64

  
52 65
  part => {
53 66
    class       => 'SL::DB::Part',
54 67
    key_columns => { parts_id => 'id' },
......
69 82
    key_columns => { project_id => 'id' },
70 83
  },
71 84

  
85
  tax => {
86
    class       => 'SL::DB::Tax',
87
    key_columns => { tax_id => 'id' },
88
  },
89

  
72 90
  unit_obj => {
73 91
    class       => 'SL::DB::Unit',
74 92
    key_columns => { unit => 'name' },
sql/Pg-upgrade2/add_charts_and_taxkey_to_invoice_items.sql
1
-- @tag: add_charts_and_tax_to_invoice_items
2
-- @description: Einkaufsrechnungspositionen mit Steuer und Gegenkonto überlagern
3
-- @depends: release_3_7_0
4

  
5
ALTER TABLE invoice ADD COLUMN inventory_chart_id INTEGER;
6
ALTER TABLE invoice ADD FOREIGN KEY (inventory_chart_id) REFERENCES chart(id);
7
ALTER TABLE invoice ADD COLUMN expense_chart_id INTEGER;
8
ALTER TABLE invoice ADD FOREIGN KEY (expense_chart_id) REFERENCES chart(id);
9
ALTER TABLE invoice ADD COLUMN tax_id INTEGER;
10
ALTER TABLE invoice ADD FOREIGN KEY (tax_id) REFERENCES tax(id);

Auch abrufbar als: Unified diff