Revision f2b44f13
Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt
SL/DB/AssortmentItem.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::AssortmentItem; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::AssortmentItem; |
|
9 |
use SL::DB::Manager::AssortmentItem; |
|
10 |
use Rose::DB::Object::Helpers qw(clone); |
|
11 |
|
|
12 |
__PACKAGE__->meta->initialize; |
|
13 |
|
|
14 |
sub linetotal { |
|
15 |
my ($self) = @_; |
|
16 |
|
|
17 |
return 0 unless $self->qty > 0 and $self->part->sellprice > 0; |
|
18 |
return $self->qty * $self->part->sellprice / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 ); |
|
19 |
} |
|
20 |
|
|
21 |
sub linetotal_lastcost { |
|
22 |
my ($self) = @_; |
|
23 |
|
|
24 |
return 0 unless $self->qty > 0 and $self->part->lastcost > 0; |
|
25 |
return $self->qty * $self->part->lastcost / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 ); |
|
26 |
} |
|
27 |
|
|
28 |
1; |
SL/DB/Helper/ALL.pm | ||
---|---|---|
4 | 4 |
|
5 | 5 |
use SL::DB::AccTransaction; |
6 | 6 |
use SL::DB::Assembly; |
7 |
use SL::DB::AssortmentItem; |
|
7 | 8 |
use SL::DB::AuthClient; |
8 | 9 |
use SL::DB::AuthClientUser; |
9 | 10 |
use SL::DB::AuthClientGroup; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
99 | 99 |
ar => 'invoice', |
100 | 100 |
ap => 'purchase_invoice', |
101 | 101 |
assembly => 'assembly', |
102 |
assortment_items => 'assortment_item', |
|
102 | 103 |
background_jobs => 'background_job', |
103 | 104 |
background_job_histories => 'background_job_history', |
104 | 105 |
ap => 'purchase_invoice', |
SL/DB/Manager/AssortmentItem.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::Manager::AssortmentItem; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use parent qw(SL::DB::Helper::Manager); |
|
9 |
|
|
10 |
sub object_class { 'SL::DB::AssortmentItem' } |
|
11 |
|
|
12 |
__PACKAGE__->make_manager_methods; |
|
13 |
|
|
14 |
1; |
SL/DB/MetaSetup/AssortmentItem.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::AssortmentItem; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use parent qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('assortment_items'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
assortment_id => { type => 'integer', not_null => 1 }, |
|
13 |
itime => { type => 'timestamp', default => 'now()' }, |
|
14 |
mtime => { type => 'timestamp' }, |
|
15 |
parts_id => { type => 'integer', not_null => 1 }, |
|
16 |
position => { type => 'integer', not_null => 1 }, |
|
17 |
qty => { type => 'float', not_null => 1, scale => 4 }, |
|
18 |
unit => { type => 'varchar', length => 20, not_null => 1 }, |
|
19 |
); |
|
20 |
|
|
21 |
__PACKAGE__->meta->primary_key_columns([ 'assortment_id', 'parts_id' ]); |
|
22 |
|
|
23 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
24 |
|
|
25 |
__PACKAGE__->meta->foreign_keys( |
|
26 |
assortment => { |
|
27 |
class => 'SL::DB::Part', |
|
28 |
key_columns => { assortment_id => 'id' }, |
|
29 |
}, |
|
30 |
|
|
31 |
part => { |
|
32 |
class => 'SL::DB::Part', |
|
33 |
key_columns => { parts_id => 'id' }, |
|
34 |
}, |
|
35 |
|
|
36 |
unit_obj => { |
|
37 |
class => 'SL::DB::Unit', |
|
38 |
key_columns => { unit => 'name' }, |
|
39 |
}, |
|
40 |
); |
|
41 |
|
|
42 |
1; |
|
43 |
; |
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
24 | 24 |
ar_show_mark_as_paid => { type => 'boolean', default => 'true' }, |
25 | 25 |
articlenumber => { type => 'text' }, |
26 | 26 |
assemblynumber => { type => 'text' }, |
27 |
assortmentnumber => { type => 'text' }, |
|
27 | 28 |
balance_startdate_method => { type => 'text' }, |
28 | 29 |
bin_id => { type => 'integer' }, |
29 | 30 |
bin_id_ignore_onhand => { type => 'integer' }, |
SL/DB/Part.pm | ||
---|---|---|
38 | 38 |
class => 'SL::DB::Translation', |
39 | 39 |
column_map => { id => 'parts_id' }, |
40 | 40 |
}, |
41 |
assortment_items => { |
|
42 |
type => 'one to many', |
|
43 |
class => 'SL::DB::AssortmentItem', |
|
44 |
column_map => { id => 'assortment_id' }, |
|
45 |
}, |
|
41 | 46 |
); |
42 | 47 |
|
43 | 48 |
__PACKAGE__->meta->initialize; |
doc/changelog | ||
---|---|---|
47 | 47 |
Verkaufsauträge finden zu können: |
48 | 48 |
Verkauf -> Berichte -> Auftragsartikelsuche |
49 | 49 |
|
50 |
- Neuer Artikeltyp "Sortiment" |
|
51 |
Einem Sortiment können wie einem Erzeugnis mehrere Artikel zugeordnet |
|
52 |
werden. Beim Hinzufügen eines Sortiments zu einem Beleg werden alle |
|
53 |
Bestandteile des Sortiments als Einzelteile zum Beleg hinzugefügt, so als |
|
54 |
ob man das manuell gemacht hätte. Der Sortimentsartikel wird ohne Preis |
|
55 |
hinzugefügt und fungiert als Überschrift, und kann sogar gelöscht werden. |
|
56 |
Nach dem Hinzufügen können die Einzelbestandteile auch gelöscht oder |
|
57 |
verändert werden. Dadurch hat das Sortiment auch keinen festen Preis, |
|
58 |
sondern der Preis im Beleg richtet sich nach dem Preis der |
|
59 |
Einzelbestandteile, die je nach Kunde z.B. durch Preisgruppenpreise |
|
60 |
variieren können. |
|
61 |
|
|
62 |
Das Sortiment eignet sich z.B. als Definition von Gruppierungen von |
|
63 |
Artikeln die häufig zusammen gekauft werden, z.B. ein Artikel in 10 |
|
64 |
Farbvariationen. |
|
65 |
|
|
66 |
Einschränkungen: das "Auspacken" eines Sortiments beim Hinzufügen in einem |
|
67 |
Beleg funktioniert derzeit nur beim neuen Auftragscontroller. |
|
68 |
|
|
50 | 69 |
Administrative Änderungen |
51 | 70 |
|
52 | 71 |
- Diverse Textsuchen werden jetzt durch eine neue Klasse Indizes |
scripts/rose_auto_create_model.pl | ||
---|---|---|
82 | 82 |
reconciliation_links => { acc_trans_id => 'acc_trans' }, |
83 | 83 |
|
84 | 84 |
assembly => { parts_id => 'part', id => 'assembly_part' }, |
85 |
assortment_items => { parts_id => 'part' }, |
|
85 | 86 |
}, |
86 | 87 |
); |
87 | 88 |
|
sql/Pg-upgrade2/assortment.sql | ||
---|---|---|
1 |
-- @tag: assortment_items |
|
2 |
-- @description: Sortimentsartikel eingeführt |
|
3 |
-- @depends: release_3_4_1 part_type_enum |
|
4 |
|
|
5 |
-- adding a new value isn't allowed inside a transaction, which is what DBUpgrade automatically does |
|
6 |
-- run this afterwards manually for now |
|
7 |
-- ALTER TYPE part_type_enum ADD VALUE 'assortment'; |
|
8 |
|
|
9 |
CREATE TABLE assortment_items ( |
|
10 |
assortment_id INTEGER REFERENCES parts(id) ON DELETE CASCADE, -- the part id of the assortment |
|
11 |
parts_id INTEGER REFERENCES parts(id), |
|
12 |
itime timestamp without time zone default now(), |
|
13 |
mtime timestamp without time zone, |
|
14 |
qty REAL NOT NULL, |
|
15 |
position INTEGER NOT NULL, |
|
16 |
unit character varying(20) NOT NULL REFERENCES units(name), |
|
17 |
CONSTRAINT assortment_part_pkey PRIMARY KEY (assortment_id, parts_id) |
|
18 |
); |
|
19 |
|
|
20 |
ALTER TABLE defaults ADD assortmentnumber TEXT; |
templates/webpages/client_config/_ranges_of_numbers.html | ||
---|---|---|
44 | 44 |
<tr> |
45 | 45 |
<td align="right" nowrap>[% LxERP.t8('Last Sales Delivery Order Number') %]</td> |
46 | 46 |
<td>[% L.input_tag("defaults.sdonumber", SELF.defaults.sdonumber, size="15") %]</td> |
47 |
<td align="right" nowrap>[% LxERP.t8('Last Assortment Number') %]</td> |
|
48 |
<td>[% L.input_tag("defaults.assortmentnumber", SELF.defaults.assortmentnumber, size="15") %]</td> |
|
47 | 49 |
</tr> |
48 | 50 |
|
49 | 51 |
<tr> |
Auch abrufbar als: Unified diff
Neuen Artikeltyp Sortiment eingeführt - sql und rose