introduce price_list to hsdb
This commit is contained in:
parent
78a525fcc6
commit
f32fd2c6b7
@ -168,3 +168,15 @@ INSERT INTO domain_option (domain_option_name)
|
|||||||
VALUES ('multiviews');
|
VALUES ('multiviews');
|
||||||
INSERT INTO domain_option (domain_option_name)
|
INSERT INTO domain_option (domain_option_name)
|
||||||
VALUES ('php');
|
VALUES ('php');
|
||||||
|
|
||||||
|
--
|
||||||
|
-- table: price_list
|
||||||
|
--
|
||||||
|
INSERT INTO price_list VALUES (1, 'Default Price List');
|
||||||
|
|
||||||
|
--
|
||||||
|
-- table: customer_price_list_mapping
|
||||||
|
--
|
||||||
|
INSERT INTO customer_price_list_mapping (SELECT bp_id, 1 FROM business_partner);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
DROP TABLE customer_price_list_mapping ;
|
||||||
|
DROP TABLE price ;
|
||||||
|
DROP TABLE price_list ;
|
||||||
DROP TABLE bank_account ;
|
DROP TABLE bank_account ;
|
||||||
DROP SEQUENCE bank_account_bank_account_id_seq ;
|
DROP SEQUENCE bank_account_bank_account_id_seq ;
|
||||||
DROP TABLE billdata ;
|
DROP TABLE billdata ;
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
CREATE TABLE bank_account (
|
CREATE TABLE bank_account (
|
||||||
bank_account_id integer DEFAULT nextval(('"bank_account_bank_account_id_seq"'::text)::regclass) NOT NULL,
|
bank_account_id integer DEFAULT nextval(('"bank_account_bank_account_id_seq"'::text)::regclass) NOT NULL,
|
||||||
bp_id integer NOT NULL,
|
bp_id integer NOT NULL,
|
||||||
autodebit_ga boolean,
|
autodebit_ga boolean NOT NULL,
|
||||||
autodebit_ar boolean,
|
autodebit_ar boolean NOT NULL,
|
||||||
autodebit_op boolean,
|
autodebit_op boolean NOT NULL,
|
||||||
bank_customer character varying(50),
|
bank_customer character varying(50),
|
||||||
bank_account character varying(10),
|
bank_account character varying(10),
|
||||||
bank_code character varying(8),
|
bank_code character varying(8),
|
||||||
@ -59,6 +59,7 @@ CREATE TABLE basepacket (
|
|||||||
basepacket_id integer DEFAULT nextval(('"basepacket_basepacket_id_seq"'::text)::regclass) NOT NULL,
|
basepacket_id integer DEFAULT nextval(('"basepacket_basepacket_id_seq"'::text)::regclass) NOT NULL,
|
||||||
basepacket_code character varying(10) NOT NULL,
|
basepacket_code character varying(10) NOT NULL,
|
||||||
description character varying(100) NOT NULL,
|
description character varying(100) NOT NULL,
|
||||||
|
article_number integer NOT NULL,
|
||||||
sorting integer NOT NULL,
|
sorting integer NOT NULL,
|
||||||
valid boolean NOT NULL
|
valid boolean NOT NULL
|
||||||
);
|
);
|
||||||
@ -144,6 +145,7 @@ CREATE SEQUENCE business_partner_bp_id_seq
|
|||||||
CREATE TABLE component (
|
CREATE TABLE component (
|
||||||
basepacket_id integer NOT NULL,
|
basepacket_id integer NOT NULL,
|
||||||
basecomponent_id integer NOT NULL,
|
basecomponent_id integer NOT NULL,
|
||||||
|
article_number integer NOT NULL,
|
||||||
min_quantity integer NOT NULL,
|
min_quantity integer NOT NULL,
|
||||||
max_quantity integer NOT NULL,
|
max_quantity integer NOT NULL,
|
||||||
default_quantity integer NOT NULL,
|
default_quantity integer NOT NULL,
|
||||||
@ -191,6 +193,38 @@ CREATE SEQUENCE contact_contact_id_seq
|
|||||||
CACHE 1;
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: price_list
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE price_list (
|
||||||
|
id serial primary key,
|
||||||
|
name character varying(20)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: customer_price_list_mapping
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE customer_price_list_mapping (
|
||||||
|
customer integer references business_partner(bp_id),
|
||||||
|
price_list integer references price_list(id)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: price
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE price (
|
||||||
|
id serial primary key,
|
||||||
|
article_number integer NOT NULL,
|
||||||
|
price decimal(10, 2) NOT NULL,
|
||||||
|
vat decimal(4,2) NOT NULL,
|
||||||
|
price_list integer references price_list(id)
|
||||||
|
);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: database_database_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
-- Name: database_database_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
@ -202,8 +236,6 @@ CREATE SEQUENCE database_database_id_seq
|
|||||||
CACHE 1;
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
SET default_with_oids = false;
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: database; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
-- Name: database; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
||||||
--
|
--
|
||||||
|
@ -32,14 +32,14 @@ public class BankAccount extends AbstractEntity implements Serializable {
|
|||||||
@OneToOne(fetch = EAGER)
|
@OneToOne(fetch = EAGER)
|
||||||
private Customer customer;
|
private Customer customer;
|
||||||
|
|
||||||
@Column(name = "autodebit_ga", columnDefinition = "boolean", nullable = true)
|
@Column(name = "autodebit_ga", columnDefinition = "boolean", nullable = false)
|
||||||
private Boolean autoDebitGA;
|
private Boolean autoDebitGA = Boolean.FALSE;
|
||||||
|
|
||||||
@Column(name = "autodebit_ar", columnDefinition = "boolean", nullable = true)
|
@Column(name = "autodebit_ar", columnDefinition = "boolean", nullable = false)
|
||||||
private Boolean autoDebitAR;
|
private Boolean autoDebitAR = Boolean.FALSE;
|
||||||
|
|
||||||
@Column(name = "autodebit_op", columnDefinition = "boolean", nullable = true)
|
@Column(name = "autodebit_op", columnDefinition = "boolean", nullable = false)
|
||||||
private Boolean autoDebitOP;
|
private Boolean autoDebitOP = Boolean.FALSE;
|
||||||
|
|
||||||
@Column(name = "bank_customer", columnDefinition = "character varying(50)", nullable = true)
|
@Column(name = "bank_customer", columnDefinition = "character varying(50)", nullable = true)
|
||||||
private String bankCustomer;
|
private String bankCustomer;
|
||||||
|
@ -80,16 +80,9 @@ public class Customer extends AbstractEntity implements Serializable {
|
|||||||
private Set<Contact> contacts;
|
private Set<Contact> contacts;
|
||||||
|
|
||||||
@OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer")
|
@OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer")
|
||||||
//@AnnFieldIO(referredProps = "customer")//gut
|
|
||||||
//@AnnFieldIO(referredProps = "customer.CustomersTariff.domainDiscountUntil")//Das ist Kappes!
|
|
||||||
//@AnnFieldIO(referredProps = "customer.billData.domainDiscountUntil.year")//falsch!
|
|
||||||
//@AnnFieldIO(referredProps = "customer.billData.domainDiscountUntil.cdate")//gut
|
|
||||||
//@AnnFieldIO(referredProps = {"customer.billData.domainDiscountUntil.cdate", "customer.billData."})//schlecht!
|
|
||||||
//@AnnFieldIO(referredProps = {"customer.billData.domainDiscountUntil.cdate", "customer.billData"})//gut
|
|
||||||
private BankAccount bankAccount;
|
private BankAccount bankAccount;
|
||||||
|
|
||||||
@OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer")
|
@OneToOne(fetch = EAGER, cascade = ALL, mappedBy = "customer")
|
||||||
// @AnnFieldIO(referredProps = "domainDiscountUntil")//gut!
|
|
||||||
private CustomersTariff billData;
|
private CustomersTariff billData;
|
||||||
|
|
||||||
@OneToMany(fetch = LAZY, cascade = ALL, mappedBy = "customer")
|
@OneToMany(fetch = LAZY, cascade = ALL, mappedBy = "customer")
|
||||||
|
@ -29,13 +29,6 @@ public class BasePac implements Serializable {
|
|||||||
components = new HashSet<Component>();
|
components = new HashSet<Component>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePac(String name, String desc, int sortPos) {
|
|
||||||
this.name = name;
|
|
||||||
this.description = desc;
|
|
||||||
this.sorting = sortPos;
|
|
||||||
this.valid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = SEQUENCE, generator = "BasePacsSeqGen")
|
@GeneratedValue(strategy = SEQUENCE, generator = "BasePacsSeqGen")
|
||||||
@Column(name = "basepacket_id", columnDefinition = "integer")
|
@Column(name = "basepacket_id", columnDefinition = "integer")
|
||||||
@ -47,6 +40,9 @@ public class BasePac implements Serializable {
|
|||||||
@Column(name = "description", columnDefinition = "character varying(100)")
|
@Column(name = "description", columnDefinition = "character varying(100)")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
@Column(name = "article_number", columnDefinition = "integer", nullable=false)
|
||||||
|
private int articleNumber;
|
||||||
|
|
||||||
@Column(name = "sorting", columnDefinition = "integer")
|
@Column(name = "sorting", columnDefinition = "integer")
|
||||||
private int sorting;
|
private int sorting;
|
||||||
|
|
||||||
@ -154,4 +150,12 @@ public class BasePac implements Serializable {
|
|||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getArticleNumber() {
|
||||||
|
return articleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleNumber(int articleNumber) {
|
||||||
|
this.articleNumber = articleNumber;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,9 @@ public class Component implements Serializable {
|
|||||||
@JoinColumn(name="basecomponent_id")
|
@JoinColumn(name="basecomponent_id")
|
||||||
private BaseComponent baseComponent;
|
private BaseComponent baseComponent;
|
||||||
|
|
||||||
|
@Column(name = "article_number", columnDefinition = "integer", nullable=false)
|
||||||
|
private int articleNumber;
|
||||||
|
|
||||||
@Column(name = "min_quantity", columnDefinition = "integer")
|
@Column(name = "min_quantity", columnDefinition = "integer")
|
||||||
private int minimumQuantity;
|
private int minimumQuantity;
|
||||||
|
|
||||||
@ -54,20 +57,6 @@ public class Component implements Serializable {
|
|||||||
public Component() {
|
public Component() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Component(BasePac basePac, BaseComponent baseComp, int min, int max,
|
|
||||||
int def, int incr, int incl, boolean adminOnly) {
|
|
||||||
this.setBasePacId(basePac.id());
|
|
||||||
this.basePac = basePac;
|
|
||||||
this.setBaseComponentId(baseComp.id());
|
|
||||||
this.baseComponent = baseComp;
|
|
||||||
this.minimumQuantity = min;
|
|
||||||
this.maximimumQuantity = max;
|
|
||||||
this.defaultQuantity = def;
|
|
||||||
this.incrementQuantity = incr;
|
|
||||||
this.includedQuantity = incl;
|
|
||||||
this.adminOnly = adminOnly;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BasePac getBasePac() {
|
public BasePac getBasePac() {
|
||||||
return basePac;
|
return basePac;
|
||||||
}
|
}
|
||||||
@ -150,4 +139,12 @@ public class Component implements Serializable {
|
|||||||
return baseComponentId;
|
return baseComponentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getArticleNumber() {
|
||||||
|
return articleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setArticleNumber(int articleNumber) {
|
||||||
|
this.articleNumber = articleNumber;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user