3.0.1.2 Requirements & tidy
This commit is contained in:
@@ -15,7 +15,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "3.0.1.1";
|
||||
private static String version { get; } = "3.0.1.2";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion() { return version; }
|
||||
public static String GetAppVersion()
|
||||
@@ -39,6 +39,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// 3.0.1 19-Feb-25 Portal Transactions.
|
||||
// 3.0.1.1 19-Feb-25 Portal tidy.
|
||||
// 3.0.1.2 26-Feb-25 Requirements & tidy.
|
||||
//-------------------------------------------------------------------
|
||||
// 3.0.0 Jul-2021 Initial demo test version.
|
||||
// 02-Feb-25 Initial live deployment.
|
||||
|
||||
@@ -1754,18 +1754,18 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
Any = -1,
|
||||
Unknown = 0,
|
||||
// NB Do not change the positive values, as tied to the database.
|
||||
Project = 10, // 'PRO'
|
||||
SalesLead = 20, // 'SLD'
|
||||
SalesQuote = 21, // 'SQT'
|
||||
SalesOrder = 22, // 'SAL'
|
||||
SalesPO = 23, // 'SPO'
|
||||
ProformaSalesOrder = 24, // 'SAP'
|
||||
PurchaseQuote = 30, // 'PQT'
|
||||
PurchaseOrder = 31, // 'PUR'
|
||||
PurchaseSO = 32, // 'PSO'
|
||||
ProformaPurchaseOrder = 33, // 'PUP'
|
||||
SalesDispatch = 40, // 'SDP'
|
||||
PurchaseDelivery = 41, // 'PDL'
|
||||
Project = 10, // 'PRO'
|
||||
SalesLead = 20, // 'SLD'
|
||||
SalesQuote = 21, // 'SQT'
|
||||
SalesOrder = 22, // 'SAL'
|
||||
SalesPO = 23, // 'SPO'
|
||||
ProformaSalesOrder = 24, // 'SAP'
|
||||
PurchaseQuote = 30, // 'PQT'
|
||||
PurchaseOrder = 31, // 'PUR'
|
||||
PurchaseSO = 32, // 'PSO'
|
||||
ProformaPurchaseOrder = 33, // 'PUP'
|
||||
SalesDispatch = 40, // 'SDP'
|
||||
PurchaseDelivery = 41, // 'PDL'
|
||||
ProformaSalesInvoice = 50, // 'PSI'
|
||||
SalesInvoice = 51, // 'SAI'
|
||||
PurchaseInvoice = 52, // 'PUV'
|
||||
@@ -1783,6 +1783,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
public enum RequirementType
|
||||
{
|
||||
Any = 0,
|
||||
Unknown = Any,
|
||||
Detail = 1,
|
||||
Job = 2,
|
||||
}
|
||||
|
||||
@@ -21,10 +21,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
Unknown,
|
||||
Pos,
|
||||
Id,
|
||||
//Requirement.
|
||||
TransId,
|
||||
Owner_Name,
|
||||
// Requirement code
|
||||
// Association.
|
||||
Assoc_Code,
|
||||
Assoc_AccountManagerCode, Assoc_AccountManagerDesc,
|
||||
Assoc_AccountHandlerCode, Assoc_AccountHandlerDesc,
|
||||
@@ -32,7 +30,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
Assoc_Target_PhoneMain,
|
||||
Assoc_Target_PhoneAlt,
|
||||
// Transaction details
|
||||
Trans_TypeDesc, Trans_Ref, Trans_RefExt, Trans_DescBrief,
|
||||
TransId,
|
||||
Trans_Type, Trans_TypeDesc, Trans_Ref, Trans_RefExt, Trans_DescBrief,
|
||||
Trans_ContactName,
|
||||
Trans_Likelihood,
|
||||
Trans_Raised,
|
||||
@@ -89,9 +88,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
Trans_DeliveryAddress_Line1, Trans_DeliveryAddress_Line2, Trans_DeliveryAddress_Line3,
|
||||
Trans_DeliveryAddress_City, Trans_DeliveryAddress_Province, Trans_DeliveryAddress_Postcode,
|
||||
Trans_DeliveryAddress_Phone, Trans_DeliveryAddress_Email,
|
||||
Trans_SourceTrans_Ref, // Source transaction reference.
|
||||
//Relation to items
|
||||
Seq,
|
||||
Trans_SourceTrans_Ref, /* Source transaction reference. */
|
||||
// Requirement.
|
||||
Type,
|
||||
Sequence,
|
||||
Started, StartedTime, Started_Day,
|
||||
Required, RequiredTime, Required_Fmt, // Formatted 'Required' date (eg. square brackets around defaulted date).
|
||||
Completed, CompletedTime,
|
||||
@@ -1147,7 +1147,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
{
|
||||
case Column.Id:
|
||||
return new DataValue((long)SysId.ToInt(data.Id));
|
||||
case Column.Seq:
|
||||
case Column.Sequence:
|
||||
return new DataValue(data.Seq);
|
||||
case Column.Required:
|
||||
return new DataValue(data.Required);
|
||||
@@ -1235,22 +1235,22 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public SysId CommodityId { get; set; }
|
||||
public SysId AssetId { get; set; }
|
||||
// Requirement.
|
||||
public HashSet<SysId> RequirementIdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> RequirementIdsExcluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> RequirementIdsSource { get; } = new HashSet<SysId>();
|
||||
public String RequirementProductCodeFull { get; set; }
|
||||
public String RequirementProductCodePartial { get; set; }
|
||||
public String Search { get; set; }
|
||||
public String ProductCodeFull { get; set; }
|
||||
public String ProductCodePartial { get; set; }
|
||||
// Stored as product code for 'Project' transactions (populating this value will force the transaction type).
|
||||
public String RequirementProjectTaskCodeFull { get; set; }
|
||||
public String RequirementProjectTaskCodePartial { get; set; }
|
||||
public String RequirementJobNumberFull { get; set; }
|
||||
public String RequirementJobNumberPartial { get; set; }
|
||||
public String RequirementAssetSerialFull { get; set; }
|
||||
public String RequirementAssetSerialPartial { get; set; }
|
||||
public String RequirementDescBrief { get; set; }
|
||||
public String RequirementPromotionCode { get; set; }
|
||||
public String ProjectTaskCodeFull { get; set; }
|
||||
public String ProjectTaskCodePartial { get; set; }
|
||||
public String JobNumberFull { get; set; }
|
||||
public String JobNumberPartial { get; set; }
|
||||
public String AssetSerialFull { get; set; }
|
||||
public String AssetSerialPartial { get; set; }
|
||||
public String DescBrief { get; set; }
|
||||
public String PromotionCode { get; set; }
|
||||
// Transaction.
|
||||
public String AliasTransaction { get; set; }
|
||||
public HashSet<SysId> TransactionIdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> TransactionIdsExcluded { get; } = new HashSet<SysId>();
|
||||
public SysId TransactionRequirementSourceId { get; set; } // Identifies the transaction to which the source requirement belongs.
|
||||
@@ -1283,7 +1283,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
// Stock by Sales Locations.
|
||||
public SysId SalesLocationIdStock01 { get; set; }
|
||||
public SysId SalesLocationIdStock02 { get; set; }
|
||||
public SysId SalesLocationIdStock03;
|
||||
public SysId SalesLocationIdStock03 { get; set; }
|
||||
// Required date.
|
||||
public DateTime RequirementRequiredFrom { get; set; }
|
||||
public DateTime RequirementRequiredTo { get; set; }
|
||||
@@ -1293,6 +1293,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
public String NotesPartial { get; set; }
|
||||
/// <summary>Requirement status.</summary>
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.Default;
|
||||
// Table aliases joined in query.
|
||||
public String AliasTransaction { get; set; }
|
||||
public String AliasCommodity { get; set; }
|
||||
public String AliasAsset { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1001,54 +1001,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public bool RefreshTotals(List<SbmRequirement> requirements)
|
||||
{
|
||||
return RefreshTotals(requirements.ToDataList());
|
||||
}
|
||||
public bool RefreshTotals(List<SbmRequirement.Data> requirements)
|
||||
{
|
||||
// Recalculate the amounts stored against the transaction in line with the list of requirements.
|
||||
ClearErrorState();
|
||||
if (this == null) return SetErrorState("transaction not specified");
|
||||
if (!HasErrorState())
|
||||
{
|
||||
// Total weight.
|
||||
decimal totalWeight = requirements.GetTotalWeight(UomIdWeight);
|
||||
Weight = totalWeight;
|
||||
|
||||
// Set the allocation status.
|
||||
ClearAllocationStatus();
|
||||
if (requirements.Count > 0)
|
||||
{
|
||||
if (requirements.IsFullAllocation()) FullAllocation = true;
|
||||
else if (requirements.IsPartialAllocation()) PartialAllocation = true;
|
||||
}
|
||||
|
||||
// Calculate the totals from the list of requirements.;
|
||||
decimal newAmountNet = 0.0m;
|
||||
decimal newAmountTax = 0.0m;
|
||||
decimal newAmountTot = 0.0m;
|
||||
decimal newTimeEst = 0.0m;
|
||||
decimal newTimeAct = 0.0m;
|
||||
if (requirements.Count > 0)
|
||||
requirements.CalculateTotals(ref newAmountNet, ref newAmountTax, ref newAmountTot, ref newTimeEst, ref newTimeAct);
|
||||
|
||||
// Include delivery amounts.
|
||||
newAmountNet += DeliveryAmountNet;
|
||||
newAmountTax += DeliveryAmountTax;
|
||||
newAmountTot += DeliveryAmountTot;
|
||||
|
||||
// Store amounts:
|
||||
AmountNet = newAmountNet;
|
||||
AmountTax = newAmountTax;
|
||||
AmountTot = newAmountTot;
|
||||
TimeEst = newTimeEst;
|
||||
TimeAct = newTimeAct;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public bool RefreshRequiredDate(List<SbmRequirement> requirements, ISacsMessageConsole messageConsole)
|
||||
{
|
||||
|
||||
@@ -610,7 +610,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// POpulate reference data.
|
||||
/// Populate reference data.
|
||||
/// <br/>- Code Types.
|
||||
/// </summary>
|
||||
public bool PopulateReferenceData()
|
||||
@@ -618,15 +618,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
ClearErrorState();
|
||||
|
||||
// Code types.
|
||||
List<SaCodeTypeDfn> codeTypeDfns = Internals.CodeTypeConsole.CodeTypeDefinitions;
|
||||
foreach (SaCodeTypeDfn codeTypeDfn in codeTypeDfns)
|
||||
{
|
||||
if (Internals.CodeTypeConsole.PopulateCodeType(codeTypeDfn.Code, DbUpdateInfo))
|
||||
{
|
||||
//foreach (var code in codeTypeDfn.Codes)
|
||||
// Internals.CodeTypeConsole.PopulateCode(codeTypeDfn.sCode, code.Code, code.Desc);
|
||||
}
|
||||
}
|
||||
String codeTypePopulationErrorMessage = "";
|
||||
if (!Internals.CodeTypeConsole.Populate(DbUpdateInfo))
|
||||
codeTypePopulationErrorMessage = Internals.CodeTypeConsole.ErrorStateMessage;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
SbmRequirement.Params prmRequirement = new SbmRequirement.Params();
|
||||
prmRequirement.RequirementIdsIncluded.Add(id);
|
||||
prmRequirement.IdsIncluded.Add(id);
|
||||
prmRequirement.StatusCat = SbmRequirement.StatusCat.Any;
|
||||
return GetRequirementCount(prmRequirement) == 1;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
SbmRequirement.Params prmRequirement = new SbmRequirement.Params();
|
||||
prmRequirement.RequirementIdsIncluded.Add(id);
|
||||
prmRequirement.IdsIncluded.Add(id);
|
||||
prmRequirement.StatusCat = SbmRequirement.StatusCat.Any;
|
||||
return GetRequirement(prmRequirement);
|
||||
}
|
||||
|
||||
@@ -25,25 +25,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
public abstract bool TransactionIsReadOnly(SbmTransaction transaction);
|
||||
public abstract bool TransactionDetailsAreReadOnly(SbmTransaction transaction);
|
||||
|
||||
public abstract bool RefreshTransactionTotals(SbmTransaction transaction, IEnumerable<SbmRequirement> requirements);
|
||||
|
||||
// Labour cost.
|
||||
public abstract decimal GetTransCostLabourRateHourDefault();
|
||||
public abstract decimal GetTransCostLabourRateHour(SysId transactionId);
|
||||
public abstract bool DeliveryFinancialsAreAvailable();
|
||||
|
||||
/// <summary>Change Transaction Association.</summary>
|
||||
public abstract bool ChangeTransactionsAssociation(SbmTransaction transaction, SysId associationId);
|
||||
|
||||
/// <summary>
|
||||
/// Refresh associated data:
|
||||
/// <para>- Refresh Stock Allocations.</para>
|
||||
/// <para>- </para>
|
||||
/// <para>- </para>
|
||||
/// <para>- </para>
|
||||
/// </summary>
|
||||
public abstract bool RefreshAssociatedData(SbmTransaction transaction, List<SbmRequirement> requirements, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool RefreshAssociatedTransactions(SbmTransaction transaction, List<SbmRequirement> requirements, DbUpdateInfo dbUpdateInfo);
|
||||
// Transaction properties.
|
||||
public abstract Sbm.TransactionType GetTransactionType(SysId transactionId);
|
||||
|
||||
public DateTime GetTransactionTaxEffectiveDate(SbmTransaction transaction)
|
||||
{
|
||||
@@ -62,6 +45,24 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
return DateTime.Today;
|
||||
}
|
||||
|
||||
// Labour cost.
|
||||
public abstract decimal GetTransCostLabourRateHourDefault();
|
||||
public abstract decimal GetTransCostLabourRateHour(SysId transactionId);
|
||||
public abstract bool DeliveryFinancialsAreAvailable();
|
||||
|
||||
/// <summary>Change Transaction Association.</summary>
|
||||
public abstract bool ChangeTransactionsAssociation(SbmTransaction transaction, SysId associationId);
|
||||
|
||||
public abstract bool RefreshTransactionTotals(SbmTransaction transaction, IEnumerable<SbmRequirement> requirements);
|
||||
|
||||
/// <summary>
|
||||
/// Refresh associated data:
|
||||
/// <para>- Refresh Stock Allocations.</para>
|
||||
/// <para>- Refresh totals.</para>
|
||||
/// </summary>
|
||||
public abstract bool RefreshAssociatedData(SbmTransaction transaction, List<SbmRequirement> requirements, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool RefreshAssociatedTransactions(SbmTransaction transaction, List<SbmRequirement> requirements, DbUpdateInfo dbUpdateInfo);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Associated data.
|
||||
public abstract bool TransactionIsReferencedByOtherTransactions(SysId transactionId/*, Sbm.TransactionStatusCat transactionStatusCat*/);
|
||||
|
||||
Reference in New Issue
Block a user