This commit is contained in:
@@ -10,10 +10,32 @@ namespace AyaNova.DataList
|
|||||||
{
|
{
|
||||||
|
|
||||||
DefaultListObjectType = AyaType.PartInventory;
|
DefaultListObjectType = AyaType.PartInventory;
|
||||||
SQLFrom = "from apartinventory";
|
SQLFrom = "from apartinventory "
|
||||||
|
+ "left join apart on (apartinventory.apartid=apart.id) "
|
||||||
|
+ "left join apartwarehouse on (apartinventory.apartwarehouseid=apartwarehouse.id) ";
|
||||||
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
||||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
"PartInventoryList":"Part inventory",
|
||||||
|
"PartInventoryTransaction":"Inventory transaction",
|
||||||
|
"PartInventoryTransactionDescription":"Description",
|
||||||
|
"PartInventoryTransactionEntryDate":"Date",
|
||||||
|
"PartInventoryTransactionSource":"Transaction source",
|
||||||
|
"PartInventoryTransactionQuantity":"Quantity",
|
||||||
|
"PartInventoryBalance":"On hand quantity"
|
||||||
|
|
||||||
|
await ExecQueryAsync("CREATE TABLE apartinventory (id BIGINT GENERATED ALWAYS AS
|
||||||
|
IDENTITY PRIMARY KEY,
|
||||||
|
description text null, " +
|
||||||
|
"entrydate timestamp not null, lastentrydate timestamp null,
|
||||||
|
partid bigint not null references apart,
|
||||||
|
partwarehouseid bigint not null references apartwarehouse, " +
|
||||||
|
"sourcetype integer not null, sourceid bigint not null, " +
|
||||||
|
"quantity decimal(19,4) not null, balance decimal(19,4) not null,
|
||||||
|
lastbalance decimal(19,4) null, " +
|
||||||
|
*/
|
||||||
|
|
||||||
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
||||||
//Default ListView
|
//Default ListView
|
||||||
@@ -21,40 +43,27 @@ namespace AyaNova.DataList
|
|||||||
dynamic cm = null;
|
dynamic cm = null;
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "PartInventoryCreated";
|
cm.fld = "PartInventoryTransactionEntryDate";
|
||||||
cm.sort = "-";
|
cm.sort = "-";
|
||||||
dlistView.Add(cm);
|
dlistView.Add(cm);
|
||||||
|
//part
|
||||||
|
//warehouse
|
||||||
|
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "Object";
|
cm.fld = "PartInventoryTransactionQuantity";
|
||||||
dlistView.Add(cm);
|
dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "PartInventoryCurrency";
|
cm.fld = "PartInventoryTransactionDescription";
|
||||||
dlistView.Add(cm);
|
dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "PartInventoryCurrencyBalance";
|
cm.fld = "PartInventoryTransactionSource";
|
||||||
dlistView.Add(cm);
|
dlistView.Add(cm);
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "PartInventoryIncidents";
|
cm.fld = "PartInventoryBalance";
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "PartInventoryIncidentsBalance";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "PartInventoryHours";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "PartInventoryHoursBalance";
|
|
||||||
dlistView.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "PartInventoryDescription";
|
|
||||||
dlistView.Add(cm);
|
dlistView.Add(cm);
|
||||||
|
|
||||||
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
@@ -64,8 +73,8 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "PartInventorySourceRootObjectType",
|
TKey = "PartInventoryTransactionSource",
|
||||||
FieldKey = "PartInventorySourceRootObjectType",
|
FieldKey = "PartInventoryTransactionSource",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlIdColumnName = "apartinventory.sourceid",
|
SqlIdColumnName = "apartinventory.sourceid",
|
||||||
SqlValueColumnName = "AYGETNAME(apartinventory.sourceid, apartinventory.sourcetype)",
|
SqlValueColumnName = "AYGETNAME(apartinventory.sourceid, apartinventory.sourcetype)",
|
||||||
@@ -74,107 +83,62 @@ namespace AyaNova.DataList
|
|||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "Object",
|
TKey = "PartPartNumber",
|
||||||
FieldKey = "Object",
|
FieldKey = "PartPartNumber",
|
||||||
|
AyaObjectType = (int)AyaType.Part,
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlIdColumnName = "apartinventory.objectid",
|
SqlIdColumnName = "apart.id",
|
||||||
SqlValueColumnName = "AYGETNAME(apartinventory.objectid, apartinventory.objecttype)",
|
SqlValueColumnName = "apart.partnumber"
|
||||||
SqlAyTypeColumnName = "apartinventory.objecttype"
|
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "AyaType",
|
TKey = "PartWarehouseName",
|
||||||
FieldKey = "AyaType",
|
FieldKey = "PartWarehouseName",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Enum,
|
AyaObjectType = (int)AyaType.PartWarehouse,
|
||||||
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlValueColumnName = "apartinventory.objecttype"
|
SqlIdColumnName = "apartwarehouse.id",
|
||||||
|
SqlValueColumnName = "apartwarehouse.name"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "PartInventoryDescription",
|
TKey = "PartInventoryTransactionDescription",
|
||||||
FieldKey = "PartInventoryDescription",
|
FieldKey = "PartInventoryTransactionDescription",
|
||||||
AyaObjectType = (int)AyaType.PartInventory,
|
AyaObjectType = (int)AyaType.PartInventory,
|
||||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||||
SqlIdColumnName = "apartinventory.id",
|
SqlIdColumnName = "apartinventory.id",
|
||||||
SqlValueColumnName = "apartinventory.name",
|
SqlValueColumnName = "apartinventory.description",
|
||||||
IsRowId = true
|
IsRowId = true//should open to eventlog since no edit
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "PartInventoryCreated",
|
TKey = "PartInventoryTransactionEntryDate",
|
||||||
FieldKey = "PartInventoryCreated",
|
FieldKey = "PartInventoryTransactionEntryDate",
|
||||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||||
SqlValueColumnName = "apartinventory.entrydate"
|
SqlValueColumnName = "apartinventory.entrydate"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "PartInventoryCurrency",
|
TKey = "PartInventoryTransactionQuantity",
|
||||||
FieldKey = "PartInventoryCurrency",
|
FieldKey = "PartInventoryTransactionQuantity",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
||||||
SqlValueColumnName = "apartinventory.currency"
|
|
||||||
});
|
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
||||||
{
|
|
||||||
TKey = "PartInventoryCurrencyBalance",
|
|
||||||
FieldKey = "PartInventoryCurrencyBalance",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
||||||
SqlValueColumnName = "apartinventory.currencybalance"
|
|
||||||
});
|
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
||||||
{
|
|
||||||
TKey = "PartInventoryIncidents",
|
|
||||||
FieldKey = "PartInventoryIncidents",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||||
SqlValueColumnName = "apartinventory.incidents"
|
SqlValueColumnName = "apartinventory.quantity"
|
||||||
});
|
});
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "PartInventoryIncidentsBalance",
|
TKey = "PartInventoryBalance",
|
||||||
FieldKey = "PartInventoryIncidentsBalance",
|
FieldKey = "PartInventoryBalance",
|
||||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
||||||
SqlValueColumnName = "apartinventory.incidentsbalance"
|
SqlValueColumnName = "apartinventory.balance"
|
||||||
});
|
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
||||||
{
|
|
||||||
TKey = "PartInventoryHours",
|
|
||||||
FieldKey = "PartInventoryHours",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
|
||||||
SqlValueColumnName = "apartinventory.hours"
|
|
||||||
});
|
|
||||||
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
||||||
{
|
|
||||||
TKey = "PartInventoryHoursBalance",
|
|
||||||
FieldKey = "PartInventoryHoursBalance",
|
|
||||||
UiFieldDataType = (int)UiFieldDataType.Decimal,
|
|
||||||
SqlValueColumnName = "apartinventory.hoursbalance"
|
|
||||||
});
|
|
||||||
|
|
||||||
//META object id column
|
|
||||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
||||||
{
|
|
||||||
FieldKey = "metapartinventoryobjectid",
|
|
||||||
SqlIdColumnName = "apartinventory.objectid",
|
|
||||||
SqlValueColumnName = "apartinventory.objectid",
|
|
||||||
IsMeta = true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
}//eons
|
}//eons
|
||||||
Reference in New Issue
Block a user