This commit is contained in:
@@ -8,23 +8,49 @@ namespace AyaNova.Models
|
|||||||
{
|
{
|
||||||
public class WorkOrderItemExpense : ICoreBizObjectModel
|
public class WorkOrderItemExpense : ICoreBizObjectModel
|
||||||
{
|
{
|
||||||
public WorkOrderItemExpense()
|
|
||||||
{
|
|
||||||
Tags = new List<string>();
|
|
||||||
}
|
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public uint Concurrency { get; set; }
|
public uint Concurrency { get; set; }
|
||||||
public string Notes { get; set; }
|
|
||||||
public string CustomFields { get; set; }
|
public string Description { get; set; }
|
||||||
public List<string> Tags { get; set; }
|
public string Name { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal TotalCost { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal ChargeAmount { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal TaxPaid { get; set; }
|
||||||
|
public long? ChargeTaxCodeId { get; set; }
|
||||||
|
public bool ReimburseUser { get; set; } = false;
|
||||||
|
public long? UserId { get; set; }
|
||||||
|
public bool ChargeToCustomer { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public long WorkOrderItemId { get; set; }
|
public long WorkOrderItemId { get; set; }
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public WorkOrderItem WorkOrderItem { get; set; }
|
public WorkOrderItem WorkOrderItem { get; set; }
|
||||||
|
|
||||||
|
|
||||||
[NotMapped, JsonIgnore]
|
[NotMapped, JsonIgnore]
|
||||||
public AyaType AyaType { get => AyaType.WorkOrderItemExpense; }
|
public AyaType AyaType { get => AyaType.WorkOrderItemExpense; }
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
|
/*
|
||||||
|
[dbo].[AWORKORDERITEMMISCEXPENSE](
|
||||||
|
[AID] [uniqueidentifier] NOT NULL,
|
||||||
|
[AWORKORDERITEMID] [uniqueidentifier] NOT NULL,
|
||||||
|
[ACREATOR] [uniqueidentifier] NOT NULL,
|
||||||
|
[AMODIFIER] [uniqueidentifier] NOT NULL,
|
||||||
|
[ACREATED] [datetime] NOT NULL,
|
||||||
|
[AMODIFIED] [datetime] NOT NULL,
|
||||||
|
[ATOTALCOST] [decimal](19, 5) NULL,
|
||||||
|
[ACHARGEAMOUNT] [decimal](19, 5) NULL,
|
||||||
|
[ADESCRIPTION] [nvarchar](255) NULL,
|
||||||
|
[ATAXPAID] [decimal](19, 5) NULL,
|
||||||
|
[ACHARGETAXCODEID] [uniqueidentifier] NULL,
|
||||||
|
[ANAME] [nvarchar](255) NULL,
|
||||||
|
[AREIMBURSEUSER] [bit] NOT NULL,
|
||||||
|
[AUSERID] [uniqueidentifier] NULL,
|
||||||
|
[ACHARGETOCLIENT] [bit] NOT NULL,
|
||||||
|
*/
|
||||||
@@ -739,7 +739,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
//WORKORDER STATUS
|
//WORKORDER STATUS
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aworkorderstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000', selectroles INTEGER NOT NULL, removeroles INTEGER NOT NULL, completed BOOL NOT NULL, locked BOOL NOT NULL)");
|
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000', selectroles INTEGER NOT NULL, removeroles INTEGER NOT NULL, completed BOOL NOT NULL, locked BOOL NOT NULL)");
|
||||||
|
|
||||||
//WORKORDERITEM STATUS
|
//WORKORDERITEM STATUS
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderitemstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
await ExecQueryAsync("CREATE TABLE aworkorderitemstatus (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, name TEXT NOT NULL UNIQUE, active BOOL NOT NULL, "
|
||||||
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000')");
|
+ "notes TEXT, color VARCHAR(12) NOT NULL default '#000000')");
|
||||||
@@ -761,15 +761,22 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
+ "workorderstatusid BIGINT NOT NULL REFERENCES aworkorderstatus (id), created TIMESTAMP NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id)"
|
+ "workorderstatusid BIGINT NOT NULL REFERENCES aworkorderstatus (id), created TIMESTAMP NOT NULL, userid BIGINT NOT NULL REFERENCES auser (id)"
|
||||||
+ ")");
|
+ ")");
|
||||||
|
|
||||||
here
|
//WORKORDERITEM
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderid BIGINT NOT NULL REFERENCES aworkorder (id), "
|
await ExecQueryAsync("CREATE TABLE aworkorderitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderid BIGINT NOT NULL REFERENCES aworkorder (id), "
|
||||||
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY )");
|
+ "notes TEXT, wiki TEXT, customfields TEXT, tags VARCHAR(255) ARRAY, technotes TEXT, workorderitemstatusid BIGINT REFERENCES aworkorderitemstatus (id), "
|
||||||
|
+ " workorderitempriorityid BIGINT REFERENCES aworkorderitempriority (id), requestdate TIMESTAMP, warrantyservice BOOL NOT NULL"
|
||||||
|
+ ")");
|
||||||
|
|
||||||
|
//WORKORDERITEM EXPENSE
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
await ExecQueryAsync("CREATE TABLE aworkorderitemexpense (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||||
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
+ "description TEXT, name TEXT, totalcost DECIMAL(38,18) NOT NULL default 0, chargeamount DECIMAL(38,18) NOT NULL default 0, taxpaid DECIMAL(38,18) NOT NULL default 0, "
|
||||||
|
+ "chargetaxcodeid BIGINT REFERENCES ataxcode, reimburseuser BOOL NOT NULL, userid BIGINT REFERENCES auser, chargetocustomer BOOL NOT NULL"
|
||||||
|
+ ")");
|
||||||
|
|
||||||
|
//WORKORDERITEM LABOR
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
await ExecQueryAsync("CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||||
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
+ ""
|
||||||
|
+ ")");
|
||||||
|
|
||||||
await ExecQueryAsync("CREATE TABLE aworkorderitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
await ExecQueryAsync("CREATE TABLE aworkorderitemloan (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
|
||||||
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
+ "notes TEXT, customfields TEXT, tags VARCHAR(255) ARRAY)");
|
||||||
|
|||||||
Reference in New Issue
Block a user