This commit is contained in:
2021-03-26 17:05:06 +00:00
parent c042162daf
commit 6a0ee52dab
2 changed files with 35 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Newtonsoft.Json;
@@ -9,15 +9,22 @@ namespace AyaNova.Models
{
public class WorkOrderItemLoan : ICoreBizObjectModel
{
public WorkOrderItemLoan()
{
Tags = new List<string>();
}
public long Id { get; set; }
public uint Concurrency { get; set; }
public string Notes { get; set; }
public string CustomFields { get; set; }
public List<string> Tags { get; set; }
public DateTime? OutDate { get; set; }
public DateTime? DueDate { get; set; }
public DateTime? ReturnDate { get; set; }
[Required]
public decimal Charges { get; set; }
public long? TaxCodeId { get; set; }
[Required]
public long LoanItemId { get; set; }
[Required]
public decimal Quantity { get; set; }
[Required]
public LoanUnitRateUnit Rate { get; set; }
[Required]
public long WorkOrderItemId { get; set; }
[JsonIgnore]
@@ -28,3 +35,21 @@ namespace AyaNova.Models
}//eoc
}//eons
/*
CREATE TABLE [dbo].[AWORKORDERITEMLOAN](
[AID] [uniqueidentifier] NOT NULL,
[AWORKORDERITEMID] [uniqueidentifier] NOT NULL,
[ACREATED] [datetime] NULL,
[AMODIFIED] [datetime] NULL,
[ACREATOR] [uniqueidentifier] NULL,
[AMODIFIER] [uniqueidentifier] NULL,
[ANOTES] [ntext] NULL,
[AOUTDATE] [datetime] NULL,
[ADUEDATE] [datetime] NULL,
[ARETURNDATE] [datetime] NULL,
[ACHARGES] [decimal](19, 5) NOT NULL,
[ATAXCODEID] [uniqueidentifier] NULL,
[ALOANITEMID] [uniqueidentifier] NOT NULL,
[AQUANTITY] [decimal](19, 5) NOT NULL,
[ARATE] [smallint] NOT NULL
*/

View File

@@ -781,7 +781,9 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
//WORKORDERITEM LOAN
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, outdate TIMESTAMP, duedate TIMESTAMP, returndate TIMESTAMP, charges DECIMAL(38,18) NOT NULL default 0, taxcodeid BIGINT REFERENCES ataxcode, "
+ "loanitemid BIGINT NOT NULL REFERENCES aloanitem, quantity DECIMAL(19,5) NOT NULL default 0, rate INTEGER NOT NULL"
+ ")");
await ExecQueryAsync("ALTER TABLE aloanunit ADD column workorderitemloanid BIGINT NULL REFERENCES aworkorderitemloan");