Commit Graph

321 Commits

Author SHA1 Message Date
ashan_rusiru 9a3ab2a4f6 Merge pull request 'Dev' (#116) from Dev into production
Reviewed-on: #116
2026-10-18 16:23:26 +05:30
ashan_rusiru 6e4d16dc88 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 13m45s
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 15m14s
2026-10-18 16:23:18 +05:30
Dhananjaya99 a0793b35d3 Add migration to include AccruedExpensesCode in gl_account_config table
- Introduced a new column 'AccruedExpensesCode' of type varchar(20) to the 'gl_account_config' table.
- Added SQL command to update existing records with a default value of '2300' for the 'AccruedExpensesCode' where it is currently null.
2026-10-18 16:21:38 +05:30
Dhananjaya99 dcdb628647 Merge branch 'Dev' of https://gitea.hexdive.com/New_REP_SYSTEM/ERP-core into Dev 2026-10-18 14:49:34 +05:30
Dhananjaya99 ce35973b58 feat: Enhance Stock Ledger functionality with item details and filters
- Updated StockService to compute running balance on read and include item SKU, name, category, and brand in StockLedgerRowDto.
- Modified GetLedgerAsync method to accept categoryId and brandId parameters for filtering.
- Enhanced StockController to support new query parameters for ledger retrieval.
- Updated StockDtos to include additional item information in StockLedgerRowDto.
- Adjusted frontend Stock Ledger page to display item details and implement searchable item picker.
- Added tests for StockLedger to verify running balance calculations and filtering by category and brand.
- Updated appsettings for service URLs and modified login page navigation logic.
2026-10-18 14:49:26 +05:30
ashan_rusiru efab804b04 Merge pull request 'Dev' (#115) from Dev into production
Reviewed-on: #115
2026-10-18 12:50:58 +05:30
ashan_rusiru 8726531d94 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 12m41s
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 16m8s
2026-10-18 12:50:52 +05:30
Dhananjaya99 7da8834ce9 Merge branch 'Dev' of https://gitea.hexdive.com/New_REP_SYSTEM/ERP-core into Dev 2026-10-18 12:46:57 +05:30
Dhananjaya99 e7b1f270a5 feat: add vendor optional fields and configuration hooks
- Implemented VendorOptionalFields component to handle optional vendor details (mobile, email, address) with validation.
- Created useCustomerConfig hook to load optional customer field settings from Sales configuration.
- Developed useProcurementConfig hook to manage Procurement configuration flags.
- Introduced accessConfigApi for managing access configuration settings.
- Added openingBalancesApi for handling opening balances operations.
- Created procurementConfigApi for managing procurement configuration settings.
- Implemented nav-routes for permission-based routing.
- Developed PDF generation for purchase orders with dynamic vendor and item details.
- Added purchase-order tax helpers for tax calculations and formatting.
- Defined types for opening balances and related operations.
2026-10-18 12:46:31 +05:30
ashan_rusiru 70e8193247 Merge pull request 'Dev' (#114) from Dev into production
Reviewed-on: #114
2026-10-17 18:25:55 +05:30
ashan_rusiru 8b61c0910f Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 12m44s
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 16m19s
2026-10-17 18:25:49 +05:30
Dhananjaya99 c27db06880 feat: add PriceAdjustmentLine repository to PriceAdjustmentService and optimize pending item query 2026-10-17 18:24:57 +05:30
Sasanka e289b8430f ui fixers in 10/16 2026-10-16 14:34:28 +05:30
Dhananjaya99 379ad204bd Merge branch 'Dev' of https://gitea.hexdive.com/New_REP_SYSTEM/ERP-core into Dev 2026-10-15 10:54:34 +05:30
Dhananjaya99 61330f3927 feat: implement user role status toggle and reset password functionality
- Added toggle functionality for user roles (activate/deactivate) in roles and users pages.
- Introduced a reset password page that validates and updates user passwords via a reset link.
- Enhanced user detail page with edit functionality for user information (display name, email, mobile number).
- Implemented sending reset link feature for users, with appropriate error handling and success notifications.
- Updated API endpoints for user management to support new functionalities.
- Improved UI components for better user experience during status updates and password changes.
2026-10-15 10:54:28 +05:30
ashan_rusiru 81695a1fda Merge pull request 'Dev' (#113) from Dev into production
Reviewed-on: #113
2026-10-14 19:14:48 +00:00
ashan_rusiru e33fe85bbb Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 13m30s
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 17m0s
2026-10-14 19:14:42 +00:00
Dhananjaya99 5ec3edc0c6 Merge branch 'Dev' of https://gitea.hexdive.com/New_REP_SYSTEM/ERP-core into Dev 2026-10-14 17:22:27 +05:30
Dhananjaya99 eb274e62c4 Remove sample trend data and update chart rendering logic for better handling of empty trends 2026-10-14 17:22:19 +05:30
ashan_rusiru 0a1ef66f68 Merge pull request 'Dev' (#112) from Dev into production
Reviewed-on: #112
2026-10-14 08:50:31 +00:00
ashan_rusiru 0ff6f33e9a Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 12m49s
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 16m23s
2026-10-14 08:50:21 +00:00
Dhananjaya99 fd019e8ee6 Merge branch 'Dev' of https://gitea.hexdive.com/New_REP_SYSTEM/ERP-core into Dev 2026-10-14 14:19:37 +05:30
Dhananjaya99 7fa871c449 Remove 'peer' field from several dependencies in package-lock.json 2026-10-14 14:19:25 +05:30
ashan_rusiru 6b87cd2d64 Merge pull request 'Dev' (#111) from Dev into production
Reviewed-on: #111
2026-10-14 07:55:17 +00:00
ashan_rusiru b78152b428 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 11m33s
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 13m2s
2026-10-14 07:54:55 +00:00
Dhananjaya99 d926254419 Remove build.ps1 script and correct typo in page.tsx comment 2026-10-14 13:24:32 +05:30
Dhananjaya99 169a7c325c Update .dockerignore and .gitignore to include 'dist' directory; add build.ps1 script for frontend packaging 2026-10-14 13:21:27 +05:30
ImanThiyanga 24a8b1045c Merge pull request 'Dev' (#109) from Dev into production
Reviewed-on: #109
2026-10-14 05:46:44 +00:00
ImanThiyanga b3f3b45c27 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 11m36s
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 15m7s
2026-10-14 05:46:37 +00:00
ImanThiyanga a1160e4f15 Merge pull request 'Fix/ui bug fixers rebase repair' (#108) from fix/ui-bug-fixers-rebase-repair into Dev
Reviewed-on: #108
2026-10-14 05:45:31 +00:00
ImanThiyanga 3be425284c Repair botched rebase resolutions from ui-bug-fixers
The rebase onto Dev resolved five conflicts; four were wrong. In the
service files Dev's constructor parameter lists won while the branch's
field declarations and constructor bodies stayed, so the bodies assigned
parameters that no longer existed.

- AdjustmentService: restore fifo, approvals, db and serialTracking
  parameters (Dev's glAccounts kept, configuration dropped).
- FifoCostingService: restore the LowStockTracker field, parameter and
  assignment.
- CountService: restore _serialTracking and _adjustments, and delete
  Dev's PostAdjustmentJournalAsync. Dev's call site did not survive the
  rebase, so the method was orphaned dead code referencing fields this
  class no longer has. The branch routes count variances through
  AdjustmentService.SubmitAsync, which posts via Dev's role-keyed
  glCodes, so nothing is lost by removing it.
- PurchaseInvoicePaymentService: this one compiled. paymentDay was
  computed but the GL period and EntryDate still used now, so a
  back-dated payment posted its journal to today's period. Use
  paymentDay, and resolve "today" through BusinessClock, matching
  SalesInvoicePaymentService.
- ErpDbContextModelSnapshot: the resolution dropped the whole Expense
  module from the definition and relationship sections while leaving its
  navigation entries behind, so the snapshot no longer loaded. Rebuilt as
  the branch's snapshot plus Dev's GlAccountConfig blocks; EF now reports
  no pending model changes.

Tests: BankDepositTestSupport's FakeGeneralLedger gains the
ListAccountsAsync member Dev added to IGeneralLedgerService, and
DualApprovalTests passes a StubGlAccountConfigService in place of the
removed IConfiguration.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-14 09:49:09 +05:30
Sasanka d0354ed169 price adjustment and stock adjustments 2026-10-12 15:02:59 +05:30
Sasanka a788349138 serial numbers 2026-10-12 14:57:15 +05:30
Sasanka 3abcfa6e6f ui bug fixers 2026-10-12 14:56:12 +05:30
ImanThiyanga 0d3f2fba14 Merge branch 'Dev' of https://gitea.hexdive.com/New_REP_SYSTEM/ERP-core into Dev 2026-10-12 14:36:01 +05:30
ImanThiyanga 1cddbaf84f Merge pull request 'Add GL account configuration and role mapping entities' (#107) from Dev into production
Reviewed-on: #107
2026-10-07 08:19:12 +00:00
ImanThiyanga c9906d24c9 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 13m3s
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 14m7s
2026-10-07 08:19:03 +00:00
ImanThiyanga a3591d3643 Sync package-lock.json with package.json so npm ci works again
html-to-image and jspdf were added to package.json without being added to
the lockfile, so `npm ci` - which the frontend Dockerfile runs - failed
with the package.json/package-lock.json out-of-sync error. tsc also could
not resolve either module in SalesInvoicePrint.tsx.

Pre-existing and unrelated to the GL account work; found because the GL
Accounts screen could not be build-verified without it.

Adds those two plus their transitive deps. It also drops @emnapi/core and
@emnapi/runtime: both are optional, and required only by the wasm32-wasi /
sharp-wasm32 variants, which linux-x64 never selects in favour of the
native binaries - so the Docker build is unaffected.

Verified: npm ci succeeds, tsc --noEmit is clean, npm run build compiles.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-07 13:17:52 +05:30
ImanThiyanga c30ff473f5 Add the GL Accounts settings screen
Pickers are populated from GL's own chart of accounts, postable and active
accounts only, so a user can only choose a code the server will accept. A
stored code GL does not have is shown flagged and still selected rather
than appearing blank, which is the state 11 of the 12 mappings are in until
GL's chart is seeded - the broken mapping stays visible instead of looking
merely unset.

Options come from /gl-account-config rather than the GL proxy: that proxy
is gated on the `ledgers` nav permission while this screen is on
`settings`, and one endpoint keeps the picker and the server-side
validation working from the same list. Gated on the existing `settings` key
so no role_permissions edit is needed.

Saving is disabled outright while GL is unreachable, matching the server,
which refuses to store a mapping it could not verify.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-07 13:17:22 +05:30
ImanThiyanga c41aed9a80 Move the GL account mapping out of appsettings into validated master data
The per-module Gl*Code appsettings keys pinned GL's account *codes* in
ERPCore's config, while GL generates codes positionally and refuses a
requested one. Nothing connected the two, so "1100 means Inventory" held
only because someone once created accounts in a particular order - and on
2026-10-07 eleven of the twelve configured codes turned out never to have
existed in GL. Every GRN, adjustment, day-end, invoice and FIFO posting had
been failing with "Account <code> not found".

The mapping is now master data in gl_account_config, keyed by accounting
role rather than by module, and GlAccountConfigService validates every
submitted code against GL's live chart of accounts before storing it. A
code GL does not have, or cannot post to, is refused with the role named -
so the mismatch is unrepresentable rather than merely detected. Correcting
a mapping no longer needs a redeploy.

Notes:
- Fails closed on save (503 if GL is unreachable), deliberately opposite to
  the startup validator, which must still let the app serve.
- Non-postable accounts are rejected too: GL rejects a journal line against
  one, so storing it only defers the failure. The auto-created 1000
  Bank/Cash header is exactly that trap.
- The settings endpoint also serves the selectable accounts, because
  GeneralLedgerController is gated on `ledgers` while this is on `settings`
  - and it keeps the picker and the validation list the same data.
- Reading an unmapped role throws naming the role, instead of posting ""
  and letting GL return an opaque 404 from inside a transaction.
- The appsettings keys are now seed-only: DataSeeder copies them in once so
  existing deployments keep their current mapping. No runtime fallback, or
  there would be two sources of truth again.
- The 32 read sites across 11 services collapsed to 12 roles, since every
  module carried the same value for a given role.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-07 13:04:49 +05:30
ImanThiyanga 614df3065d Add GL account configuration and role mapping entities
- Introduced GlAccountConfig entity for mapping accounting roles to GL account codes.
- Added GlAccountConfigConfiguration for database configuration of the singleton GL account mapping.
- Created GlAccountRole enum to define accounting roles used in GL postings.
- Enhanced error handling with new error codes for unconfigured and invalid GL accounts.
- Updated existing DbContext to include GlAccountConfig DbSet.
2026-10-07 12:51:15 +05:30
ImanThiyanga 60652d611e Merge pull request 'Stop the GL account-code check from being able to abort startup' (#106) from Dev into production
Reviewed-on: #106
2026-10-07 06:40:46 +00:00
ImanThiyanga 65976c5cd3 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 11m15s
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 12m33s
2026-10-07 06:40:39 +00:00
ImanThiyanga 3c8837e21e Stop the GL account-code check from being able to abort startup
The catch filter only matched DomainException/OperationCanceledException,
so anything else escaped a hosted service and took the host down. One such
path was mine: `"items": null` deserializes over the property initialiser,
so `data.Items.Select(...)` would NullReferenceException straight past the
filter.

Fixed at both ends - the reader tolerates a null or absent items array, and
the catch is now a deliberate catch-all that only lets a genuine host
shutdown through. This is a diagnostic; a diagnostic that can core-dump the
thing it diagnoses is worse than no diagnostic at all.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-07 11:53:31 +05:30
ImanThiyanga 63c8c8457f Merge pull request 'Make the GL account-code check report instead of refusing to start' (#105) from Dev into production
Reviewed-on: #105
2026-10-07 06:14:37 +00:00
ImanThiyanga e0601d5a8d Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 12m25s
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 13m43s
2026-10-07 06:14:29 +00:00
ImanThiyanga 9eab6372b3 Make the GL account-code check report instead of refusing to start
The check shipped in f753cae threw on a missing code, which core-dumped
erpcore.service on deploy: 11 of the 12 configured Gl*Code values turned
out never to have existed in GL's chart of accounts, so a long-standing
mismatch became an immediate outage.

Detection was the point; refusing to serve the rest of the app was not.
GL already rejects a posting to an unknown account, so the per-flow error
stays the real enforcement — this now logs the whole set at Error once at
boot instead of surfacing one flow at a time.

Hard-fail is still available behind
GeneralLedgerService:FailOnMissingAccountCodes, for once the chart of
accounts is known-good and drift should stop a deploy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-07 11:40:46 +05:30
ImanThiyanga 92f571bbf1 Merge pull request 'Refactor GL period and entry date handling to use BusinessClock for accurate date resolution; add GlAccountCodeValidator for startup validation of configured account codes.' (#104) from Dev into production
Reviewed-on: #104
2026-10-07 05:57:54 +00:00
ImanThiyanga b236b2b126 Merge branch 'production' into Dev
CI/CD - ERP Core Monorepo / Build & Deploy Frontend (pull_request) Failing after 14m6s
CI/CD - ERP Core Monorepo / Build & Deploy Backend (pull_request) Failing after 15m25s
2026-10-07 05:57:43 +00:00
ImanThiyanga f753cae82d Refactor GL period and entry date handling to use BusinessClock for accurate date resolution; add GlAccountCodeValidator for startup validation of configured account codes. 2026-10-07 11:27:12 +05:30