Modifica per correzione errore lunghezza descrizioni nuovi impianti e commesse se ragione sociale cliente troppo lunga
This commit is contained in:
parent
58b70978b0
commit
c897970931
@ -183,8 +183,26 @@ namespace VirtualTask.Controllers
|
||||
anagCommImp.imp = impianto;
|
||||
anagCommImp.imp.imcodimp = "IMP_" + codcli;
|
||||
anagCommImp.imp.imdescri = "IMP_" + model.andescri.Trim() + "_" + codcli;
|
||||
anagCommImp.imp.imultcli = model.ancodice;
|
||||
anagCommImp.imp.imindiri2 = model.anindiri;
|
||||
|
||||
//11/11/2025 - Messo questo nuovo controllo perchè se la ragione sociale è troppo lunga
|
||||
//quando crea l'impianto il campo imdescri è troppo lungo e va in errore.
|
||||
var substr = string.Empty;
|
||||
if (anagCommImp.imp.imdescri.Length > 40)
|
||||
{
|
||||
substr = model.andescri.Trim().Substring(0, 29);
|
||||
anagCommImp.imp.imdescri = "IMP_" + substr + "_" + codcli;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(model.ancodice))
|
||||
{
|
||||
anagCommImp.imp.imultcli = model.ancodice;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(model.anindiri))
|
||||
{
|
||||
anagCommImp.imp.imindiri2 = model.anindiri.TrimEnd();
|
||||
|
||||
}
|
||||
|
||||
//commmessa generica
|
||||
CommesseVT_Table commessa = new CommesseVT_Table();
|
||||
@ -192,7 +210,10 @@ namespace VirtualTask.Controllers
|
||||
anagCommImp.comm = commessa;
|
||||
anagCommImp.comm.laserial = GetNewSerialeComm();
|
||||
anagCommImp.comm.lacodcom = "COM_" + model.ancodice.Substring(model.ancodice.Length - 6, 6);
|
||||
anagCommImp.comm.ladeslav = "COMM_" + model.andescri + "_" + model.ancodice;
|
||||
|
||||
//11/11/2025 assegno substr e codcli perchè se la ragione sociale inserita nel cliente è troppo lunga
|
||||
//va in errore quando salva la commessa
|
||||
anagCommImp.comm.ladeslav = "COM_" + substr /*model.andescri*/ + "_" + codcli/*model.ancodice*/;
|
||||
anagCommImp.comm.lacodcli = model.ancodice;
|
||||
anagCommImp.comm.lacodimp = anagCommImp.imp.imcodimp;
|
||||
anagCommImp.comm.lacomgen = "S";
|
||||
@ -304,7 +325,16 @@ namespace VirtualTask.Controllers
|
||||
string data = response.Content.ReadAsStringAsync().Result;
|
||||
modelList = JsonConvert.DeserializeObject<List<Anag>>(data);
|
||||
anag = modelList.Where(x => x.ancodice.Equals(id)).First();
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(anag.andescri))
|
||||
{
|
||||
anag.andescri = anag.andescri.TrimEnd();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(anag.anindiri))
|
||||
{
|
||||
anag.anindiri = anag.anindiri.TrimEnd();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -328,7 +358,8 @@ namespace VirtualTask.Controllers
|
||||
bool bparivaOK = false;
|
||||
string sCodFis = !string.IsNullOrEmpty(model.ancodfis) ? model.ancodfis : string.Empty;
|
||||
string sParIva = !string.IsNullOrEmpty(model.anpariva) ? model.anpariva : string.Empty;
|
||||
|
||||
model.andescri = model.andescri.TrimEnd();
|
||||
model.anindiri = model.anindiri.TrimEnd();
|
||||
if (string.IsNullOrEmpty(sParIva))
|
||||
{
|
||||
bparivaOK = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user