This commit is contained in:
2021-07-26 19:41:31 +00:00
parent cd56594286
commit c5a5f102ab
3 changed files with 76 additions and 30 deletions

View File

@@ -12,13 +12,14 @@ namespace AyaNova.DataList
DefaultListAType = AyaType.Quote;
SQLFrom = "from aquote "
+ "left join aquotestatus on (aquote.laststatusid = aquotestatus.id) "
+ "left join acustomer on (aquote.customerid=acustomer.id) "
+ "left join aheadoffice on (acustomer.headofficeid=aheadoffice.id) "
+ "left join aproject on (aquote.projectid=aproject.id) "
+ "left join acontract on (aquote.contractid=acontract.id)";
+ "left join acustomer on (aquote.customerid = acustomer.id) "
+ "left join aheadoffice on (acustomer.headofficeid = aheadoffice.id) "
+ "left join aproject on (aquote.projectid = aproject.id) "
+ "left join auser on (aquote.preparedbyid = auser.id) "
+ "left join acontract on (aquote.contractid = acontract.id)";
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
DefaultColumns = new List<string>() { "QuoteSerialNumber", "Customer", "QuoteStatus", "Project" };
DefaultColumns = new List<string>() { "QuoteSerialNumber", "Customer", "QuoteQuoteStatusType", "QuoteQuoteRequestDate", "QuotePreparedByID" };
DefaultSortBy = new Dictionary<string, string>() { { "QuoteSerialNumber", "-" } };
FieldDefinitions = new List<DataListFieldDefinition>();
@@ -53,6 +54,16 @@ namespace AyaNova.DataList
SqlValueColumnName = "aheadoffice.name"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuotePreparedByID",
FieldKey = "QuotePreparedByID",
UiFieldDataType = (int)UiFieldDataType.Text,
AType = (int)AyaType.User,
SqlIdColumnName = "aquote.preparedbyid",
SqlValueColumnName = "auser.name"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuoteQuoteStatusType",
@@ -124,29 +135,45 @@ namespace AyaNova.DataList
SqlValueColumnName = "aquote.customercontactname"
});
// FieldDefinitions.Add(new DataListFieldDefinition
// {
// TKey = "QuoteServiceDate",
// FieldKey = "QuoteServiceDate",
// UiFieldDataType = (int)UiFieldDataType.DateTime,
// SqlValueColumnName = "aquote.servicedate"
// });
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuoteQuoteRequestDate",
FieldKey = "QuoteQuoteRequestDate",
UiFieldDataType = (int)UiFieldDataType.DateTime,
SqlValueColumnName = "aquote.requested"
});
// FieldDefinitions.Add(new DataListFieldDefinition
// {
// TKey = "QuoteCloseByDate",
// FieldKey = "QuoteCloseByDate",
// UiFieldDataType = (int)UiFieldDataType.DateTime,
// SqlValueColumnName = "aquote.completebydate"
// });
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuoteValidUntilDate",
FieldKey = "QuoteValidUntilDate",
UiFieldDataType = (int)UiFieldDataType.DateTime,
SqlValueColumnName = "aquote.validuntil"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuoteDateSubmitted",
FieldKey = "QuoteDateSubmitted",
UiFieldDataType = (int)UiFieldDataType.DateTime,
SqlValueColumnName = "aquote.submitted"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuoteDateApproved",
FieldKey = "QuoteDateApproved",
UiFieldDataType = (int)UiFieldDataType.DateTime,
SqlValueColumnName = "aquote.approved"
});
// FieldDefinitions.Add(new DataListFieldDefinition
// {
// TKey = "QuoteInvoiceNumber",
// FieldKey = "QuoteInvoiceNumber",
// UiFieldDataType = (int)UiFieldDataType.Text,
// SqlValueColumnName = "aquote.invoicenumber"
// });
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "QuoteIntroduction",
FieldKey = "QuoteIntroduction",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "aquote.introduction"
});
FieldDefinitions.Add(new DataListFieldDefinition
{

View File

@@ -2208,6 +2208,7 @@
"NextPMNumber": "Next preventive maintenance",
"WorkOrderErrorLocked": "Work order is set to a locked status and can't be changed",
"WorkOrderSerialNumber": "Number",
"QuoteSerialNumber": "Number",
"Sequence": "Sequence",
"SoftDelete": "Mark for deletion",
"SoftDeleteAll": "Mark all for deletion",

View File

@@ -579,7 +579,7 @@ namespace AyaNova.Util
KnownUserTechRestrictedId = await SeedUserAsync(log, 1, AuthorizationRoles.TechRestricted, UserType.Service, "TechRestricted", "TechRestricted", KnownUserTags);
KnownUserTechId = await SeedUserAsync(log, 1, AuthorizationRoles.Tech, UserType.Service, "Tech", "Tech", KnownUserTags);
await SeedUserAsync(log, 1, AuthorizationRoles.SalesRestricted, UserType.NotService, "SalesRestricted", "SalesRestricted", KnownUserTags);
await SeedUserAsync(log, 1, AuthorizationRoles.Sales, UserType.NotService, "Sales", "Sales", KnownUserTags);
KnownUserSalesId = await SeedUserAsync(log, 1, AuthorizationRoles.Sales, UserType.NotService, "Sales", "Sales", KnownUserTags);
@@ -1692,6 +1692,7 @@ namespace AyaNova.Util
public long KnownUserCustomerId = 0;
public long KnownUserCustomerRestrictedId = 0;
public long KnownCustomerForShadownUnitsId = 0;
public long KnownUserSalesId = 0;
public async Task<long> SeedUserAsync(
@@ -2770,6 +2771,15 @@ namespace AyaNova.Util
return ServiceUserIds[Fake.Random.Int(1, ServiceUserIds.Count - 1)];
}
/*
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗██████╗
██║ ██║██╔═══██╗██╔══██╗██║ ██╔╝ ██╔═══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗
██║ █╗ ██║██║ ██║██████╔╝█████╔╝█████╗██║ ██║██████╔╝██║ ██║█████╗ ██████╔╝
██║███╗██║██║ ██║██╔══██╗██╔═██╗╚════╝██║ ██║██╔══██╗██║ ██║██╔══╝ ██╔══██╗
╚███╔███╔╝╚██████╔╝██║ ██║██║ ██╗ ╚██████╔╝██║ ██║██████╔╝███████╗██║ ██║
╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝
*/
private int TotalSeededWorkOrders = 0;
//////////////////////////////////////////////////////
//WORK ORDER
@@ -3239,8 +3249,15 @@ namespace AyaNova.Util
//--------------------- QUOTE --------------------------
/*
██████╗ ██╗ ██╗ ██████╗ ████████╗███████╗
██╔═══██╗██║ ██║██╔═══██╗╚══██╔══╝██╔════╝
██║ ██║██║ ██║██║ ██║ ██║ █████╗
██║▄▄ ██║██║ ██║██║ ██║ ██║ ██╔══╝
╚██████╔╝╚██████╔╝╚██████╔╝ ██║ ███████╗
╚══▀▀═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝
*/
private int TotalSeededQuotes = 0;
//////////////////////////////////////////////////////
//Quote
@@ -3261,8 +3278,8 @@ namespace AyaNova.Util
var woDate = DesiredTimeInUtc(new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, tempHour, 0, 0));
o.CreatedDate = woDate > DateTime.UtcNow ? DateTime.UtcNow : woDate;//no created dates in future but want a range of past dates to show off age of wo
// o.CompleteByDate = woDate.AddDays(5);
// o.CustomerContactName = "contact name here";
o.Requested = woDate.AddDays(-2);
o.PreparedById = KnownUserSalesId;
o.CustomerId = GetRandomCustomerId();//Fake.Random.Long(1, TotalSeededCustomers);
using (AyContext ct = ServiceProviderProvider.DBContext)
@@ -3620,6 +3637,7 @@ namespace AyaNova.Util
Created = woDate.AddMinutes(5)
};
o.States.Add(WoState);
o.LastStatusId = WoState.QuoteStatusId;
}