From d1da05fe6d65e6899f0365a3ba4be45144929525 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Mon, 29 Apr 2013 11:16:17 +0200 Subject: [PATCH] customer properties free vat_indicator --- hsarback/database/schema.sql | 2 ++ .../src/de/hsadmin/mods/cust/Customer.java | 27 +++++++++++++++++++ .../de/hsadmin/mods/cust/IndicatorVAT.java | 5 ++++ 3 files changed, 34 insertions(+) create mode 100644 hsarback/src/de/hsadmin/mods/cust/IndicatorVAT.java diff --git a/hsarback/database/schema.sql b/hsarback/database/schema.sql index 6b2b5f0..04b6480 100644 --- a/hsarback/database/schema.sql +++ b/hsarback/database/schema.sql @@ -120,6 +120,8 @@ CREATE TABLE business_partner ( shares_updated date, shares_signed integer NOT NULL, uid_vat character varying(20), + free boolean NOT NULL, + indicator_vat varying(20) NOT NULL, CONSTRAINT ckc_member_id_business CHECK (((member_id >= 10000) AND (member_id <= 99999))), CONSTRAINT ckc_shares_signed_business CHECK ((shares_signed >= 0)), CONSTRAINT ckt_business_partner CHECK ( ( ((member_since IS NULL) AND (member_until IS NULL)) OR ((member_since IS NOT NULL) AND (member_until IS NULL)) OR ((member_since IS NOT NULL) AND (member_until IS NOT NULL) AND (member_since < member_until)) ) AND ((member_code)::text ~~ 'hsh00-%'::text)), diff --git a/hsarback/src/de/hsadmin/mods/cust/Customer.java b/hsarback/src/de/hsadmin/mods/cust/Customer.java index 28f0bbf..5d9c987 100644 --- a/hsarback/src/de/hsadmin/mods/cust/Customer.java +++ b/hsarback/src/de/hsadmin/mods/cust/Customer.java @@ -9,9 +9,12 @@ import java.util.Date; import java.util.HashSet; import java.util.Set; +import javax.persistence.Basic; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EntityManager; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -73,6 +76,14 @@ public class Customer extends AbstractEntity implements Serializable { @Column(name = "shares_signed", columnDefinition = "integer") private int sharesSigned; + @Column(name = "free", nullable = false) + private boolean free = false; + + @Column(name = "indicator_vat", nullable = false) + @Basic + @Enumerated(EnumType.STRING) + private IndicatorVAT indicatorVAT = IndicatorVAT.GROSS; + @Column(name = "uid_vat", columnDefinition = "character varying(20)", nullable = true) private String uidVAT; @@ -277,4 +288,20 @@ public class Customer extends AbstractEntity implements Serializable { public String getPassword() { return password; } + + public boolean isFree() { + return free; + } + + public void setFree(boolean free) { + this.free = free; + } + + public IndicatorVAT getIndicatorVAT() { + return indicatorVAT; + } + + public void setIndicatorVAT(IndicatorVAT indicatorVAT) { + this.indicatorVAT = indicatorVAT; + } } diff --git a/hsarback/src/de/hsadmin/mods/cust/IndicatorVAT.java b/hsarback/src/de/hsadmin/mods/cust/IndicatorVAT.java new file mode 100644 index 0000000..84a2ff6 --- /dev/null +++ b/hsarback/src/de/hsadmin/mods/cust/IndicatorVAT.java @@ -0,0 +1,5 @@ +package de.hsadmin.mods.cust; + +public enum IndicatorVAT { + NET, GROSS +}