diff --git a/.classpath b/.classpath index fdc2fdc..e23e978 100644 --- a/.classpath +++ b/.classpath @@ -1,18 +1,5 @@ - - - - - - - - - - - - - @@ -25,13 +12,30 @@ + + + + + + + + + + + + + - + + + + + diff --git a/build.gradle b/build.gradle index 3682f63..f094e72 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'war' apply plugin: 'eclipse' group = 'jottyfan' -version = '1.1.4' +version = '1.1.5' description = """timetrack""" diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java b/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java index 99f0429..7b964f4 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/Done.java @@ -5,6 +5,7 @@ package de.jottyfan.timetrack.db.done; import de.jottyfan.timetrack.db.DefaultCatalog; +import de.jottyfan.timetrack.db.done.tables.TBilling; import de.jottyfan.timetrack.db.done.tables.TDone; import de.jottyfan.timetrack.db.done.tables.TJob; import de.jottyfan.timetrack.db.done.tables.TModule; @@ -14,7 +15,6 @@ import de.jottyfan.timetrack.db.done.tables.VDaylimits; import de.jottyfan.timetrack.db.done.tables.VDaysummary; import de.jottyfan.timetrack.db.done.tables.VDone; import de.jottyfan.timetrack.db.done.tables.VDuration; -import de.jottyfan.timetrack.db.done.tables.VEucanshare; import de.jottyfan.timetrack.db.done.tables.VHamster; import de.jottyfan.timetrack.db.done.tables.VHamstersummary; import de.jottyfan.timetrack.db.done.tables.VTasklist; @@ -43,6 +43,11 @@ public class Done extends SchemaImpl { */ public static final Done DONE = new Done(); + /** + * The table done.t_billing. + */ + public final TBilling T_BILLING = TBilling.T_BILLING; + /** * The table done.t_done. */ @@ -88,11 +93,6 @@ public class Done extends SchemaImpl { */ public final VDuration V_DURATION = VDuration.V_DURATION; - /** - * The table done.v_eucanshare. - */ - public final VEucanshare V_EUCANSHARE = VEucanshare.V_EUCANSHARE; - /** * The table done.v_hamster. */ @@ -139,6 +139,7 @@ public class Done extends SchemaImpl { @Override public final List> getTables() { return Arrays.>asList( + TBilling.T_BILLING, TDone.T_DONE, TJob.T_JOB, TModule.T_MODULE, @@ -148,7 +149,6 @@ public class Done extends SchemaImpl { VDaysummary.V_DAYSUMMARY, VDone.V_DONE, VDuration.V_DURATION, - VEucanshare.V_EUCANSHARE, VHamster.V_HAMSTER, VHamstersummary.V_HAMSTERSUMMARY, VTasklist.V_TASKLIST, diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/Keys.java b/src/jooq/java/de/jottyfan/timetrack/db/done/Keys.java index 9043af4..6596f96 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/Keys.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/Keys.java @@ -4,10 +4,12 @@ package de.jottyfan.timetrack.db.done; +import de.jottyfan.timetrack.db.done.tables.TBilling; import de.jottyfan.timetrack.db.done.tables.TDone; import de.jottyfan.timetrack.db.done.tables.TJob; import de.jottyfan.timetrack.db.done.tables.TModule; import de.jottyfan.timetrack.db.done.tables.TProject; +import de.jottyfan.timetrack.db.done.tables.records.TBillingRecord; import de.jottyfan.timetrack.db.done.tables.records.TDoneRecord; import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; @@ -33,6 +35,9 @@ public class Keys { // UNIQUE and PRIMARY KEY definitions // ------------------------------------------------------------------------- + public static final UniqueKey T_BILLING_NAME_KEY = Internal.createUniqueKey(TBilling.T_BILLING, DSL.name("t_billing_name_key"), new TableField[] { TBilling.T_BILLING.NAME }, true); + public static final UniqueKey T_BILLING_PKEY = Internal.createUniqueKey(TBilling.T_BILLING, DSL.name("t_billing_pkey"), new TableField[] { TBilling.T_BILLING.PK }, true); + public static final UniqueKey T_BILLING_SHORTCUT_KEY = Internal.createUniqueKey(TBilling.T_BILLING, DSL.name("t_billing_shortcut_key"), new TableField[] { TBilling.T_BILLING.SHORTCUT }, true); public static final UniqueKey T_DONE_PKEY = Internal.createUniqueKey(TDone.T_DONE, DSL.name("t_done_pkey"), new TableField[] { TDone.T_DONE.PK }, true); public static final UniqueKey T_CATEGORY_NAME_KEY = Internal.createUniqueKey(TJob.T_JOB, DSL.name("t_category_name_key"), new TableField[] { TJob.T_JOB.NAME }, true); public static final UniqueKey T_CATEGORY_PKEY = Internal.createUniqueKey(TJob.T_JOB, DSL.name("t_category_pkey"), new TableField[] { TJob.T_JOB.PK }, true); @@ -45,6 +50,7 @@ public class Keys { // FOREIGN KEY definitions // ------------------------------------------------------------------------- + public static final ForeignKey T_DONE__T_DONE_FK_BILLING_FKEY = Internal.createForeignKey(TDone.T_DONE, DSL.name("t_done_fk_billing_fkey"), new TableField[] { TDone.T_DONE.FK_BILLING }, Keys.T_BILLING_PKEY, new TableField[] { TBilling.T_BILLING.PK }, true); public static final ForeignKey T_DONE__T_DONE_FK_CATEGORY_FKEY = Internal.createForeignKey(TDone.T_DONE, DSL.name("t_done_fk_category_fkey"), new TableField[] { TDone.T_DONE.FK_JOB }, Keys.T_CATEGORY_PKEY, new TableField[] { TJob.T_JOB.PK }, true); public static final ForeignKey T_DONE__T_DONE_FK_JOB_FKEY = Internal.createForeignKey(TDone.T_DONE, DSL.name("t_done_fk_job_fkey"), new TableField[] { TDone.T_DONE.FK_MODULE }, Keys.T_JOB_PKEY, new TableField[] { TModule.T_MODULE.PK }, true); public static final ForeignKey T_DONE__T_DONE_FK_LOGIN_FKEY = Internal.createForeignKey(TDone.T_DONE, DSL.name("t_done_fk_login_fkey"), new TableField[] { TDone.T_DONE.FK_LOGIN }, de.jottyfan.timetrack.db.profile.Keys.T_LOGIN_PKEY, new TableField[] { TLogin.T_LOGIN.PK }, true); diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java b/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java index a48ec8b..9c57c11 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/Tables.java @@ -4,6 +4,7 @@ package de.jottyfan.timetrack.db.done; +import de.jottyfan.timetrack.db.done.tables.TBilling; import de.jottyfan.timetrack.db.done.tables.TDone; import de.jottyfan.timetrack.db.done.tables.TJob; import de.jottyfan.timetrack.db.done.tables.TModule; @@ -13,7 +14,6 @@ import de.jottyfan.timetrack.db.done.tables.VDaylimits; import de.jottyfan.timetrack.db.done.tables.VDaysummary; import de.jottyfan.timetrack.db.done.tables.VDone; import de.jottyfan.timetrack.db.done.tables.VDuration; -import de.jottyfan.timetrack.db.done.tables.VEucanshare; import de.jottyfan.timetrack.db.done.tables.VHamster; import de.jottyfan.timetrack.db.done.tables.VHamstersummary; import de.jottyfan.timetrack.db.done.tables.VTasklist; @@ -28,6 +28,11 @@ import de.jottyfan.timetrack.db.done.tables.VWorktime; @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class Tables { + /** + * The table done.t_billing. + */ + public static final TBilling T_BILLING = TBilling.T_BILLING; + /** * The table done.t_done. */ @@ -73,11 +78,6 @@ public class Tables { */ public static final VDuration V_DURATION = VDuration.V_DURATION; - /** - * The table done.v_eucanshare. - */ - public static final VEucanshare V_EUCANSHARE = VEucanshare.V_EUCANSHARE; - /** * The table done.v_hamster. */ diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TBilling.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TBilling.java new file mode 100644 index 0000000..815de79 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TBilling.java @@ -0,0 +1,164 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables; + + +import de.jottyfan.timetrack.db.done.Done; +import de.jottyfan.timetrack.db.done.Keys; +import de.jottyfan.timetrack.db.done.tables.records.TBillingRecord; + +import java.time.LocalDateTime; +import java.util.Arrays; +import java.util.List; + +import org.jooq.Field; +import org.jooq.ForeignKey; +import org.jooq.Identity; +import org.jooq.Name; +import org.jooq.Record; +import org.jooq.Row5; +import org.jooq.Schema; +import org.jooq.Table; +import org.jooq.TableField; +import org.jooq.TableOptions; +import org.jooq.UniqueKey; +import org.jooq.impl.DSL; +import org.jooq.impl.SQLDataType; +import org.jooq.impl.TableImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TBilling extends TableImpl { + + private static final long serialVersionUID = 1L; + + /** + * The reference instance of done.t_billing + */ + public static final TBilling T_BILLING = new TBilling(); + + /** + * The class holding records for this type + */ + @Override + public Class getRecordType() { + return TBillingRecord.class; + } + + /** + * The column done.t_billing.lastchange. + */ + public final TableField LASTCHANGE = createField(DSL.name("lastchange"), SQLDataType.LOCALDATETIME(6).defaultValue(DSL.field("now()", SQLDataType.LOCALDATETIME)), this, ""); + + /** + * The column done.t_billing.pk. + */ + public final TableField PK = createField(DSL.name("pk"), SQLDataType.INTEGER.nullable(false).identity(true), this, ""); + + /** + * The column done.t_billing.name. + */ + public final TableField NAME = createField(DSL.name("name"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column done.t_billing.shortcut. + */ + public final TableField SHORTCUT = createField(DSL.name("shortcut"), SQLDataType.CLOB.nullable(false), this, ""); + + /** + * The column done.t_billing.csskey. + */ + public final TableField CSSKEY = createField(DSL.name("csskey"), SQLDataType.CLOB, this, ""); + + private TBilling(Name alias, Table aliased) { + this(alias, aliased, null); + } + + private TBilling(Name alias, Table aliased, Field[] parameters) { + super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table()); + } + + /** + * Create an aliased done.t_billing table reference + */ + public TBilling(String alias) { + this(DSL.name(alias), T_BILLING); + } + + /** + * Create an aliased done.t_billing table reference + */ + public TBilling(Name alias) { + this(alias, T_BILLING); + } + + /** + * Create a done.t_billing table reference + */ + public TBilling() { + this(DSL.name("t_billing"), null); + } + + public TBilling(Table child, ForeignKey key) { + super(child, key, T_BILLING); + } + + @Override + public Schema getSchema() { + return Done.DONE; + } + + @Override + public Identity getIdentity() { + return (Identity) super.getIdentity(); + } + + @Override + public UniqueKey getPrimaryKey() { + return Keys.T_BILLING_PKEY; + } + + @Override + public List> getKeys() { + return Arrays.>asList(Keys.T_BILLING_PKEY, Keys.T_BILLING_NAME_KEY, Keys.T_BILLING_SHORTCUT_KEY); + } + + @Override + public TBilling as(String alias) { + return new TBilling(DSL.name(alias), this); + } + + @Override + public TBilling as(Name alias) { + return new TBilling(alias, this); + } + + /** + * Rename this table + */ + @Override + public TBilling rename(String name) { + return new TBilling(DSL.name(name), null); + } + + /** + * Rename this table + */ + @Override + public TBilling rename(Name name) { + return new TBilling(name, null); + } + + // ------------------------------------------------------------------------- + // Row5 type methods + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java index 5eeaa5e..40fa2b1 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/TDone.java @@ -91,9 +91,9 @@ public class TDone extends TableImpl { public final TableField FK_LOGIN = createField(DSL.name("fk_login"), SQLDataType.INTEGER.nullable(false), this, ""); /** - * The column done.t_done.wp. + * The column done.t_done.fk_billing. */ - public final TableField WP = createField(DSL.name("wp"), SQLDataType.CLOB, this, ""); + public final TableField FK_BILLING = createField(DSL.name("fk_billing"), SQLDataType.INTEGER, this, ""); private TDone(Name alias, Table aliased) { this(alias, aliased, null); @@ -150,7 +150,7 @@ public class TDone extends TableImpl { @Override public List> getReferences() { - return Arrays.>asList(Keys.T_DONE__T_DONE_FK_PROJECT_FKEY, Keys.T_DONE__T_DONE_FK_JOB_FKEY, Keys.T_DONE__T_DONE_FK_CATEGORY_FKEY, Keys.T_DONE__T_DONE_FK_LOGIN_FKEY); + return Arrays.>asList(Keys.T_DONE__T_DONE_FK_PROJECT_FKEY, Keys.T_DONE__T_DONE_FK_JOB_FKEY, Keys.T_DONE__T_DONE_FK_CATEGORY_FKEY, Keys.T_DONE__T_DONE_FK_LOGIN_FKEY, Keys.T_DONE__T_DONE_FK_BILLING_FKEY); } public TProject tProject() { @@ -169,6 +169,10 @@ public class TDone extends TableImpl { return new TLogin(this, Keys.T_DONE__T_DONE_FK_LOGIN_FKEY); } + public TBilling tBilling() { + return new TBilling(this, Keys.T_DONE__T_DONE_FK_BILLING_FKEY); + } + @Override public TDone as(String alias) { return new TDone(DSL.name(alias), this); @@ -200,7 +204,7 @@ public class TDone extends TableImpl { // ------------------------------------------------------------------------- @Override - public Row9 fieldsRow() { + public Row9 fieldsRow() { return (Row9) super.fieldsRow(); } } diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VEucanshare.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VEucanshare.java deleted file mode 100644 index 392c003..0000000 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VEucanshare.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package de.jottyfan.timetrack.db.done.tables; - - -import de.jottyfan.timetrack.db.done.Done; -import de.jottyfan.timetrack.db.done.tables.records.VEucanshareRecord; - -import java.time.LocalDate; - -import org.jooq.Field; -import org.jooq.ForeignKey; -import org.jooq.Name; -import org.jooq.Record; -import org.jooq.Row8; -import org.jooq.Schema; -import org.jooq.Table; -import org.jooq.TableField; -import org.jooq.TableOptions; -import org.jooq.impl.DSL; -import org.jooq.impl.SQLDataType; -import org.jooq.impl.TableImpl; -import org.jooq.types.YearToSecond; - - -/** - * This class is generated by jOOQ. - */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class VEucanshare extends TableImpl { - - private static final long serialVersionUID = 1L; - - /** - * The reference instance of done.v_eucanshare - */ - public static final VEucanshare V_EUCANSHARE = new VEucanshare(); - - /** - * The class holding records for this type - */ - @Override - public Class getRecordType() { - return VEucanshareRecord.class; - } - - /** - * The column done.v_eucanshare.fk_done. - */ - public final TableField FK_DONE = createField(DSL.name("fk_done"), SQLDataType.INTEGER, this, ""); - - /** - * The column done.v_eucanshare.workday. - */ - public final TableField WORKDAY = createField(DSL.name("workday"), SQLDataType.LOCALDATE, this, ""); - - /** - * The column done.v_eucanshare.duration. - */ - public final TableField DURATION = createField(DSL.name("duration"), SQLDataType.INTERVAL, this, ""); - - /** - * The column done.v_eucanshare.project_name. - */ - public final TableField PROJECT_NAME = createField(DSL.name("project_name"), SQLDataType.CLOB, this, ""); - - /** - * The column done.v_eucanshare.module_name. - */ - public final TableField MODULE_NAME = createField(DSL.name("module_name"), SQLDataType.CLOB, this, ""); - - /** - * The column done.v_eucanshare.job_name. - */ - public final TableField JOB_NAME = createField(DSL.name("job_name"), SQLDataType.CLOB, this, ""); - - /** - * The column done.v_eucanshare.fk_login. - */ - public final TableField FK_LOGIN = createField(DSL.name("fk_login"), SQLDataType.INTEGER, this, ""); - - /** - * The column done.v_eucanshare.wp. - */ - public final TableField WP = createField(DSL.name("wp"), SQLDataType.CLOB, this, ""); - - private VEucanshare(Name alias, Table aliased) { - this(alias, aliased, null); - } - - private VEucanshare(Name alias, Table aliased, Field[] parameters) { - super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view()); - } - - /** - * Create an aliased done.v_eucanshare table reference - */ - public VEucanshare(String alias) { - this(DSL.name(alias), V_EUCANSHARE); - } - - /** - * Create an aliased done.v_eucanshare table reference - */ - public VEucanshare(Name alias) { - this(alias, V_EUCANSHARE); - } - - /** - * Create a done.v_eucanshare table reference - */ - public VEucanshare() { - this(DSL.name("v_eucanshare"), null); - } - - public VEucanshare(Table child, ForeignKey key) { - super(child, key, V_EUCANSHARE); - } - - @Override - public Schema getSchema() { - return Done.DONE; - } - - @Override - public VEucanshare as(String alias) { - return new VEucanshare(DSL.name(alias), this); - } - - @Override - public VEucanshare as(Name alias) { - return new VEucanshare(alias, this); - } - - /** - * Rename this table - */ - @Override - public VEucanshare rename(String name) { - return new VEucanshare(DSL.name(name), null); - } - - /** - * Rename this table - */ - @Override - public VEucanshare rename(Name name) { - return new VEucanshare(name, null); - } - - // ------------------------------------------------------------------------- - // Row8 type methods - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } -} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VWorktime.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VWorktime.java index 272d49a..a158ac0 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VWorktime.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/VWorktime.java @@ -11,7 +11,7 @@ import org.jooq.Field; import org.jooq.ForeignKey; import org.jooq.Name; import org.jooq.Record; -import org.jooq.Row8; +import org.jooq.Row9; import org.jooq.Schema; import org.jooq.Table; import org.jooq.TableField; @@ -73,9 +73,14 @@ public class VWorktime extends TableImpl { public final TableField JOB_NAME = createField(DSL.name("job_name"), SQLDataType.CLOB, this, ""); /** - * The column done.v_worktime.wp. + * The column done.v_worktime.billing_shortcut. */ - public final TableField WP = createField(DSL.name("wp"), SQLDataType.CLOB, this, ""); + public final TableField BILLING_SHORTCUT = createField(DSL.name("billing_shortcut"), SQLDataType.CLOB, this, ""); + + /** + * The column done.v_worktime.billing_csskey. + */ + public final TableField BILLING_CSSKEY = createField(DSL.name("billing_csskey"), SQLDataType.CLOB, this, ""); /** * The column done.v_worktime.fk_login. @@ -147,11 +152,11 @@ public class VWorktime extends TableImpl { } // ------------------------------------------------------------------------- - // Row8 type methods + // Row9 type methods // ------------------------------------------------------------------------- @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); } } diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TBillingRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TBillingRecord.java new file mode 100644 index 0000000..2f295a9 --- /dev/null +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TBillingRecord.java @@ -0,0 +1,257 @@ +/* + * This file is generated by jOOQ. + */ +package de.jottyfan.timetrack.db.done.tables.records; + + +import de.jottyfan.timetrack.db.done.tables.TBilling; + +import java.time.LocalDateTime; + +import org.jooq.Field; +import org.jooq.Record1; +import org.jooq.Record5; +import org.jooq.Row5; +import org.jooq.impl.UpdatableRecordImpl; + + +/** + * This class is generated by jOOQ. + */ +@SuppressWarnings({ "all", "unchecked", "rawtypes" }) +public class TBillingRecord extends UpdatableRecordImpl implements Record5 { + + private static final long serialVersionUID = 1L; + + /** + * Setter for done.t_billing.lastchange. + */ + public void setLastchange(LocalDateTime value) { + set(0, value); + } + + /** + * Getter for done.t_billing.lastchange. + */ + public LocalDateTime getLastchange() { + return (LocalDateTime) get(0); + } + + /** + * Setter for done.t_billing.pk. + */ + public void setPk(Integer value) { + set(1, value); + } + + /** + * Getter for done.t_billing.pk. + */ + public Integer getPk() { + return (Integer) get(1); + } + + /** + * Setter for done.t_billing.name. + */ + public void setName(String value) { + set(2, value); + } + + /** + * Getter for done.t_billing.name. + */ + public String getName() { + return (String) get(2); + } + + /** + * Setter for done.t_billing.shortcut. + */ + public void setShortcut(String value) { + set(3, value); + } + + /** + * Getter for done.t_billing.shortcut. + */ + public String getShortcut() { + return (String) get(3); + } + + /** + * Setter for done.t_billing.csskey. + */ + public void setCsskey(String value) { + set(4, value); + } + + /** + * Getter for done.t_billing.csskey. + */ + public String getCsskey() { + return (String) get(4); + } + + // ------------------------------------------------------------------------- + // Primary key information + // ------------------------------------------------------------------------- + + @Override + public Record1 key() { + return (Record1) super.key(); + } + + // ------------------------------------------------------------------------- + // Record5 type implementation + // ------------------------------------------------------------------------- + + @Override + public Row5 fieldsRow() { + return (Row5) super.fieldsRow(); + } + + @Override + public Row5 valuesRow() { + return (Row5) super.valuesRow(); + } + + @Override + public Field field1() { + return TBilling.T_BILLING.LASTCHANGE; + } + + @Override + public Field field2() { + return TBilling.T_BILLING.PK; + } + + @Override + public Field field3() { + return TBilling.T_BILLING.NAME; + } + + @Override + public Field field4() { + return TBilling.T_BILLING.SHORTCUT; + } + + @Override + public Field field5() { + return TBilling.T_BILLING.CSSKEY; + } + + @Override + public LocalDateTime component1() { + return getLastchange(); + } + + @Override + public Integer component2() { + return getPk(); + } + + @Override + public String component3() { + return getName(); + } + + @Override + public String component4() { + return getShortcut(); + } + + @Override + public String component5() { + return getCsskey(); + } + + @Override + public LocalDateTime value1() { + return getLastchange(); + } + + @Override + public Integer value2() { + return getPk(); + } + + @Override + public String value3() { + return getName(); + } + + @Override + public String value4() { + return getShortcut(); + } + + @Override + public String value5() { + return getCsskey(); + } + + @Override + public TBillingRecord value1(LocalDateTime value) { + setLastchange(value); + return this; + } + + @Override + public TBillingRecord value2(Integer value) { + setPk(value); + return this; + } + + @Override + public TBillingRecord value3(String value) { + setName(value); + return this; + } + + @Override + public TBillingRecord value4(String value) { + setShortcut(value); + return this; + } + + @Override + public TBillingRecord value5(String value) { + setCsskey(value); + return this; + } + + @Override + public TBillingRecord values(LocalDateTime value1, Integer value2, String value3, String value4, String value5) { + value1(value1); + value2(value2); + value3(value3); + value4(value4); + value5(value5); + return this; + } + + // ------------------------------------------------------------------------- + // Constructors + // ------------------------------------------------------------------------- + + /** + * Create a detached TBillingRecord + */ + public TBillingRecord() { + super(TBilling.T_BILLING); + } + + /** + * Create a detached, initialised TBillingRecord + */ + public TBillingRecord(LocalDateTime lastchange, Integer pk, String name, String shortcut, String csskey) { + super(TBilling.T_BILLING); + + setLastchange(lastchange); + setPk(pk); + setName(name); + setShortcut(shortcut); + setCsskey(csskey); + } +} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java index b1c3c5e..ef6cae7 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/TDoneRecord.java @@ -19,7 +19,7 @@ import org.jooq.impl.UpdatableRecordImpl; * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class TDoneRecord extends UpdatableRecordImpl implements Record9 { +public class TDoneRecord extends UpdatableRecordImpl implements Record9 { private static final long serialVersionUID = 1L; @@ -136,17 +136,17 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec } /** - * Setter for done.t_done.wp. + * Setter for done.t_done.fk_billing. */ - public void setWp(String value) { + public void setFkBilling(Integer value) { set(8, value); } /** - * Getter for done.t_done.wp. + * Getter for done.t_done.fk_billing. */ - public String getWp() { - return (String) get(8); + public Integer getFkBilling() { + return (Integer) get(8); } // ------------------------------------------------------------------------- @@ -163,12 +163,12 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec // ------------------------------------------------------------------------- @Override - public Row9 fieldsRow() { + public Row9 fieldsRow() { return (Row9) super.fieldsRow(); } @Override - public Row9 valuesRow() { + public Row9 valuesRow() { return (Row9) super.valuesRow(); } @@ -213,8 +213,8 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec } @Override - public Field field9() { - return TDone.T_DONE.WP; + public Field field9() { + return TDone.T_DONE.FK_BILLING; } @Override @@ -258,8 +258,8 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec } @Override - public String component9() { - return getWp(); + public Integer component9() { + return getFkBilling(); } @Override @@ -303,8 +303,8 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec } @Override - public String value9() { - return getWp(); + public Integer value9() { + return getFkBilling(); } @Override @@ -356,13 +356,13 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec } @Override - public TDoneRecord value9(String value) { - setWp(value); + public TDoneRecord value9(Integer value) { + setFkBilling(value); return this; } @Override - public TDoneRecord values(LocalDateTime value1, Integer value2, LocalDateTime value3, LocalDateTime value4, Integer value5, Integer value6, Integer value7, Integer value8, String value9) { + public TDoneRecord values(LocalDateTime value1, Integer value2, LocalDateTime value3, LocalDateTime value4, Integer value5, Integer value6, Integer value7, Integer value8, Integer value9) { value1(value1); value2(value2); value3(value3); @@ -389,7 +389,7 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec /** * Create a detached, initialised TDoneRecord */ - public TDoneRecord(LocalDateTime lastchange, Integer pk, LocalDateTime timeFrom, LocalDateTime timeUntil, Integer fkProject, Integer fkModule, Integer fkJob, Integer fkLogin, String wp) { + public TDoneRecord(LocalDateTime lastchange, Integer pk, LocalDateTime timeFrom, LocalDateTime timeUntil, Integer fkProject, Integer fkModule, Integer fkJob, Integer fkLogin, Integer fkBilling) { super(TDone.T_DONE); setLastchange(lastchange); @@ -400,6 +400,6 @@ public class TDoneRecord extends UpdatableRecordImpl implements Rec setFkModule(fkModule); setFkJob(fkJob); setFkLogin(fkLogin); - setWp(wp); + setFkBilling(fkBilling); } } diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VEucanshareRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VEucanshareRecord.java deleted file mode 100644 index 5846f57..0000000 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VEucanshareRecord.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * This file is generated by jOOQ. - */ -package de.jottyfan.timetrack.db.done.tables.records; - - -import de.jottyfan.timetrack.db.done.tables.VEucanshare; - -import java.time.LocalDate; - -import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; -import org.jooq.impl.TableRecordImpl; -import org.jooq.types.YearToSecond; - - -/** - * This class is generated by jOOQ. - */ -@SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class VEucanshareRecord extends TableRecordImpl implements Record8 { - - private static final long serialVersionUID = 1L; - - /** - * Setter for done.v_eucanshare.fk_done. - */ - public void setFkDone(Integer value) { - set(0, value); - } - - /** - * Getter for done.v_eucanshare.fk_done. - */ - public Integer getFkDone() { - return (Integer) get(0); - } - - /** - * Setter for done.v_eucanshare.workday. - */ - public void setWorkday(LocalDate value) { - set(1, value); - } - - /** - * Getter for done.v_eucanshare.workday. - */ - public LocalDate getWorkday() { - return (LocalDate) get(1); - } - - /** - * Setter for done.v_eucanshare.duration. - */ - public void setDuration(YearToSecond value) { - set(2, value); - } - - /** - * Getter for done.v_eucanshare.duration. - */ - public YearToSecond getDuration() { - return (YearToSecond) get(2); - } - - /** - * Setter for done.v_eucanshare.project_name. - */ - public void setProjectName(String value) { - set(3, value); - } - - /** - * Getter for done.v_eucanshare.project_name. - */ - public String getProjectName() { - return (String) get(3); - } - - /** - * Setter for done.v_eucanshare.module_name. - */ - public void setModuleName(String value) { - set(4, value); - } - - /** - * Getter for done.v_eucanshare.module_name. - */ - public String getModuleName() { - return (String) get(4); - } - - /** - * Setter for done.v_eucanshare.job_name. - */ - public void setJobName(String value) { - set(5, value); - } - - /** - * Getter for done.v_eucanshare.job_name. - */ - public String getJobName() { - return (String) get(5); - } - - /** - * Setter for done.v_eucanshare.fk_login. - */ - public void setFkLogin(Integer value) { - set(6, value); - } - - /** - * Getter for done.v_eucanshare.fk_login. - */ - public Integer getFkLogin() { - return (Integer) get(6); - } - - /** - * Setter for done.v_eucanshare.wp. - */ - public void setWp(String value) { - set(7, value); - } - - /** - * Getter for done.v_eucanshare.wp. - */ - public String getWp() { - return (String) get(7); - } - - // ------------------------------------------------------------------------- - // Record8 type implementation - // ------------------------------------------------------------------------- - - @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); - } - - @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); - } - - @Override - public Field field1() { - return VEucanshare.V_EUCANSHARE.FK_DONE; - } - - @Override - public Field field2() { - return VEucanshare.V_EUCANSHARE.WORKDAY; - } - - @Override - public Field field3() { - return VEucanshare.V_EUCANSHARE.DURATION; - } - - @Override - public Field field4() { - return VEucanshare.V_EUCANSHARE.PROJECT_NAME; - } - - @Override - public Field field5() { - return VEucanshare.V_EUCANSHARE.MODULE_NAME; - } - - @Override - public Field field6() { - return VEucanshare.V_EUCANSHARE.JOB_NAME; - } - - @Override - public Field field7() { - return VEucanshare.V_EUCANSHARE.FK_LOGIN; - } - - @Override - public Field field8() { - return VEucanshare.V_EUCANSHARE.WP; - } - - @Override - public Integer component1() { - return getFkDone(); - } - - @Override - public LocalDate component2() { - return getWorkday(); - } - - @Override - public YearToSecond component3() { - return getDuration(); - } - - @Override - public String component4() { - return getProjectName(); - } - - @Override - public String component5() { - return getModuleName(); - } - - @Override - public String component6() { - return getJobName(); - } - - @Override - public Integer component7() { - return getFkLogin(); - } - - @Override - public String component8() { - return getWp(); - } - - @Override - public Integer value1() { - return getFkDone(); - } - - @Override - public LocalDate value2() { - return getWorkday(); - } - - @Override - public YearToSecond value3() { - return getDuration(); - } - - @Override - public String value4() { - return getProjectName(); - } - - @Override - public String value5() { - return getModuleName(); - } - - @Override - public String value6() { - return getJobName(); - } - - @Override - public Integer value7() { - return getFkLogin(); - } - - @Override - public String value8() { - return getWp(); - } - - @Override - public VEucanshareRecord value1(Integer value) { - setFkDone(value); - return this; - } - - @Override - public VEucanshareRecord value2(LocalDate value) { - setWorkday(value); - return this; - } - - @Override - public VEucanshareRecord value3(YearToSecond value) { - setDuration(value); - return this; - } - - @Override - public VEucanshareRecord value4(String value) { - setProjectName(value); - return this; - } - - @Override - public VEucanshareRecord value5(String value) { - setModuleName(value); - return this; - } - - @Override - public VEucanshareRecord value6(String value) { - setJobName(value); - return this; - } - - @Override - public VEucanshareRecord value7(Integer value) { - setFkLogin(value); - return this; - } - - @Override - public VEucanshareRecord value8(String value) { - setWp(value); - return this; - } - - @Override - public VEucanshareRecord values(Integer value1, LocalDate value2, YearToSecond value3, String value4, String value5, String value6, Integer value7, String value8) { - value1(value1); - value2(value2); - value3(value3); - value4(value4); - value5(value5); - value6(value6); - value7(value7); - value8(value8); - return this; - } - - // ------------------------------------------------------------------------- - // Constructors - // ------------------------------------------------------------------------- - - /** - * Create a detached VEucanshareRecord - */ - public VEucanshareRecord() { - super(VEucanshare.V_EUCANSHARE); - } - - /** - * Create a detached, initialised VEucanshareRecord - */ - public VEucanshareRecord(Integer fkDone, LocalDate workday, YearToSecond duration, String projectName, String moduleName, String jobName, Integer fkLogin, String wp) { - super(VEucanshare.V_EUCANSHARE); - - setFkDone(fkDone); - setWorkday(workday); - setDuration(duration); - setProjectName(projectName); - setModuleName(moduleName); - setJobName(jobName); - setFkLogin(fkLogin); - setWp(wp); - } -} diff --git a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VWorktimeRecord.java b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VWorktimeRecord.java index e4e8ed0..86b0201 100644 --- a/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VWorktimeRecord.java +++ b/src/jooq/java/de/jottyfan/timetrack/db/done/tables/records/VWorktimeRecord.java @@ -7,8 +7,8 @@ package de.jottyfan.timetrack.db.done.tables.records; import de.jottyfan.timetrack.db.done.tables.VWorktime; import org.jooq.Field; -import org.jooq.Record8; -import org.jooq.Row8; +import org.jooq.Record9; +import org.jooq.Row9; import org.jooq.impl.TableRecordImpl; @@ -16,7 +16,7 @@ import org.jooq.impl.TableRecordImpl; * This class is generated by jOOQ. */ @SuppressWarnings({ "all", "unchecked", "rawtypes" }) -public class VWorktimeRecord extends TableRecordImpl implements Record8 { +public class VWorktimeRecord extends TableRecordImpl implements Record9 { private static final long serialVersionUID = 1L; @@ -105,45 +105,59 @@ public class VWorktimeRecord extends TableRecordImpl implements } /** - * Setter for done.v_worktime.wp. + * Setter for done.v_worktime.billing_shortcut. */ - public void setWp(String value) { + public void setBillingShortcut(String value) { set(6, value); } /** - * Getter for done.v_worktime.wp. + * Getter for done.v_worktime.billing_shortcut. */ - public String getWp() { + public String getBillingShortcut() { return (String) get(6); } + /** + * Setter for done.v_worktime.billing_csskey. + */ + public void setBillingCsskey(String value) { + set(7, value); + } + + /** + * Getter for done.v_worktime.billing_csskey. + */ + public String getBillingCsskey() { + return (String) get(7); + } + /** * Setter for done.v_worktime.fk_login. */ public void setFkLogin(Integer value) { - set(7, value); + set(8, value); } /** * Getter for done.v_worktime.fk_login. */ public Integer getFkLogin() { - return (Integer) get(7); + return (Integer) get(8); } // ------------------------------------------------------------------------- - // Record8 type implementation + // Record9 type implementation // ------------------------------------------------------------------------- @Override - public Row8 fieldsRow() { - return (Row8) super.fieldsRow(); + public Row9 fieldsRow() { + return (Row9) super.fieldsRow(); } @Override - public Row8 valuesRow() { - return (Row8) super.valuesRow(); + public Row9 valuesRow() { + return (Row9) super.valuesRow(); } @Override @@ -178,11 +192,16 @@ public class VWorktimeRecord extends TableRecordImpl implements @Override public Field field7() { - return VWorktime.V_WORKTIME.WP; + return VWorktime.V_WORKTIME.BILLING_SHORTCUT; } @Override - public Field field8() { + public Field field8() { + return VWorktime.V_WORKTIME.BILLING_CSSKEY; + } + + @Override + public Field field9() { return VWorktime.V_WORKTIME.FK_LOGIN; } @@ -218,11 +237,16 @@ public class VWorktimeRecord extends TableRecordImpl implements @Override public String component7() { - return getWp(); + return getBillingShortcut(); } @Override - public Integer component8() { + public String component8() { + return getBillingCsskey(); + } + + @Override + public Integer component9() { return getFkLogin(); } @@ -258,11 +282,16 @@ public class VWorktimeRecord extends TableRecordImpl implements @Override public String value7() { - return getWp(); + return getBillingShortcut(); } @Override - public Integer value8() { + public String value8() { + return getBillingCsskey(); + } + + @Override + public Integer value9() { return getFkLogin(); } @@ -304,18 +333,24 @@ public class VWorktimeRecord extends TableRecordImpl implements @Override public VWorktimeRecord value7(String value) { - setWp(value); + setBillingShortcut(value); return this; } @Override - public VWorktimeRecord value8(Integer value) { + public VWorktimeRecord value8(String value) { + setBillingCsskey(value); + return this; + } + + @Override + public VWorktimeRecord value9(Integer value) { setFkLogin(value); return this; } @Override - public VWorktimeRecord values(String value1, String value2, Double value3, String value4, String value5, String value6, String value7, Integer value8) { + public VWorktimeRecord values(String value1, String value2, Double value3, String value4, String value5, String value6, String value7, String value8, Integer value9) { value1(value1); value2(value2); value3(value3); @@ -324,6 +359,7 @@ public class VWorktimeRecord extends TableRecordImpl implements value6(value6); value7(value7); value8(value8); + value9(value9); return this; } @@ -341,7 +377,7 @@ public class VWorktimeRecord extends TableRecordImpl implements /** * Create a detached, initialised VWorktimeRecord */ - public VWorktimeRecord(String day, String duration, Double durationHours, String projectName, String moduleName, String jobName, String wp, Integer fkLogin) { + public VWorktimeRecord(String day, String duration, Double durationHours, String projectName, String moduleName, String jobName, String billingShortcut, String billingCsskey, Integer fkLogin) { super(VWorktime.V_WORKTIME); setDay(day); @@ -350,7 +386,8 @@ public class VWorktimeRecord extends TableRecordImpl implements setProjectName(projectName); setModuleName(moduleName); setJobName(jobName); - setWp(wp); + setBillingShortcut(billingShortcut); + setBillingCsskey(billingCsskey); setFkLogin(fkLogin); } } diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java index 457611a..3d99e40 100644 --- a/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DailySummaryBean.java @@ -10,16 +10,18 @@ public class DailySummaryBean { private final String moduleName; private final String jobName; private final String duration; - private final String wp; + private final String billingShortcut; + private final String billingCsskey; private final Double durationHours; - public DailySummaryBean(String projectName, String moduleName, String jobName, String duration, String wp, Double durationHours) { + public DailySummaryBean(String projectName, String moduleName, String jobName, String duration, String billingShortcut, String billingCsskey, Double durationHours) { super(); this.projectName = projectName; this.moduleName = moduleName; this.jobName = jobName; this.duration = duration; - this.wp = wp; + this.billingShortcut = billingShortcut; + this.billingCsskey = billingCsskey; this.durationHours = durationHours; } @@ -40,10 +42,17 @@ public class DailySummaryBean { } /** - * @return the wp + * @return the billing shortcut */ - public String getWp() { - return wp; + public String getBillingShortcut() { + return billingShortcut; + } + + /** + * @return the billing csskey + */ + public String getBillingCsskey() { + return billingCsskey; } /** diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java index 97256b9..07adeae 100644 --- a/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneBean.java @@ -7,9 +7,9 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Date; -import java.util.List; import java.util.Map; +import de.jottyfan.timetrack.db.done.tables.records.TBillingRecord; import de.jottyfan.timetrack.db.done.tables.records.TDoneRecord; import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; @@ -32,31 +32,20 @@ public class DoneBean implements Bean, Serializable, Comparable { private TProjectRecord project; private TModuleRecord module; private TJobRecord activity; - private WpBean wp; + private TBillingRecord billing; public DoneBean() { } public DoneBean(TDoneRecord r, Map projectMap, Map moduleMap, - Map jobMap) { + Map jobMap, Map billingMap) { this.pk = r.getPk(); this.timeFrom = r.getTimeFrom(); this.timeUntil = r.getTimeUntil(); this.project = projectMap.get(r.getFkProject()); this.module = moduleMap.get(r.getFkModule()); this.activity = jobMap.get(r.getFkJob()); - List list = DoneGateway.getAllWps(); - String key = r.getWp(); - if (key != null && key.isBlank()) { - key = null; - } - if (key != null) { - for (WpBean bean : list) { - if (bean.getKey().equals(r.getWp())) { - this.wp = bean; - } - } - } + this.billing = billingMap.get(r.getFkBilling()); } /** @@ -133,11 +122,11 @@ public class DoneBean implements Bean, Serializable, Comparable { return ldt; } - public String getProjectNameWithWP() { + public String getProjectNameWithBilling() { StringBuilder buf = new StringBuilder(); buf.append(project == null ? "" : project.getName()); - if (wp != null) { - buf.append(" (").append(wp.getKey()).append(")"); + if (billing != null) { + buf.append(" (").append(billing.getShortcut()).append(")"); } return buf.toString(); } @@ -154,8 +143,8 @@ public class DoneBean implements Bean, Serializable, Comparable { return activity == null ? "" : activity.getName(); } - public String getWpName() { - return wp == null ? "" : wp.getName(); + public String getBillingName() { + return billing == null ? "" : billing.getName(); } public String getTimeFromString() { @@ -223,16 +212,16 @@ public class DoneBean implements Bean, Serializable, Comparable { } /** - * @return the wp + * @return the billing */ - public WpBean getWp() { - return wp; + public TBillingRecord getBilling() { + return billing; } /** - * @param wp the wp to set + * @param billing the billing to set */ - public void setWp(WpBean wp) { - this.wp = wp; + public void setBilling(TBillingRecord billing) { + this.billing = billing; } } diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java index d30b946..7144450 100644 --- a/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneGateway.java @@ -4,6 +4,7 @@ import static de.jottyfan.timetrack.db.done.Tables.T_DONE; import static de.jottyfan.timetrack.db.done.Tables.T_JOB; import static de.jottyfan.timetrack.db.done.Tables.T_MODULE; import static de.jottyfan.timetrack.db.done.Tables.T_PROJECT; +import static de.jottyfan.timetrack.db.done.Tables.T_BILLING; import static de.jottyfan.timetrack.db.done.Tables.V_HAMSTERSUMMARY; import static de.jottyfan.timetrack.db.done.Tables.V_TOTALOFDAY; import static de.jottyfan.timetrack.db.done.Tables.V_WORKTIME; @@ -33,6 +34,7 @@ import org.jooq.Record3; import org.jooq.Record4; import org.jooq.Record5; import org.jooq.Record6; +import org.jooq.Record7; import org.jooq.SelectConditionStep; import org.jooq.SelectJoinStep; import org.jooq.SelectWhereStep; @@ -40,6 +42,7 @@ import org.jooq.UpdateConditionStep; import org.jooq.exception.DataAccessException; import de.jooqfaces.JooqFacesContext; +import de.jottyfan.timetrack.db.done.tables.records.TBillingRecord; import de.jottyfan.timetrack.db.done.tables.records.TDoneRecord; import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; @@ -125,6 +128,27 @@ public class DoneGateway extends JooqGateway { return list; } } + + /** + * get all billings from db + * + * @return billings + * @throws SQLException + * @throws ClassNotFoundException + */ + public List getAllBillings() throws DataAccessException, ClassNotFoundException, SQLException { + try (CloseableDSLContext jooq = getJooq()) { + List list = new ArrayList<>(); + SelectWhereStep sql = jooq.selectFrom(T_BILLING); + LOGGER.debug(sql.toString()); + for (TBillingRecord r : sql.fetch()) { + list.add(r); + } + list.sort((o1, o2) -> o1 == null || o2 == null || o1.getName() == null || o2.getName() == null ? 0 + : o1.getName().compareTo(o2.getName())); + return list; + } + } private Map generateProjectMap(List list) { Map map = new HashMap<>(); @@ -150,6 +174,14 @@ public class DoneGateway extends JooqGateway { return map; } + private Map generateBillingMap(List list) { + Map map = new HashMap<>(); + for (TBillingRecord r : list) { + map.put(r.getPk(), r); + } + return map; + } + /** * get all from t_done of the given day * @@ -163,6 +195,7 @@ public class DoneGateway extends JooqGateway { Map projectMap = generateProjectMap(getAllProjects()); Map moduleMap = generateModuleMap(getAllModules()); Map jobMap = generateJobMap(getAllActivities()); + Map billingMap = generateBillingMap(getAllBillings()); if (day == null) { day = LocalDateTime.now(); @@ -185,7 +218,7 @@ public class DoneGateway extends JooqGateway { // @formatter:on LOGGER.debug(sql.toString()); for (TDoneRecord r : sql.fetch()) { - list.add(new DoneBean(r, projectMap, moduleMap, jobMap)); + list.add(new DoneBean(r, projectMap, moduleMap, jobMap, billingMap)); } } list.sort((o1, o2) -> o1 == null || o2 == null ? 0 : o1.compareTo(o2)); @@ -203,11 +236,11 @@ public class DoneGateway extends JooqGateway { Integer fkProject = bean.getProject() == null ? null : bean.getProject().getPk(); Integer fkModule = bean.getModule() == null ? null : bean.getModule().getPk(); Integer fkJob = bean.getActivity() == null ? null : bean.getActivity().getPk(); - String wp = bean.getWp() == null ? null : bean.getWp().getKey(); + Integer fkBilling = bean.getBilling() == null ? null : bean.getBilling().getPk(); Integer fkLogin = getFkLogin(); try (CloseableDSLContext jooq = getJooq()) { - InsertValuesStep7 sql = jooq + InsertValuesStep7 sql = jooq // @formatter:off .insertInto(T_DONE, T_DONE.TIME_FROM, @@ -215,9 +248,9 @@ public class DoneGateway extends JooqGateway { T_DONE.FK_PROJECT, T_DONE.FK_MODULE, T_DONE.FK_JOB, - T_DONE.WP, + T_DONE.FK_BILLING, T_DONE.FK_LOGIN) - .values(bean.getTimeFrom(), bean.getTimeUntil(), fkProject, fkModule, fkJob, wp, fkLogin); + .values(bean.getTimeFrom(), bean.getTimeUntil(), fkProject, fkModule, fkJob, fkBilling, fkLogin); // @formatter:on LOGGER.debug(sql.toString()); sql.execute(); @@ -233,7 +266,6 @@ public class DoneGateway extends JooqGateway { */ public void update(DoneBean bean) throws DataAccessException, ClassNotFoundException, SQLException { try (CloseableDSLContext jooq = getJooq()) { - String wp = bean.getWp() == null ? null : bean.getWp().getKey(); UpdateConditionStep sql = jooq // @formatter:off .update(T_DONE) @@ -242,7 +274,7 @@ public class DoneGateway extends JooqGateway { .set(T_DONE.FK_PROJECT, bean.getProject() == null ? null : bean.getProject().getPk()) .set(T_DONE.FK_JOB, bean.getActivity() == null ? null : bean.getActivity().getPk()) .set(T_DONE.FK_MODULE, bean.getModule() == null ? null : bean.getModule().getPk()) - .set(T_DONE.WP, wp) + .set(T_DONE.FK_BILLING, bean.getBilling() == null ? null : bean.getBilling().getPk()) .where(T_DONE.PK.eq(bean.getPk())); // @formatter:on LOGGER.debug(sql.toString()); @@ -312,29 +344,31 @@ public class DoneGateway extends JooqGateway { public List getAllJobs(java.util.Date day) throws DataAccessException, ClassNotFoundException, SQLException { try (CloseableDSLContext jooq = getJooq()) { - SelectConditionStep> sql = jooq + SelectConditionStep> sql = jooq // @formatter:off .select(V_WORKTIME.DURATION, V_WORKTIME.DURATION_HOURS, V_WORKTIME.PROJECT_NAME, V_WORKTIME.MODULE_NAME, V_WORKTIME.JOB_NAME, - V_WORKTIME.WP) + V_WORKTIME.BILLING_SHORTCUT, + V_WORKTIME.BILLING_CSSKEY) .from(V_WORKTIME) .where(V_WORKTIME.DAY.eq(new SimpleDateFormat("yyyy-MM-dd").format(day))) .and(V_WORKTIME.FK_LOGIN.eq(getFkLogin())); // @formatter:on LOGGER.debug(sql.toString()); List list = new ArrayList<>(); - for (Record6 r : sql.fetch()) { + for (Record7 r : sql.fetch()) { String duration = r.get(V_WORKTIME.DURATION); Double durationHours = r.get(V_WORKTIME.DURATION_HOURS); String projectName = r.get(V_WORKTIME.PROJECT_NAME); String moduleName = r.get(V_WORKTIME.MODULE_NAME); String jobName = r.get(V_WORKTIME.JOB_NAME); - String wp = r.get(V_WORKTIME.WP); + String billingShortcut = r.get(V_WORKTIME.BILLING_SHORTCUT); + String billingCsskey = r.get(V_WORKTIME.BILLING_CSSKEY); durationHours = durationHours == null ? null : new BigDecimal(durationHours).setScale(2, RoundingMode.HALF_UP).doubleValue(); - list.add(new DailySummaryBean(projectName, moduleName, jobName, duration, wp, durationHours)); + list.add(new DailySummaryBean(projectName, moduleName, jobName, duration, billingShortcut, billingCsskey, durationHours)); } return list; } @@ -354,7 +388,7 @@ public class DoneGateway extends JooqGateway { // @formatter:off .select(T_DONE.TIME_FROM, T_DONE.TIME_UNTIL, - T_DONE.WP, + T_BILLING.NAME, T_PROJECT.NAME, T_MODULE.NAME, T_JOB.NAME) @@ -362,6 +396,7 @@ public class DoneGateway extends JooqGateway { .leftJoin(T_PROJECT).on(T_PROJECT.PK.eq(T_DONE.FK_PROJECT)) .leftJoin(T_MODULE).on(T_MODULE.PK.eq(T_DONE.FK_MODULE)) .leftJoin(T_JOB).on(T_JOB.PK.eq(T_DONE.FK_JOB)) + .leftJoin(T_BILLING).on(T_BILLING.PK.eq(T_DONE.FK_BILLING)) .where(T_DONE.FK_LOGIN.eq(getFkLogin())); // @formatter:on LOGGER.debug(sql.toString()); @@ -370,14 +405,14 @@ public class DoneGateway extends JooqGateway { String projectName = r.get(T_PROJECT.NAME); String moduleName = r.get(T_MODULE.NAME); String jobName = r.get(T_JOB.NAME); - String wp = r.get(T_DONE.WP); + String billingName = r.get(T_BILLING.NAME); LocalDateTime timeFrom = r.get(T_DONE.TIME_FROM); LocalDateTime timeUntil = r.get(T_DONE.TIME_UNTIL); StringBuilder buf = new StringBuilder(); buf.append(projectName); - if (wp != null && !wp.isBlank()) { - buf.append(" (").append(wp).append(")"); + if (billingName != null && !billingName.isBlank()) { + buf.append(" (").append(billingName).append(")"); } buf.append(", "); buf.append(moduleName); @@ -453,18 +488,4 @@ public class DoneGateway extends JooqGateway { } return buf.toString(); } - - /** - * dummy method to use until a table has been created - * - * @return all valid wps - */ - public static final List getAllWps() { - List list = new ArrayList<>(); - list.add(new WpBean("WP2", "WP2 (eucs) - Opal/Mica/..., REST")); - list.add(new WpBean("WP4", "WP4 (eucs) - Square²")); - list.add(new WpBean("WP5", "WP5 (eucs) - SHIP-Datenbereitstellung")); - list.add(new WpBean("NFDI TA3", "TA3 (nfdi) - Mica Dev")); - return list; - } } diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java b/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java index ef72e72..9c3c7b6 100644 --- a/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java +++ b/src/main/java/de/jottyfan/timetrack/modules/done/DoneModel.java @@ -21,6 +21,7 @@ import javax.inject.Named; import org.jooq.exception.DataAccessException; import de.jooqfaces.JooqFacesContext; +import de.jottyfan.timetrack.db.done.tables.records.TBillingRecord; import de.jottyfan.timetrack.db.done.tables.records.TJobRecord; import de.jottyfan.timetrack.db.done.tables.records.TModuleRecord; import de.jottyfan.timetrack.db.done.tables.records.TProjectRecord; @@ -41,7 +42,7 @@ public class DoneModel implements Model, Serializable { private List projects; private List modules; private List activities; - private List wps; + private List billings; private List times; private List allJobs; private WholeDaySummaryBean daySummary; @@ -58,7 +59,7 @@ public class DoneModel implements Model, Serializable { modules = gw.getAllModules(); activities = gw.getAllActivities(); projects = gw.getAllProjects(); - wps = DoneGateway.getAllWps(); + billings = gw.getAllBillings(); daySummary = gw.getDaySummary(day); allJobs = gw.getAllJobs(day); calendarEvents = gw.getAllCalendarEvents(); @@ -211,8 +212,8 @@ public class DoneModel implements Model, Serializable { buf.append(thatday).append("\t"); buf.append(sdb.getDuration()).append("\t"); buf.append(sdb.getProjectName()); - if (sdb.getWp() != null && !sdb.getWp().isBlank()) { - buf.append(" (").append(sdb.getWp()).append(")"); + if (sdb.getBillingShortcut() != null && !sdb.getBillingShortcut().isBlank()) { + buf.append(" (").append(sdb.getBillingShortcut()).append(")"); } buf.append("\t"); buf.append(sdb.getModuleName()).append("\t"); @@ -246,8 +247,8 @@ public class DoneModel implements Model, Serializable { return activities; } - public List getWps() { - return wps; + public List getBillings() { + return billings; } public List getAllJobs() { diff --git a/src/main/java/de/jottyfan/timetrack/modules/done/WpBean.java b/src/main/java/de/jottyfan/timetrack/modules/done/WpBean.java deleted file mode 100644 index 731138e..0000000 --- a/src/main/java/de/jottyfan/timetrack/modules/done/WpBean.java +++ /dev/null @@ -1,34 +0,0 @@ -package de.jottyfan.timetrack.modules.done; - -import java.io.Serializable; - -/** - * - * @author jotty - * - */ -public class WpBean implements Serializable { - private static final long serialVersionUID = 1L; - private final String name; - private final String key; - - public WpBean(String key, String name) { - super(); - this.key = key; - this.name = name; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @return the key - */ - public String getKey() { - return key; - } -} diff --git a/src/main/webapp/pages/done/add.xhtml b/src/main/webapp/pages/done/add.xhtml index 391eec4..5bc2d9e 100644 --- a/src/main/webapp/pages/done/add.xhtml +++ b/src/main/webapp/pages/done/add.xhtml @@ -58,9 +58,9 @@ - + - + @@ -72,7 +72,7 @@ $("[id='formular:projectInner']").attr("size", 25); $("[id='formular:moduleInner']").attr("size", 25); $("[id='formular:activityInner']").attr("size", 25); - $("[id='formular:wpInner']").attr("size", 25); + $("[id='formular:billingInner']").attr("size", 25); }); diff --git a/src/main/webapp/pages/done/delete.xhtml b/src/main/webapp/pages/done/delete.xhtml index 123cfc1..1fa3df5 100644 --- a/src/main/webapp/pages/done/delete.xhtml +++ b/src/main/webapp/pages/done/delete.xhtml @@ -23,6 +23,8 @@ + + diff --git a/src/main/webapp/pages/done/edit.xhtml b/src/main/webapp/pages/done/edit.xhtml index c277465..bfa7717 100644 --- a/src/main/webapp/pages/done/edit.xhtml +++ b/src/main/webapp/pages/done/edit.xhtml @@ -45,7 +45,7 @@ - + @@ -58,9 +58,9 @@ - + - + @@ -72,7 +72,7 @@ $("[id='formular:projectInner']").attr("size", 25); $("[id='formular:moduleInner']").attr("size", 25); $("[id='formular:activityInner']").attr("size", 25); - $("[id='formular:wpInner']").attr("size", 25); + $("[id='formular:billingInner']").attr("size", 25); }); diff --git a/src/main/webapp/pages/done/init.xhtml b/src/main/webapp/pages/done/init.xhtml index 7da1bc8..f5d7b7e 100644 --- a/src/main/webapp/pages/done/init.xhtml +++ b/src/main/webapp/pages/done/init.xhtml @@ -24,7 +24,7 @@ - + @@ -75,7 +75,7 @@ searching="false"> - + @@ -108,9 +108,12 @@ - - + + + + + diff --git a/src/main/webapp/resources/css/style.css b/src/main/webapp/resources/css/style.css index 197f13c..e9fd4ba 100644 --- a/src/main/webapp/resources/css/style.css +++ b/src/main/webapp/resources/css/style.css @@ -47,17 +47,30 @@ .WP2 { color: black !important; - background-color: #ffe169 !important; + background: radial-gradient(#ffff00, #ffe169) !important; + border: 1px solid darkgray; + padding-top: 8px !important; } .WP4 { - color: white !important; - background-color: #69c3ff !important; + color: black !important; + background: radial-gradient(#00ffff, #69c3ff) !important; + border: 1px solid darkgray; + padding-top: 8px !important; } .WP5 { color: black !important; - background-color: #e396ff !important; + background: radial-gradient(#ff0000, #e396ff) !important; + border: 1px solid darkgray; + padding-top: 8px !important; +} + +.TA3 { + color: black !important; + background: radial-gradient(#99ff99, #ccffcc) !important; + border: 1px solid darkgray; + padding-top: 8px !important; } .left {