aggiunta prog su destinazioni
This commit is contained in:
parent
194a3db2e8
commit
8e096a1157
@ -261,6 +261,57 @@ namespace ApiSoftway.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Route("modGiro")]
|
||||||
|
public async Task<ActionResult<GiriConsegna_out>> modGiro(GiriConsegnaView model)
|
||||||
|
{
|
||||||
|
GiriConsegna_out tOut = new GiriConsegna_out();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//step 1 : calcolo il nuovo seriale
|
||||||
|
|
||||||
|
GiriConsegna gc = new GiriConsegna();
|
||||||
|
gc.Pisergir = model.SerialeGiro;
|
||||||
|
gc.Pidarecu = model.ImportoDaRecuperare;
|
||||||
|
gc.Piautist = model.CodAutista;
|
||||||
|
gc.Pirecupe = model.ImportoRecuperato;
|
||||||
|
gc.Pidata = model.DataGiro;
|
||||||
|
gc.Pidatchi = null;
|
||||||
|
gc.Pitbancar = model.BancaliCaricati;
|
||||||
|
gc.Pitbanrec = null;
|
||||||
|
gc.Pimezzo = model.CodMezzo;
|
||||||
|
|
||||||
|
using (var transactionGiri = _giricons_context.Database.BeginTransaction())
|
||||||
|
{
|
||||||
|
_giricons_context.Entry(gc).State = EntityState.Modified;
|
||||||
|
await _giricons_context.SaveChangesAsync();
|
||||||
|
transactionGiri.Commit();
|
||||||
|
}
|
||||||
|
_giriConsView = _consegnevista_context.GiriView;
|
||||||
|
var giro = await _giriConsView.Where(t => t.SerialeGiro != null && t.SerialeGiro.Equals(model.SerialeGiro)).FirstAsync();
|
||||||
|
tOut.Pisergir = giro.SerialeGiro;
|
||||||
|
tOut.Pirecupe = giro.ImportoRecuperato;
|
||||||
|
tOut.Pidarecu = giro.ImportoDaRecuperare;
|
||||||
|
tOut.Piautist = giro.CodAutista;
|
||||||
|
tOut.Pidata = giro.DataGiro;
|
||||||
|
tOut.Pidatchi = giro.DataChiusura;
|
||||||
|
tOut.Pitbancar = giro.BancaliCaricati;
|
||||||
|
tOut.Pitbanrec = giro.BancaliRecuperati;
|
||||||
|
|
||||||
|
|
||||||
|
return StatusCode(StatusCodes.Status200OK, tOut);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
string errmsg = ex.InnerException != null ? ex.InnerException.Message : ex.Message;
|
||||||
|
tOut.err_title = ex.Message;
|
||||||
|
tOut.err_detail = errmsg;
|
||||||
|
tOut.err_status_code = "500";
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError, tOut);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("delGiro")]
|
[Route("delGiro")]
|
||||||
public async Task<ActionResult<GiriConsegna_out>> delGiro(string? serialeGiro, string? autista, DateTime? data)
|
public async Task<ActionResult<GiriConsegna_out>> delGiro(string? serialeGiro, string? autista, DateTime? data)
|
||||||
@ -398,6 +449,9 @@ namespace ApiSoftway.Controllers
|
|||||||
o.num_cons = d.num_cons;
|
o.num_cons = d.num_cons;
|
||||||
o.Uova=d.Uova;
|
o.Uova=d.Uova;
|
||||||
o.Cist=d.Cist;
|
o.Cist=d.Cist;
|
||||||
|
o.Note = d.Note;
|
||||||
|
o.Seq = d.Seq;
|
||||||
|
o.Prog = d.Prog;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(d.consFattaSerial))
|
if (!string.IsNullOrEmpty(d.consFattaSerial))
|
||||||
{
|
{
|
||||||
@ -474,6 +528,7 @@ namespace ApiSoftway.Controllers
|
|||||||
o.Cist=d.Cist;
|
o.Cist=d.Cist;
|
||||||
o.Note = d.Note;
|
o.Note = d.Note;
|
||||||
o.Seq = d.Seq;
|
o.Seq = d.Seq;
|
||||||
|
o.Prog = d.Prog;
|
||||||
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(d.consFattaSerial))
|
if (!string.IsNullOrEmpty(d.consFattaSerial))
|
||||||
@ -500,6 +555,83 @@ namespace ApiSoftway.Controllers
|
|||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("listaDestinazioneBySerial")]
|
||||||
|
public async Task<ActionResult<Destinazioni_out>> listaDestinazioneBySerial(string seriale)
|
||||||
|
{
|
||||||
|
|
||||||
|
Destinazioni_out lst = new Destinazioni_out();
|
||||||
|
_destinazioni = _destinazioni_context.Destinazioni;
|
||||||
|
var r = await _destinazioni.Where(t => t.Brserial != null && t.Brserial.Equals(seriale)).OrderByDescending(t => t.DataCarico).ThenBy(t => t.Seq).FirstAsync();
|
||||||
|
|
||||||
|
Destinazioni_out o = new Destinazioni_out();
|
||||||
|
string _aut = !string.IsNullOrEmpty(r.Autista) ? r.Autista.Trim() : string.Empty;
|
||||||
|
o.Autista = _aut;
|
||||||
|
|
||||||
|
string _autCod = !string.IsNullOrEmpty(r.CodAutista) ? r.CodAutista.Trim() : string.Empty;
|
||||||
|
o.CodAutista = _autCod;
|
||||||
|
|
||||||
|
string _automezzo = !string.IsNullOrEmpty(r.DescAutomezzo) ? r.DescAutomezzo.Trim() : string.Empty;
|
||||||
|
o.DescAutomezzo = _automezzo;
|
||||||
|
|
||||||
|
string _automezzoCod = !string.IsNullOrEmpty(r.CodAutomezzo) ? r.CodAutomezzo.Trim() : string.Empty;
|
||||||
|
o.CodAutomezzo = r.CodAutomezzo;
|
||||||
|
|
||||||
|
o.DataCarico = r.DataCarico;
|
||||||
|
o.Brserial = r.Brserial;
|
||||||
|
o.Brmerce = r.Brmerce;
|
||||||
|
o.Brnote = r.Brnote;
|
||||||
|
o.Cproword = r.Cproword;
|
||||||
|
o.Cprownum = r.Cprownum;
|
||||||
|
|
||||||
|
string _sedeInd = !string.IsNullOrEmpty(r.IndirizzoSede) ? r.IndirizzoSede.Trim() : string.Empty;
|
||||||
|
o.IndirizzoSede = _sedeInd;
|
||||||
|
|
||||||
|
string _sede = !string.IsNullOrEmpty(r.Sede) ? r.Sede.Trim() : string.Empty;
|
||||||
|
o.Sede = _sede;
|
||||||
|
o.CodCommittente = r.CodCommittente;
|
||||||
|
|
||||||
|
string _committente = !string.IsNullOrEmpty(r.Committente) ? r.Committente.Trim() : string.Empty;
|
||||||
|
o.Committente = _committente;
|
||||||
|
|
||||||
|
o.CodSede = r.CodSede;
|
||||||
|
o.ItemList = formattaDestinazione(r);
|
||||||
|
o.ImportoDaRitirare = r.ImportoDaRitirare;
|
||||||
|
o.serialeGiro = r.serialeGiro;
|
||||||
|
o.Casse = r.Casse;
|
||||||
|
o.Trasf = r.Trasf;
|
||||||
|
o.Colli = r.Colli;
|
||||||
|
o.num_cons = r.num_cons;
|
||||||
|
o.Uova = r.Uova;
|
||||||
|
o.Cist = r.Cist;
|
||||||
|
o.Note = r.Note;
|
||||||
|
o.Seq = r.Seq;
|
||||||
|
o.Prog=r.Prog;
|
||||||
|
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(r.consFattaSerial))
|
||||||
|
{
|
||||||
|
ConsegnaFatta cf = new ConsegnaFatta();
|
||||||
|
cf.consFattaSerial = r.consFattaSerial;
|
||||||
|
cf.consFattaRow = r.consFattaRow;
|
||||||
|
cf.consFattaAut = r.consFattaAut;
|
||||||
|
cf.consFattaBanSca = r.consFattaBanSca;
|
||||||
|
cf.consFattaBanCar = r.consFattaBanCar;
|
||||||
|
string nota = !string.IsNullOrEmpty(r.consFattaNotBan) ? r.consFattaNotBan.Trim() : string.Empty;
|
||||||
|
cf.consFattaNotBan = nota;
|
||||||
|
cf.consFattaImpor = r.consFattaImpor;
|
||||||
|
cf.consFattaMezzo = r.consFattaMezzo;
|
||||||
|
string nota2 = !string.IsNullOrEmpty(r.consFattaNotImp) ? r.consFattaNotImp.Trim() : string.Empty;
|
||||||
|
cf.consFattaNotImp = nota2;
|
||||||
|
cf.consFattaFlagCons = r.consFattaFlagCons;
|
||||||
|
|
||||||
|
o.ConsFatta = cf;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>Salva i dati della consegna</summary>
|
/// <summary>Salva i dati della consegna</summary>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Route("destinazione/salva")]
|
[Route("destinazione/salva")]
|
||||||
|
|||||||
@ -52,5 +52,7 @@ namespace ApiSoftway.Models
|
|||||||
public string? Note { get; set; }
|
public string? Note { get; set; }
|
||||||
public int? Seq { get; set; }
|
public int? Seq { get; set; }
|
||||||
|
|
||||||
|
//progressivo- chiave tabella pimodgir
|
||||||
|
public string? Prog { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,6 +37,9 @@ namespace ApiSoftway.Models
|
|||||||
public int? Cist { get; set; }
|
public int? Cist { get; set; }
|
||||||
public string? Note { get; set; }
|
public string? Note { get; set; }
|
||||||
public int? Seq { get; set; }
|
public int? Seq { get; set; }
|
||||||
|
|
||||||
|
//progressivo- chiave tabella pimodgir
|
||||||
|
public string? Prog { get; set; }
|
||||||
}
|
}
|
||||||
public class ConsegnaFatta
|
public class ConsegnaFatta
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user