3.0.1.3 Requirements
This commit is contained in:
@@ -180,10 +180,10 @@ namespace Sarand.BusinessMgr.Net.Core.Procs.Procs
|
||||
{
|
||||
return Internals.GetCurrencyByCode(currencyCode);
|
||||
}
|
||||
protected static byte CurrencyDecimalsDefault { get { return SbmInternals.CurrencyDecimalsDefault; } }
|
||||
protected byte GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
protected static ushort CurrencyDecimalsDefault { get { return SbmInternals.CurrencyDecimalsDefault; } }
|
||||
protected ushort GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
{
|
||||
return Internals.GetCurrencyDecimalsForCurrencyById(currencyId);
|
||||
return Internals.GetCurrencyDecimalsById(currencyId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -202,6 +202,19 @@ namespace Sarand.BusinessMgr.Net.Core.Web.Components
|
||||
return value.Format("d-MMM-yy HH:mm", SessionCulture).TrimAll();
|
||||
}
|
||||
|
||||
// Display data - Numeric.
|
||||
public string FormatNumberForDisplay(decimal value, ushort decimals)
|
||||
{
|
||||
return value.ToString($"N{decimals}", SessionCulture);
|
||||
}
|
||||
|
||||
// Display data - Money.
|
||||
public string FormatMoneyForDisplay(decimal? value, ushort decimals)
|
||||
{
|
||||
if (value == null) return "";
|
||||
return ((decimal)value).ToString($"N{decimals}", SessionCulture);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Form data - Dates.
|
||||
// Format may depend on locale, but as long as these methods are used consistently,
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "3.0.1.2";
|
||||
private static String version { get; } = "3.0.1.3";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion() { return version; }
|
||||
public static String GetAppVersion()
|
||||
@@ -40,6 +40,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.1.3 02-Mar-25 Requirements.
|
||||
//-------------------------------------------------------------------
|
||||
// 3.0.0 Jul-2021 Initial demo test version.
|
||||
// 02-Feb-25 Initial live deployment.
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Consoles;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Core;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Mgr.Control;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.CodeTypes;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Diary;
|
||||
using Sarand.Net.Standard.Base.Email;
|
||||
using Sarand.Net.Standard.Base.Interfaces;
|
||||
using Sarand.Net.Standard.Base.ItemData;
|
||||
using Sarand.Net.Standard.Base.ItemDocs;
|
||||
using Sarand.Net.Standard.Base.ItemOptions;
|
||||
using Sarand.Net.Standard.Base.ReferenceData;
|
||||
using Sarand.Net.Standard.Base.Security;
|
||||
using Sarand.Net.Standard.Base.UpdateLog;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
{
|
||||
//=======================================================================
|
||||
// Internals - Reference Data.
|
||||
//=======================================================================
|
||||
partial class SbmInternals
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
// Reference data.
|
||||
private class ReferenceData
|
||||
{
|
||||
public Dictionary<SysId, SaRegion> Regions { get; set; } = null;
|
||||
public Dictionary<SysId, SaCurrency> Currencies { get; set; } = null;
|
||||
public Dictionary<SysId, SaTaxCode> TaxCodes { get; set; } = null;
|
||||
public Dictionary<SysId, SaUnitMeasure> UnitsOfMeasure { get; set; } = null;
|
||||
}
|
||||
private ReferenceData rfd { get; } = new ReferenceData();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// T a x C o d e s
|
||||
//-------------------------------------------------------------------
|
||||
private void populateRegions()
|
||||
{
|
||||
if (rfd.Regions != null) return;
|
||||
SaRegion.Params prmRegion = new SaRegion.Params();
|
||||
prmRegion.StatusCat = SaRegion.StatusCat.Any;
|
||||
rfd.Regions = ReferenceDataConsole.GetRegionList(prmRegion).ToDictionary(region => region.Id, region => region);
|
||||
}
|
||||
public List<SaRegion> GetRegions()
|
||||
{
|
||||
populateRegions();
|
||||
return new List<SaRegion>(rfd.Regions.Values);
|
||||
}
|
||||
public SaRegion GetRegionById(SysId regionId)
|
||||
{
|
||||
if (!SysId.IsValid(regionId)) return null;
|
||||
populateRegions();
|
||||
return rfd.Regions.GetValueOrDefault(regionId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C u r r e n c i e s
|
||||
//-------------------------------------------------------------------
|
||||
public static ushort CurrencyDecimalsDefault { get; } = 2;
|
||||
|
||||
// Current Currency - as defined by Organisation (or default).
|
||||
public String GetCurrentCurrencyCode()
|
||||
{
|
||||
return SaReferenceDataConsole.GetDefaultCurrencyCode();
|
||||
}
|
||||
public SaCurrency GetCurrentCurrency()
|
||||
{
|
||||
return GetCurrencies().FirstOrDefault(item => item.Code.EqualsCI(GetCurrentCurrencyCode()));
|
||||
}
|
||||
public ushort GetCurrentCurrencyDecimals()
|
||||
{
|
||||
return GetCurrencyDecimals(GetCurrentCurrency());
|
||||
}
|
||||
|
||||
// Currency Decimals.
|
||||
/// <summary>Constrain Currency Decimals - Min: 0, Max: 4.</summary>
|
||||
public static ushort GetCurrencyDecimals(ushort currencyDecimals)
|
||||
{
|
||||
return (ushort)Math.Min(4, Math.Max(0, (int)currencyDecimals));
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the number of decimal places for the specified currency.
|
||||
/// <br/>Defaults to 'Current' currency if not specified or found.
|
||||
/// </summary>
|
||||
public ushort GetCurrencyDecimals(SaCurrency currency)
|
||||
{
|
||||
ushort currencyDecimals = CurrencyDecimalsDefault;
|
||||
if (currency == null)
|
||||
currency = GetCurrentCurrency();
|
||||
if (currency != null)
|
||||
currencyDecimals = (ushort)currency.Decimals;
|
||||
return GetCurrencyDecimals(currencyDecimals);
|
||||
}
|
||||
/// <summary>
|
||||
/// Get the number of decimal places for the specified currency.
|
||||
/// <br/>Defaults to 'Current' currency if not specified or found.
|
||||
/// </summary>
|
||||
public ushort GetCurrencyDecimalsById(SysId currencyId)
|
||||
{
|
||||
return GetCurrencyDecimals(GetCurrencyById(currencyId));
|
||||
}
|
||||
|
||||
// Currencies.
|
||||
private void populateCurrencies()
|
||||
{
|
||||
if (rfd.Currencies != null) return;
|
||||
SaCurrency.Params prmCurrency = new SaCurrency.Params();
|
||||
prmCurrency.StatusCat = SaCurrency.StatusCat.Any;
|
||||
rfd.Currencies = ReferenceDataConsole.GetCurrencyList(prmCurrency).ToDictionary(currency => currency.Id, currency => currency);
|
||||
}
|
||||
public List<SaCurrency> GetCurrencies()
|
||||
{
|
||||
populateCurrencies();
|
||||
return new List<SaCurrency>(rfd.Currencies.Values);
|
||||
}
|
||||
public SaCurrency GetCurrencyById(SysId currencyId)
|
||||
{
|
||||
if (!SysId.IsValid(currencyId)) return null;
|
||||
populateCurrencies();
|
||||
return rfd.Currencies.GetValueOrDefault(currencyId);
|
||||
}
|
||||
public SaCurrency GetCurrencyByCode(String currencyCode)
|
||||
{
|
||||
if (StringUtil.IsBlank(currencyCode))
|
||||
return null;
|
||||
populateCurrencies();
|
||||
return rfd.Currencies.Values.FirstOrDefault(item => item.Code.EqualsCI(currencyCode));
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// T a x C o d e s
|
||||
//-------------------------------------------------------------------
|
||||
public String GetDefaultTaxCode()
|
||||
{
|
||||
return SaReferenceDataConsole.GetTaxCode(SaTaxCodeType.Std);
|
||||
}
|
||||
private void populateTaxCodes()
|
||||
{
|
||||
if (rfd.TaxCodes != null) return;
|
||||
SaTaxCode.Params prmTaxCode = new SaTaxCode.Params();
|
||||
prmTaxCode.StatusCat = SaTaxCode.StatusCat.Any;
|
||||
rfd.TaxCodes = ReferenceDataConsole.GetTaxCodeList(prmTaxCode).ToDictionary(taxCode => taxCode.Id, taxCode => taxCode);
|
||||
}
|
||||
public List<SaTaxCode> GetTaxCodes()
|
||||
{
|
||||
populateTaxCodes();
|
||||
return new List<SaTaxCode>(rfd.TaxCodes.Values);
|
||||
}
|
||||
public List<SaTaxCode> GetTaxCodesEffectiveOn(DateTime effectiveOn)
|
||||
{
|
||||
populateTaxCodes();
|
||||
return new List<SaTaxCode>(rfd.TaxCodes.Values.Where(tax => tax.IsEffectiveOn(effectiveOn)));
|
||||
}
|
||||
public SaTaxCode GetTaxCodeById(SysId taxCodeId)
|
||||
{
|
||||
if (!SysId.IsValid(taxCodeId)) return null;
|
||||
populateTaxCodes();
|
||||
return rfd.TaxCodes.GetValueOrDefault(taxCodeId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// U n i t s O f M e a s u r e
|
||||
//-------------------------------------------------------------------
|
||||
public SaUomType GetDefaultUomType()
|
||||
{
|
||||
return SaUomType.Pack_Each;
|
||||
}
|
||||
private void populateUnitsOfMeasure()
|
||||
{
|
||||
if (rfd.UnitsOfMeasure != null) return;
|
||||
SaUnitMeasure.Params prmUnitMeasure = new SaUnitMeasure.Params();
|
||||
prmUnitMeasure.StatusCat = SaUnitMeasure.StatusCat.Any;
|
||||
rfd.UnitsOfMeasure = ReferenceDataConsole.GetUnitMeasureList(prmUnitMeasure).ToDictionary(unitMeasure => unitMeasure.Id, unitMeasure => unitMeasure);
|
||||
}
|
||||
public List<SaUnitMeasure> GetUnitsOfMeasure()
|
||||
{
|
||||
populateUnitsOfMeasure();
|
||||
return new List<SaUnitMeasure>(rfd.UnitsOfMeasure.Values);
|
||||
}
|
||||
public SaUnitMeasure GetUnitOfMeasureById(SysId unitMeasureId)
|
||||
{
|
||||
if (!SysId.IsValid(unitMeasureId)) return null;
|
||||
populateUnitsOfMeasure();
|
||||
return rfd.UnitsOfMeasure.GetValueOrDefault(unitMeasureId);
|
||||
}
|
||||
public SaUnitMeasure GetDefaultUnitOfMeasureByCategory(SaUomCategory uomCategory)
|
||||
{
|
||||
populateUnitsOfMeasure();
|
||||
return rfd.UnitsOfMeasure.Values.FirstOrDefault(item => item.Category == uomCategory && item.CategoryDefault);
|
||||
}
|
||||
public SaUomType GetUnitOfMeasureType(SysId unitMeasureId)
|
||||
{
|
||||
return GetUnitOfMeasureById(unitMeasureId)?.UnitType ?? SaUomType.Unknown;
|
||||
}
|
||||
public String GetUnitOfMeasureCode(SysId unitMeasureId)
|
||||
{
|
||||
return GetUnitOfMeasureById(unitMeasureId)?.Code ?? "";
|
||||
}
|
||||
public String GetUnitOfMeasureCaption(SysId unitMeasureId)
|
||||
{
|
||||
return GetUnitOfMeasureById(unitMeasureId)?.GetCaption() ?? "";
|
||||
}
|
||||
public List<SaUnitMeasure> GetUnitsOfMeasureByCategory(SaUomCategory uomCategory)
|
||||
{
|
||||
if (uomCategory == 0) return null;
|
||||
populateUnitsOfMeasure();
|
||||
return new List<SaUnitMeasure>(rfd.UnitsOfMeasure.Values.Where(item => item.Category == uomCategory));
|
||||
}
|
||||
public SaUnitMeasure GetUnitOfMeasureByType(SaUomType uomType)
|
||||
{
|
||||
if (uomType == 0) return null;
|
||||
populateUnitsOfMeasure();
|
||||
return rfd.UnitsOfMeasure.Values.FirstOrDefault(item => item.UnitType == uomType);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -25,7 +25,9 @@ using System.Linq;
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
{
|
||||
//=======================================================================
|
||||
public class SbmInternals : SacsDisposable, ISbmOrganisationConfig
|
||||
// Internals.
|
||||
//=======================================================================
|
||||
public partial class SbmInternals : SacsDisposable, ISbmOrganisationConfig
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
@@ -94,11 +96,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
// Configurations.
|
||||
private SbmStockControlConfig stockControlConfig;
|
||||
private SbmRequirementCostingConfig requirementCostingConfig;
|
||||
// Reference data.
|
||||
private Dictionary<SysId, SaRegion> regions = null;
|
||||
private Dictionary<SysId, SaCurrency> currencies = null;
|
||||
private Dictionary<SysId, SaTaxCode> taxCodes = null;
|
||||
private Dictionary<SysId, SaUnitMeasure> unitsOfMeasure = null;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -132,11 +129,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
if (mgr.stockMgr != null) mgr.stockMgr.Dispose();
|
||||
if (mgr.processMgr != null) mgr.processMgr.Dispose();
|
||||
if (mgr.dataItemMgr != null) mgr.dataItemMgr.Dispose();
|
||||
// Reference data.
|
||||
if (regions != null) regions.Values.ToList().ClearAndDispose();
|
||||
if (currencies != null) currencies.Values.ToList().ClearAndDispose();
|
||||
if (taxCodes != null) taxCodes.Values.ToList().ClearAndDispose();
|
||||
if (unitsOfMeasure != null) unitsOfMeasure.Values.ToList().ClearAndDispose();
|
||||
// Consoles.
|
||||
// Database console doesn't require disposal.
|
||||
if (con.sessionConsole != null) con.sessionConsole.Dispose();
|
||||
@@ -488,153 +480,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.App
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// T a x C o d e s
|
||||
//-------------------------------------------------------------------
|
||||
private void populateRegions()
|
||||
{
|
||||
if (regions != null) return;
|
||||
SaRegion.Params prmRegion = new SaRegion.Params();
|
||||
prmRegion.StatusCat = SaRegion.StatusCat.Any;
|
||||
regions = ReferenceDataConsole.GetRegionList(prmRegion).ToDictionary(region => region.Id, region => region);
|
||||
}
|
||||
public List<SaRegion> GetRegions()
|
||||
{
|
||||
populateRegions();
|
||||
return new List<SaRegion>(regions.Values);
|
||||
}
|
||||
public SaRegion GetRegionById(SysId regionId)
|
||||
{
|
||||
if (!SysId.IsValid(regionId)) return null;
|
||||
populateRegions();
|
||||
return regions.GetValueOrDefault(regionId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C u r r e n c i e s
|
||||
//-------------------------------------------------------------------
|
||||
private void populateCurrencies()
|
||||
{
|
||||
if (currencies != null) return;
|
||||
SaCurrency.Params prmCurrency = new SaCurrency.Params();
|
||||
prmCurrency.StatusCat = SaCurrency.StatusCat.Any;
|
||||
currencies = ReferenceDataConsole.GetCurrencyList(prmCurrency).ToDictionary(currency => currency.Id, currency => currency);
|
||||
}
|
||||
public List<SaCurrency> GetCurrencies()
|
||||
{
|
||||
populateCurrencies();
|
||||
return new List<SaCurrency>(currencies.Values);
|
||||
}
|
||||
public SaCurrency GetCurrencyById(SysId currencyId)
|
||||
{
|
||||
if (!SysId.IsValid(currencyId)) return null;
|
||||
populateCurrencies();
|
||||
return currencies.GetValueOrDefault(currencyId);
|
||||
}
|
||||
public SaCurrency GetCurrencyByCode(String currencyCode)
|
||||
{
|
||||
if (StringUtil.IsBlank(currencyCode))
|
||||
return null;
|
||||
populateCurrencies();
|
||||
return currencies.Values.Where(item => item.Code.EqualsCI(currencyCode)).FirstOrDefault();
|
||||
}
|
||||
// Currency Decimals.
|
||||
public static byte CurrencyDecimalsDefault { get; } = 2;
|
||||
public byte GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
{
|
||||
byte currencyDecimals = CurrencyDecimalsDefault;
|
||||
SaCurrency currency = GetCurrencyById(currencyId);
|
||||
if (currency != null)
|
||||
currencyDecimals = (byte)Math.Min(4, Math.Max(0, (int)currency.Decimals));
|
||||
return currencyDecimals;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// T a x C o d e s
|
||||
//-------------------------------------------------------------------
|
||||
public String GetDefaultTaxCode()
|
||||
{
|
||||
return StringUtil.OnBlank(SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.TaxCodeType).GetCodeForType(SaTaxCodeType.Std), $"{SaTaxCodeType.Std}");
|
||||
}
|
||||
private void populateTaxCodes()
|
||||
{
|
||||
if (taxCodes != null) return;
|
||||
SaTaxCode.Params prmTaxCode = new SaTaxCode.Params();
|
||||
prmTaxCode.StatusCat = SaTaxCode.StatusCat.Any;
|
||||
taxCodes = ReferenceDataConsole.GetTaxCodeList(prmTaxCode).ToDictionary(taxCode => taxCode.Id, taxCode => taxCode);
|
||||
}
|
||||
public List<SaTaxCode> GetTaxCodes()
|
||||
{
|
||||
populateTaxCodes();
|
||||
return new List<SaTaxCode>(taxCodes.Values);
|
||||
}
|
||||
public List<SaTaxCode> GetTaxCodesEffectiveOn(DateTime effectiveOn)
|
||||
{
|
||||
populateTaxCodes();
|
||||
return new List<SaTaxCode>(taxCodes.Values.Where(tax => tax.IsEffectiveOn(effectiveOn)));
|
||||
}
|
||||
public SaTaxCode GetTaxCodeById(SysId taxCodeId)
|
||||
{
|
||||
if (!SysId.IsValid(taxCodeId)) return null;
|
||||
populateTaxCodes();
|
||||
return taxCodes.GetValueOrDefault(taxCodeId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// U n i t s O f M e a s u r e
|
||||
//-------------------------------------------------------------------
|
||||
public SaUomType GetDefaultUomType()
|
||||
{
|
||||
return SaUomType.Pack_Each;
|
||||
}
|
||||
private void populateUnitsOfMeasure()
|
||||
{
|
||||
if (unitsOfMeasure != null) return;
|
||||
SaUnitMeasure.Params prmUnitMeasure = new SaUnitMeasure.Params();
|
||||
prmUnitMeasure.StatusCat = SaUnitMeasure.StatusCat.Any;
|
||||
unitsOfMeasure = ReferenceDataConsole.GetUnitMeasureList(prmUnitMeasure).ToDictionary(unitMeasure => unitMeasure.Id, unitMeasure => unitMeasure);
|
||||
}
|
||||
public List<SaUnitMeasure> GetUnitsOfMeasure()
|
||||
{
|
||||
populateUnitsOfMeasure();
|
||||
return new List<SaUnitMeasure>(unitsOfMeasure.Values);
|
||||
}
|
||||
public SaUnitMeasure GetUnitOfMeasureById(SysId unitMeasureId)
|
||||
{
|
||||
if (!SysId.IsValid(unitMeasureId)) return null;
|
||||
populateUnitsOfMeasure();
|
||||
return unitsOfMeasure.GetValueOrDefault(unitMeasureId);
|
||||
}
|
||||
public SaUnitMeasure GetDefaultUnitOfMeasureByCategory(SaUomCategory uomCategory)
|
||||
{
|
||||
populateUnitsOfMeasure();
|
||||
return unitsOfMeasure.Values.FirstOrDefault(item => item.Category == uomCategory && item.CategoryDefault);
|
||||
}
|
||||
public SaUomType GetUnitOfMeasureType(SysId unitMeasureId)
|
||||
{
|
||||
return GetUnitOfMeasureById(unitMeasureId)?.UnitType ?? SaUomType.Unknown;
|
||||
}
|
||||
public String GetUnitOfMeasureCode(SysId unitMeasureId)
|
||||
{
|
||||
return GetUnitOfMeasureById(unitMeasureId)?.Code ?? "";
|
||||
}
|
||||
public String GetUnitOfMeasureCaption(SysId unitMeasureId)
|
||||
{
|
||||
return GetUnitOfMeasureById(unitMeasureId)?.GetCaption() ?? "";
|
||||
}
|
||||
public List<SaUnitMeasure> GetUnitsOfMeasureByCategory(SaUomCategory uomCategory)
|
||||
{
|
||||
if (uomCategory == 0) return null;
|
||||
populateUnitsOfMeasure();
|
||||
return new List<SaUnitMeasure>(unitsOfMeasure.Values.Where(item => item.Category == uomCategory));
|
||||
}
|
||||
public SaUnitMeasure GetUnitOfMeasureByType(SaUomCategory uomCategory, SaUomType uomType)
|
||||
{
|
||||
if (uomCategory == 0 || uomType == 0) return null;
|
||||
populateUnitsOfMeasure();
|
||||
return unitsOfMeasure.Values.Where(item => item.Category == uomCategory && item.UnitType == uomType).FirstOrDefault();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation configuration.
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -1131,6 +1131,11 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
|
||||
return new SbmItemId(Sbm.ItemType.Commodity, Id);
|
||||
}
|
||||
|
||||
public String GetCaption()
|
||||
{
|
||||
return StringUtil.TrimWhitespace($"{Code} - {DescBrief}");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
|
||||
@@ -91,30 +91,30 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
|
||||
// Transaction types cannot be created locally if they are either imported from or exported to Sage.
|
||||
// In the case of exports, it is the 'proforma' equivalent that can be created for export.
|
||||
createTransaction_PurchaseOrder = true;
|
||||
createTransaction_SalesQuote = true;
|
||||
createTransaction_SalesOrder = true;
|
||||
createTrans_SalesInvoice = true;
|
||||
if (createTransaction_PurchaseOrder) createTransaction_PurchaseOrder = !dfnSageInt.importPurchaseOrder && !dfnSageInt.exportPurchaseOrder;
|
||||
if (createTransaction_SalesOrder) createTransaction_SalesOrder = !dfnSageInt.importSalesOrder && !dfnSageInt.exportSalesOrder;
|
||||
if (createTrans_SalesInvoice) createTrans_SalesInvoice = !dfnSageInt.importProductInvoice && !dfnSageInt.exportProductInvoice && !dfnSageInt.importServiceInvoice && !dfnSageInt.exportServiceInvoice && !dfnSageInt.importSalesOrderInvoice && !dfnSageInt.bexport_SalesOrderInvoice;
|
||||
if (createTransaction_PurchaseOrder) createTransaction_PurchaseOrder = !dfnQBooksInt.importPurchaseOrder && !dfnQBooksInt.exportPurchaseOrder;
|
||||
if (createTransaction_SalesOrder) createTransaction_SalesOrder = !dfnQBooksInt.importSalesOrder && !dfnQBooksInt.exportSalesOrder;
|
||||
if (createTrans_SalesInvoice) createTrans_SalesInvoice = !dfnQBooksInt.importProductInvoice && !dfnQBooksInt.exportProductInvoice && !dfnQBooksInt.importServiceInvoice && !dfnQBooksInt.exportServiceInvoice && !dfnQBooksInt.importSalesOrderInvoice && !dfnQBooksInt.bexport_SalesOrderInvoice;
|
||||
mbr.CreateTransaction_PurchaseOrder = true;
|
||||
mbr.CreateTransaction_SalesQuote = true;
|
||||
mbr.CreateTransaction_SalesOrder = true;
|
||||
mbr.CreateTransaction_SalesInvoice = true;
|
||||
if (mbr.CreateTransaction_PurchaseOrder) mbr.CreateTransaction_PurchaseOrder = !dfnSageInt.importPurchaseOrder && !dfnSageInt.exportPurchaseOrder;
|
||||
if (mbr.CreateTransaction_SalesOrder) mbr.CreateTransaction_SalesOrder = !dfnSageInt.importSalesOrder && !dfnSageInt.exportSalesOrder;
|
||||
if (mbr.CreateTransaction_SalesInvoice) mbr.CreateTransaction_SalesInvoice = !dfnSageInt.importProductInvoice && !dfnSageInt.exportProductInvoice && !dfnSageInt.importServiceInvoice && !dfnSageInt.exportServiceInvoice && !dfnSageInt.importSalesOrderInvoice && !dfnSageInt.bexport_SalesOrderInvoice;
|
||||
if (mbr.CreateTransaction_PurchaseOrder) mbr.CreateTransaction_PurchaseOrder = !dfnQBooksInt.importPurchaseOrder && !dfnQBooksInt.exportPurchaseOrder;
|
||||
if (mbr.CreateTransaction_SalesOrder) mbr.CreateTransaction_SalesOrder = !dfnQBooksInt.importSalesOrder && !dfnQBooksInt.exportSalesOrder;
|
||||
if (mbr.CreateTransaction_SalesInvoice) mbr.CreateTransaction_SalesInvoice = !dfnQBooksInt.importProductInvoice && !dfnQBooksInt.exportProductInvoice && !dfnQBooksInt.importServiceInvoice && !dfnQBooksInt.exportServiceInvoice && !dfnQBooksInt.importSalesOrderInvoice && !dfnQBooksInt.bexport_SalesOrderInvoice;
|
||||
|
||||
// Sales quotes are also imported from Sage Sales Orders.
|
||||
createTransaction_SalesQuote = createTransaction_SalesOrder;
|
||||
mbr.CreateTransaction_SalesQuote = mbr.CreateTransaction_SalesOrder;
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
case Sbm.TransactionType.SalesQuote:
|
||||
return createTransaction_SalesQuote;
|
||||
return mbr.CreateTransaction_SalesQuote;
|
||||
case Sbm.TransactionType.SalesOrder:
|
||||
return createTransaction_SalesOrder;
|
||||
return mbr.CreateTransaction_SalesOrder;
|
||||
case Sbm.TransactionType.SalesInvoice:
|
||||
return createTrans_SalesInvoice;
|
||||
return mbr.CreateTransaction_SalesInvoice;
|
||||
case Sbm.TransactionType.PurchaseOrder:
|
||||
return createTransaction_PurchaseOrder;
|
||||
return mbr.CreateTransaction_PurchaseOrder;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -337,8 +337,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
{
|
||||
// Build the list of transaction types that are allowed to be raised from the specified type.
|
||||
List<TypeCodeDesc> transTypes = new List<TypeCodeDesc>();
|
||||
if (transactionTypes_Full.Count == 0) transactionTypes_Full = Internals.GetSystemCodes(Sbm.SystemCode.TransactionType);
|
||||
foreach (TypeCodeDesc transTypeTo in transactionTypes_Full)
|
||||
if (mbr.TransactionTypes_Full == null) mbr.TransactionTypes_Full = Internals.GetSystemCodes(Sbm.SystemCode.TransactionType);
|
||||
foreach (TypeCodeDesc transTypeTo in mbr.TransactionTypes_Full)
|
||||
{
|
||||
//if ((Sbm.TransactionType)typeTo.iType == typeFrom) continue;
|
||||
if (CanRaiseTransaction(typeFrom, (Sbm.TransactionType)transTypeTo.Type))
|
||||
@@ -352,9 +352,9 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
{
|
||||
// Build the list of transaction types that are allowed to be raised to the specified type.
|
||||
List<TypeCodeDesc> transTypes = new List<TypeCodeDesc>();
|
||||
if (transactionTypes_Full.Count == 0) transactionTypes_Full = Internals.GetSystemCodes(Sbm.SystemCode.TransactionType);
|
||||
if (mbr.TransactionTypes_Full.Count == 0) mbr.TransactionTypes_Full = Internals.GetSystemCodes(Sbm.SystemCode.TransactionType);
|
||||
//transTypes_Full.GotoStart();
|
||||
foreach (TypeCodeDesc transTypeTo in transactionTypes_Full)
|
||||
foreach (TypeCodeDesc transTypeTo in mbr.TransactionTypes_Full)
|
||||
{
|
||||
//TypeCodeDesc & typeTo = transTypes_Full.Index();
|
||||
if ((Sbm.TransactionType)transTypeTo.Type == typeTo) continue;
|
||||
|
||||
@@ -78,15 +78,14 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
this.InternalsSupplied = internalsSupplied;
|
||||
}
|
||||
public SbmInternals InternalsSupplied { get; }
|
||||
public SbmInstanceConfig InstanceConfig { get; set; }
|
||||
public SbmOrganisationConfig OrganisationConfig { get; set; }
|
||||
public List<TypeCodeDesc> TransactionTypes_Full { get;set; }
|
||||
public bool CreateTransaction_PurchaseOrder, CreateTransaction_SalesQuote, CreateTransaction_SalesOrder, CreateTransaction_SalesInvoice;
|
||||
}
|
||||
private DataMembers mbr { get; }
|
||||
private List<TypeCodeDesc> transactionTypes_Full = new List<TypeCodeDesc>();
|
||||
private SbmInstanceConfig instanceConfig;
|
||||
private SbmOrganisationConfig organisationConfig;
|
||||
private AccountsInterfaceDfn dfnSageInt = new AccountsInterfaceDfn();
|
||||
private AccountsInterfaceDfn dfnQBooksInt = new AccountsInterfaceDfn();
|
||||
private bool createTransaction_PurchaseOrder, createTransaction_SalesQuote, createTransaction_SalesOrder, createTrans_SalesInvoice;
|
||||
private bool productionControl;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -112,8 +111,8 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
private SbmInternals Internals { get { return mbr.InternalsSupplied; } }
|
||||
public ISbmUserOrganisationContext UserContext { get { return Internals.UserContext; } }
|
||||
public SbmSessionContext SessionContext { get { return Internals.SessionContext; } }
|
||||
public SbmInstanceConfig InstanceConfig { get { if (instanceConfig == null) { instanceConfig = SbmGlobals.Application.GetInstanceConfig(SessionContext); } return instanceConfig; } }
|
||||
public SbmOrganisationConfig OrganisationConfig { get { if (organisationConfig == null) { organisationConfig = SbmGlobals.Application.GetOrganisationConfig(UserContext); } return organisationConfig; } }
|
||||
public SbmInstanceConfig InstanceConfig { get { if (mbr.InstanceConfig == null) { mbr.InstanceConfig = SbmGlobals.Application.GetInstanceConfig(SessionContext); } return mbr.InstanceConfig; } }
|
||||
public SbmOrganisationConfig OrganisationConfig { get { if (mbr.OrganisationConfig == null) { mbr.OrganisationConfig = SbmGlobals.Application.GetOrganisationConfig(UserContext); } return mbr.OrganisationConfig; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// C r e a t e C o n s o l e
|
||||
@@ -326,7 +325,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Consoles
|
||||
// Update Log.
|
||||
public virtual bool IsColumnChangeLogged(SbmDbDfn.ColumnIdx column)
|
||||
{
|
||||
return instanceConfig.IsColumnChangeLogged(column, false);
|
||||
return InstanceConfig.IsColumnChangeLogged(column, false);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
using Org.BouncyCastle.Asn1.Ocsp;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.ReferenceData;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.Helpers
|
||||
{
|
||||
//=======================================================================
|
||||
public static class SbmRequirementHelper
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public static decimal Round(decimal? value, ushort decimals)
|
||||
{
|
||||
return Decimal.Round((decimal)value, decimals, MidpointRounding.AwayFromZero);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Calculate Requirement amounts.
|
||||
public class CalculateRequest
|
||||
{
|
||||
public CalculateRequest(SbmInternals internals) { this.Internals = internals; }
|
||||
public SbmInternals Internals { get; }
|
||||
public SysId TransactionId { get; set; }
|
||||
public Sbm.TransactionType TransactionType { get; set; }
|
||||
public SysId CommodityId { get; set; }
|
||||
public SysId CurrencyId { get; set; }
|
||||
public String TaxCode { get; set; }
|
||||
public DateTime TaxEffective { get; set; } = DateTime.Today;
|
||||
public decimal AmountUnit { get; set; }
|
||||
public decimal Quantity { get; set; }
|
||||
public decimal PercentDiscount { get; set; }
|
||||
public decimal AmountDiscount { get; set; }
|
||||
}
|
||||
public class CalculateRespose
|
||||
{
|
||||
public decimal? AmountUnit { get; set; }
|
||||
public decimal? Quantity { get; set; }
|
||||
public decimal? AmountAct { get; set; }
|
||||
public decimal? PercentDisc { get; set; }
|
||||
public decimal? AmountDisc { get; set; }
|
||||
public decimal? AmountNet { get; set; }
|
||||
public decimal? RateTax { get; set; }
|
||||
public decimal? AmountTax { get; set; }
|
||||
public decimal? AmountTot { get; set; }
|
||||
public bool Success { get; set; }
|
||||
}
|
||||
public static CalculateRespose Calculate(CalculateRequest request)
|
||||
{
|
||||
CalculateRespose response = new CalculateRespose();
|
||||
|
||||
// Transaction.
|
||||
// Currently only retrieved if Transaction type not specified.
|
||||
if (request.TransactionType == 0)
|
||||
{
|
||||
SysId transactionId = request.TransactionId;
|
||||
SbmTransaction transaction = request.Internals.TransactionMgr.GetTransactionById(transactionId);
|
||||
if (transaction == null && SysId.IsValid(transactionId))
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Transaction. Id: {transactionId}");
|
||||
return response;
|
||||
}
|
||||
if (transaction != null) request.TransactionType = transaction.TransactionType;
|
||||
if (request.TransactionType <= 0)
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Transaction type not specified.");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
// Commodity. [not required as yet]
|
||||
bool retrieveCommodity = false;
|
||||
if (retrieveCommodity)
|
||||
{
|
||||
SysId commodityId = request.CommodityId;
|
||||
SbmCommodity commodity = request.Internals.CommodityMgr.GetCommodityById(commodityId);
|
||||
if (commodity == null && SysId.IsValid(commodityId))
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Commodity. Id: {commodityId}");
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
// Currency.
|
||||
ushort currencyDecimals = request.Internals.GetCurrencyDecimalsById(request.CurrencyId);
|
||||
|
||||
// Unit amount.
|
||||
// NB Use the supplied amount rather than reverting to the Commodity price as the Unit Amount may have been manually modified.
|
||||
response.AmountUnit = Round(request.AmountUnit, currencyDecimals);
|
||||
|
||||
// Actual amount.
|
||||
response.Quantity = request.Quantity;
|
||||
response.AmountAct = Round(response.AmountUnit * response.Quantity, currencyDecimals);
|
||||
|
||||
// Discount.
|
||||
response.AmountDisc = request.AmountDiscount;
|
||||
if (Math.Abs((decimal)response.AmountDisc) < 0.01m && Math.Abs(request.PercentDiscount) > 0.01m && Math.Abs(request.PercentDiscount) < 100.0m)
|
||||
response.AmountDisc = response.AmountAct * request.PercentDiscount / 100.0m;
|
||||
response.AmountDisc = Round(response.AmountDisc * response.Quantity, currencyDecimals);
|
||||
|
||||
// Net amount.
|
||||
response.AmountNet = Round(response.AmountAct - response.AmountDisc, currencyDecimals);
|
||||
|
||||
// Tax.
|
||||
SaTaxCode taxCode = request.Internals.GetTaxCodesEffectiveOn(request.TaxEffective).FirstOrDefault(tax => tax.Code.EqualsCI(request.TaxCode));
|
||||
response.RateTax = taxCode?.TaxRate ?? 0.0m;
|
||||
response.AmountTax = Round(response.AmountNet * response.RateTax / 100.0m, currencyDecimals);
|
||||
|
||||
// Total amount.
|
||||
response.AmountTot = Round(response.AmountNet + response.AmountTax, currencyDecimals);
|
||||
|
||||
response.Success = true;
|
||||
return response;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.Helpers
|
||||
{
|
||||
//=======================================================================
|
||||
public static class SbmTransactionHelper
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -239,10 +239,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
{
|
||||
return Internals.GetCurrencyByCode(currencyCode);
|
||||
}
|
||||
protected static byte CurrencyDecimalsDefault { get { return SbmInternals.CurrencyDecimalsDefault; } }
|
||||
protected byte GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
protected static ushort CurrencyDecimalsDefault { get { return SbmInternals.CurrencyDecimalsDefault; } }
|
||||
protected ushort GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
{
|
||||
return Internals.GetCurrencyDecimalsForCurrencyById(currencyId);
|
||||
return Internals.GetCurrencyDecimalsById(currencyId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -9,6 +9,7 @@ using Sarand.Net.Standard.Base.ReferenceData;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using static Sarand.BusinessMgr.Net.Standard.Base.App.Sbm;
|
||||
|
||||
namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
{
|
||||
@@ -28,22 +29,27 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Mgr
|
||||
// Transaction properties.
|
||||
public abstract Sbm.TransactionType GetTransactionType(SysId transactionId);
|
||||
|
||||
public DateTime GetTransactionTaxEffectiveDate(SbmTransaction transaction)
|
||||
// Tax Effective date.
|
||||
public DateTime GetTransactionTaxEffectiveDate(Sbm.TransactionType transactionType, SaStatus status, DateTime raised, DateTime inProgress)
|
||||
{
|
||||
// Original thinking was that the status would have an effect on the tax point.
|
||||
SbmTransaction.StatusCat transactionStatusCat = SbmTransaction.GetCategoryForStatus(transaction.Status);
|
||||
SbmTransaction.StatusCat transactionStatusCat = SbmTransaction.GetCategoryForStatus(status);
|
||||
|
||||
// Nov-08 Current thinking is that the only differences is whether the 'In Progress' date has been specified and whether that should be used in preference to the 'Raised' date.
|
||||
if (DateUtil.IsValid(transaction.InProgress) && (transactionStatusCat == SbmTransaction.StatusCat.Open || transactionStatusCat == SbmTransaction.StatusCat.Closed))
|
||||
if (DateUtil.IsValid(inProgress) && (transactionStatusCat == SbmTransaction.StatusCat.Open || transactionStatusCat == SbmTransaction.StatusCat.Closed))
|
||||
{
|
||||
if (SessionConsole.UseInProgressTaxDateAsTaxPoint(transaction.TransactionType))
|
||||
return transaction.InProgress;
|
||||
if (SessionConsole.UseInProgressTaxDateAsTaxPoint(transactionType))
|
||||
return inProgress;
|
||||
}
|
||||
// Otherwise, use 'Raised' date.
|
||||
if (DateUtil.IsValid(transaction.Raised))
|
||||
return transaction.Raised;
|
||||
if (DateUtil.IsValid(raised))
|
||||
return raised;
|
||||
return DateTime.Today;
|
||||
}
|
||||
public DateTime GetTransactionTaxEffectiveDate(SbmTransaction transaction)
|
||||
{
|
||||
return GetTransactionTaxEffectiveDate(transaction.TransactionType, transaction.Status, transaction.Raised, transaction.InProgress);
|
||||
}
|
||||
|
||||
// Labour cost.
|
||||
public abstract decimal GetTransCostLabourRateHourDefault();
|
||||
|
||||
@@ -95,10 +95,10 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Procs
|
||||
{
|
||||
return Internals.GetCurrencyByCode(currencyCode);
|
||||
}
|
||||
protected static byte CurrencyDecimalsDefault { get { return SbmInternals.CurrencyDecimalsDefault; } }
|
||||
protected byte GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
protected static ushort CurrencyDecimalsDefault { get { return SbmInternals.CurrencyDecimalsDefault; } }
|
||||
protected ushort GetCurrencyDecimalsForCurrencyById(SysId currencyId)
|
||||
{
|
||||
return Internals.GetCurrencyDecimalsForCurrencyById(currencyId);
|
||||
return Internals.GetCurrencyDecimalsById(currencyId);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
ClearErrorState();
|
||||
if (requirement == null) return SetErrorState(ErrorMessage.InvalidStatus);
|
||||
int decimalsCurrency = 2;
|
||||
int decimalsCurrency = SbmInternals.CurrencyDecimalsDefault;
|
||||
|
||||
// Calculate intermediate amounts.
|
||||
if (requirement.AmountAct == 0.0m)
|
||||
|
||||
@@ -891,4 +891,10 @@
|
||||
<data name="label.desc.detail" xml:space="preserve">
|
||||
<value>Detail desc</value>
|
||||
</data>
|
||||
<data name="caption.requirement.update" xml:space="preserve">
|
||||
<value>Update Requirement</value>
|
||||
</data>
|
||||
<data name="caption.requirement.create" xml:space="preserve">
|
||||
<value>Create Requirement</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
using Microsoft.AspNetCore.Mvc.Filters;
|
||||
using Newtonsoft.Json;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.Components;
|
||||
|
||||
@@ -230,6 +230,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Consoles
|
||||
if (HasErrorState()) return false;
|
||||
SysId affilliateIdOwner = data.AffiliateIdOrganisation;
|
||||
Dictionary<SaUomType, SaUnitMeasure> uomTypes = Internals.GetUnitsOfMeasure().ToDictionary(item => item.UnitType, item => item);
|
||||
SaTaxCode taxCode = Internals.GetTaxCodesEffectiveOn(DateTime.Today).FirstOrDefault(item => item.Code.EqualsCI(SaReferenceDataConsole.GetStdTaxCode()));
|
||||
if (taxCode == null)
|
||||
taxCode = Internals.GetTaxCodes().OrderByDescending(item => item.EffectFrom).FirstOrDefault(item => item.Code.EqualsCI(SaReferenceDataConsole.GetStdTaxCode()));
|
||||
|
||||
foreach (var commodityData in data.Commodities)
|
||||
{
|
||||
@@ -237,6 +240,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Consoles
|
||||
commodity.DescBrief = commodityData.Caption;
|
||||
commodity.SalesPrice = commodityData.SalePrice;
|
||||
commodity.UomIdSale = uomTypes.GetValueOrDefault(commodityData.SaleUnitType)?.Id;
|
||||
commodity.TaxCodeId = taxCode?.Id;
|
||||
commodity.Notes = commodityData.Notes;
|
||||
if (Internals.CommodityMgr.InsertCommodity(commodity, DbUpdateInfo))
|
||||
{
|
||||
|
||||
+49
-30
@@ -39,60 +39,79 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
}
|
||||
private class CommodityItemData : CommodityListData
|
||||
{
|
||||
// Affiliate properties with specific handling.
|
||||
// Item properties with specific handling.
|
||||
public String TypeCode { get; set; }
|
||||
public String TypeDesc { get; set; }
|
||||
public String SalesUnitType { get; set; }
|
||||
}
|
||||
private void PopulateCommodityResponseListData(SbmCommodity commodity, CommodityListData data)
|
||||
private void PopulateCommodityResponseListData(SbmModel_Portal model, SbmCommodity commodity, CommodityListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(commodity.Id);
|
||||
}
|
||||
private void PopulateCommodityResponseItemData(SbmCommodity commodity, CommodityItemData data, HashSet<CommodityDataGroup> dataGroups)
|
||||
private void PopulateCommodityResponseItemData(SbmModel_Portal model, SbmCommodity commodity, CommodityItemData data, HashSet<CommodityDataGroup> dataGroups)
|
||||
{
|
||||
PopulateCommodityResponseListData(commodity, data as CommodityListData);
|
||||
PopulateCommodityResponseListData(model, commodity, data as CommodityListData);
|
||||
// Prominent properties for selecting and editing.
|
||||
data.Code = commodity.Code;
|
||||
data.Caption = commodity.DescBrief;
|
||||
// Affiliate type - populate for list ('Type' property populated with desc) and form (Type Code & Desc).
|
||||
data.Caption = commodity.GetCaption();
|
||||
// Commodity type - populate for list ('Type' property populated with desc) and form (Type Code & Desc).
|
||||
data.TypeCode = Internals.CommodityTypeCodes.GetCodeForType(commodity.CommodityType);
|
||||
data.TypeDesc = Internals.CommodityTypeCodes.GetDescForType(commodity.CommodityType);
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.Type}", Internals.CommodityTypeCodes.GetDescForType(commodity.CommodityType));
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.Type}", Internals.CommodityTypeCodes.GetCodeForType(commodity.CommodityType));
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.TypeDesc}", Internals.CommodityTypeCodes.GetDescForType(commodity.CommodityType));
|
||||
// Commodity properties.
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.Code}", commodity.Code);
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.DescBrief}", commodity.DescBrief);
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.DrawingIssue}", commodity.DrawingIssue);
|
||||
|
||||
// Sales.
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SalesPriceFmt}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.SalesPrice, SbmInternals.CurrencyDecimalsDefault, 0, ',')));
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SalesUnit}", StringUtil.NullOnBlank(Internals.GetUnitOfMeasureCaption(commodity.UomIdSale)));
|
||||
if (model.UserCanViewCommodityFinancials_Sales())
|
||||
{
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SaleAmountFmt}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.SalesPrice, SbmInternals.CurrencyDecimalsDefault, 0, ',')));
|
||||
}
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SaleUnit}", StringUtil.NullOnBlank(Internals.GetUnitOfMeasureCaption(commodity.UomIdSale)));
|
||||
if (dataGroups != null && dataGroups.Contains(CommodityDataGroup.Sales))
|
||||
{
|
||||
// Sales.
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SalesPrice}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.SalesPrice, SbmInternals.CurrencyDecimalsDefault)));
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SalesTaxCode}", Internals.GetTaxCodeById(commodity.TaxCodeId)?.Code);
|
||||
if (model.UserCanViewCommodityFinancials_Sales())
|
||||
{
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SaleAmount}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.SalesPrice, SbmInternals.CurrencyDecimalsDefault)));
|
||||
}
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SaleTaxCode}", Internals.GetTaxCodeById(commodity.TaxCodeId)?.Code);
|
||||
data.SalesUnitType = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureType(commodity.UomIdSale));
|
||||
if (commodity.PackQtySale > 0)
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SalesPackQty}", $"{commodity.PackQtySale}");
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.SalePackQty}", $"{commodity.PackQtySale}");
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.AssocIdCustomer}", StringUtil.NullOnBlank(SysId.ToString(commodity.AssociationIdCustomer)));
|
||||
}
|
||||
|
||||
// Purchasing.
|
||||
if (model.UserCanViewCommodityFinancials_Supply())
|
||||
{
|
||||
//if (model.GetInternals().SessionConsole.GetOwnerOption_ShowColumn(Sbm.OrgOption_ShowColumn.Commodity_CostPrice))
|
||||
// data.Field.Value.Add($"{Model_Commodity.ItemField.AmountCostFmt}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.CostPrice, SbmInternals.CurrencyDecimalsDefault, 0, ',')));
|
||||
}
|
||||
if (dataGroups != null && dataGroups.Contains(CommodityDataGroup.Purchasing))
|
||||
{
|
||||
// Purchasing.
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.CostPrice}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.CostPrice, SbmInternals.CurrencyDecimalsDefault)));
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.CostPriceFmt}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.CostPrice, SbmInternals.CurrencyDecimalsDefault, 0, ',')));
|
||||
if (model.UserCanViewCommodityFinancials_Supply())
|
||||
{
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.AmountCost}", StringUtil.NullOnBlank(StringUtil.FormatNumeric(commodity.CostPrice, SbmInternals.CurrencyDecimalsDefault)));
|
||||
}
|
||||
data.Field.Value.Add($"{Model_Commodity.ItemField.AssocIdSupplier}", StringUtil.NullOnBlank(SysId.ToString(commodity.AssociationIdSupplier)));
|
||||
}
|
||||
|
||||
// Specification.
|
||||
if (dataGroups != null && dataGroups.Contains(CommodityDataGroup.Specification))
|
||||
{
|
||||
// Specification.
|
||||
}
|
||||
|
||||
// Production.
|
||||
if (dataGroups != null && dataGroups.Contains(CommodityDataGroup.Production))
|
||||
{
|
||||
// Production.
|
||||
}
|
||||
|
||||
// Common properties.
|
||||
data.StatusCode = commodity.StatusCode;
|
||||
data.StatusDesc = commodity.StatusDesc;
|
||||
@@ -120,11 +139,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
// Reference data.
|
||||
public List<ItemCodeDesc> CommodityTypes { get; } = new List<ItemCodeDesc>();
|
||||
public String CommodityTypeDefault { get; set; }
|
||||
public List<TaxCode> TaxCodes { get; } = new List<TaxCode>();
|
||||
public String taxCodeDefault { get; set; }
|
||||
public List<TaxCodeData> TaxCodes { get; } = new List<TaxCodeData>();
|
||||
public String TaxCodeDefault { get; set; }
|
||||
public List<ItemCodeDesc> UomCats { get; } = new List<ItemCodeDesc>();
|
||||
public List<ItemCodeDesc> UomTypes { get; } = new List<ItemCodeDesc>();
|
||||
public String uomTypeDefault { get; set; }
|
||||
public String UomTypeDefault { get; set; }
|
||||
public List<UomData> Uoms { get; set; } = new List<UomData>();
|
||||
public List<ItemCodeDesc> Statuses { get; } = new List<ItemCodeDesc>();
|
||||
public String DefaultStatusCode { get; set; }
|
||||
@@ -169,8 +188,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
|
||||
// Tax codes.
|
||||
DateTime taxEffectiveOn = DateTime.Today;
|
||||
responseData.Data.TaxCodes.AddRange(Internals.GetTaxCodesEffectiveOn(taxEffectiveOn).Select(tax => new AjaxResponse_Data.TaxCode() { Id = $"{SysId.ToLong(tax.Id)}", Code = tax.Code, Caption = tax.GetCaption(), Rate = tax.TaxRate }));
|
||||
responseData.Data.taxCodeDefault = Internals.GetDefaultTaxCode();
|
||||
responseData.Data.TaxCodes.AddRange(Internals.GetTaxCodesEffectiveOn(taxEffectiveOn).Select(tax => new AjaxResponse_Data.TaxCodeData() { Id = $"{SysId.ToLong(tax.Id)}", Code = tax.Code, Caption = tax.GetCaption(), Rate = tax.TaxRate }));
|
||||
responseData.Data.TaxCodeDefault = Internals.GetDefaultTaxCode();
|
||||
|
||||
// Units of measure.
|
||||
List<TypeCodeDesc> uomCategories = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureCategory);
|
||||
@@ -187,7 +206,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
Caption = uom.GetCaption()
|
||||
});
|
||||
}
|
||||
responseData.Data.uomTypeDefault = uomTypes.GetCodeForType(Internals.GetDefaultUomType());
|
||||
responseData.Data.UomTypeDefault = uomTypes.GetCodeForType(Internals.GetDefaultUomType());
|
||||
|
||||
// Reference data - statuses.
|
||||
foreach (SaStatus status in SbmCommodity.ValidStatuses.FindAll(item => item != SaStatus.Deleted))
|
||||
@@ -289,16 +308,16 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
Caption = values.GetString(colDescBrief.DataName),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
};
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.Type}", Internals.CommodityTypeCodes.GetDescForType(commodityType));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.TypeDesc}", Internals.CommodityTypeCodes.GetDescForType(commodityType));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.Code}", values.GetString(colCode.DataName));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.DescBrief}", values.GetString(colDescBrief.DataName));
|
||||
if (model.UserCanViewCommodityFinancials_Sales())
|
||||
{
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.SalesPriceFmt}", StringUtil.FormatNumeric(values.GetValue(colSalesPrice.DataName).ToDecimal(), SbmInternals.CurrencyDecimalsDefault, 0, ','));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.SalesUnit}", Internals.GetUnitOfMeasureCaption(new SysId(values.GetLong(colSalesUomId.DataName))));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.SaleAmountFmt}", StringUtil.FormatNumeric(values.GetValue(colSalesPrice.DataName).ToDecimal(), SbmInternals.CurrencyDecimalsDefault, 0, ','));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.SaleUnit}", Internals.GetUnitOfMeasureCaption(new SysId(values.GetLong(colSalesUomId.DataName))));
|
||||
}
|
||||
if (model.UserCanViewCommodityFinancials_Supply())
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.CostPriceFmt}", StringUtil.FormatNumeric(values.GetValue(colCostPrice.DataName).ToDecimal(), SbmInternals.CurrencyDecimalsDefault, 0, ','));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.AmountCostFmt}", StringUtil.FormatNumeric(values.GetValue(colCostPrice.DataName).ToDecimal(), SbmInternals.CurrencyDecimalsDefault, 0, ','));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.Notes}", CommodityMgr.GetCommodityDataValue(colNotes, values).ToString());
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.Status}", SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName)));
|
||||
commodityData.Field.Value.Add($"{Model_Commodity.ItemField.CreatedOn}", Localiser.FormatDate(values.GetDate(colCreatedOn.DataName)));
|
||||
@@ -367,7 +386,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
|
||||
// Construct response.
|
||||
model.PopulateItemConfig(responseData.Config, commodity);
|
||||
PopulateCommodityResponseItemData(commodity, responseData.commodity, model.GetDataGroups());
|
||||
PopulateCommodityResponseItemData(model, commodity, responseData.commodity, model.GetDataGroups());
|
||||
responseData.Success = true;
|
||||
}
|
||||
return Json(responseData);
|
||||
@@ -436,13 +455,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
if (model.Commodity.DescBrief != null)
|
||||
commodity.DescBrief = model.Commodity.DescBrief;
|
||||
// Sales.
|
||||
if (model.Commodity.SalesPrice != null)
|
||||
if (model.Commodity.SaleAmount != null)
|
||||
commodity.SalesPrice = model.GetCommoditySalesPrice();
|
||||
if (model.Commodity.SalesTaxCode != null)
|
||||
if (model.Commodity.SaleTaxCode != null)
|
||||
commodity.TaxCodeId = model.GetCommoditySalesTaxCodeId();
|
||||
if (model.Commodity.SalesUnitType != null)
|
||||
if (model.Commodity.SaleUnitType != null)
|
||||
commodity.UomIdSale = model.GetCommoditySalesUnitId();
|
||||
if (model.Commodity.SalesPackQty != null)
|
||||
if (model.Commodity.SalePackQty != null)
|
||||
commodity.PackQtySale = model.GetCommoditySalesPackQty();
|
||||
// Common properties.
|
||||
if (model.Commodity.Notes != null)
|
||||
@@ -473,7 +492,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Commodities
|
||||
|
||||
// Construct response.
|
||||
model.PopulateItemConfig(responseData.Config, commodity);
|
||||
PopulateCommodityResponseItemData(commodity, responseData.commodity, model.GetDataGroups());
|
||||
PopulateCommodityResponseItemData(model, commodity, responseData.commodity, model.GetDataGroups());
|
||||
responseData.Success = true;
|
||||
}
|
||||
return Json(responseData);
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Contacts
|
||||
}
|
||||
private class AffiliateItemData : AffiliateListData
|
||||
{
|
||||
// Affiliate properties with specific handling.
|
||||
// Item properties with specific handling.
|
||||
public String TypeCode { get; set; }
|
||||
public String TypeDesc { get; set; }
|
||||
}
|
||||
|
||||
+183
-30
@@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Helpers;
|
||||
using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Contacts;
|
||||
using Sarand.BusinessMgr.Web.Portal.Models.Requirements;
|
||||
@@ -15,6 +16,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Transactions;
|
||||
using static Sarand.BusinessMgr.Web.Portal.Models.Requirements.Model_Requirement;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
{
|
||||
@@ -36,30 +38,38 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
}
|
||||
private class RequirementItemData : RequirementListData
|
||||
{
|
||||
// Affiliate properties with specific handling.
|
||||
// Item properties with specific handling.
|
||||
public String CommodityId { get; set; }
|
||||
public String CommodityCaption { get; set; }
|
||||
public String UnitType { get; set; }
|
||||
}
|
||||
private void PopulateRequirementResponseListData(SbmModel_Portal model, SbmTransaction transaction, SbmRequirement requirement, RequirementListData data)
|
||||
private void PopulateRequirementResponseListData(SbmModel_Portal model, SbmTransaction transaction, SbmRequirement requirement, SbmCommodity commodity, RequirementListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(requirement.Id);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.Id}", $"{SysId.ToLong(requirement.Id)}");
|
||||
// Status dates for list refresh.
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.RequiredFmt}", model.FormatDateForDisplay(requirement.Required));
|
||||
}
|
||||
private void PopulateRequirementResponseItemData(SbmModel_Portal model, SbmTransaction transaction, SbmRequirement requirement, RequirementItemData data, HashSet<RequirementDataGroup> dataGroups = null)
|
||||
private void PopulateRequirementResponseItemData(SbmModel_Portal model, SbmTransaction transaction, SbmRequirement requirement, SbmCommodity commodity, RequirementItemData data, HashSet<RequirementDataGroup> dataGroups = null)
|
||||
{
|
||||
PopulateRequirementResponseListData(model, transaction, requirement, data as RequirementListData);
|
||||
PopulateRequirementResponseListData(model, transaction, requirement, commodity, data as RequirementListData);
|
||||
// Requirement properties.
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.TransactionId}", $"{SysId.ToLong(requirement.TransactionId)}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.TransactionType}", Internals.TransactionTypeCodes.GetCodeForType(transaction.TransactionType));
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.CurrencyId}", $"{transaction.CurrencyId ?? model.GetInternals().GetCurrentCurrency()?.Id}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.Type}", Internals.RequirementTypeCodes.GetDescForType(requirement.RequirementType));
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.Sequence}", $"{requirement.Seq}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.JobNumber}", requirement.JobNumber);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.Required}", model.FormatDateForForm(requirement.Required));
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.DescBrief}", requirement.DescBrief);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.CommodityId}", $"{SysId.ToLong(requirement.CommodityId)}");
|
||||
// Commodity.
|
||||
data.CommodityId = $"{SysId.ToLong(requirement.CommodityId)}";
|
||||
data.CommodityCaption = commodity?.GetCaption();
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.ProductCode}", requirement.ProductCode);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.Quantity}", $"{requirement.Quantity}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.QuantityProd}", $"{requirement.QuantityProd}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.UomId}", $"{SysId.ToLong(requirement.UomId)}");
|
||||
data.UnitType = SbmSystem.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureType(requirement.UomId));
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.UnitType}", SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureType).GetCodeForType(Internals.GetUnitOfMeasureById(requirement.UomId)?.UnitType ?? Internals.GetDefaultUomType()));
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.MaterialSourceCode}", requirement.MaterialSourceCode);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.PromotionCode}", requirement.PromotionCode);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.LocationIdStock}", $"{SysId.ToLong(requirement.LocationIdStock)}");
|
||||
@@ -69,6 +79,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.AmountDisc}", $"{requirement.AmountDisc}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.AmountNet}", $"{requirement.AmountNet}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.TaxCode}", Internals.GetTaxCodeById(requirement.TaxCodeId)?.Code);
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.TaxEffective}", DateUtil.FormatSqlDate(Internals.TransactionMgr.GetTransactionTaxEffectiveDate(transaction)));
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.TaxCodeId}", $"{SysId.ToLong(requirement.TaxCodeId)}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.TaxRate}", $"{Internals.GetTaxCodeById(requirement.TaxCodeId)?.TaxRate}");
|
||||
data.Field.Value.Add($"{Model_Requirement.ItemField.AmountTax}", $"{requirement.AmountTax}");
|
||||
@@ -121,7 +132,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
public Model_Requirement.ItemConfigData CfgItemNew { get; } = new Model_Requirement.ItemConfigData();
|
||||
// Reference data.
|
||||
public List<ItemCodeDesc> RequirementTypes { get; } = new List<ItemCodeDesc>();
|
||||
public List<TaxCode> TaxCodes { get; } = new List<TaxCode>();
|
||||
public List<TaxCodeData> TaxCodes { get; } = new List<TaxCodeData>();
|
||||
public String taxCodeDefault { get; set; }
|
||||
public List<ItemCodeDesc> UomCats { get; } = new List<ItemCodeDesc>();
|
||||
public List<ItemCodeDesc> UomTypes { get; } = new List<ItemCodeDesc>();
|
||||
@@ -165,7 +176,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
|
||||
// Tax codes.
|
||||
DateTime taxEffectiveOn = DateTime.Today;
|
||||
responseData.Data.TaxCodes.AddRange(Internals.GetTaxCodesEffectiveOn(taxEffectiveOn).Select(tax => new AjaxResponse_Data.TaxCode() { Id = $"{SysId.ToLong(tax.Id)}", Code = tax.Code, Caption = tax.GetCaption(), Rate = tax.TaxRate }));
|
||||
responseData.Data.TaxCodes.AddRange(
|
||||
Internals.GetTaxCodesEffectiveOn(taxEffectiveOn)
|
||||
.Select(tax => new AjaxResponse_Data.TaxCodeData() { Id = $"{SysId.ToLong(tax.Id)}", Code = tax.Code, Caption = tax.GetCaption(), Rate = tax.TaxRate }));
|
||||
responseData.Data.taxCodeDefault = Internals.GetDefaultTaxCode();
|
||||
|
||||
// Units of measure.
|
||||
@@ -358,7 +371,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
// Configuration.
|
||||
public Model_Requirement.ItemConfigData Config { get; } = new Model_Requirement.ItemConfigData();
|
||||
// Requirement details.
|
||||
public RequirementItemData requirement { get; } = new RequirementItemData();
|
||||
public RequirementItemData Requirement { get; } = new RequirementItemData();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
@@ -375,7 +388,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
RefreshModel(model);
|
||||
|
||||
// Identify item.
|
||||
SysId requirementId = SysId.ToSysId(model.Requirement.Id);
|
||||
SysId requirementId = model.GetRequirementId();
|
||||
if (!SysId.IsValid(requirementId))
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||
|
||||
@@ -395,9 +408,134 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// Commodity.
|
||||
SbmCommodity commodity = CommodityMgr.GetCommodityById(requirement.CommodityId);
|
||||
|
||||
// Construct response.
|
||||
model.PopulateItemConfig(responseData.Config, transaction, requirement);
|
||||
PopulateRequirementResponseItemData(model, transaction, requirement, responseData.requirement);
|
||||
PopulateRequirementResponseItemData(model, transaction, requirement, commodity, responseData.Requirement);
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Commodity ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_Commodity : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Commodity(SbmModel_Portal model) : base(model) { }
|
||||
// Configuration - only required for Field.Prefix.
|
||||
public Model_Requirement.ItemConfigData Config { get; } = new Model_Requirement.ItemConfigData();
|
||||
// Item details.
|
||||
public RequirementItemData Requirement { get; } = new RequirementItemData();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Requirement/Ajax/Commodity")]
|
||||
public IActionResult Ajax_GetCommodity(Model_Requirement model)
|
||||
{
|
||||
String messageTitle = Localiser["label.requirement"];
|
||||
AjaxResponse_Commodity responseData = new AjaxResponse_Commodity(model);
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
if (!ValidReferer) return Forbid();
|
||||
RefreshModel(model);
|
||||
|
||||
// Transaction.
|
||||
Sbm.TransactionType transactionType = model.GetTransactionType();
|
||||
SysId currencyId = model.GetCurrencyId();
|
||||
if (transactionType == 0 || !SysId.IsValid(currencyId))
|
||||
{
|
||||
SbmTransaction transaction = Internals.TransactionMgr.GetTransactionById(model.GetTransactionId());
|
||||
if (transaction != null)
|
||||
{
|
||||
transactionType = transaction.TransactionType;
|
||||
currencyId = transaction.CurrencyId;
|
||||
}
|
||||
}
|
||||
if (!SysId.IsValid(currencyId))
|
||||
currencyId = Internals.GetCurrentCurrency()?.Id;
|
||||
|
||||
// Control values.
|
||||
ushort currencyDecimals = Internals.GetCurrencyDecimalsById(model.GetCurrencyId());
|
||||
|
||||
// Retrieve Commodity.
|
||||
SbmCommodity commodity = Internals.CommodityMgr.GetCommodityById(model.GetCommodityId());
|
||||
if (commodity != null)
|
||||
{
|
||||
// Unit amount.
|
||||
decimal unitAmount = commodity.SalesPrice;
|
||||
if (SbmTransaction.IsPurchaseType(transactionType))
|
||||
unitAmount = commodity.CostPrice;
|
||||
unitAmount = SbmRequirementHelper.Round(unitAmount, currencyDecimals);
|
||||
|
||||
// Populate response.
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.AmountUnit}"] = model.FormatMoneyForDisplay(unitAmount, currencyDecimals);
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.TaxCodeId}"] = $"{commodity.TaxCodeId}";
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.TaxCode}"] = Internals.GetTaxCodeById(commodity.TaxCodeId)?.Code;
|
||||
|
||||
// Cleanse item values.
|
||||
responseData.Requirement.Field.Value.RemoveAll(item => StringUtil.IsBlank(item.Value));
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Calculate Requirement ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_Calculate : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_Calculate(SbmModel_Portal model) : base(model) { }
|
||||
// Configuration - only required for Field.Prefix.
|
||||
public Model_Requirement.ItemConfigData Config { get; } = new Model_Requirement.ItemConfigData();
|
||||
// Item details.
|
||||
public RequirementItemData Requirement { get; } = new RequirementItemData();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Requirement/Ajax/Calculate")]
|
||||
public IActionResult Ajax_RequirementCalculate(Model_Requirement model)
|
||||
{
|
||||
String messageTitle = Localiser["label.requirement"];
|
||||
AjaxResponse_Calculate responseData = new AjaxResponse_Calculate(model);
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
if (!ValidReferer) return Forbid();
|
||||
RefreshModel(model);
|
||||
|
||||
// Control values.
|
||||
ushort currencyDecimals = Internals.GetCurrencyDecimalsById(model.GetCurrencyId());
|
||||
|
||||
// Calculate Requirement.
|
||||
SbmRequirementHelper.CalculateRequest request = new SbmRequirementHelper.CalculateRequest(Internals);
|
||||
request.TransactionId = model.GetTransactionId();
|
||||
request.TransactionType = model.GetTransactionType();
|
||||
request.CommodityId = model.GetCommodityId();
|
||||
request.AmountUnit = StringUtil.ToDecimal(model.Requirement.AmountUnit);
|
||||
request.Quantity = StringUtil.ToDecimal(model.Requirement.Quantity);
|
||||
request.AmountDiscount = StringUtil.ToDecimal(model.Requirement.AmountDisc);
|
||||
request.TaxCode = model.Requirement.TaxCode;
|
||||
request.TaxEffective = model.GetRequirementTaxEffective();
|
||||
SbmRequirementHelper.CalculateRespose response = SbmRequirementHelper.Calculate(request);
|
||||
|
||||
// Populate response.
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.AmountAct}"] = model.FormatMoneyForDisplay(response.AmountAct, currencyDecimals);
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.AmountNet}"] = model.FormatMoneyForDisplay(response.AmountNet, currencyDecimals);
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.AmountTax}"] = model.FormatMoneyForDisplay(response.AmountTax, currencyDecimals);
|
||||
responseData.Requirement.Field.Value[$"{Model_Requirement.ItemField.AmountTot}"] = model.FormatMoneyForDisplay(response.AmountTot, currencyDecimals);
|
||||
|
||||
// Cleanse item values.
|
||||
responseData.Requirement.Field.Value.RemoveAll(item => StringUtil.IsBlank(item.Value));
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
@@ -433,7 +571,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
return Json(responseData);
|
||||
|
||||
// Validate item Id against 'Exists' flag.
|
||||
SysId requirementId = SysId.ToSysId(model.Requirement.Id);
|
||||
SysId requirementId = model.GetRequirementId();
|
||||
bool requirementExists = StringUtil.ToBool(model.Requirement.Exists);
|
||||
if (requirementExists && !SysId.IsValid(requirementId))
|
||||
{
|
||||
@@ -470,13 +608,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
if (requirement == null)
|
||||
{
|
||||
// Transaction.
|
||||
SysId transactionId = SysId.ToSysId(model.Requirement.TransactionId);
|
||||
SysId transactionId = model.GetTransactionId();
|
||||
if (!SysId.IsValid(transactionId))
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Transaction not specified for new Requirement.");
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
transaction = TransactionMgr.GetTransactionById(requirement.TransactionId);
|
||||
transaction = TransactionMgr.GetTransactionById(transactionId);
|
||||
if (transaction == null)
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve transaction for Id: '{transactionId}'");
|
||||
@@ -490,8 +628,23 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to create Requirement. {TransactionMgr.ErrorStateMessage.TrimEnd('.')}.");
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
requirement.Seq = (short)(TransactionMgr.GetTransactionRequirementCount(transaction.Id) + 1);
|
||||
}
|
||||
|
||||
// Commodity.
|
||||
SbmCommodity commodity = null;
|
||||
if (model.Requirement.CommodityId != null)
|
||||
{
|
||||
commodity = CommodityMgr.GetCommodityById(model.GetCommodityId());
|
||||
if (commodity == null)
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Commodity. Id: {model.Requirement.CommodityId}.");
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
}
|
||||
else if (SysId.IsValid(requirement.CommodityId))
|
||||
commodity = CommodityMgr.GetCommodityById(requirement.CommodityId);
|
||||
|
||||
// Populate item properties.
|
||||
if (model.Requirement.RequirementIdSource != null)
|
||||
requirement.RequirementIdSource = SysId.ToSysId(model.Requirement.RequirementIdSource);
|
||||
@@ -508,19 +661,21 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
requirement.Completed = model.ParseDateFromForm(model.Requirement.Completed);
|
||||
// Commodity.
|
||||
if (model.Requirement.CommodityId != null)
|
||||
requirement.CommodityId = model.GetRequirementCommodityId();
|
||||
requirement.CommodityId = model.GetCommodityId();
|
||||
if (model.Requirement.ProductCode != null)
|
||||
requirement.ProductCode = model.Requirement.ProductCode;
|
||||
else if (commodity != null)
|
||||
requirement.ProductCode = commodity.Code;
|
||||
if (model.Requirement.DescBrief != null)
|
||||
requirement.DescBrief = model.Requirement.DescBrief;
|
||||
if (model.Requirement.Quantity != null)
|
||||
requirement.Quantity = StringUtil.ToDecimal(model.Requirement.Quantity);
|
||||
if (model.Requirement.QuantityProd != null)
|
||||
requirement.QuantityProd = StringUtil.ToDecimal(model.Requirement.QuantityProd);
|
||||
if (model.Requirement.UomId != null)
|
||||
requirement.UomId = SysId.ToSysId(model.Requirement.UomId);
|
||||
if (model.Requirement.UomIdWeight != null)
|
||||
requirement.UomIdWeight = SysId.ToSysId(model.Requirement.UomIdWeight);
|
||||
if (model.Requirement.UnitType != null)
|
||||
requirement.UomId = model.GetRequirementUnitId();
|
||||
if (model.Requirement.WeightUnitType != null)
|
||||
requirement.UomIdWeight = model.GetRequirementWeightUnitId();
|
||||
if (model.Requirement.MaterialSourceCode != null)
|
||||
requirement.MaterialSourceCode = model.Requirement.MaterialSourceCode;
|
||||
if (model.Requirement.LocationIdStock != null)
|
||||
@@ -528,18 +683,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
// Amounts.
|
||||
if (model.Requirement.AmountUnit != null)
|
||||
requirement.AmountUnit = StringUtil.ToDecimal(model.Requirement.AmountUnit);
|
||||
if (model.Requirement.AmountAct != null)
|
||||
requirement.AmountAct = StringUtil.ToDecimal(model.Requirement.AmountAct);
|
||||
if (model.Requirement.AmountDisc != null)
|
||||
requirement.AmountDisc = StringUtil.ToDecimal(model.Requirement.AmountDisc);
|
||||
if (model.Requirement.AmountNet != null)
|
||||
requirement.AmountNet = StringUtil.ToDecimal(model.Requirement.AmountNet);
|
||||
if (model.Requirement.TaxCodeId != null)
|
||||
requirement.TaxCodeId = SysId.ToSysId(model.Requirement.TaxCodeId);
|
||||
if (model.Requirement.AmountTax != null)
|
||||
requirement.AmountTax = StringUtil.ToDecimal(model.Requirement.AmountTax);
|
||||
if (model.Requirement.AmountTot != null)
|
||||
requirement.AmountTot = StringUtil.ToDecimal(model.Requirement.AmountTot);
|
||||
if (model.Requirement.TaxCode != null)
|
||||
{
|
||||
requirement.TaxCodeId = model.GetRequirementTaxCodeId();
|
||||
requirement.TaxRate = model.GetRequirementTaxRate();
|
||||
}
|
||||
// Common properties.
|
||||
if (model.Requirement.StatusCode != null)
|
||||
requirement.Status = model.GetRequirementStatus();
|
||||
@@ -572,7 +722,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Requirements
|
||||
|
||||
// Construct response.
|
||||
model.PopulateItemConfig(responseData.Config, transaction, requirement);
|
||||
PopulateRequirementResponseItemData(model, transaction, requirement, responseData.requirement);
|
||||
PopulateRequirementResponseItemData(model, transaction, requirement, commodity, responseData.Requirement);
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
+27
-16
@@ -13,6 +13,7 @@ using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Transactions;
|
||||
|
||||
namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
{
|
||||
@@ -26,8 +27,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
private class TransactionListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
// Item properties with specific handling.
|
||||
public String TypeCode { get; set; }
|
||||
public String TypeDesc { get; set; }
|
||||
public String Reference { get; set; }
|
||||
public String Narrative { get; set; }
|
||||
public String TaxEffective { get; set; }
|
||||
// Field values.
|
||||
public AjaxResponse_Data.FieldValuesData Field { get; } = new AjaxResponse_Data.FieldValuesData();
|
||||
}
|
||||
@@ -37,13 +41,18 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
}
|
||||
private class TransactionItemData : TransactionListData
|
||||
{
|
||||
// Affiliate properties with specific handling.
|
||||
public String TypeCode { get; set; }
|
||||
public String TypeDesc { get; set; }
|
||||
}
|
||||
private void PopulateTransactionResponseListData(SbmModel_Portal model, SbmTransaction transaction, TransactionListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(transaction.Id);
|
||||
// Affiliate type - populate for list ('Type' property populated with desc) and form (Type Code & Desc).
|
||||
data.TypeCode = Internals.TransactionTypeCodes.GetCodeForType(transaction.TransactionType);
|
||||
data.TypeDesc = Internals.TransactionTypeCodes.GetDescForType(transaction.TransactionType);
|
||||
// Prominent properties for selecting and editing.
|
||||
data.Reference = transaction.Ref;
|
||||
data.Narrative = transaction.DescBrief;
|
||||
// Tax effective date.
|
||||
data.TaxEffective = DateUtil.FormatSqlDate(Internals.TransactionMgr.GetTransactionTaxEffectiveDate(transaction));
|
||||
// Derived values for list refresh.
|
||||
long itemCount = TransactionMgr.GetTransactionRequirementCount(transaction.Id);
|
||||
if (itemCount > 0)
|
||||
@@ -56,16 +65,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
private void PopulateTransactionResponseItemData(SbmModel_Portal model, SbmTransaction transaction, TransactionItemData data, HashSet<TransactionDataGroup> dataGroups = null)
|
||||
{
|
||||
PopulateTransactionResponseListData(model, transaction, data as TransactionListData);
|
||||
// Prominent properties for selecting and editing.
|
||||
data.Reference = transaction.Ref;
|
||||
data.Narrative = transaction.DescBrief;
|
||||
// Affiliate type - populate for list ('Type' property populated with desc) and form (Type Code & Desc).
|
||||
data.TypeCode = Internals.TransactionTypeCodes.GetCodeForType(transaction.TransactionType);
|
||||
data.TypeDesc = Internals.TransactionTypeCodes.GetDescForType(transaction.TransactionType);
|
||||
// Transaction properties.
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.Type}", Internals.TransactionTypeCodes.GetDescForType(transaction.TransactionType));
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.AssociationId}", $"{SysId.ToInt(transaction.AssociationId)}");
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.AssociationName}", AccountMgr.GetAssociationTargetName(transaction.AssociationId));
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.Association}", AccountMgr.GetAssociationTargetName(transaction.AssociationId));
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.Reference}", transaction.Ref);
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.ReferenceExt}", transaction.RefExt);
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.DescBrief}", transaction.DescBrief);
|
||||
@@ -74,6 +77,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
// Status dates.
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.Raised}", model.FormatDateForForm(transaction.Raised));
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.InProgress}", model.FormatDateForForm(transaction.InProgress));
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.Required}", model.FormatDateForForm(transaction.Required));
|
||||
data.Field.Value.Add($"{Model_Transaction.ItemField.Closed}", model.FormatDateForForm(transaction.Closed));
|
||||
if (dataGroups != null && dataGroups.Contains(TransactionDataGroup.Core))
|
||||
{
|
||||
@@ -225,7 +229,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
else prmTransaction.StatusCat = SbmTransaction.StatusCat.NotDeleted;
|
||||
if (model.GetFilterTransactionType() <= 0)
|
||||
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.Type_Desc));
|
||||
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.RaisedOn).SetSortDescending());
|
||||
prmTransaction.SortColumns.Add(TransactionMgr.GetTransactionColumnDfn(SbmTransaction.Column.Id).SetSortDescending());
|
||||
model.Paging.ItemTotal = (ulong)TransactionMgr.GetTransactionCount(prmTransaction);
|
||||
model.PopulatePagingTo(prmTransaction.ResultsPaging);
|
||||
|
||||
@@ -264,14 +268,18 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
Sbm.TransactionType transactionType = (Sbm.TransactionType)values.GetLong(colType.DataName);
|
||||
DateTime transactionRaisedOn = values.GetDate(colRaisedOn.DataName);
|
||||
DateTime transactionInProgressOn = values.GetDate(colInProgressOn.DataName);
|
||||
SaStatus transactionStatus = SacsSystem.GetStatusForCode(values.GetString(colStatus.DataName));
|
||||
TransactionListData transactionData = new TransactionListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
Reference = values.GetString(colRef.DataName),
|
||||
Narrative = values.GetString(colDescBrief.DataName),
|
||||
TaxEffective = DateUtil.FormatSqlDate(Internals.TransactionMgr.GetTransactionTaxEffectiveDate(transactionType, transactionStatus, transactionRaisedOn, transactionInProgressOn)),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
};
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.AssociationName}", values.GetString(colTargetName.DataName));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.Association}", values.GetString(colTargetName.DataName));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.Type}", Internals.TransactionTypeCodes.GetDescForType(transactionType));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.Reference}", values.GetString(colRef.DataName));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.ReferenceExt}", values.GetString(colRefExt.DataName));
|
||||
@@ -280,9 +288,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
if (itemCount > 0)
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.ItemCount}", $"{itemCount}");
|
||||
// Status dates.
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.RaisedFmt}", model.FormatDateForDisplay(values.GetDate(colRaisedOn.DataName)));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.RaisedFmt}", model.FormatDateForDisplay(transactionRaisedOn));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.RequiredFmt}", model.FormatDateForDisplay(values.GetDate(colRequiredOn.DataName)));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.InProgressFmt}", model.FormatDateForDisplay(values.GetDate(colInProgressOn.DataName)));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.InProgressFmt}", model.FormatDateForDisplay(transactionInProgressOn));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.ClosedFmt}", model.FormatDateForDisplay(values.GetDate(colClosedOn.DataName)));
|
||||
if (model.UserCanViewFinancials())
|
||||
{
|
||||
@@ -291,7 +299,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.AmountTotal}", colAmountTot.FormatValue(values));
|
||||
}
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.Notes}", TransactionMgr.GetTransactionDataValue(colNotes, values).ToString());
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.Status}", SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName)));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.Status}", SacsSystem.GetStatusDescForCode(SacsSystem.GetStatusCode(transactionStatus)));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.CreatedOn}", Localiser.FormatDate(values.GetDate(colCreatedOn.DataName)));
|
||||
transactionData.Field.Value.Add($"{Model_Transaction.ItemField.UpdatedOn}", Localiser.FormatDate(values.GetDate(colUpdatedOn.DataName)));
|
||||
// Cleanse item values.
|
||||
@@ -447,6 +455,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
// Status & dates.
|
||||
if (model.Transaction.StatusCode != null)
|
||||
transaction.Status = model.GetTransactionStatus();
|
||||
// Required date.
|
||||
if (model.Transaction.Required != null)
|
||||
transaction.Required = model.ParseDateFromForm(model.Transaction.Required);
|
||||
// Raised date.
|
||||
if (model.Transaction.Raised != null)
|
||||
transaction.Raised = model.ParseDateFromForm(model.Transaction.Raised);
|
||||
@@ -458,7 +469,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Controllers.Transactions
|
||||
if (model.Transaction.InProgress != null)
|
||||
transaction.InProgress = model.ParseDateFromForm(model.Transaction.InProgress);
|
||||
// Closed date.
|
||||
if (transaction.TransactionStatusCat == SbmTransaction.StatusCat.Closed)
|
||||
if (transaction.TransactionStatusCat == SbmTransaction.StatusCat.Open)
|
||||
transaction.Closed = DateTime.MinValue;
|
||||
else if (model.Transaction.Closed != null)
|
||||
transaction.Closed = model.ParseDateFromForm(model.Transaction.Closed);
|
||||
|
||||
@@ -65,16 +65,19 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
DrawingNo,
|
||||
DrawingIssue,
|
||||
Type,
|
||||
TypeDesc,
|
||||
DescBrief,
|
||||
//---------------------------------------------------------------
|
||||
// Sales.
|
||||
SalesPrice,
|
||||
SaleAmount,
|
||||
/// <summary>Formatted sales price - for list only.</summary>
|
||||
SalesPriceFmt,
|
||||
SalesTaxCode,
|
||||
SaleAmountFmt,
|
||||
SaleTaxCode,
|
||||
/// <summary>Unit of sale - caption for list & name of form control.</summary>
|
||||
SalesUnit,
|
||||
SalesPackQty,
|
||||
SaleUnit,
|
||||
SaleUnitCat,
|
||||
SaleUnitType,
|
||||
SalePackQty,
|
||||
MinOrderQty,
|
||||
RetailPrice,
|
||||
RetailPricePlanned,
|
||||
@@ -87,9 +90,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
Promotion,
|
||||
//---------------------------------------------------------------
|
||||
// Purchasing.
|
||||
CostPrice,
|
||||
AmountCost,
|
||||
/// <summary>Formatted cost price - for list only.</summary>
|
||||
CostPriceFmt,
|
||||
AmountCostFmt,
|
||||
PlaceOfOrigin,
|
||||
MaterialCost,
|
||||
MaterialCurrency,
|
||||
@@ -265,9 +268,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
// Commodity type.
|
||||
if (commodityType <= 0)
|
||||
config.Column.Label.Add($"{ItemField.Type}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_Type, Localiser["label.type"]));
|
||||
config.Column.Label.Add($"{ItemField.TypeDesc}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_Type, Localiser["label.type"]));
|
||||
else
|
||||
config.Column.Hide.Add($"{ItemField.Type}");
|
||||
config.Column.Hide.Add($"{ItemField.TypeDesc}");
|
||||
|
||||
// Description.
|
||||
|
||||
@@ -276,13 +279,13 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
// Sales price.
|
||||
if (!UserCanViewCommodityFinancials_Sales())
|
||||
config.Column.Hide.Add($"{ItemField.SalesPrice}");
|
||||
config.Column.Hide.Add($"{ItemField.SaleAmount}");
|
||||
|
||||
// Pack qty.
|
||||
if (modeIsStockControl || SessionConsole.GetOwnerOption_ShowColumn(Sbm.OrgOption_ShowColumn.Commodity_PackQtySale))
|
||||
config.Column.Label.Add($"{ItemField.SalesPackQty}", Localiser["label.pack.quantity"]);
|
||||
config.Column.Label.Add($"{ItemField.SalePackQty}", Localiser["label.pack.quantity"]);
|
||||
else
|
||||
config.Column.Hide.Add($"{ItemField.SalesPackQty}");
|
||||
config.Column.Hide.Add($"{ItemField.SalePackQty}");
|
||||
|
||||
// Customer.
|
||||
if (modeIsStockControl || !SessionConsole.AllowOption(Sbm.ConfigOption.CommodityExclusiveToCustomer))
|
||||
@@ -297,7 +300,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
// Cost price.
|
||||
if (!UserCanViewCommodityFinancials_Supply())
|
||||
config.Column.Hide.Add($"{ItemField.CostPrice}");
|
||||
config.Column.Hide.Add($"{ItemField.AmountCost}");
|
||||
|
||||
// Supplier.
|
||||
if (!modeIsStockControl)
|
||||
@@ -451,9 +454,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
// Sales price.
|
||||
if (!UserCanViewCommodityFinancials_Sales())
|
||||
config.Field.Hide.Add($"{ItemField.SalesPrice}");
|
||||
config.Field.Hide.Add($"{ItemField.SaleAmount}");
|
||||
else if (managedByAccounts || !UserCanUpdateFinancials())
|
||||
config.Field.Readonly.Add($"{ItemField.SalesPrice}");
|
||||
config.Field.Readonly.Add($"{ItemField.SaleAmount}");
|
||||
|
||||
// Retail price.
|
||||
if (UserCanViewCommodityFinancials_Sales() && SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_RetailPrice))
|
||||
@@ -475,7 +478,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
// Tax code
|
||||
if (managedByAccounts || !UserCanUpdateFinancials())
|
||||
config.Field.Readonly.Add($"{ItemField.SalesTaxCode}");
|
||||
config.Field.Readonly.Add($"{ItemField.SaleTaxCode}");
|
||||
|
||||
// Indicative carriage cost.
|
||||
if (UserCanViewCommodityFinancials_Sales() && SessionConsole.DisplayAttribute(SbmDbDfn.ColumnIdx.Commodity_CarriageCostIndicative) || !CommodityMgr.ColumnExists(SbmDbDfn.ColumnIdx.Commodity_CarriageCostIndicative))
|
||||
@@ -488,7 +491,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
|
||||
// Sales Unit.
|
||||
if (managedByAccounts || !UserCanUpdateFinancials())
|
||||
config.Field.Readonly.Add($"{ItemField.SalesUnit}");
|
||||
config.Field.Readonly.Add($"{ItemField.SaleUnit}");
|
||||
|
||||
// Sales Pack quantity.
|
||||
|
||||
@@ -522,11 +525,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
// Cost price.
|
||||
if (UserCanViewCommodityFinancials_Supply())
|
||||
{
|
||||
config.Field.Label.Add($"{ItemField.CostPrice}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_CostPrice, Localiser["label.cost.price"]));
|
||||
config.Field.Label.Add($"{ItemField.AmountCost}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_CostPrice, Localiser["label.cost.price"]));
|
||||
if (!UserCanUpdateFinancials())
|
||||
config.Field.Readonly.Add($"{ItemField.CostPrice}");
|
||||
config.Field.Readonly.Add($"{ItemField.AmountCost}");
|
||||
}
|
||||
else config.Field.Hide.Add($"{ItemField.CostPrice}");
|
||||
else config.Field.Hide.Add($"{ItemField.AmountCost}");
|
||||
|
||||
// Place of origin.
|
||||
config.Field.Label.Add($"{ItemField.PlaceOfOrigin}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Commodity_PlaceOfOrigin, Localiser["label.place.of.origin"]));
|
||||
|
||||
@@ -73,10 +73,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
public String AssocIdCustomer { get; set; }
|
||||
public String AssocIdSupplier { get; set; }
|
||||
// Sales.
|
||||
public String SalesPrice { get; set; }
|
||||
public String SalesTaxCode { get; set; }
|
||||
public String SalesUnitType { get; set; }
|
||||
public String SalesPackQty { get; set; }
|
||||
public String SaleAmount { get; set; }
|
||||
public String SaleTaxCode { get; set; }
|
||||
public String SaleUnitType { get; set; }
|
||||
public String SalePackQty { get; set; }
|
||||
// Common properties.
|
||||
public String Notes { get; set; }
|
||||
public String StatusCode { get; set; }
|
||||
@@ -98,15 +98,15 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
// Sales.
|
||||
public decimal GetCommoditySalesPrice()
|
||||
{
|
||||
return StringUtil.ToDecimal(Commodity.SalesPrice);
|
||||
return StringUtil.ToDecimal(Commodity.SaleAmount);
|
||||
}
|
||||
public SysId GetCommoditySalesTaxCodeId()
|
||||
{
|
||||
return Internals.GetTaxCodesEffectiveOn(DateTime.Today).FirstOrDefault(tax => tax.Code.EqualsCI(Commodity.SalesTaxCode))?.Id;
|
||||
return Internals.GetTaxCodesEffectiveOn(DateTime.Today).FirstOrDefault(tax => tax.Code.EqualsCI(Commodity.SaleTaxCode))?.Id;
|
||||
}
|
||||
public SaUomType GetCommoditySalesUnitType()
|
||||
{
|
||||
return (SaUomType)Internals.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetTypeForCode(Commodity.SalesUnitType);
|
||||
return (SaUomType)Internals.GetSystemCodes(Sbm.SystemCode.UnitMeasureType).GetTypeForCode(Commodity.SaleUnitType);
|
||||
}
|
||||
public SysId GetCommoditySalesUnitId()
|
||||
{
|
||||
@@ -114,7 +114,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
}
|
||||
public int GetCommoditySalesPackQty()
|
||||
{
|
||||
return StringUtil.ToInt(Commodity.SalesPackQty);
|
||||
return StringUtil.ToInt(Commodity.SalePackQty);
|
||||
}
|
||||
// Common properties.
|
||||
public SaStatus GetCommodityStatus()
|
||||
@@ -160,41 +160,41 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Commodities
|
||||
}
|
||||
|
||||
// Commodity Sales Price.
|
||||
if (Commodity.SalesPrice != null)
|
||||
if (Commodity.SaleAmount != null)
|
||||
{
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SalesPrice);
|
||||
responseData.SetControlValue(controlName, Commodity.SalesPrice);
|
||||
if (Commodity.SalesPrice.IsBlank())
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SaleAmount);
|
||||
responseData.SetControlValue(controlName, Commodity.SaleAmount);
|
||||
if (Commodity.SaleAmount.IsBlank())
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!StringUtil.IsDecimal(Commodity.SalesPrice) || GetCommoditySalesPrice() < 0.0m)
|
||||
else if (!StringUtil.IsDecimal(Commodity.SaleAmount) || GetCommoditySalesPrice() < 0.0m)
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Commodity Tax.
|
||||
if (Commodity.SalesTaxCode != null)
|
||||
if (Commodity.SaleTaxCode != null)
|
||||
{
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SalesTaxCode);
|
||||
if (Commodity.SalesTaxCode.IsBlank())
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SaleTaxCode);
|
||||
if (Commodity.SaleTaxCode.IsBlank())
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!SysId.IsValid(GetCommoditySalesTaxCodeId()))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Commodity Sales Unit Type.
|
||||
if (Commodity.SalesUnitType != null)
|
||||
if (Commodity.SaleUnitType != null)
|
||||
{
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SalesUnit);
|
||||
if (Commodity.SalesUnitType.IsBlank())
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SaleUnit);
|
||||
if (Commodity.SaleUnitType.IsBlank())
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (GetCommoditySalesUnitType() == SaUomType.Unknown || !SysId.IsValid(GetCommoditySalesUnitId()))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Commodity Sales pack quantity.
|
||||
if (Commodity.SalesPackQty != null)
|
||||
if (Commodity.SalePackQty != null)
|
||||
{
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SalesPackQty);
|
||||
if (!StringUtil.IsBlank(Commodity.SalesPackQty) && (!StringUtil.IsDecimal(Commodity.SalesPackQty) || GetCommoditySalesPackQty() < 1))
|
||||
String controlName = GetFieldName(Model_Commodity.ItemField.SalePackQty);
|
||||
if (!StringUtil.IsBlank(Commodity.SalePackQty) && (!StringUtil.IsDecimal(Commodity.SalePackQty) || GetCommoditySalesPackQty() < 1))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,10 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Contacts
|
||||
{
|
||||
Id,
|
||||
Type,
|
||||
OwnerId,
|
||||
Owner,
|
||||
/// <summary>Target name.</summary>
|
||||
TargetId,
|
||||
Target,
|
||||
Code,
|
||||
ReferenceExt,
|
||||
|
||||
@@ -28,9 +28,11 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
// Identity.
|
||||
Pos,
|
||||
Id,
|
||||
Exists,
|
||||
TransactionId,
|
||||
TransactionType,
|
||||
TransactionRef,
|
||||
CurrencyId,
|
||||
AssociationName,
|
||||
AssociationId,
|
||||
Type,
|
||||
@@ -60,12 +62,16 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
CommodityId,
|
||||
ProductCode,
|
||||
DrawingIssue,
|
||||
Asset,
|
||||
AssetId,
|
||||
Quantity,
|
||||
QuantityProd,
|
||||
Unit,
|
||||
UomId,
|
||||
UnitType,
|
||||
PackQty,
|
||||
Weight,
|
||||
WeightUnit,
|
||||
WeightUnitType,
|
||||
MaterialSourceCode,
|
||||
LocationIdStock,
|
||||
AllocationIndicator,
|
||||
@@ -74,8 +80,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
AmountAct,
|
||||
AmountDisc,
|
||||
AmountNet,
|
||||
TaxCodeId,
|
||||
TaxCode,
|
||||
TaxCodeId,
|
||||
TaxEffective,
|
||||
TaxRate,
|
||||
AmountTax,
|
||||
AmountTot,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using DocumentFormat.OpenXml.EMMA;
|
||||
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Sarand.BusinessMgr.Net.Core.Web.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
||||
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
||||
@@ -6,6 +8,7 @@ using Sarand.BusinessMgr.Web.Portal.Components;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.ReferenceData;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -50,8 +53,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
public String Mode { get; set; }
|
||||
public String TransactionId { get; set; }
|
||||
public String TransactionType { get; set; }
|
||||
public String Search { get; set; }
|
||||
public String TransactionStatusCat { get; set; }
|
||||
public String Search { get; set; }
|
||||
public String StatusCat { get; set; }
|
||||
}
|
||||
public FilterData Filter { get; } = new FilterData();
|
||||
@@ -88,55 +91,135 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
public String Exists { get; set; }
|
||||
public String Id { get; set; }
|
||||
public String TransactionId { get; set; }
|
||||
public String TransactionType { get; set; }
|
||||
public String RequirementIdSource { get; set; }
|
||||
public String Type { get; set; }
|
||||
public String Sequence { get; set; }
|
||||
public String JobNumber { get; set; }
|
||||
// Status dates.
|
||||
public String Required { get; set; }
|
||||
public String Started { get; set; }
|
||||
public String Completed { get; set; }
|
||||
// Details.
|
||||
public String AssociationIdSubContract { get; set; }
|
||||
public String DescBrief { get; set; }
|
||||
public String DescIntro { get; set; }
|
||||
public String DescOutline { get; set; }
|
||||
public String DescDetail { get; set; }
|
||||
public String CurrencyId { get; set; }
|
||||
public String PromotionCode { get; set; }
|
||||
public String NominalCode { get; set; }
|
||||
public String AssociationIdSubContract { get; set; }
|
||||
// Commodity.
|
||||
public String CommodityId { get; set; }
|
||||
public String ProductCode { get; set; }
|
||||
public String AssetId { get; set; }
|
||||
public String Quantity { get; set; }
|
||||
public String QuantityProd { get; set; }
|
||||
public String UomId { get; set; }
|
||||
public String UnitType { get; set; }
|
||||
public String Weight { get; set; }
|
||||
public String UomIdWeight { get; set; }
|
||||
public String WeightUnitType { get; set; }
|
||||
public String MaterialSourceCode { get; set; }
|
||||
public String LocationIdStock { get; set; }
|
||||
// Amounts.
|
||||
public String AmountUnit { get; set; }
|
||||
public String AmountAct { get; set; }
|
||||
public String PercentDisc { get; set; }
|
||||
public String AmountDisc { get; set; }
|
||||
public String AmountNet { get; set; }
|
||||
public String TaxCodeId { get; set; }
|
||||
public String TaxCode { get; set; }
|
||||
public String TaxRate { get; set; }
|
||||
public String AmountTax { get; set; }
|
||||
public String AmountTot { get; set; }
|
||||
public String TaxEffective { get; set; }
|
||||
// Status dates.
|
||||
public String Required { get; set; }
|
||||
public String Started { get; set; }
|
||||
public String Completed { get; set; }
|
||||
// Common properties.
|
||||
public String Notes { get; set; }
|
||||
public String StatusCode { get; set; }
|
||||
// Confirmations.
|
||||
public class ConfirmData
|
||||
{
|
||||
public String SuperStatus { get; set; }
|
||||
}
|
||||
public ConfirmData Confirm { get; } = new ConfirmData();
|
||||
}
|
||||
public RequirementData Requirement { get; } = new RequirementData();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Extract Requirement properties.
|
||||
|
||||
// Transaction.
|
||||
public SysId GetTransactionId()
|
||||
{
|
||||
return SysId.ToSysId(Requirement.TransactionId);
|
||||
}
|
||||
public Sbm.TransactionType GetTransactionType()
|
||||
{
|
||||
return (Sbm.TransactionType)Internals.TransactionTypeCodes.GetTypeForCode(Requirement.TransactionType);
|
||||
}
|
||||
|
||||
// Requirement.
|
||||
public SysId GetRequirementId()
|
||||
{
|
||||
return SysId.ToSysId(Requirement.Id);
|
||||
}
|
||||
public Sbm.RequirementType GetRequirementType()
|
||||
{
|
||||
return (Sbm.RequirementType)Internals.RequirementTypeCodes.GetTypeForCode(Requirement.Type);
|
||||
Sbm.RequirementType requirementType = (Sbm.RequirementType)Internals.RequirementTypeCodes.GetTypeForCode(Requirement.Type);
|
||||
if (requirementType <= 0)
|
||||
requirementType = Sbm.RequirementType.Detail;
|
||||
return requirementType;
|
||||
}
|
||||
public SysId GetRequirementCommodityId()
|
||||
|
||||
// Currency.
|
||||
public SysId GetCurrencyId()
|
||||
{
|
||||
return SysId.ToSysId(Requirement.CurrencyId);
|
||||
}
|
||||
|
||||
// Commodity.
|
||||
public SysId GetCommodityId()
|
||||
{
|
||||
return SysId.ToSysId(Requirement.CommodityId);
|
||||
}
|
||||
|
||||
// Unit.
|
||||
public SaUomType GetRequirementUnitType()
|
||||
{
|
||||
List<TypeCodeDesc> unitTypes = SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureType);
|
||||
SaUomType unitType = (SaUomType)unitTypes.GetTypeForCode(Requirement.UnitType);
|
||||
return unitType;
|
||||
}
|
||||
public SysId GetRequirementUnitId()
|
||||
{
|
||||
return Internals.GetUnitOfMeasureByType(GetRequirementUnitType())?.Id;
|
||||
}
|
||||
|
||||
// Weight Unit.
|
||||
public SaUomType GetRequirementWeightUnitType()
|
||||
{
|
||||
List<TypeCodeDesc> unitTypes = SaReferenceDataConsole.GetReferenceDataCodes(ReferenceDataSystemCode.UnitMeasureType);
|
||||
SaUomType weightUnitType = (SaUomType)unitTypes.GetTypeForCode(Requirement.WeightUnitType);
|
||||
return weightUnitType;
|
||||
}
|
||||
public SysId GetRequirementWeightUnitId()
|
||||
{
|
||||
return Internals.GetUnitOfMeasureByType(GetRequirementWeightUnitType())?.Id;
|
||||
}
|
||||
|
||||
// Tax code.
|
||||
public SaTaxCode GetRequirementTaxCode()
|
||||
{
|
||||
return Internals.GetTaxCodesEffectiveOn(GetRequirementTaxEffective()).FirstOrDefault(tax => tax.Code.EqualsCI(Requirement.TaxCode));
|
||||
}
|
||||
public DateTime GetRequirementTaxEffective()
|
||||
{
|
||||
return DateUtil.OnInvalid(DateUtil.ParseXmlDate(Requirement.TaxEffective), DateTime.Today);
|
||||
}
|
||||
public SysId GetRequirementTaxCodeId()
|
||||
{
|
||||
return GetRequirementTaxCode()?.Id;
|
||||
}
|
||||
public decimal GetRequirementTaxRate()
|
||||
{
|
||||
return GetRequirementTaxCode()?.TaxRate ?? 0.0m;
|
||||
}
|
||||
|
||||
// Status.
|
||||
public SaStatus GetRequirementStatus()
|
||||
{
|
||||
return SacsSystem.GetStatusForCode(Requirement.StatusCode);
|
||||
@@ -148,13 +231,48 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
// Requirement validation.
|
||||
public bool ValidateRequirementData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData)
|
||||
{
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Transaction.
|
||||
if (Requirement.TransactionId != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.TransactionId);
|
||||
}
|
||||
|
||||
// Source Requirement.
|
||||
if (Requirement.RequirementIdSource != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.SourceReqntId);
|
||||
}
|
||||
|
||||
// Type.
|
||||
if (Requirement.Type != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Type);
|
||||
}
|
||||
|
||||
// Sequence.
|
||||
if (Requirement.Sequence != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Sequence);
|
||||
}
|
||||
|
||||
// Job Number.
|
||||
if (Requirement.JobNumber != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.JobNumber);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Narrative.
|
||||
if (Requirement.DescBrief != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.DescBrief);
|
||||
responseData.SetControlValue(controlName, Requirement.DescBrief);
|
||||
if (StringUtil.GetLength(Requirement.DescBrief) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief))
|
||||
if (StringUtil.IsBlank(Requirement.DescBrief))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(Requirement.DescBrief) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief)]);
|
||||
}
|
||||
|
||||
@@ -185,6 +303,156 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescDetail)]);
|
||||
}
|
||||
|
||||
// Promotion Code.
|
||||
if (Requirement.PromotionCode != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.PromotionCode);
|
||||
responseData.SetControlValue(controlName, Requirement.PromotionCode);
|
||||
if (StringUtil.GetLength(Requirement.PromotionCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_PromotionCode))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_PromotionCode)]);
|
||||
}
|
||||
|
||||
// Nominal Code.
|
||||
if (Requirement.NominalCode != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.NominalCode);
|
||||
responseData.SetControlValue(controlName, Requirement.NominalCode);
|
||||
if (StringUtil.GetLength(Requirement.NominalCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_NominalCode))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_NominalCode)]);
|
||||
}
|
||||
|
||||
// SubContractor Association.
|
||||
if (Requirement.AssociationIdSubContract != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.AssociationIdSubContract);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Commodity.
|
||||
if (Requirement.CommodityId != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Commodity);
|
||||
SysId commodityId = GetCommodityId();
|
||||
if (!SysId.IsValid(commodityId))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!CommodityMgr.CommodityExistsById(commodityId))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Product Code.
|
||||
if (Requirement.ProductCode != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.ProductCode);
|
||||
responseData.SetControlValue(controlName, Requirement.ProductCode);
|
||||
if (StringUtil.GetLength(Requirement.ProductCode) > GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_ProductCode))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_ProductCode)]);
|
||||
}
|
||||
|
||||
// Asset.
|
||||
if (Requirement.AssetId != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Asset);
|
||||
SysId assetId = SysId.ToSysId(Requirement.AssetId);
|
||||
if (!AssetMgr.AssetExistsById(assetId))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Quantity.
|
||||
if (Requirement.Quantity != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Quantity);
|
||||
if (!StringUtil.IsDecimal(Requirement.Quantity))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Production Quantity.
|
||||
if (Requirement.QuantityProd != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.QuantityProd);
|
||||
if (!StringUtil.IsDecimal(Requirement.QuantityProd))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Unit of Measure.
|
||||
if (Requirement.UnitType != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Unit);
|
||||
SaUomType unitType = GetRequirementUnitType();
|
||||
SaUnitMeasure uom = Internals.GetUnitOfMeasureByType(unitType);
|
||||
if (uom == null)
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Weight.
|
||||
if (Requirement.Weight != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.Weight);
|
||||
if (!StringUtil.IsDecimal(Requirement.Weight))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Weight Unit.
|
||||
if (Requirement.WeightUnitType != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.WeightUnit);
|
||||
SaUomType unitTypeWeight = GetRequirementWeightUnitType();
|
||||
SaUnitMeasure uom = Internals.GetUnitOfMeasureByType(unitTypeWeight);
|
||||
if (uom == null)
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Material Source Code.
|
||||
if (Requirement.MaterialSourceCode != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.MaterialSourceCode);
|
||||
}
|
||||
|
||||
// Stock Location.
|
||||
if (Requirement.LocationIdStock != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.LocationIdStock);
|
||||
SysId locationId = SysId.ToSysId(Requirement.LocationIdStock);
|
||||
if (!StockMgr.LocationExistsById(locationId))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Amount Unit.
|
||||
if (Requirement.AmountUnit != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.AmountUnit);
|
||||
if (!StringUtil.IsDecimal(Requirement.AmountUnit))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Amount Discount.
|
||||
if (Requirement.AmountDisc != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.AmountDisc);
|
||||
if (!StringUtil.IsBlank(Requirement.AmountDisc) && !StringUtil.IsDecimal(Requirement.AmountDisc))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Tax Code.
|
||||
if (Requirement.TaxCode != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.TaxCodeId);
|
||||
SaTaxCode taxCode = GetRequirementTaxCode();
|
||||
if (taxCode == null)
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Tax Rate.
|
||||
if (Requirement.TaxRate != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.TaxRate);
|
||||
if (!StringUtil.IsDecimal(Requirement.TaxRate))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
// Requirement status.
|
||||
if (Requirement.StatusCode != null)
|
||||
@@ -229,6 +497,8 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Requirements
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_Notes)]);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
return !responseData.HasControlErrors();
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
||||
// Transaction.
|
||||
Pos,
|
||||
Id,
|
||||
AssociationName,
|
||||
Association,
|
||||
AssociationId,
|
||||
Type,
|
||||
Reference,
|
||||
@@ -276,9 +276,9 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
||||
String associationLabel = Localiser["label.target"];
|
||||
if (isSales) associationLabel = Localiser["label.customer"];
|
||||
else if (isPurchase) associationLabel = Localiser["label.supplier"];
|
||||
config.Column.Label.Add($"{ItemField.AssociationName}", associationLabel);
|
||||
config.Column.Label.Add($"{ItemField.Association}", associationLabel);
|
||||
}
|
||||
else config.Column.Hide.Add($"{ItemField.AssociationName}");
|
||||
else config.Column.Hide.Add($"{ItemField.Association}");
|
||||
|
||||
// Narrative.
|
||||
config.Column.Label.Add($"{ItemField.DescBrief}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Transaction_DescBrief, Localiser["label.narrative"]));
|
||||
@@ -627,7 +627,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
||||
config.Field.Readonly.Add($"{ItemField.Type}");
|
||||
|
||||
// Association.
|
||||
config.Field.Readonly.Add($"{ItemField.AssociationName}");
|
||||
config.Field.Readonly.Add($"{ItemField.Association}");
|
||||
|
||||
// Reference.
|
||||
config.Field.Label.Add($"{ItemField.Reference}", SessionConsole.GetAttributeCaption(SbmDbDfn.ColumnIdx.Transaction_Ref, Localiser["label.reference"]));
|
||||
|
||||
@@ -202,7 +202,7 @@ namespace Sarand.BusinessMgr.Web.Portal.Models.Transactions
|
||||
// Association.
|
||||
if (Transaction.AssociationId != null)
|
||||
{
|
||||
String controlName = GetFieldName(ItemField.AssociationName);
|
||||
String controlName = GetFieldName(ItemField.Association);
|
||||
SysId associationId = SysId.ToSysId(Transaction.AssociationId);
|
||||
if (!SysId.IsValid(associationId))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<select name="Association.Type" id="cbAssocType" class="AssocType sbm-select"></select>
|
||||
<select name="Association.Type" id="cbAssocType" class="@Model_Association.GetFieldName(Model_Association.ItemField.Type) sbm-select"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<select id="cbAssocStatus" class="AssocStatus sbm-select sbm-auto-val" name="Association.StatusCode"></select>
|
||||
<select id="cbAssocStatus" class="@Model_Association.GetFieldName(Model_Association.ItemField.Status) sbm-select sbm-auto-val" name="Association.StatusCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -80,8 +80,8 @@
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control row">
|
||||
<div class="col">
|
||||
<input type="hidden" name="Association.ContactIdOwner" id="" class=" AssocOwnerId sbm-input" />
|
||||
<input type="text" id="ifAssocOwner" class="AssocOwner sbm-input sbm-auto-val" readonly="readonly" />
|
||||
@Html.Hidden("Association.ContactIdOwner", "", new { @id = "", @class = $"{Model_Association.GetFieldName(Model_Association.ItemField.OwnerId)} sbm-input" })
|
||||
<input type="text" id="ifAssocOwner" class="@Model_Association.GetFieldName(Model_Association.ItemField.Owner) sbm-input sbm-auto-val" readonly="readonly" />
|
||||
</div>
|
||||
<div class="fixed">
|
||||
@* <div class="sbm-action AssocOwnerSearch"><img src="~/img/action/search24.png" alt="" title="" /></div> *@
|
||||
@@ -103,8 +103,8 @@
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control row">
|
||||
<div class="col">
|
||||
<input type="hidden" name="Association.TargetId" id="" class=" AssocTargetId sbm-input" />
|
||||
<input type="text" id="ifAssocTarget" class="AssocTarget sbm-input sbm-auto-val" readonly="readonly" />
|
||||
@Html.Hidden("Association.TargetId", "", new { @id = "", @class = $"{Model_Association.GetFieldName(Model_Association.ItemField.TargetId)} sbm-input" })
|
||||
<input type="text" id="ifAssocTarget" class="@Model_Association.GetFieldName(Model_Association.ItemField.Target) sbm-input sbm-auto-val" readonly="readonly" />
|
||||
</div>
|
||||
<div class="fixed">
|
||||
<div class="sbm-action AssocTargetSearch"><img src="~/img/action/search24.png" alt="" title="" /></div>
|
||||
@@ -131,7 +131,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<input type="text" name="Association.Code" id="ifAssocCode" class="AssocCode sbm-input upper sbm-auto-val" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Code)" />
|
||||
@Html.TextBox("Association.Code", "", new { @id = "ifAssocCode", @class = $"{Model_Association.GetFieldName(Model_Association.ItemField.Code)} sbm-input upper sbm-auto-val", @maxlength = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Code) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -152,7 +152,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<input type="text" name="Association.ReferenceExt" id="ifAssocExtRef" class="AssocExtRef sbm-input upper sbm-auto-val" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_ExtRef)" />
|
||||
<input type="text" name="Association.ReferenceExt" id="ifAssocExtRef" class="@Model_Association.GetFieldName(Model_Association.ItemField.ReferenceExt) sbm-input upper sbm-auto-val" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_ExtRef)" />
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -175,7 +175,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<input type="text" name="Association.Location" id="ifAssocLocation" class="AssocLocation sbm-input sbm-auto-val" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Location)" />
|
||||
@Html.TextBox("Association.Location", "", new { @id = "ifAssocLocation", @class = $"{Model_Association.GetFieldName(Model_Association.ItemField.Location)} sbm-input sbm-auto-val", @maxlength = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Location) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -196,7 +196,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<input type="text" name="Association.Group" id="ifAssocGroup" class="AssocGroup sbm-input sbm-auto-val" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Group)" />
|
||||
@Html.TextBox("Association.Group", "", new { @id = "ifAssocGroup", @class = $"{Model_Association.GetFieldName(Model_Association.ItemField.Group)} sbm-input sbm-auto-val", @maxlength = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Group) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -216,7 +216,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<textarea name="Association.Notes" id="ifAssocNotes" class="AssocNotes sbm-textarea sbm-auto-val" rows="3" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Notes)"></textarea>
|
||||
@Html.TextArea("Association.Notes", "", new { @id = "ifAssocNotes", @class = $"{Model_Association.GetFieldName(Model_Association.ItemField.Notes)} sbm-textarea sbm-auto-val", @rows = 3, @maxlength = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Association_Notes) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Commodity.Code", "", new { @id = "ifCommodityCode", @class = "CommodityCode sbm-input upper sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Commodity_Code) })
|
||||
@Html.TextBox("Commodity.Code", "", new { @id = "ifCommodityCode", @class = $"{Model_Commodity.GetFieldName(Model_Commodity.ItemField.Code)} sbm-input upper sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Commodity_Code) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.DropDownList("Commodity.Type", Model.GetCommodityTypeCodesForDropdown(), Localiser["label.select"], new { @id = "cbCommodityType", @class = "CommodityType sbm-select" })
|
||||
@Html.DropDownList("Commodity.Type", Model.GetCommodityTypeCodesForDropdown(), Localiser["label.select"], new { @id = "cbCommodityType", @class = $"{Model_Commodity.GetFieldName(Model_Commodity.ItemField.Type)} sbm-select sbm-auto-val" })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Commodity.DescBrief", "", new { @id = "ifCommodityDesc", @class = "CommodityDesc sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Commodity_DescBrief) })
|
||||
@Html.TextBox("Commodity.DescBrief", "", new { @id = "ifCommodityDesc", @class = $"{Model_Commodity.GetFieldName(Model_Commodity.ItemField.DescBrief)} sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Commodity_DescBrief) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -90,17 +90,17 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Sales Price *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesPrice)">
|
||||
@* Sale Amount *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleAmount)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="ifCommoditySalesPrice"><span>@Localiser["label.price"]</span><span class="required"> *</span></label>
|
||||
<label for="ifCommoditySaleAmount"><span>@Localiser["label.price"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Commodity.SalesPrice", "", new { @id = "ifCommoditySalesPrice", @class = "CommoditySalesPrice sbm-input right sbm-auto-val sbm-format-currency", @maxlength = 12 })
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control width50pc">
|
||||
@Html.TextBox("Commodity.SaleAmount", "", new { @id = "ifCommoditySaleAmount", @class = $"{Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleAmount)} sbm-input right sbm-auto-val sbm-format-currency", @maxlength = 12 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -110,22 +110,22 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Sales Unit *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesUnit)">
|
||||
@* Sale Unit *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleUnit)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="ifCommoditySalesUnit"><span>@Localiser["label.unit"]</span><span class="required"> *</span></label>
|
||||
<label for="ifCommoditySaleUnit"><span>@Localiser["label.unit"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<div class="row">
|
||||
<div class="col-5 pr-1">
|
||||
<select id="" class="CommoditySalesUnitCategory sbm-select" name=""></select>
|
||||
<select id="" class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleUnitCat) sbm-select" name=""></select>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<select id="" class="CommoditySalesUnitType sbm-select" name="Commodity.SalesUnitType"></select>
|
||||
<select id="" class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleUnitType) sbm-select" name="Commodity.SaleUnitType"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -140,17 +140,17 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Sales Tax *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesTaxCode)">
|
||||
@* Sale Tax *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleTaxCode)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="ifCommoditySalesTax"><span>@Localiser["label.tax"]</span><span class="required"> *</span></label>
|
||||
<label for="ifCommoditySaleTax"><span>@Localiser["label.tax"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="sbm-control">
|
||||
<select id="" class="CommoditySalesTaxCode sbm-select sbm-auto-val" name="Commodity.SalesTaxCode"></select>
|
||||
<select id="" class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleTaxCode) sbm-select sbm-auto-val" name="Commodity.SaleTaxCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -160,18 +160,17 @@
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Sales Unit *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesPackQty)">
|
||||
@Html.Hidden("Commodity.SalesUomId")
|
||||
@* Sale Unit *@
|
||||
<div class="sbm-form-control @Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalePackQty)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="ifCommoditySalesUnit"><span>@Localiser["label.pack.quantity"]</span><span class="required"> *</span></label>
|
||||
<label for="ifCommoditySaleUnit"><span>@Localiser["label.pack.quantity"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Commodity.SalesPackQty", "", new { @id = "ifCommoditySalesPackQty", @class = "CommoditySalesPackQty sbm-input right sbm-auto-val", @maxlength = 5 })
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control width50pc">
|
||||
@Html.TextBox("Commodity.SalePackQty", "", new { @id = "ifCommoditySalePackQty", @class = $"{Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalePackQty)} sbm-input right sbm-auto-val", @maxlength = 5 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -191,7 +190,7 @@
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-control">
|
||||
<select id="cbCommodityStatus" class="CommodityStatus sbm-select sbm-auto-val" name="Commodity.StatusCode"></select>
|
||||
<select id="cbCommodityStatus" class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Status) sbm-select sbm-auto-val" name="Commodity.StatusCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -208,7 +207,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextArea("Commodity.Notes", "", new { @id = "ifCommodityNotes", @class = "CommodityNotes sbm-textarea sbm-auto-val", @rows = "3", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Commodity_Notes) })
|
||||
@Html.TextArea("Commodity.Notes", "", new { @id = "ifCommodityNotes", @class = $"{Model_Commodity.GetFieldName(Model_Commodity.ItemField.Notes)} sbm-textarea sbm-auto-val", @rows = "3", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Commodity_Notes) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
|
||||
@@ -13,11 +13,11 @@
|
||||
<tr>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Code) width20pc pl-2">@Localiser["label.code"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.DescBrief) width25pc">@Localiser["label.description"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Type) width5pc center">@Localiser["label.type"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.TypeDesc) width5pc center">@Localiser["label.type"]</th>
|
||||
@if (Model.UserCanViewCommodityFinancials_Sales())
|
||||
{
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesPriceFmt) width5pc right">@Localiser["label.price"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesUnit) width5pc center">@Localiser["label.unit"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleAmountFmt) width5pc right">@Localiser["label.price"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleUnit) width5pc center">@Localiser["label.unit"]</th>
|
||||
}
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Notes) width25pc d-none d-md-table-cell">@Localiser["label.notes"]</th>
|
||||
<th class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Status) width5pc center">@Localiser["label.status"]</th>
|
||||
@@ -42,11 +42,11 @@
|
||||
<tr class="sbm-row-item Commodity">
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Code) pl-1"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.DescBrief)"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Type) center nowrap"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.TypeDesc) center nowrap"></td>
|
||||
@if (Model.UserCanViewCommodityFinancials_Sales())
|
||||
{
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesPriceFmt) right nowrap"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SalesUnit) center nowrap"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleAmountFmt) right nowrap"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.SaleUnit) center nowrap"></td>
|
||||
}
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Notes) d-none d-md-table-cell"></td>
|
||||
<td class="@Model_Commodity.GetFieldName(Model_Commodity.ItemField.Status) center nowrap"></td>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<select name="Contact.Type" id="cbContactType" class="ContactType sbm-select"></select>
|
||||
<select name="Contact.Type" id="cbContactType" class="@Model_Contact.GetFieldName(Model_Contact.ItemField.Type) sbm-select"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Abbreviation", "", new { @id = "ifContactAbbreviation", @class = "ContactAbbreviation sbm-input sbm-auto-val upper", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Abbrev) })
|
||||
@Html.TextBox("Contact.Abbreviation", "", new { @id = "ifContactAbbreviation", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Abbreviation) + " sbm-input sbm-auto-val upper", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Abbrev) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Name", "", new { @id = "ifContactName", @class = "ContactName sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Name) })
|
||||
@Html.TextBox("Contact.Name", "", new { @id = "ifContactName", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Name) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Name) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,7 +100,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Nature", "", new { @id = "ifContactNature", @class = "ContactNature sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Nature) })
|
||||
@Html.TextBox("Contact.Nature", "", new { @id = "ifContactNature", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Nature) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Nature) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -121,7 +121,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Contact", "", new { @id = "ifContactContact", @class = "ContactContact sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Contact) })
|
||||
@Html.TextBox("Contact.Contact", "", new { @id = "ifContactContact", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Contact) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Contact) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -144,7 +144,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<select name="Contact.Title" id="cbContactTitle" class="ContactTitle sbm-select sbm-auto-val">
|
||||
<select name="Contact.Title" id="cbContactTitle" class="@Model_Contact.GetFieldName(Model_Contact.ItemField.Title) sbm-select sbm-auto-val">
|
||||
@foreach (var title in Model.GetCodeTypeCodesForSelect(Sbm.ApplCodeType.ContactTitle))
|
||||
{
|
||||
<option value="@title.Value">@title.Text</option>
|
||||
@@ -170,7 +170,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Salutation", "", new { @id = "ifContactSalutation", @class = "ContactSalutation sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Salutation) })
|
||||
@Html.TextBox("Contact.Salutation", "", new { @id = "ifContactSalutation", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Salutation) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Salutation) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.FirstName", "", new { @id = "ifContactFirstName", @class = "ContactFirstName sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_FirstName) })
|
||||
@Html.TextBox("Contact.FirstName", "", new { @id = "ifContactFirstName", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.FirstName) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_FirstName) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -214,7 +214,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Initials", "", new { @id = "ifContactInitials", @class = "ContactInitials sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Initials) })
|
||||
@Html.TextBox("Contact.Initials", "", new { @id = "ifContactInitials", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Initials) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Initials) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -234,7 +234,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.LastName", "", new { @id = "ifContactLastName", @class = "ContactLastName sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_LastName) })
|
||||
@Html.TextBox("Contact.LastName", "", new { @id = "ifContactLastName", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.LastName) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_LastName) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -254,7 +254,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.PhoneMain", "", new { @id = "ifContactPhoneMain", @class = "ContactPhoneMain sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneMain) })
|
||||
@Html.TextBox("Contact.PhoneMain", "", new { @id = "ifContactPhoneMain", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.PhoneMain) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneMain) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -275,7 +275,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.PhoneAlt", "", new { @id = "ifContactPhoneAlt", @class = "ContactPhoneAlt sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneAlt) })
|
||||
@Html.TextBox("Contact.PhoneAlt", "", new { @id = "ifContactPhoneAlt", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.PhoneAlt) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneAlt) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -292,7 +292,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.PhoneMobile", "", new { @id = "ifContactPhoneMobile", @class = "ContactPhoneMobile sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneMobile) })
|
||||
@Html.TextBox("Contact.PhoneMobile", "", new { @id = "ifContactPhoneMobile", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.PhoneMobile) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneMobile) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -315,7 +315,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.PhoneDirect", "", new { @id = "ifContactPhoneDirect", @class = "ContactPhoneDirect sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneDirect) })
|
||||
@Html.TextBox("Contact.PhoneDirect", "", new { @id = "ifContactPhoneDirect", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.PhoneDirect) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneDirect) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -336,7 +336,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.PhoneFax", "", new { @id = "ifContactPhoneFax", @class = "ContactPhoneFax sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneFax) })
|
||||
@Html.TextBox("Contact.PhoneFax", "", new { @id = "ifContactPhoneFax", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.PhoneFax) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_PhoneFax) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -356,7 +356,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Email", "", new { @id = "ifContactEmail", @class = "ContactEmail sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Email) })
|
||||
@Html.TextBox("Contact.Email", "", new { @id = "ifContactEmail", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Email) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Email) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -373,7 +373,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.Website", "", new { @id = "ifContactWebsite", @class = "ContactWebsite sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Website) })
|
||||
@Html.TextBox("Contact.Website", "", new { @id = "ifContactWebsite", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.Website) + " sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Website) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -393,7 +393,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.CompanyNo", "", new { @id = "ifContactCompanyNo", @class = "ContactCompanyNo sbm-input upper sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_CompanyNo) })
|
||||
@Html.TextBox("Contact.CompanyNo", "", new { @id = "ifContactCompanyNo", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.CompanyNo) + " sbm-input upper sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_CompanyNo) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -414,7 +414,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Contact.VatReg", "", new { @id = "ifContactVatReg", @class = "ContactVatReg sbm-input upper sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_VatReg) })
|
||||
@Html.TextBox("Contact.VatReg", "", new { @id = "ifContactVatReg", @class = Model_Contact.GetFieldName(Model_Contact.ItemField.VatReg) + " sbm-input upper sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_VatReg) })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -435,7 +435,7 @@
|
||||
<div class="col-sm">
|
||||
<div class="sbm-form-control @Model_Contact.GetFieldName(Model_Contact.ItemField.Prospect)">
|
||||
<div class="sbm-control">
|
||||
<input type="checkbox" name="Contact.Prospect" id="chkContactProspect" class="ContactProspect sbm-checkbox mt-1" value="true" />
|
||||
<input type="checkbox" name="Contact.Prospect" id="chkContactProspect" class="@Model_Contact.GetFieldName(Model_Contact.ItemField.Prospect) sbm-checkbox mt-1" value="true" />
|
||||
<input type="checkbox" name="Contact.Prospect" class="sbm-checkbox hidden" value="false" />
|
||||
<span class="sbm-label pointer" onclick="$('#chkContactProspect').click();">@Localiser["label.prospect"]</span>
|
||||
</div>
|
||||
@@ -455,7 +455,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<textarea name="Contact.Notes" id="ifContactNotes" class="ContactNotes sbm-textarea sbm-auto-val" rows="3" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Notes)"></textarea>
|
||||
<textarea name="Contact.Notes" id="ifContactNotes" class="@Model_Contact.GetFieldName(Model_Contact.ItemField.Notes) sbm-textarea sbm-auto-val" rows="3" maxlength="@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Notes)"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
}
|
||||
|
||||
<script type="text/javascript">
|
||||
sbm.dlg.title.createRequirement = '@Localiser.GetJavascriptText("caption.commodity.create")';
|
||||
sbm.dlg.title.updateRequirement = '@Localiser.GetJavascriptText("caption.commodity.update")';
|
||||
sbm.dlg.title.createRequirement = '@Localiser.GetJavascriptText("caption.requirement.create")';
|
||||
sbm.dlg.title.updateRequirement = '@Localiser.GetJavascriptText("caption.requirement.update")';
|
||||
</script>
|
||||
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmRequirementId", @class = "sbm-form" }))
|
||||
@@ -22,9 +22,13 @@
|
||||
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmRequirement", @class = "sbm-form", @onSubmit = "return false;" }))
|
||||
{
|
||||
@Html.Hidden("Requirement.Id", "", new { @id = "", @class = "RequirementId sbm-input" })
|
||||
@Html.Hidden("Requirement.Exists", "", new { @id = "", @class = "RequirementExists sbm-input" })
|
||||
@Html.Hidden("Requirement.SupersededStatusConfirmed", "", new { @id = "", @class = "SupersededStatusConfirmed sbm-input" })
|
||||
@Html.Hidden("Requirement.Id", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.Id)} sbm-input" })
|
||||
@Html.Hidden("Requirement.Exists", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.Exists)} sbm-input" })
|
||||
@Html.Hidden("Requirement.TransactionId", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.TransactionId)} sbm-input sbm-auto-val" })
|
||||
@Html.Hidden("Requirement.TransactionType", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.TransactionType)} sbm-input sbm-auto-val" })
|
||||
@Html.Hidden("Requirement.CurrencyId", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.CurrencyId)} sbm-input sbm-auto-val" })
|
||||
@Html.Hidden("Requirement.TaxEffective", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.TaxEffective)} sbm-input sbm-auto-val" })
|
||||
@Html.Hidden("Requirement.Confirm.SuperStatus", "", new { @id = "", @class = "ReqntConfirmSuperStatus sbm-input" })
|
||||
<div class="spacer2"></div>
|
||||
|
||||
@* Commodity *@
|
||||
@@ -32,14 +36,14 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntProductCode"><span>@Localiser["label.item"]</span><span class="required"> *</span></label>
|
||||
<label for="ifReqntCommodity"><span>@Localiser["label.item"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control row">
|
||||
<div class="col">
|
||||
@Html.Hidden("Requirement.CommodityId", "", new { @id = "", @class = "ReqntCommodityId sbm-input" })
|
||||
<input type="text" id="ifReqntProductCode" class="ReqntProductCode sbm-input" readonly="readonly" />
|
||||
@Html.Hidden("Requirement.CommodityId", "", new { @id = "", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.CommodityId)} sbm-input" })
|
||||
<input type="text" id="ifReqntCommodity" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.Commodity) sbm-input" autocomplete="off" readonly="readonly" />
|
||||
</div>
|
||||
<div class="fixed">
|
||||
<div class="sbm-action ReqntCommoditySearch"><img src="~/img/action/search24.png" alt="" title="" /></div>
|
||||
@@ -60,7 +64,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.DescBrief", "", new { @id = "ifReqntDesc", @class = "ReqntDesc sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief) })
|
||||
@Html.TextBox("Requirement.DescBrief", "", new { @id = "ifReqntDesc", @class = $"{@Model_Requirement.GetFieldName(Model_Requirement.ItemField.DescBrief)} sbm-input sbm-auto-val", @autocomplete = false, @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_DescBrief) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -68,24 +72,24 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
|
||||
@* Sales Unit *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.Unit)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-label">
|
||||
<label for="cbReqntUnitType"><span>@Localiser["label.unit"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="col-sm-7">
|
||||
<div class="sbm-control">
|
||||
<div class="row">
|
||||
<div class="col-5 pr-1">
|
||||
<select id="" class="ReqntUnitCategory sbm-select" name=""></select>
|
||||
</div>
|
||||
<div class="col-7 pr-2">
|
||||
<select id="cbReqntUnitType" class="ReqntUnitType sbm-select" name="Requirement.UomId"></select>
|
||||
<select id="cbReqntUnitType" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.UnitType) sbm-select" name="Requirement.UnitType"></select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,20 +99,24 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
|
||||
@* Sales Unit *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.PackQty)">
|
||||
@Html.Hidden("Requirement.SalesUomId")
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-label">
|
||||
<label for="ifRequirementSalesUnit"><span>@Localiser["label.pack.quantity"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-control">
|
||||
<input type="text" id="ifReqntPackQty" class="ReqntPackQty sbm-input right" readonly="readonly" />
|
||||
<input type="text" id="ifReqntPackQty" class="ReqntPackQty sbm-input right" autocomplete="off" readonly="readonly" />
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -116,25 +124,19 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm">
|
||||
|
||||
@* Sales Price *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountUnit)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-6">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountUnit"><span>@Localiser["label.amount.unit"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.AmountUnit", "", new { @id = "ifReqntAmountUnit", @class = "ReqntAmountUnit sbm-input sbm-auto-val right sbm-format-currency", @readonly = true, @maxlength = 12 })
|
||||
@Html.TextBox("Requirement.AmountUnit", "", new { @id = "ifReqntAmountUnit", @class = "ReqntAmountUnit sbm-input sbm-auto-val right sbm-format-currency", @autocomplete = false, @readonly = true, @maxlength = 12 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -145,19 +147,19 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
|
||||
@* Quantity *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.Quantity)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntQuantity"><span>@Localiser["label.quantity"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.Quantity", "", new { @id = "ifReqntQuantity", @class = "ReqntQuantity sbm-input sbm-auto-val right", @maxlength = 8 })
|
||||
@Html.TextBox("Requirement.Quantity", "", new { @id = "ifReqntQuantity", @class = "ReqntQuantity sbm-input sbm-auto-val right", @autocomplete = false, @maxlength = 8 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -165,19 +167,19 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm">
|
||||
|
||||
@* Actual Amount *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountAct)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-6">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountAct"><span>@Localiser["label.amount.actual"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.AmountAct", "", new { @id = "ifReqntAmountAct", @class = "ReqntAmountAct sbm-input sbm-auto-val right sbm-format-currency", @readonly = true, @maxlength = 12 })
|
||||
@Html.TextBox("Requirement.AmountAct", "", new { @id = "ifReqntAmountAct", @class = "ReqntAmountAct sbm-input sbm-auto-val right sbm-format-currency", @autocomplete = false, @readonly = true, @maxlength = 12 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -188,22 +190,21 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
<div class="col-sm-8">
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm">
|
||||
|
||||
@* Amount Disc*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountDisc)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-6">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountDisc"><span>@Localiser["label.discount"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.AmountDisc", "", new { @id = "ifReqntAmountDisc", @class = "ReqntAmountDisc sbm-input sbm-auto-val right sbm-format-currency", @readonly = true, @maxlength = 12 })
|
||||
<input type="text" id="ifReqntAmountDisc" class="ReqntAmountDisc sbm-input sbm-auto-val right sbm-format-currency" autocomplete="off" readonly="readonly" maxlength=12 />
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -214,88 +215,19 @@
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Amount Net*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountNet)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountNet"><span>@Localiser["label.amount.net"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.AmountNet", "", new { @id = "ifReqntAmountNet", @class = "ReqntAmountNet sbm-input sbm-auto-val right sbm-format-currency", @readonly = true, @maxlength = 12 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Tax *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.TaxCode)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="cbReqntTaxCode"><span>@Localiser["label.tax"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="sbm-control">
|
||||
<select id="cbReqntTaxCode" class="ReqntTaxCode sbm-select sbm-auto-val" name="Requirement.TaxCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Amount Tax*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountTax)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountTax"><span>@Localiser["label.amount.tax"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.AmountTax", "", new { @id = "ifReqntAmountTax", @class = "ReqntAmountTax sbm-input sbm-auto-val right sbm-format-currency", @readonly = true, @maxlength = 12 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-8">
|
||||
|
||||
@* Required *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.Required)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-label">
|
||||
<label for="ifRequirementRequired"><span>@Localiser["label.required"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control row">
|
||||
<div class="fixed">@Html.TextBox("Requirement.Required", "", new { @id = "ifRequirementRequired", @class = "RequirementRequired sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })</div>
|
||||
<div class="fixed">@Html.TextBox("Requirement.Required", "", new { @id = "ifRequirementRequired", @class = "RequirementRequired sbm-input sbm-calendar sbm-auto-val", @autocomplete = false, @maxlen = 10 })</div>
|
||||
<div class="col"><div class="pt-2 pl-2"><img src="~/img/action/delete16.png" class="ClearRequirementRequired sbm-action" alt="" title="" /></div></div>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
@@ -304,19 +236,19 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm">
|
||||
|
||||
@* Amount Tot*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountTot)">
|
||||
@* Amount Net*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountNet)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-6">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountTot"><span>@Localiser["label.amount.total"]</span><span class="required"> *</span></label>
|
||||
<label for="ifReqntAmountNet"><span>@Localiser["label.amount.net"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Requirement.AmountTot", "", new { @id = "ifReqntAmountTot", @class = "ReqntAmountTot sbm-input sbm-auto-val right sbm-format-currency", @readonly = true, @maxlength = 12 })
|
||||
<input type="text" id="ifReqntAmountNet" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountNet) sbm-input sbm-auto-val right sbm-format-currency" autocomplete="off" readonly="readonly" maxlength=12 />
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -326,20 +258,63 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
|
||||
@* Tax *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.TaxCode)">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-label">
|
||||
<label for="cbReqntTaxCode"><span>@Localiser["label.tax"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="sbm-control">
|
||||
<select id="cbReqntTaxCode" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.TaxCode) sbm-select sbm-auto-val" name="Requirement.TaxCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
|
||||
@* Amount Tax*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountTax)">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountTax"><span>@Localiser["label.amount.tax"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<input type="text" id="ifReqntAmountTax" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountTax) sbm-input sbm-auto-val right sbm-format-currency" autocomplete="off" readonly="readonly" maxlength="12" />
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
|
||||
@* Requirement status *@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.Status)">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-3">
|
||||
<div class="sbm-label">
|
||||
<label for="cbRequirementStatus"><span>@Localiser["label.status"]</span><span class="required"> *</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-5">
|
||||
<div class="sbm-control">
|
||||
<select id="cbRequirementStatus" class="RequirementStatus sbm-select sbm-auto-val" name="Requirement.StatusCode"></select>
|
||||
<select id="cbRequirementStatus" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.Status) sbm-select sbm-auto-val" name="Requirement.StatusCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -347,7 +322,25 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
|
||||
@* Amount Tot*@
|
||||
<div class="sbm-form-control @Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountTot)">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="sbm-label">
|
||||
<label for="ifReqntAmountTot"><span>@Localiser["label.amount.total"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<input type="text" id="ifReqntAmountTot" class="@Model_Requirement.GetFieldName(Model_Requirement.ItemField.AmountTot) sbm-input sbm-auto-val right sbm-format-currency" autocomplete="off" readonly="readonly" maxlength=12 />
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -361,7 +354,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextArea("Requirement.Notes", "", new { @id = "ifRequirementNotes", @class = "RequirementNotes sbm-textarea sbm-auto-val", @rows = "3", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_Notes) })
|
||||
@Html.TextArea("Requirement.Notes", "", new { @id = "ifRequirementNotes", @class = $"{Model_Requirement.GetFieldName(Model_Requirement.ItemField.Notes)} sbm-textarea sbm-auto-val", @autocomplete = false, @rows = "3", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Requirement_Notes) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<div class="sbm-panel-header">
|
||||
<div class="row">
|
||||
<div class="col"><partial name="~/Views/Common/ResultsPaging.cshtml" /></div>
|
||||
<div class="fixed center"><div class="sbm-panel-caption">@Localiser["label.Requirements"]</div></div>
|
||||
<div class="fixed center"><div class="sbm-panel-caption">@Localiser["label.requirements"]</div></div>
|
||||
<div class="col right">
|
||||
@* Burger menu *@
|
||||
<ul class="nav navbar-nav navbar-dark navbar-right sbm-burger">
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
{
|
||||
@Html.Hidden("Filter.Mode", Model_Requirement.ViewMode.Search, new { @id = "", @class = "FilterMode" })
|
||||
@Html.Hidden("Filter.TransactionId", "", new { @id = "", @class = "FilterTransactionId" })
|
||||
@Html.Hidden("Filter.TransactionType", "", new { @id = "", @class = "FilterTransactionType" })
|
||||
<input type="hidden" class="FilterTaxEffective" />
|
||||
|
||||
@* Filter Panel *@
|
||||
<div class="sbm-panel-filter">
|
||||
@@ -32,6 +34,34 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@* Element templates *@
|
||||
<div class="sbm-panel-item-template">
|
||||
|
||||
@* Dialog Titlebar content *@
|
||||
<div class="sbm-panel-header">
|
||||
<div class="row">
|
||||
<div class="col"><partial name="~/Views/Common/ResultsPaging.cshtml" /></div>
|
||||
<div class="fixed center"><div class="sbm-panel-caption">@Localiser["label.requirements"]</div></div>
|
||||
<div class="col right">
|
||||
@* Burger menu *@
|
||||
<ul class="nav navbar-nav navbar-dark navbar-right sbm-burger">
|
||||
<li class="dropdown-toggle caret-off">
|
||||
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right sbm-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Dialog burger dropdown template is defined in Requirement List panel. *@
|
||||
|
||||
</div>
|
||||
|
||||
<partial name="Panel-RequirementList.cshtml" />
|
||||
|
||||
</div>
|
||||
|
||||
@* Commodity panels. *@
|
||||
<partial name="~/Views/Commodity/Panel-CommoditySelect.cshtml" />
|
||||
<partial name="~/Views/Commodity/Panel-CommodityDialog.cshtml" />
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
sbm.msg.dataNoneFound = '@Localiser.GetJavascriptText("msg.data.noneFound")';
|
||||
sbm.maxProfileImageSize = 2 * 10 ** 6;
|
||||
sbm.sessionCookieName = '@Model.SessionCookieName';
|
||||
sbm.data.decimalsCurrency = 2;
|
||||
sbm.data.decimalsCurrency = @Model.GetInternals().GetCurrentCurrencyDecimals();
|
||||
sbm.awaitingLogin = @awaitingLogin;
|
||||
sbm.keepLoggedIn = @keepLoggedIn;
|
||||
sbm.keepLoggedInDelay = @(Sbm.Config.Control.Session.Cookie.KeepLoggedInTimeoutMillis);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<div class="spacer2"></div>
|
||||
|
||||
@* Association *@
|
||||
<div class="sbm-form-control @Model_Transaction.GetFieldName(Model_Transaction.ItemField.AssociationName)">
|
||||
<div class="sbm-form-control @Model_Transaction.GetFieldName(Model_Transaction.ItemField.Association)">
|
||||
<div class="row">
|
||||
<div class="col-sm-2">
|
||||
<div class="sbm-label">
|
||||
@@ -38,11 +38,11 @@
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control row">
|
||||
<div class="col">
|
||||
@Html.Hidden("Transaction.AssociationId", "", new { @id = "", @class = "TransactionAssociationId sbm-input" })
|
||||
<input type="text" name="Transaction.Association" id="ifTransactionAssociation" readonly="readonly" class="TransactionAssociation sbm-input sbm-auto-val" maxlength=@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Name) />
|
||||
@Html.Hidden("Transaction.AssociationId", "", new { @id = "", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.AssociationId)} sbm-input" })
|
||||
<input type="text" name="Transaction.Association" id="ifTransactionAssociation" readonly="readonly" class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Association) sbm-input sbm-auto-val" maxlength=@Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Affiliate_Name) />
|
||||
</div>
|
||||
<div class="fixed">
|
||||
<div class="sbm-action AssociationTargetSearch"><img src="~/img/action/search24.png" alt="" title="" /></div>
|
||||
<div class="sbm-action TransactionAssociationSearch"><img src="~/img/action/search24.png" alt="" title="" /></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.Reference", "", new { @id = "ifTransactionReference", @class = "TransactionReference sbm-input upper sbm-auto-val", @readonly = true, @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Ref) })
|
||||
@Html.TextBox("Transaction.Reference", "", new { @id = "ifTransactionReference", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.Reference)} sbm-input upper sbm-auto-val", @readonly = true, @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Ref) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -83,7 +83,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.TransactionReferenceExt", "", new { @id = "ifTransactionReferenceExt", @class = "TransactionReferenceExt sbm-input upper sbm-auto-val" })
|
||||
@Html.TextBox("Transaction.ReferenceExt", "", new { @id = "ifTransactionReferenceExt", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.ReferenceExt)} sbm-input upper sbm-auto-val" })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -103,7 +103,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.DescBrief", "", new { @id = "ifTransactionDesc", @class = "TransactionDesc sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescBrief) })
|
||||
@Html.TextBox("Transaction.DescBrief", "", new { @id = "ifTransactionDesc", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescBrief)} sbm-input sbm-auto-val", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_DescBrief) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -123,7 +123,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
<select id="cbTransactionStatus" class="TransactionStatus sbm-select sbm-auto-val" name="Transaction.StatusCode"></select>
|
||||
<select id="cbTransactionStatus" class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Status) sbm-select sbm-auto-val" name="Transaction.StatusCode"></select>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -143,7 +143,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.ContactName", "", new { @id = "ifTransactionContactName", @class = "TransactionContactName sbm-input sbm-auto-val", @maxlen = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactName) })
|
||||
@Html.TextBox("Transaction.ContactName", "", new { @id = "ifTransactionContactName", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.ContactName)} sbm-input sbm-auto-val", @maxlen = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_ContactName) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -166,7 +166,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.Raised", "", new { @id = "ifTransactionRaised", @class = "TransactionRaised sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })
|
||||
@Html.TextBox("Transaction.Raised", "", new { @id = "ifTransactionRaised", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.Raised)} sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -186,7 +186,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.RaisedBy", "", new { @id = "ifTransactionRaisedBy", @class = "TransactionRaisedBy sbm-input sbm-auto-val", @maxlen = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_RaisedBy) })
|
||||
@Html.TextBox("Transaction.RaisedBy", "", new { @id = "ifTransactionRaisedBy", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.RaisedBy)} sbm-input sbm-auto-val", @maxlen = Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_RaisedBy) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -209,7 +209,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.InProgress", "", new { @id = "ifTransactionInProgress", @class = "TransactionInProgress sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })
|
||||
@Html.TextBox("Transaction.InProgress", "", new { @id = "ifTransactionInProgress", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.InProgress)} sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -229,7 +229,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control row">
|
||||
<div class="fixed">@Html.TextBox("Transaction.Required", "", new { @id = "ifTransactionRequired", @class = "TransactionRequired sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })</div>
|
||||
<div class="fixed">@Html.TextBox("Transaction.Required", "", new { @id = "ifTransactionRequired", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.Required)} sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })</div>
|
||||
<div class="col"><div class="pt-2 pl-2"><img src="~/img/action/delete16.png" class="ClearTransactionRequired sbm-action" alt="" title="" /></div></div>
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
@@ -253,7 +253,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextBox("Transaction.Closed", "", new { @id = "ifTransactionClosed", @class = "TransactionClosed sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })
|
||||
@Html.TextBox("Transaction.Closed", "", new { @id = "ifTransactionClosed", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.Closed)} sbm-input sbm-calendar sbm-auto-val", @maxlen = 10 })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
@@ -276,7 +276,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sbm-control">
|
||||
@Html.TextArea("Transaction.Notes", "", new { @id = "ifTransactionNotes", @class = "TransactionNotes sbm-textarea sbm-auto-val", @rows = "3", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Notes) })
|
||||
@Html.TextArea("Transaction.Notes", "", new { @id = "ifTransactionNotes", @class = $"{Model_Transaction.GetFieldName(Model_Transaction.ItemField.Notes)} sbm-textarea sbm-auto-val", @rows = "3", @maxlength = @Model.GetControlMaxLength(SbmDbDfn.ColumnIdx.Transaction_Notes) })
|
||||
</div>
|
||||
<div class="sbm-message"></div>
|
||||
</div>
|
||||
|
||||
@@ -13,14 +13,15 @@
|
||||
<tr>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Reference) width5pc center">@Localiser["label.reference"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Type) width5pc center">@Localiser["label.type"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.AssociationName) width15pc">@Localiser["label.association"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Association) width15pc">@Localiser["label.association"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescBrief) width10pc d-none d-lg-table-cell">@Localiser["label.narrative"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.RaisedFmt) width5pc center nowrap">@Localiser["label.items"]</th>
|
||||
@* Status dates. *@
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.RaisedFmt) width5pc center nowrap">@Localiser["label.raised"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.RequiredFmt) width5pc center nowrap">@Localiser["label.required"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.InProgressFmt) width5pc center nowrap">@Localiser["label.in.progress"]</th>
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.ClosedFmt) width5pc center nowrap">@Localiser["label.closed"]</th>
|
||||
@* Items *@
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.ItemCount) width5pc center nowrap">@Localiser["label.items"]</th>
|
||||
@if (Model.UserCanViewFinancials())
|
||||
{
|
||||
<th class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.AmountNet) width5pc right">@Localiser["label.amount.net"]</th>
|
||||
@@ -49,14 +50,15 @@
|
||||
<tr class="sbm-row-item Transaction">
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Reference) center nowrap"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Type) center nowrap"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.AssociationName)"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.Association)"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.DescBrief) d-none d-lg-table-cell"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.ItemCount) center nowrap"></td>
|
||||
@* Status dates. *@
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.RaisedFmt) center nowrap"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.RequiredFmt) center nowrap"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.InProgressFmt) center nowrap"></td>
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.ClosedFmt) center nowrap"></td>
|
||||
@* Items *@
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.ItemCount) center nowrap"></td>
|
||||
@if (Model.UserCanViewFinancials())
|
||||
{
|
||||
<td class="@Model_Transaction.GetFieldName(Model_Transaction.ItemField.AmountNet) right nowrap"></td>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
/* Panels */
|
||||
|
||||
.sbm-panel-info, .sbm-panel-form
|
||||
.sbm-panel-form
|
||||
{
|
||||
max-width: 720px;
|
||||
margin: 24px auto;
|
||||
@@ -25,12 +25,11 @@
|
||||
|
||||
@media (min-width: 576px)
|
||||
{
|
||||
.sbm-panel-info, .sbm-panel-form
|
||||
.sbm-panel-form
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
.sbm-panel-info > .sbm-header,
|
||||
.sbm-panel-form > .sbm-header
|
||||
{
|
||||
padding: 12px 12px;
|
||||
@@ -40,7 +39,6 @@
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
.sbm-panel-info > .sbm-header .sbm-caption,
|
||||
.sbm-panel-form > .sbm-header .sbm-caption
|
||||
{
|
||||
font-size: 1.5rem;
|
||||
@@ -48,7 +46,6 @@
|
||||
color: var(--color-primary-dark);
|
||||
}
|
||||
|
||||
.sbm-panel-info > .sbm-header .sbm-action img:hover,
|
||||
.sbm-panel-form > .sbm-header .sbm-action img:hover
|
||||
{
|
||||
background-color: #f0f0f0;
|
||||
@@ -56,7 +53,6 @@
|
||||
box-shadow: 2px 2px 4px 0 #80808080;
|
||||
}
|
||||
|
||||
.sbm-panel-info > .sbm-content,
|
||||
.sbm-panel-form > .sbm-content
|
||||
{
|
||||
max-height: 400px;
|
||||
@@ -65,66 +61,6 @@
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.sbm-panel-info > .sbm-content
|
||||
{
|
||||
padding: 8px 12px;
|
||||
}
|
||||
|
||||
.sbm-panel-section.sbm-edit .sbm-panel-info,
|
||||
.sbm-panel-section.sbm-populating .sbm-button-action.edit,
|
||||
.sbm-panel-section .sbm-panel-form
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.sbm-panel-section.sbm-edit .sbm-panel-form
|
||||
{
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Form */
|
||||
|
||||
.sbm-form
|
||||
{
|
||||
}
|
||||
|
||||
/* Labels, values, notes */
|
||||
|
||||
.sbm-panel-info .sbm-label, .sbm-panel-info .sbm-value
|
||||
{
|
||||
margin-bottom: 6px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.sbm-panel-info .sbm-label
|
||||
{
|
||||
padding-right: 16px;
|
||||
font-weight: bold;
|
||||
color: #808080;
|
||||
}
|
||||
|
||||
.sbm-panel-info .sbm-value
|
||||
{
|
||||
}
|
||||
|
||||
.sbm-form .sbm-form-control .sbm-label
|
||||
{
|
||||
margin: 2px 0 8px 0;
|
||||
}
|
||||
|
||||
.sbm-form .sbm-form-control .sbm-label,
|
||||
.sbm-form .sbm-form-control .sbm-label-text
|
||||
{
|
||||
font-size: 1rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.sbm-form .sbm-form-control .sbm-note
|
||||
{
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* Controls */
|
||||
|
||||
.sbm-form .sbm-form-control
|
||||
|
||||
@@ -380,6 +380,14 @@ a:focus
|
||||
border-color: var(--color-dialog);
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-titlebar .sbm-panel-caption
|
||||
{
|
||||
margin: 2px 0;
|
||||
font-size: 1.1em;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.ui-widget-content
|
||||
{
|
||||
font-size: 16px;
|
||||
@@ -444,7 +452,7 @@ a:focus
|
||||
|
||||
.ui-datepicker-trigger
|
||||
{
|
||||
margin-left:4px;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
/* The End */
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
$ctrls.filter('.CommodityExists').val(1);
|
||||
sbm.selectOrAdd($ctrls.filter('.CommodityType'), item.typeCode, item.typeDesc);
|
||||
co.populateSaleUomType(env, item.salesUnitType);
|
||||
$ctrls.filter('.CommoditySalesPackQty').off('blur').on('blur', function () { sbm.formatNumber($(this), cfg.decimals.packQty); }).trigger('blur');
|
||||
$ctrls.filter('.CommoditySalePackQty').off('blur').on('blur', function () { sbm.formatNumber($(this), cfg.decimals.packQty); }).trigger('blur');
|
||||
sbm.selectOrAdd($ctrls.filter('.CommodityStatus'), item.statusCode, item.field.value.Status);
|
||||
co.openItemDlg(env, cfg, sbm.dlg.title.updateCommodity);
|
||||
}
|
||||
@@ -327,15 +327,15 @@
|
||||
env.$dlg.item = $items.find('#dlgCommodity').dialog(opt);
|
||||
env.$frm.item = env.$dlg.item.find('#frmCommodity').off('input').on('input', '.sbm-input, .sbm-textarea', function () { sbm.clearControlError(this); }).off('change').on('change', '.sbm-select', function () { sbm.clearControlError(this); });
|
||||
env.$frm.item.off('blur').on('blur', '.sbm-input.sbm-format-integer', function () { sbm.formatInteger($(this)); }).off('blur').on('blur', '.sbm-input.sbm-format-currency', function () { sbm.formatCurrency($(this)); });
|
||||
env.$ctrl.saleTaxCode = env.$frm.item.find('.sbm-select.CommoditySalesTaxCode');
|
||||
env.$ctrl.saleUomCat = env.$frm.item.find('.sbm-select.CommoditySalesUnitCategory');
|
||||
env.$ctrl.saleUomTyp = env.$frm.item.find('.sbm-select.CommoditySalesUnitType');
|
||||
env.$ctrl.saleTaxCode = env.$frm.item.find('.sbm-select.CommoditySaleTaxCode');
|
||||
env.$ctrl.saleUomCat = env.$frm.item.find('.sbm-select.CommoditySaleUnitCat');
|
||||
env.$ctrl.saleUomTyp = env.$frm.item.find('.sbm-select.CommoditySaleUnitType');
|
||||
|
||||
var opt = sbm.dlgOpts();
|
||||
opt.dialogClass += " sbm-Commodity";
|
||||
opt.buttons[sbm.lbl.ok] = function () { co.selectItem(env); };
|
||||
opt.buttons[sbm.lbl.cancel] = function () { delete env.prmSelect; $(this).dialog('close'); };
|
||||
env.$dlg.select = $items.find('#dlgCommoditySelect').dialog(opt);
|
||||
env.$dlg.select = $('#dlgCommoditySelect').dialog(opt);
|
||||
|
||||
return env;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
}
|
||||
ct.handleCodeTypes = function (env, response)
|
||||
{
|
||||
sbm.debug('handleCodeTypes', response);
|
||||
//sbm.debug('handleCodeTypes', response);
|
||||
delete ct.awaitingRefreshResponse;
|
||||
let $table = $('table', env.$pnl.table).find('tbody tr').remove().end();
|
||||
env.$pnl.msgs.hide().empty();
|
||||
|
||||
@@ -169,13 +169,13 @@
|
||||
sbm.populateItemValues = function (cfg, $item, val)
|
||||
{
|
||||
//sbm.debug('populateItemValues', cfg, $item, val);
|
||||
for (var name in val || []) { $item.find('.' + cfg.column.prefix + name).text(val[name]); };
|
||||
for (var name in val || {}) { $item.find('.' + cfg.column.prefix + name).text(val[name]); };
|
||||
}
|
||||
sbm.clearItemForm = function ($frm)
|
||||
{
|
||||
sbm.clearControlErrors($frm);
|
||||
$frm.find('.sbm-input,.sbm-textarea,.sbm-select').val('').prop('readonly', false).prop('disabled', false);
|
||||
$frm.find('.sbm-checkbox').prop('readonly', false).prop('disabled', false).removeAttr('checked');
|
||||
$frm.find('.sbm-input,.sbm-textarea,.sbm-select').val('').filter('.sbm-auto-val').prop('readonly', false).prop('disabled', false);
|
||||
$frm.find('.sbm-checkbox').removeAttr('checked').filter('.sbm-auto-val').prop('readonly', false).prop('disabled', false);
|
||||
}
|
||||
sbm.configureItemControls = function (cfg, $frm)
|
||||
{
|
||||
@@ -189,8 +189,8 @@
|
||||
sbm.populateFormValues = function (cfg, $frm, val)
|
||||
{
|
||||
//sbm.debug('populateFormValues', cfg, $frm, val);
|
||||
let $ctrl = $('.sbm-form-control', $frm);
|
||||
for (var name in val || {}) { $ctrl.filter('.' + cfg.field.prefix + name).find('.sbm-input,.sbm-textarea,.sbm-select').filter('.sbm-auto-val').val(val[name]).end().find('.sbm-checkbox').prop('checked', !!val[name]); };
|
||||
let $ctrl = $frm.find('.sbm-input,.sbm-textarea,.sbm-select,.sbm-checkbox').filter('.sbm-auto-val');
|
||||
for (var name in val || {}) { $ctrl.filter('.' + cfg.field.prefix + name).val(val[name]).filter('.sbm-checkbox').prop('checked', !!val[name]); };
|
||||
}
|
||||
sbm.formatInteger = function ($ctrl)
|
||||
{
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
env.$pnl.table.find('tbody tr').remove();
|
||||
env.$pnl.msgs.hide().empty().append($('<div class="sbm-message">' + sbm.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||
}
|
||||
env.ajax.refreshResults = env.ajax.refreshResults || { url: sbm.url.base + 'Requirement/Ajax/List', formSel: env.$frm.filter, callbackFn: function (response) { re.doRefreshResults(env, response); } };
|
||||
sbm.doAjaxRequest(env.ajax.refreshResults, delay || 50);
|
||||
sbm.doAjaxRequest(env.ajax.refreshResults = env.ajax.refreshResults || { url: sbm.url.base + 'Requirement/Ajax/List', formSel: env.$frm.filter, callbackFn: function (response) { re.doRefreshResults(env, response); } }, delay || 50);
|
||||
re.awaitingRefreshResponse = true;
|
||||
}
|
||||
re.doRefreshResults = function (env, response)
|
||||
@@ -126,8 +125,9 @@
|
||||
{
|
||||
re.clearItem(env, cfg);
|
||||
let $frm = env.$frm.item;
|
||||
$frm.find('.RequirementType').val(env.data.requirementTypeDefault);
|
||||
$frm.find('.RequirementStatus').val(env.data.defaultStatusCode);
|
||||
$frm.find('.ReqntType').val(env.data.requirementTypeDefault);
|
||||
$frm.find('.ReqntTaxEffective').val(env.$frm.filter.find('.FilterTaxEffective').val());
|
||||
$frm.find('.ReqntStatus').val(env.data.defaultStatusCode);
|
||||
re.openItemDlg(env, cfg, sbm.dlg.title.createRequirement);
|
||||
}
|
||||
re.clearItem = function (env, cfg)
|
||||
@@ -143,6 +143,12 @@
|
||||
{
|
||||
let $dlg = env.$dlg.item;
|
||||
let $frm = env.$frm.item;
|
||||
let fnSelCmd = function () { re.selectCommodity(env); };
|
||||
$frm.find('.ReqntTransactionId').val(env.$frm.filter.find('.FilterTransactionId').val());
|
||||
$frm.find('.ReqntTransactionType').val(env.$frm.filter.find('.FilterTransactionType').val());
|
||||
$frm.find('.ReqntCommodity').off('dblclick').on('dblclick', fnSelCmd);
|
||||
$frm.find('.ReqntCommoditySearch').off('click').on('click', fnSelCmd);
|
||||
$frm.find('.ReqntQuantity').off('input').on('input', function () { re.calculate(env, 500); });
|
||||
env.$ctrl.saleTaxCode.off('change').on('change', function () { re.onTaxCodeSelected(env); });
|
||||
env.$ctrl.uomCat.off('change').on('change', function () { re.onUomCatSelected(env); })
|
||||
env.$ctrl.uomTyp.off('change').on('change', function () { re.onUomSelected(env); });
|
||||
@@ -161,12 +167,11 @@
|
||||
let $frm = env.$frm.itemId;
|
||||
$('.RequirementId', $frm).val(id);
|
||||
$('.RequirementDataGroups', $frm).val('Sales');
|
||||
env.ajax.updateItem = env.ajax.updateItem || { url: sbm.url.base + 'Requirement/Ajax/GetItem', formSel: $frm, callbackFn: function (response) { re.onUpdateItem(env, response); } };
|
||||
sbm.doAjaxRequest(env.ajax.updateItem, 50);
|
||||
sbm.doAjaxRequest(env.ajax.updateItem = env.ajax.updateItem || { url: sbm.url.base + 'Requirement/Ajax/GetItem', formSel: $frm, callbackFn: function (response) { re.onUpdateItem(env, response); } }, 50);
|
||||
}
|
||||
re.onUpdateItem = function (env, response)
|
||||
{
|
||||
sbm.debug('onUpdateItem', env, response);
|
||||
//sbm.debug('onUpdateItem', env, response);
|
||||
if (!response.success) return;
|
||||
let cfg = response.config || {};
|
||||
re.clearItem(env, cfg);
|
||||
@@ -174,8 +179,10 @@
|
||||
let $frm = env.$frm.item;
|
||||
sbm.populateFormValues(cfg, $frm, item.field.value);
|
||||
let $ctrls = $frm.find('.sbm-input,.sbm-textarea,.sbm-select');
|
||||
$ctrls.filter('.RequirementId').val(item.id);
|
||||
$ctrls.filter('.RequirementExists').val(1);
|
||||
$ctrls.filter('.ReqntId').val(item.id);
|
||||
$ctrls.filter('.ReqntExists').val(1);
|
||||
env.$ctrl.commmodityId.val(item.commodityId);
|
||||
env.$ctrl.commmodity.val(item.commodityCaption);
|
||||
sbm.selectOrAdd($ctrls.filter('.RequirementType'), item.typeCode, item.typeDesc);
|
||||
re.populateUomType(env, item.unitType);
|
||||
sbm.selectOrAdd($ctrls.filter('.RequirementStatus'), item.statusCode, item.field.value.Status);
|
||||
@@ -183,14 +190,51 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
re.selectCommodity = function (env)
|
||||
{
|
||||
//sbm.debug('selectCommodity');
|
||||
sbm.fn.selectCommodity({ fnSuccess: function (item) { re.onCommoditySelected(env, item); } });
|
||||
}
|
||||
re.onCommoditySelected = function (env, item)
|
||||
{
|
||||
//sbm.debug('onCommoditySelected', item)
|
||||
let $frm = env.$frm.item;
|
||||
env.$ctrl.commmodityId.val(item.id);
|
||||
env.$ctrl.commmodity.val(item.caption);
|
||||
env.$ctrl.desc.val(item.caption);
|
||||
let fn = function (env, response)
|
||||
{
|
||||
//sbm.debug('Commodity response', response);
|
||||
if (!response.success) return;
|
||||
sbm.populateFormValues(response.config, $frm, response.requirement.field.value);
|
||||
re.calculate(env);
|
||||
}
|
||||
sbm.doAjaxRequest(env.ajax.commodity = env.ajax.commodity || { url: sbm.url.base + 'Requirement/Ajax/Commodity', formSel: $frm, callbackFn: function (response) { fn(env, response); } }, 50);
|
||||
}
|
||||
|
||||
re.onTaxCodeSelected = function (env)
|
||||
{
|
||||
re.calculate(env);
|
||||
}
|
||||
|
||||
re.calculate = function (env, delay)
|
||||
{
|
||||
//sbm.debug('calculate');
|
||||
let $frm = env.$frm.item;
|
||||
let fn = function (env, response)
|
||||
{
|
||||
//sbm.debug('Calculate response', response);
|
||||
if (!response.success) return;
|
||||
sbm.populateFormValues(response.config, $frm, response.requirement.field.value);
|
||||
}
|
||||
sbm.doAjaxRequest(env.ajax.calculate = env.ajax.calculate || { url: sbm.url.base + 'Requirement/Ajax/Calculate', formSel: $frm, callbackFn: function (response) { fn(env, response); } }, delay || 50);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
re.onUomCatSelected = function (env)
|
||||
{
|
||||
//sbm.debug('onUomCatSelected', env);
|
||||
//sbm.debug('onUomCatSelected', env.$ctrl.uomCat.val());
|
||||
let $uomCat = env.$ctrl.uomCat;
|
||||
let $uomTyp = env.$ctrl.uomTyp;
|
||||
let uomCat = $uomCat.val();
|
||||
@@ -206,20 +250,16 @@
|
||||
let $uomTyp = env.$ctrl.uomTyp;
|
||||
let uom = env.data.uoms.find(function (uom) { return uom.type == type; });
|
||||
if (!uom) return;
|
||||
$uomCat.val(uom.category).trigger('change');
|
||||
$uomCat.val(uom.category);
|
||||
re.onUomCatSelected(env);
|
||||
$uomTyp.val(uom.type);
|
||||
}
|
||||
re.onUomSelected = function (env)
|
||||
{
|
||||
let $uomCat = env.$ctrl.uomCat;
|
||||
let $uomTyp = env.$ctrl.uomTyp;
|
||||
}
|
||||
re.onUomSelected = function (env) { }
|
||||
|
||||
//--------------------------------------------------------------
|
||||
re.storeItem = function (env)
|
||||
{
|
||||
env.ajax.storeItem = env.ajax.storeItem || { url: sbm.url.base + 'Requirement/Ajax/StoreItem', formSel: env.$frm.item, callbackFn: function (response) { re.onStoreItem(env, response); } };
|
||||
sbm.doAjaxRequest(env.ajax.storeItem, 50);
|
||||
sbm.doAjaxRequest(env.ajax.storeItem = env.ajax.storeItem || { url: sbm.url.base + 'Requirement/Ajax/StoreItem', formSel: env.$frm.item, callbackFn: function (response) { re.onStoreItem(env, response); } }, 50);
|
||||
}
|
||||
re.onStoreItem = function (env, response)
|
||||
{
|
||||
@@ -243,12 +283,14 @@
|
||||
}
|
||||
re.populateItem(env, $item, item);
|
||||
sbm.configureItemTable(env.data.cfgList, env.$pnl.table);
|
||||
setTimeout(function () { re.refreshResults(env); }, 50);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sbm.fn.maintainRequirements = function (prm)
|
||||
{
|
||||
//sbm.debug('maintainRequirements', prm);
|
||||
let env = re.env.select;
|
||||
env.prmList = prm;
|
||||
prm.mode = 'Maintain';
|
||||
@@ -261,13 +303,15 @@
|
||||
prm.mode = 'Search';
|
||||
re.showRequirements(env, prm);
|
||||
}
|
||||
/* Params: transId, search, fnSuccess. */
|
||||
/* Params: transId, transType, search, fnSuccess. */
|
||||
re.showRequirements = function (env, prm)
|
||||
{
|
||||
//sbm.debug('showRequirements', env, prm, env.$frm.filter.find('.FilterMode'));
|
||||
if (!env.$pnl.items.length) return;
|
||||
env.$frm.filter.find('.FilterMode').val(prm.mode || null);
|
||||
env.$frm.filter.find('.FilterTransactionId').val(prm.transId);
|
||||
env.$frm.filter.find('.FilterTransactionType').val(prm.transType);
|
||||
env.$frm.filter.find('.FilterTaxEffective').val(prm.taxEffective);
|
||||
env.$frm.filter.find('.FilterSearch').val(prm.search || '');
|
||||
env.$pnl.table.find('tbody tr').remove();
|
||||
sbm.openDialog(env.$dlg.select, 1160, 800);
|
||||
@@ -284,7 +328,8 @@
|
||||
{
|
||||
//sbm.debug('selectItem', env, env.prmSelect.item);
|
||||
env.$dlg.select.dialog('close');
|
||||
env.prmSelect.fnSuccess(env.prmSelect.item);
|
||||
if ((env.prmList || {}).fnSuccess) env.prmList.fnSuccess(env.prmList.item);
|
||||
else if ((env.prmSelect || {}).fnSuccess) env.prmSelect.fnSuccess(env.prmSelect.item);
|
||||
delete env.prmSelect;
|
||||
}
|
||||
|
||||
@@ -326,16 +371,24 @@
|
||||
env.$frm.item = env.$dlg.item.find('#frmRequirement').off('input').on('input', '.sbm-input, .sbm-textarea', function () { sbm.clearControlError(this); }).off('change').on('change', '.sbm-select', function () { sbm.clearControlError(this); });
|
||||
env.$frm.item.off('blur').on('blur', '.sbm-input.sbm-format-integer', function () { sbm.formatInteger($(this)); }).off('blur').on('blur', '.sbm-input.sbm-format-currency', function () { sbm.formatCurrency($(this)); });
|
||||
sbm.initCalendars(env.$frm.item.find('.sbm-input.sbm-calendar'), {});
|
||||
env.$ctrl.saleTaxCode = env.$frm.item.find('.sbm-select.ReqntTaxCode');
|
||||
env.$ctrl.uomCat = env.$frm.item.find('.sbm-select.ReqntUnitCategory');
|
||||
env.$ctrl.uomTyp = env.$frm.item.find('.sbm-select.ReqntUnitType');
|
||||
let $ctrls = env.$frm.item.find('.sbm-input,.sbm-textarea,.sbm-select');
|
||||
env.$ctrl.commmodityId = $ctrls.filter('.ReqntCommodityId');
|
||||
env.$ctrl.commmodity = $ctrls.filter('.ReqntCommodity');
|
||||
env.$ctrl.desc = $ctrls.filter('.ReqntDescBrief');
|
||||
env.$ctrl.saleTaxCode = $ctrls.filter('.ReqntTaxCode');
|
||||
env.$ctrl.uomCat = $ctrls.filter('.ReqntUnitCategory');
|
||||
env.$ctrl.uomTyp = $ctrls.filter('.ReqntUnitType');
|
||||
|
||||
let $dlgSelect = $('#dlgRequirementSelect');
|
||||
if ($dlgSelect.length)
|
||||
{
|
||||
var opt = sbm.dlgOpts();
|
||||
opt.dialogClass += " sbm-Requirement";
|
||||
opt.buttons[sbm.lbl.ok] = function () { re.selectItem(env); };
|
||||
opt.buttons[sbm.lbl.cancel] = function () { delete env.prmSelect; $(this).dialog('close'); };
|
||||
env.$dlg.select = $('#dlgRequirementSelect').dialog(opt);
|
||||
|
||||
env.$dlg.select = $dlgSelect.dialog(opt);
|
||||
env.$dlg.select.parent().find('.ui-dialog-titlebar').empty().append(env.$pnl.tmpl.find('.sbm-panel-header').remove());
|
||||
}
|
||||
return env;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
tr.clearItem(env, cfg);
|
||||
let $frm = env.$frm.item;
|
||||
env.$ctrl.trnType.val(env.$frm.filter.find('.sbm-input.FilterType').val());
|
||||
env.$ctrl.searchTgtAssoc.show();
|
||||
env.$ctrl.searchAssoc.show();
|
||||
env.$ctrl.trnStatus.val(env.data.defaultStatusCode);
|
||||
tr.onChangeStatus(env);
|
||||
env.$ctrl.trnRaised.datepicker('setDate', 'today');
|
||||
@@ -147,7 +147,7 @@
|
||||
let $dlg = env.$dlg.item;
|
||||
let $frm = env.$frm.item;
|
||||
$frm.find('.TransactionAssociation').off('dblclick').on('dblclick', function () { tr.selectAssocTarget(env); });
|
||||
env.$ctrl.searchTgtAssoc.off('click').on('click', function () { tr.selectAssocTarget(env); });
|
||||
env.$ctrl.searchAssoc.off('click').on('click', function () { tr.selectAssocTarget(env); });
|
||||
env.$ctrl.trnStatus.off('change').on('change', function () { tr.onChangeStatus(env); });
|
||||
env.$ctrl.clearRequired.off('click').on('click', function () { env.$ctrl.trnRequired.val(''); });
|
||||
sbm.configureItemControls(cfg, $frm);
|
||||
@@ -181,7 +181,7 @@
|
||||
$ctrls.filter('.TransactionExists').val(1);
|
||||
$ctrls.filter('.TransactionType').val(item.typeCode);
|
||||
$ctrls.filter('.TransactionAssociationId').val(item.field.value.AssociationId);
|
||||
env.$ctrl.searchTgtAssoc.hide();
|
||||
env.$ctrl.searchAssoc.hide();
|
||||
sbm.selectOrAdd(env.$ctrl.trnStatus, item.statusCode, item.field.value.Status);
|
||||
tr.onChangeStatus(env);
|
||||
tr.openItemDlg(env, cfg, sbm.dlg.title.updateTransaction);
|
||||
@@ -245,12 +245,12 @@
|
||||
//--------------------------------------------------------------
|
||||
tr.showRequirements = function (env, item)
|
||||
{
|
||||
//sbm.debug('showRequirements');
|
||||
//sbm.debug('showRequirements', item);
|
||||
let fn = function (env, item)
|
||||
{
|
||||
sbm.debug('showRequirementsmaintainRequirementsDone', item);
|
||||
//sbm.debug('showRequirementsmaintainRequirementsDone', item);
|
||||
}
|
||||
sbm.fn.maintainRequirements({ transId: item.id, successFn: function (item) { fn(env, item); } });
|
||||
sbm.fn.maintainRequirements({ transId: item.id, transType: item.typeCode, taxEffective: item.taxEffective, fnSuccess: function (item) { fn(env, item); } });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -323,7 +323,7 @@
|
||||
{
|
||||
env.$frm.item.off('blur').on('blur', '.sbm-input.sbm-format-integer', function () { sbm.formatInteger($(this)); }).off('blur').on('blur', '.sbm-input.sbm-format-currency', function () { sbm.formatCurrency($(this)); });
|
||||
env.$ctrl.trnType = env.$frm.item.find('.sbm-input.TransactionType');
|
||||
env.$ctrl.searchTgtAssoc = env.$frm.item.find('.AssociationTargetSearch');
|
||||
env.$ctrl.searchAssoc = env.$frm.item.find('.TransactionAssociationSearch');
|
||||
env.$ctrl.trnStatus = env.$frm.item.find('.sbm-select.TransactionStatus');
|
||||
sbm.initCalendars(env.$frm.item.find('.sbm-input.sbm-calendar'), {});
|
||||
env.$ctrl.trnRaised = env.$frm.item.find('.sbm-input.TransactionRaised');
|
||||
|
||||
Reference in New Issue
Block a user