+ Timeout logout

+ Pred kreiranjem povpraševanja vprašaj za partnerja
+ Prikaz TOP 100 (predolgo nalaga)
+ Dodaj Sorovec na Urejanje Artikla (zadnji surovec)
+ V Urejanju artikla popravi opis v pot dokumentov
+ Kooperant
This commit is contained in:
David Štaleker
2025-07-18 08:10:42 +02:00
parent db0cc8d3de
commit a7560aa141
16 changed files with 463 additions and 55 deletions

View File

@@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Authorization;
using EveryThing.Models.Project;
using System.Text.Json;
using EveryThing.Models.Invoice;
using static EveryThing.Pages.Projects.EditModel;
namespace EveryThing.Pages.Invoices
@@ -106,10 +107,26 @@ namespace EveryThing.Pages.Invoices
return Page();
}
//var oldInvoice = _context.Invoices.FirstOrDefault(x => x.IdInvoice == Invoice.IdInvoice);
var statusChanged = true;//oldInvoice == null || oldInvoice.State != Invoice.State;
Invoice.PostText = Invoice.PostText.Replace("<div><br></div>", "");
Invoice.PreText = Invoice.PreText.Replace("<div><br></div>", "");
_context.Attach(Invoice).State = EntityState.Modified;
if (Invoice.Type == Invoice.InvoiceType.Cooperation
&& statusChanged
&& Invoice.State == Invoice.InvoiceState.Closed)
{
await _context.InvoiceItems
.Where(x => x.IdInvoiceFk == Invoice.IdInvoice)
.Include(invoiceItem => invoiceItem.ProjectPartItem).ForEachAsync(x =>
{
x.ProjectPartItem.Status = ProjectPartItemStatus.Finished;
});
}
try
{