diff --git a/devdocs/modernization/NET10-PORT.md b/devdocs/modernization/NET10-PORT.md index 780d434f..2777881d 100644 --- a/devdocs/modernization/NET10-PORT.md +++ b/devdocs/modernization/NET10-PORT.md @@ -223,7 +223,7 @@ John's "next release" cases for AyaNova (exported 2026-10-24). Each is its own s | 4634 | Docs: custom checkbox shows nothing for older records | 1, docs | | 4633 | Docs: pg_dump path quoting on Windows (likely fixed by the port; confirm) | 1, docs | | 4632 | AYANOVA_REPORT_RENDER_API_URL_OVERRIDE breaks customer notification reports (do before or with 4719) | 1. **Done.** Cause, reproduced on a Windows Server 2025 Hyper-V VM (IIS, https-only site with a host name, as for internet access): AyaNova runs inside IIS (in-process), so nothing listens on `AYANOVA_USE_URLS`; user reports called `http://127.0.0.1:` (443 over https: connection reset), notification reports `127.0.0.1:7575` (refused); the override only fixed user reports, and only where the server reaches itself by its public name. Fix: under IIS the report page's requests under the API URL are intercepted (PuppeteerSharp request interception) and made by the server (`util/ReportApiRelay.cs`) to the local address and port a user's request arrived on, with its host name and scheme (IIS binding and certificate match, no DNS/router hairpin); notification reports use the latest signed-in request, else the override; the page is opened at the API origin so its calls are same-origin; outside IIS nothing changes. The notification token check no longer requires host `127.0.0.1`, only a request from this machine. Proof: VM before (both fail) and after (user report 1.6 s and notification email with PDF, https-only with and without the override); locally 22 stock reports identical with the relay forced on (temporary switch, removed); integration suite = baseline. Manual: IIS install page and override page; changelog | -| 4628 | Deleting a work order tied to a CSR gives a raw server error | 1, bug | +| 4628 | Deleting a work order tied to a CSR gives a raw server error | 1. **Done** (the request's `workorderitemid` foreign key blocked deleting the item, a 500 from the database; John chose: delete, unlink the request and set it back to Open, no notification. `WorkOrderBiz.ItemDeleteAsync` does that in the delete's transaction and logs a Modified event on the request; covers deleting the item alone too. Test `WorkOrderFromServiceRequest`: before 500, after 204 and the request Open and unlinked; full suite = baseline. Manual (service requests) and changelog) | | 4623 | Docs: migration, what is erased and what is kept | 1, docs | | 4602 | Logo upload UI: hide Upload and Delete until usable | 1, client | | 4579 | Windows installer modify rights: only the folders AyaNova writes to, only for the account it runs as (includes F2) | 00. **Done** (both installers: no `users-modify` on `{app}` or `local-postgres`; `icacls "{app}" /remove:g *S-1-5-32-545 /T /C /Q` after install removes the Users grant on upgrades too; data folder keeps `users-modify` and `config.json` stays readable by local users, accepted by John and documented in the single-user and LAN install pages. Sandbox: single-user fresh and upgrade over 8.2.4, LAN upgrade; Users modify entries under `{app}` 4632/1281 before, 0 after; trial, login, attachment, backup, report render after upgrade. Found on the way: the downloaded "8.2.4" LAN installer installs server 8.2.3, which fails its integrity check on a new PostgreSQL 18 database (E1030); gone once the 8.3.0 LAN installer is published) | diff --git a/docs/8.0/ayanova/docs/changelog.md b/docs/8.0/ayanova/docs/changelog.md index 5c866725..e0a78e13 100644 --- a/docs/8.0/ayanova/docs/changelog.md +++ b/docs/8.0/ayanova/docs/changelog.md @@ -34,6 +34,7 @@ IN PROGRESS - Server: relative date filters such as "today" or "last month" (in lists and dashboard widgets) now start and end the period at midnight in the user's own [time zone](ay-start-form-data-tables.md#filtering-dates-and-time-zones). Previously, for a user in a different time zone from the server, records close to the start or end of the period could be included or left out by mistake. - Server: when a report fails to render, objects and errors a report script passes to `console.error` are now shown with their contents and stack (line numbers within the script) in the error message, to help with [writing report scripts](ay-report-edit.md#script-errors). - Server: on servers in a time zone with daylight saving time, the automatic backup could run an hour earlier or later than the chosen [backup time](ops-form-backup.md#backup-time) for part of the year; it now always runs at the chosen time on the server's clock. +- Server: a work order created from a [customer service request](svc-csr.md#accept-to-new-work-order) can now be deleted; the request goes back to Open. Previously the delete failed with a server error. - Server: the SuperUser account can no longer be deleted. - Server: role rights corrected to match the documentation: "Service technician - restricted" users can view tax codes, projects, unit models and meter readings; "Business administration" users can view server metrics; Accounting users can no longer enter unit meter readings; only "Business administration" users can switch an [integrated application](api-integrated-applications.md) on or off or delete it. - Server: fixed direct notification messages to a user: only the first one within 12 hours was delivered, now every message is. diff --git a/docs/8.0/ayanova/docs/svc-csr.md b/docs/8.0/ayanova/docs/svc-csr.md index 45e53bbf..d7480e64 100644 --- a/docs/8.0/ayanova/docs/svc-csr.md +++ b/docs/8.0/ayanova/docs/svc-csr.md @@ -117,6 +117,8 @@ This option will locally create a new work order based off this Customer service If the Work order is not saved no changes are made to the Customer service request and it remains Open. +If that work order, or the work order item created from the request, is later deleted, the Customer service request goes back to Open so it can be accepted again. No notification is sent for this. + #### Reject service request This option will immediately reject the CSR, save changes and close the CSR form. diff --git a/server/AyaNova/biz/WorkOrderBiz.cs b/server/AyaNova/biz/WorkOrderBiz.cs index f61c6c88..99c54b21 100644 --- a/server/AyaNova/biz/WorkOrderBiz.cs +++ b/server/AyaNova/biz/WorkOrderBiz.cs @@ -2423,6 +2423,21 @@ namespace AyaNova.Biz if (!await OutsideServiceDeleteAsync(ItemId, transaction)) return false; + //case 4628: a customer service request accepted into this item goes back to Open, unlinked (its link blocked the + //delete with a raw database error); no notification, an entry in the request's history + var acceptedRequests = await ct.CustomerServiceRequest.Where(z => z.WorkOrderItemId == id).ToListAsync(); + foreach (var csr in acceptedRequests) + { + csr.WorkOrderItemId = null; + csr.Status = CustomerServiceRequestStatus.Open; + } + if (acceptedRequests.Count > 0) + { + await ct.SaveChangesAsync(); + foreach (var csr in acceptedRequests) + await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, csr.Id, AyaType.CustomerServiceRequest, AyaEvent.Modified), ct); + } + ct.WorkOrderItem.Remove(dbObject); await ct.SaveChangesAsync();