This commit is contained in:
2022-01-26 22:54:09 +00:00
parent 8d1201b861
commit 5b50e29054
3 changed files with 35 additions and 8 deletions

View File

@@ -1013,7 +1013,7 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "ExpenseTaxBViz", TKeySection = "WorkOrderItemExpense", Requireable = false });
l.Add(new FormField { TKey = "LineTotal", FieldKey = "ExpenseLineTotalViz", TKeySection = "WorkOrderItemExpense", Requireable = false });
//WORKORDER ITEM LOAN WorkOrderItemLoanRate ?
//WORKORDER ITEM LOAN
l.Add(new FormField { TKey = "WorkOrderItemLoanRate", TKeySection = "WorkOrderItemLoan", ModelProperty = "Rate", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderItemLoanNotes", TKeySection = "WorkOrderItemLoan", ModelProperty = "Notes" });
l.Add(new FormField { TKey = "WorkOrderItemLoanOutDate", TKeySection = "WorkOrderItemLoan", ModelProperty = "OutDate" });
@@ -1179,7 +1179,7 @@ namespace AyaNova.Biz
//QUOTE ITEM PART
l.Add(new FormField { TKey = "WorkOrderItemPartDescription", ModelProperty = "Description", TKeySection = "WorkOrderItemPart" });
l.Add(new FormField { TKey = "PurchaseOrderItemSerialNumbers", ModelProperty = "Serials", TKeySection = "WorkOrderItemPart" });
l.Add(new FormField { TKey = "WorkOrderItemPartSuggestedQuantity", TKeySection = "WorkOrderItemPart", Requireable = false });//requires at least a zero so effectively can't be required
//l.Add(new FormField { TKey = "WorkOrderItemPartSuggestedQuantity", TKeySection = "WorkOrderItemPart", Requireable = false });//requires at least a zero so effectively can't be required
l.Add(new FormField { TKey = "WorkOrderItemPartTaxPartSaleID", ModelProperty = "TaxPartSaleId", TKeySection = "WorkOrderItemPart" });
l.Add(new FormField { TKey = "PartDescription", TKeySection = "WorkOrderItemPart", Requireable = false });
l.Add(new FormField { TKey = "PartUPC", TKeySection = "WorkOrderItemPart", Requireable = false });
@@ -1245,6 +1245,7 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "LineTotal", FieldKey = "ExpenseLineTotalViz", TKeySection = "WorkOrderItemExpense", Requireable = false });
//QUOTE ITEM LOAN
l.Add(new FormField { TKey = "WorkOrderItemLoanRate", TKeySection = "WorkOrderItemLoan", ModelProperty = "Rate", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderItemLoanNotes", TKeySection = "WorkOrderItemLoan", ModelProperty = "Notes" });
l.Add(new FormField { TKey = "WorkOrderItemLoanOutDate", TKeySection = "WorkOrderItemLoan", ModelProperty = "OutDate" });
l.Add(new FormField { TKey = "WorkOrderItemLoanDueDate", TKeySection = "WorkOrderItemLoan", ModelProperty = "DueDate" });
@@ -1254,7 +1255,7 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "ListPrice", FieldKey = "LoanListPrice", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "Price", FieldKey = "LoanPriceViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "PriceOverride", FieldKey = "LoanPriceOverride", TKeySection = "WorkOrderItemLoan", ModelProperty = "PriceOverride" });
l.Add(new FormField { TKey = "UnitOfMeasure", FieldKey = "LoanUnitOfMeasureViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
//l.Add(new FormField { TKey = "UnitOfMeasure", FieldKey = "LoanUnitOfMeasureViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "NetPrice", FieldKey = "LoanNetViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "LoanTaxAViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LoanTaxBViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
@@ -1445,7 +1446,7 @@ namespace AyaNova.Biz
//PM ITEM PART
l.Add(new FormField { TKey = "WorkOrderItemPartDescription", ModelProperty = "Description", TKeySection = "WorkOrderItemPart" });
l.Add(new FormField { TKey = "PurchaseOrderItemSerialNumbers", ModelProperty = "Serials", TKeySection = "WorkOrderItemPart" });
l.Add(new FormField { TKey = "WorkOrderItemPartSuggestedQuantity", TKeySection = "WorkOrderItemPart", Requireable = false });//requires at least a zero so effectively can't be required
//l.Add(new FormField { TKey = "WorkOrderItemPartSuggestedQuantity", TKeySection = "WorkOrderItemPart", Requireable = false });//requires at least a zero so effectively can't be required
l.Add(new FormField { TKey = "WorkOrderItemPartTaxPartSaleID", ModelProperty = "TaxPartSaleId", TKeySection = "WorkOrderItemPart" });
l.Add(new FormField { TKey = "PartDescription", TKeySection = "WorkOrderItemPart", Requireable = false });
l.Add(new FormField { TKey = "PartUPC", TKeySection = "WorkOrderItemPart", Requireable = false });
@@ -1511,6 +1512,7 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "LineTotal", FieldKey = "ExpenseLineTotalViz", TKeySection = "WorkOrderItemExpense", Requireable = false });
//PM ITEM LOAN
l.Add(new FormField { TKey = "WorkOrderItemLoanRate", TKeySection = "WorkOrderItemLoan", ModelProperty = "Rate", Requireable = false });
l.Add(new FormField { TKey = "WorkOrderItemLoanNotes", TKeySection = "WorkOrderItemLoan", ModelProperty = "Notes" });
l.Add(new FormField { TKey = "WorkOrderItemLoanOutDate", TKeySection = "WorkOrderItemLoan", ModelProperty = "OutDate" });
l.Add(new FormField { TKey = "WorkOrderItemLoanDueDate", TKeySection = "WorkOrderItemLoan", ModelProperty = "DueDate" });
@@ -1520,7 +1522,7 @@ namespace AyaNova.Biz
l.Add(new FormField { TKey = "ListPrice", FieldKey = "LoanListPrice", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "Price", FieldKey = "LoanPriceViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "PriceOverride", FieldKey = "LoanPriceOverride", TKeySection = "WorkOrderItemLoan", ModelProperty = "PriceOverride" });
l.Add(new FormField { TKey = "UnitOfMeasure", FieldKey = "LoanUnitOfMeasureViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
// l.Add(new FormField { TKey = "UnitOfMeasure", FieldKey = "LoanUnitOfMeasureViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "NetPrice", FieldKey = "LoanNetViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "LoanTaxAViz", TKeySection = "WorkOrderItemLoan", Requireable = false });
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LoanTaxBViz", TKeySection = "WorkOrderItemLoan", Requireable = false });

View File

@@ -30,10 +30,33 @@ namespace AyaNova.Biz
//get the type and because of quote and pm subsections "TKeySection" property being named "WorkOrder" in the formFieldReference due to lack of separate
//translations for quote and pm subitems it's necessary to adjust the name here first before matching
var proposedObjectType=proposedObject.GetType().ToString().Replace("QuoteItem","WorkOrderItem").Replace("PMItem","WorkOrderItem");
//don't validate custom fields, just skip them, make sure if it's sectional it matches the section of the object type (workorder sub sections)
if (!FF.IsCustomField && (FF.TKeySection == null || proposedObjectType.EndsWith(FF.TKeySection)))
var proposedObjectType = proposedObject.GetType().ToString().Replace("AyaNova.Models.", "").Replace("QuoteItem", "WorkOrderItem").Replace("PMItem", "WorkOrderItem");
//hacky last minute work around but workorder, quote and pm header objects have no tkeysection normally which can cause interference here with duplicate fields i.e. Tags in subsections
//as they will have the header rule applied if we just leave the tkeysection as null so for here we workaround that by creating a temporary tkeysection
if (FF.TKeySection == null)
{
switch (proposedObjectType)
{
case "WorkOrder":
FF.TKeySection = proposedObjectType;
break;
case "Quote":
FF.TKeySection = proposedObjectType;
break;
case "PM":
FF.TKeySection = proposedObjectType;
break;
}
}
//don't validate custom fields, just skip them, make sure if it's sectional it matches the section of the object type (workorder sub sections)
if (!FF.IsCustomField && (FF.TKeySection == null || proposedObjectType == FF.TKeySection))
{
//bugbug: if section is workorderitem and field is tags but there is a tags required in workorder htat has NOT tkeysection it applies that rule
//Now get the actual property name from the available fields using the lt key
string RequiredPropertyName = FF.FieldKey;
//there might be a more specific model property due to being a workorder sub item duplicate such as WorkOrderItemTags vs WorkOrderTags