Revision f2b44f13
Von Kivitendo Admin vor etwa 8 Jahren hinzugefügt
SL/DB/AssortmentItem.pm | ||
---|---|---|
# This file has been auto-generated only because it didn't exist.
|
||
# Feel free to modify it at will; it will not be overwritten automatically.
|
||
|
||
package SL::DB::AssortmentItem;
|
||
|
||
use strict;
|
||
|
||
use SL::DB::MetaSetup::AssortmentItem;
|
||
use SL::DB::Manager::AssortmentItem;
|
||
use Rose::DB::Object::Helpers qw(clone);
|
||
|
||
__PACKAGE__->meta->initialize;
|
||
|
||
sub linetotal {
|
||
my ($self) = @_;
|
||
|
||
return 0 unless $self->qty > 0 and $self->part->sellprice > 0;
|
||
return $self->qty * $self->part->sellprice / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 );
|
||
}
|
||
|
||
sub linetotal_lastcost {
|
||
my ($self) = @_;
|
||
|
||
return 0 unless $self->qty > 0 and $self->part->lastcost > 0;
|
||
return $self->qty * $self->part->lastcost / ( $self->part->price_factor_id ? $self->part->price_factor->factor : 1 );
|
||
}
|
||
|
||
1;
|
SL/DB/Helper/ALL.pm | ||
---|---|---|
|
||
use SL::DB::AccTransaction;
|
||
use SL::DB::Assembly;
|
||
use SL::DB::AssortmentItem;
|
||
use SL::DB::AuthClient;
|
||
use SL::DB::AuthClientUser;
|
||
use SL::DB::AuthClientGroup;
|
SL/DB/Helper/Mappings.pm | ||
---|---|---|
ar => 'invoice',
|
||
ap => 'purchase_invoice',
|
||
assembly => 'assembly',
|
||
assortment_items => 'assortment_item',
|
||
background_jobs => 'background_job',
|
||
background_job_histories => 'background_job_history',
|
||
ap => 'purchase_invoice',
|
SL/DB/Manager/AssortmentItem.pm | ||
---|---|---|
# This file has been auto-generated only because it didn't exist.
|
||
# Feel free to modify it at will; it will not be overwritten automatically.
|
||
|
||
package SL::DB::Manager::AssortmentItem;
|
||
|
||
use strict;
|
||
|
||
use parent qw(SL::DB::Helper::Manager);
|
||
|
||
sub object_class { 'SL::DB::AssortmentItem' }
|
||
|
||
__PACKAGE__->make_manager_methods;
|
||
|
||
1;
|
SL/DB/MetaSetup/AssortmentItem.pm | ||
---|---|---|
# This file has been auto-generated. Do not modify it; it will be overwritten
|
||
# by rose_auto_create_model.pl automatically.
|
||
package SL::DB::AssortmentItem;
|
||
|
||
use strict;
|
||
|
||
use parent qw(SL::DB::Object);
|
||
|
||
__PACKAGE__->meta->table('assortment_items');
|
||
|
||
__PACKAGE__->meta->columns(
|
||
assortment_id => { type => 'integer', not_null => 1 },
|
||
itime => { type => 'timestamp', default => 'now()' },
|
||
mtime => { type => 'timestamp' },
|
||
parts_id => { type => 'integer', not_null => 1 },
|
||
position => { type => 'integer', not_null => 1 },
|
||
qty => { type => 'float', not_null => 1, scale => 4 },
|
||
unit => { type => 'varchar', length => 20, not_null => 1 },
|
||
);
|
||
|
||
__PACKAGE__->meta->primary_key_columns([ 'assortment_id', 'parts_id' ]);
|
||
|
||
__PACKAGE__->meta->allow_inline_column_values(1);
|
||
|
||
__PACKAGE__->meta->foreign_keys(
|
||
assortment => {
|
||
class => 'SL::DB::Part',
|
||
key_columns => { assortment_id => 'id' },
|
||
},
|
||
|
||
part => {
|
||
class => 'SL::DB::Part',
|
||
key_columns => { parts_id => 'id' },
|
||
},
|
||
|
||
unit_obj => {
|
||
class => 'SL::DB::Unit',
|
||
key_columns => { unit => 'name' },
|
||
},
|
||
);
|
||
|
||
1;
|
||
;
|
SL/DB/MetaSetup/Default.pm | ||
---|---|---|
ar_show_mark_as_paid => { type => 'boolean', default => 'true' },
|
||
articlenumber => { type => 'text' },
|
||
assemblynumber => { type => 'text' },
|
||
assortmentnumber => { type => 'text' },
|
||
balance_startdate_method => { type => 'text' },
|
||
bin_id => { type => 'integer' },
|
||
bin_id_ignore_onhand => { type => 'integer' },
|
SL/DB/Part.pm | ||
---|---|---|
class => 'SL::DB::Translation',
|
||
column_map => { id => 'parts_id' },
|
||
},
|
||
assortment_items => {
|
||
type => 'one to many',
|
||
class => 'SL::DB::AssortmentItem',
|
||
column_map => { id => 'assortment_id' },
|
||
},
|
||
);
|
||
|
||
__PACKAGE__->meta->initialize;
|
doc/changelog | ||
---|---|---|
Verkaufsauträge finden zu können:
|
||
Verkauf -> Berichte -> Auftragsartikelsuche
|
||
|
||
- Neuer Artikeltyp "Sortiment"
|
||
Einem Sortiment können wie einem Erzeugnis mehrere Artikel zugeordnet
|
||
werden. Beim Hinzufügen eines Sortiments zu einem Beleg werden alle
|
||
Bestandteile des Sortiments als Einzelteile zum Beleg hinzugefügt, so als
|
||
ob man das manuell gemacht hätte. Der Sortimentsartikel wird ohne Preis
|
||
hinzugefügt und fungiert als Überschrift, und kann sogar gelöscht werden.
|
||
Nach dem Hinzufügen können die Einzelbestandteile auch gelöscht oder
|
||
verändert werden. Dadurch hat das Sortiment auch keinen festen Preis,
|
||
sondern der Preis im Beleg richtet sich nach dem Preis der
|
||
Einzelbestandteile, die je nach Kunde z.B. durch Preisgruppenpreise
|
||
variieren können.
|
||
|
||
Das Sortiment eignet sich z.B. als Definition von Gruppierungen von
|
||
Artikeln die häufig zusammen gekauft werden, z.B. ein Artikel in 10
|
||
Farbvariationen.
|
||
|
||
Einschränkungen: das "Auspacken" eines Sortiments beim Hinzufügen in einem
|
||
Beleg funktioniert derzeit nur beim neuen Auftragscontroller.
|
||
|
||
Administrative Änderungen
|
||
|
||
- Diverse Textsuchen werden jetzt durch eine neue Klasse Indizes
|
scripts/rose_auto_create_model.pl | ||
---|---|---|
reconciliation_links => { acc_trans_id => 'acc_trans' },
|
||
|
||
assembly => { parts_id => 'part', id => 'assembly_part' },
|
||
assortment_items => { parts_id => 'part' },
|
||
},
|
||
);
|
||
|
sql/Pg-upgrade2/assortment.sql | ||
---|---|---|
-- @tag: assortment_items
|
||
-- @description: Sortimentsartikel eingeführt
|
||
-- @depends: release_3_4_1 part_type_enum
|
||
|
||
-- adding a new value isn't allowed inside a transaction, which is what DBUpgrade automatically does
|
||
-- run this afterwards manually for now
|
||
-- ALTER TYPE part_type_enum ADD VALUE 'assortment';
|
||
|
||
CREATE TABLE assortment_items (
|
||
assortment_id INTEGER REFERENCES parts(id) ON DELETE CASCADE, -- the part id of the assortment
|
||
parts_id INTEGER REFERENCES parts(id),
|
||
itime timestamp without time zone default now(),
|
||
mtime timestamp without time zone,
|
||
qty REAL NOT NULL,
|
||
position INTEGER NOT NULL,
|
||
unit character varying(20) NOT NULL REFERENCES units(name),
|
||
CONSTRAINT assortment_part_pkey PRIMARY KEY (assortment_id, parts_id)
|
||
);
|
||
|
||
ALTER TABLE defaults ADD assortmentnumber TEXT;
|
templates/webpages/client_config/_ranges_of_numbers.html | ||
---|---|---|
<tr>
|
||
<td align="right" nowrap>[% LxERP.t8('Last Sales Delivery Order Number') %]</td>
|
||
<td>[% L.input_tag("defaults.sdonumber", SELF.defaults.sdonumber, size="15") %]</td>
|
||
<td align="right" nowrap>[% LxERP.t8('Last Assortment Number') %]</td>
|
||
<td>[% L.input_tag("defaults.assortmentnumber", SELF.defaults.assortmentnumber, size="15") %]</td>
|
||
</tr>
|
||
|
||
<tr>
|
Auch abrufbar als: Unified diff
Neuen Artikeltyp Sortiment eingeführt - sql und rose