Update cloning trattativa e documento (cambio anno)

This commit is contained in:
Samuele Locatelli
2024-01-30 15:26:47 +01:00
parent b14758031a
commit 319ac972fb
4 changed files with 28 additions and 13 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>2.0.2401.0413</Version>
<Version>2.0.2401.3015</Version>
<Copyright>Egalware 2021+</Copyright>
</PropertyGroup>
+17 -7
View File
@@ -181,20 +181,30 @@ namespace SHERPA.BBM.UI.Pages
protected void CreateNew()
{
string BaseCode = "EGW";
//string BaseCode = "EGW";
// preset anno
int yearRef = SelectData.YearSel > 0 ? SelectData.YearSel : DateTime.Today.Year;
DateTime dataIns = DateTime.Now;
string codDoc = "";
// recupero selected negotiation...
var CurrNegotiation = BBMService.NegotiationGetByKey(SelNegotiationId);
var CurrNegotiation = BBMService.NegotiationGetByKey(SelNegotiationId).Result;
if (CurrNegotiation != null)
{
string codNegot = CurrNegotiation.Result.CodNegotiation;
BaseCode = codNegot.Substring(0, codNegot.IndexOf("."));
// leggo anno e codice doc dalla negoziazione...
yearRef = CurrNegotiation.Anno;
string codNegot = CurrNegotiation.CodNegotiation;
codDoc = codNegot.Replace(".N.", ".D.");
dataIns = CurrNegotiation.DataIns;
//BaseCode = codNegot.Substring(0, codNegot.IndexOf("."));
}
// recupero counter
string newCode = BBMService.CounterGetNext($"{BaseCode}.D.{DateTime.Today.Year}", 4);
//string newCode = BBMService.CounterGetNext($"{BaseCode}.D.{DateTime.Today.Year}", 4);
string newCode = BBMService.CounterGetNext(codDoc, 2);
DocsModel newRecord = new DocsModel()
{
CodDoc = $"{newCode}.01",
DataIns = DateTime.Now,
CodDoc = $"{newCode}",
Anno = yearRef,
DataIns = dataIns,
NegotiationId = SelectData.NegotiationId,
NumDoc = 1,
DocType = BbmDocType.Quotazione,
+9 -4
View File
@@ -115,11 +115,13 @@ namespace SHERPA.BBM.UI.Pages
protected void CreateNew()
{
// recupero counter
string newCode = BBMService.CounterGetNext($"{SelectData.Company}.N.{DateTime.Today.Year}", 6);
int yearRef = SelectData.YearSel > 0 ? SelectData.YearSel : DateTime.Today.Year;
// recupero counter da anno selezionato
string newCode = BBMService.CounterGetNext($"{SelectData.Company}.N.{yearRef}", 6);
NegotiationsModel newRecord = new NegotiationsModel()
{
CodNegotiation = newCode,
Anno = yearRef,
DataIns = DateTime.Now,
BasketId = SelBasketId,
CustomerId = SelCustomerId,
@@ -150,15 +152,18 @@ namespace SHERPA.BBM.UI.Pages
// verifico di avere la company selezionata...
if (!string.IsNullOrEmpty(SelectData.Company))
{
int yearRef = SelectData.YearSel > 0 ? SelectData.YearSel : DateTime.Today.Year;
// recupero counter
string newCode = BBMService.CounterGetNext($"{SelectData.Company}.N.{DateTime.Today.Year}", 6);
string newCode = BBMService.CounterGetNext($"{SelectData.Company}.N.{yearRef}", 6);
NegotiationsModel newRecord = new NegotiationsModel()
{
CodNegotiation = newCode,
Anno = yearRef,
DataIns = DateTime.Now,
Descript = "COPIA di " + currRecord.Descript,
BasePath = currRecord.BasePath,
BasketId = SelBasketId
BasketId = SelBasketId,
CustomerId = currRecord.CustomerId
};
currItem = newRecord;
}
+1 -1
View File
@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<UserSecretsId>60fcdaab-6c1e-4bec-9d88-f7727ef1c12c</UserSecretsId>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<Version>2.0.2401.0413</Version>
<Version>2.0.2401.3015</Version>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Copyright>Egalware 2021+</Copyright>