927 Commits

Author SHA1 Message Date
Ahmed Bouhuolia
52c97f1401 Merge pull request #1075 from bigcapitalhq/fix/export-i18n-column-headers
fix(server): localize i18n column headers in CSV/XLSX/PDF exports
2026-04-13 18:37:38 +02:00
Ahmed Bouhuolia
3db9061c60 fix(server): localize i18n column headers in export (CSV/XLSX/PDF)
Export column headers displayed raw i18n keys like
`expense.field.payment_account` instead of translated names like
"Payment Account" because ExportResourceService never resolved the
i18n keys before rendering.

Inject I18nService and translate column names in both
getExportableColumns() (CSV/XLSX) and getPrintableColumns() (PDF).

Closes #1073

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 18:32:24 +02:00
Ahmed Bouhuolia
a7a0a7fbe7 fix(server): use correct base currency in financial reports
Reports (Receivable Aging Summary, Payable Aging Summary, Inventory
Valuation, Sales Tax Liability Summary, Vendor Balance Summary) were
not assigning baseCurrency from meta in their constructors, causing
currency formatting to fall back to USD instead of the organization's
base currency.

Closes #1069

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 17:52:46 +02:00
Y8C68
dd58f50387 fix(server): handle missing ContentType in attachment download
GET /api/attachments/:id crashes with "Cannot read properties of
undefined (reading extension)" when the S3 object has no ContentType
metadata. This happens when files are uploaded without explicit content
type (e.g., via API integrations).

mime.extension(undefined) returns undefined, which then causes the
Content-Disposition header template to fail.

Fix: fallback to "application/octet-stream" when ContentType is missing,
and "bin" when mime.extension() returns undefined.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 06:11:28 +00:00
Ahmed Bouhuolia
d5cc3d1a71 wip 2026-03-27 11:29:57 +02:00
Ahmed Bouhuolia
2e90e3cc5b wip 2026-03-26 18:04:33 +02:00
Ahmed Bouhuolia
8b59f28125 wip 2026-03-26 17:40:24 +02:00
Ahmed Bouhuolia
cfbfc0b746 fix(accounts): correct typos in account type constants (#1046)
- Fix 'none-current-asset' -> 'non-current-asset' in ACCOUNT_TYPE
- Fix 'non-ACCOUNT_PARENT_TYPE.CURRENT_ASSET' -> 'non-current-asset' copy-paste error
- Fix 'expene' -> 'expense' typo in ACCOUNT_ROOT_TYPE
- Add database migration to update existing records

Fixes #1041

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 02:34:41 +02:00
Ahmed Bouhuolia
5caa4bce61 Merge pull request #1045 from bigcapitalhq/self-contained-e2e-github-action
feat(ci): self contained e2e GitHub action
2026-03-15 23:49:49 +02:00
Ahmed Bouhuolia
9b31210f6d wip 2026-03-15 21:14:27 +02:00
Ahmed Bouhuolia
2f45263263 feat(server): add Query DTOs for consistent filtering across modules
- Add GetBillsQuery.dto.ts, GetCreditNotesQuery.dto.ts, GetExpensesQuery.dto.ts
- Add GetItemCategoriesQuery.dto.ts, GetManualJournalsQuery.dto.ts
- Add GetPaymentsReceivedQuery.dto.ts, GetSaleEstimatesQuery.dto.ts
- Add GetSaleInvoicesQuery.dto.ts, GetSaleReceiptsQuery.dto.ts, GetVendorCreditsQuery.dto.ts
- Update DynamicFilterQuery.dto.ts with enhanced filter options
- Refactor controllers and services to use new Query DTOs
- Update SDK schema and sale-estimates types

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-15 08:50:15 +02:00
Ahmed Bouhuolia
3706e048b6 refactor(server): migrate ExchangeRates module to NestJS
- Convert TypeDI services to NestJS @Injectable() pattern
- Replace Express router with NestJS @Controller() decorators
- Migrate express-validator to class-validator DTOs
- Add Swagger/OpenAPI documentation decorators
- Fix import paths for TenantMetadata and ServiceError
- Add ExchangeRatesModule to AppModule imports
2026-03-14 05:16:06 +02:00
Ahmed Bouhuolia
06d1cf3119 feat: add response DTOs for CreditNoteRefunds and Resource modules
- Add ResourceMetaResponse DTO for resource metadata
- Update CreditNoteRefunds service with proper types
- Regenerate SDK types from updated OpenAPI schema
- Update SDK bank-rules, credit-notes, and organization modules

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 23:19:22 +02:00
Ahmed Bouhuolia
48e41da345 Merge pull request #1033 from bigcapitalhq/feat/credit-note-sdk-ts-utils
feat: add response DTOs for credit note modules and SDK types
2026-03-09 07:18:36 +02:00
Ahmed Bouhuolia
b59f40d295 feat: add response DTOs for credit note modules and SDK types 2026-03-09 07:12:10 +02:00
Ahmed Bouhuolia
ee2726c0c7 feat(server): add response DTOs for Payment Links, Stripe, Credit Notes and Inventory Cost 2026-03-09 06:35:02 +02:00
Ahmed Bouhuolia
96338cc215 chore(docker): upgrade pnpm version in Dockerfiles for server and webapp
- Updated pnpm from version 8.10.2 to 9.0.5 in both server and webapp Dockerfiles to ensure compatibility with the latest features and improvements.
2026-03-08 04:55:16 +02:00
Ahmed Bouhuolia
400fec3e98 refactor(docker): simplify Dockerfile by consolidating shared package copies
- Updated Dockerfiles for server and webapp to copy all shared packages in a single command, improving maintainability.
- Removed individual package copy commands for bigcapital-utils, pdf-templates, and email-components.
- Ensured that all shared packages are included automatically during the build process.
2026-03-08 04:49:10 +02:00
Ahmed Bouhuolia
8dd895b34f feat: add credit note status translations and manual journal default views
- Add credit note view status translations (draft, published, open, closed)
- Add Manual Journal default views for draft and published statuses
- Add DEFAULT_VIEW_COLUMNS constant for reusability

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 21:08:48 +02:00
Ahmed Bouhuolia
6d1e93e84b fix(accounts): add missing dynamic list filter properties to GetAccountsQueryDto
Add missing viewSlug, filterRoles, stringifiedFilterRoles, searchKeyword,
columnSortBy, sortOrder, customViewId, page, and pageSize properties to
GetAccountsQueryDto to enable proper filtering when selecting table views
(Assets, Liabilities, Equity, Income, Expenses) on the Accounts Chart page.

Previously, the API received view_slug but didn't process it because the
DTO lacked these properties, causing all accounts to be returned instead
of filtering by the view's root_type.

Fixes #1023

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:23:49 +02:00
Ahmed Bouhuolia
e02e143157 fix(payment-received): allow decimal amounts in paymentAmount validation
Change @IsInt() to @IsNumber() for paymentAmount field in PaymentReceivedEntryDto
to allow recording payments with cents (e.g., $1,679.80).

Fixes #1016

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 06:31:55 +02:00
Ahmed Bouhuolia
7dd08d6141 feat(financial-statements): add new financial report DTOs and update controllers
- Introduced new DTOs for various financial reports including Balance Sheet, Cash Flow Statement, and Aging Summaries.
- Updated existing controllers to utilize the new DTOs and enhance OpenAPI documentation with proper schema references.
- Removed unnecessary query parameters from the Bank Accounts controller.
- Enhanced response structures for better data representation in reports.
2026-03-06 05:25:44 +02:00
Ahmed Bouhuolia
631df56cee feat(sdk): add banking and vendor credits SDK utilities
- Add SDK types for bank rules, cashflow accounts, and vendor credits
- Update banking controllers with proper OpenAPI annotations
- Update vendor credits controllers with new endpoints and DTOs
- Enhance banking transaction handling for categorize, recognize, pending, and exclude operations
- Add vendor credit apply bills and refund functionality

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 23:06:44 +02:00
Ahmed Bouhuolia
4c059d610e feat(sdk-ts): add authentication fetch utils 2026-03-05 19:50:38 +02:00
Ahmed Bouhuolia
e3d3da7cd9 feat(sdk): move the generate sdk ts types to nestjs command 2026-03-04 00:20:46 +02:00
Ahmed Bouhuolia
e3c55c5d6f feat(sdk): add OpenAPI export script and TypeScript SDK package
- Add export-openapi.ts script for server OpenAPI spec export
- Add shared/sdk-ts package with generated API clients (accounts, bills, customers, vendors, etc.)
- Update Customers and Vendors controllers
- Update ReportsEventsTracker
- Update .gitignore, package.json, and pnpm-lock

Made-with: Cursor
2026-03-03 23:26:24 +02:00
Ahmed Bouhuolia
28786712ea fix(server): Fix UnlinkAttachment model reference bug
Add missing function invocation on LinkModel to properly call query method.
The model reference was missing parentheses to invoke the factory function.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 22:35:21 +02:00
Ahmed Bouhuolia
b98485c5f3 fix(server): PDF template logo not showing on reopen
Generate presigned URL for companyLogoKey when retrieving PDF template
to allow the logo to display when reopening the branding template drawer.

- Inject GetAttachmentPresignedUrl service in GetPdfTemplateService
- Generate companyLogoUri from companyLogoKey in template attributes
- Add companyLogoUri to transformer included attributes

Fixes the issue where logo uploads and saves but doesn't show when
reopening the branding template customization drawer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 05:22:01 +02:00
Ahmed Bouhuolia
3575d54efa fix: add attachment support for all transaction types
Fixed attachments not showing in edit forms for various transaction types by:

1. Adding @InjectAttachable() decorator to models:
   - SaleReceipt, SaleEstimate, CreditNote, PaymentReceived
   - Bill, BillPayment, VendorCredit
   - ManualJournal, Expense

2. Fixing transformers to include attachments in API responses:
   - SaleReceiptTransformer, PaymentReceivedTransformer

3. Registering missing event subscribers in Attachment.module.ts:
   - AttachmentsOnSaleReceipts, AttachmentsOnSaleEstimates

4. Fixing DocumentLink model relation mapping:
   - Changed Document.default to Document for proper module export

5. Fixing PaymentReceived model_ref consistency:
   - Changed from 'PaymentReceive' to 'PaymentReceived' to match class name

6. Adding missing withGraphFetched('attachments') to GetPaymentReceived.service.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 23:16:12 +02:00
Ahmed Bouhuolia
ad252d2e4a fix(models): remove timestamps from models where tables lack createdAt/updatedAt columns
Add withDateSessionMixin for proper timestamp handling and fix models
to return empty timestamps array when database tables don't have
created_at/updated_at columns. This prevents ORM insert/update errors.

Models updated:
- Branch, Role, RolePermission, ViewColumn, ViewRole
- InventoryAdjustment, InventoryAdjustmentEntry, InventoryTransactionMeta
- BillLandedCostEntry, CreditNote, CreditNoteAppliedInvoice, RefundCreditNote
- PaymentReceived, SaleInvoice, SaleReceipt, Item, ItemEntry
- RefundVendorCredit, VendorCreditAppliedBill
- ItemWarehouseQuantity, Warehouse, WarehouseTransfer, WarehouseTransferEntry
- Setting, TenantMetadataModel, TenantUser

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-26 05:57:55 +02:00
Ahmed Bouhuolia
558fc29962 fix: use organization date format in banking transactions and reports
- Add OrganizationSettingsModule to BankingTransactionsModule
- Update GetBankAccountTransactions to pass dateFormat from settings
- Add meta support to FinancialSheet base class
- Refactor TransactionsByReference to use IFinancialReportMeta
- Update frontend to use server-provided formatted_date
2026-02-25 20:33:31 +02:00
Ahmed Bouhuolia
d35915b16b feat(accounts): add account settings service
- Add AccountsSettingsService for managing account-related settings
- Update validators, create and edit services to use settings
- Add constants for account configuration
- Update frontend utils and translations

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 19:27:53 +02:00
Ahmed Bouhuolia
f5e74f3e88 fix(inventory): update baseCurrency retrieval in InventoryDetailsService
- Replace tenantMetadata.baseCurrency with meta.baseCurrency in InventoryDetailsService to ensure consistent currency usage across reports.
2026-02-25 07:10:09 +02:00
Ahmed Bouhuolia
c83132b867 fix(financial-statements): use stored date format settings in all reports
- Replace hardcoded date formats ('YYYY/MM/DD') in all Meta classes with meta.dateFormat
- Add IFinancialReportMeta interface with baseCurrency and dateFormat fields
- Add DEFAULT_REPORT_META constant with default date format 'YYYY MMM DD'
- Update all sheet classes to accept IFinancialReportMeta parameter
- Update all services to pass dateFormat from meta to sheet constructors
- Fix customer/vendor transactions date formatting in table rows
- Add TenancyModule to SalesTaxLiabilityModule for dependency injection
- Make dateFormat optional in JournalSheet and GeneralLedger query types

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 07:05:31 +02:00
Ahmed Bouhuolia
f35e85c3d2 fix(organization): align date formats and fix address field naming
- Fix date format mismatch between Miscellaneous and Organization constants
- Fix default date format casing ('DD MMM yyyy' -> 'DD MMM YYYY')
- Rename address fields from address_1/address_2 to address1/address2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 22:42:29 +02:00
Ahmed Bouhuolia
f149ff43b4 feat(contacts): add country field to customer and vendor address forms
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 20:53:14 +02:00
Ahmed Bouhuolia
688b1bfb56 fix(server): add invoices Map for validateInvoicesRemainingAmount 2026-02-24 02:52:28 +02:00
Ahmed Bouhuolia
0f8147daff Merge branch 'develop' into fix/credit-note-apply-invoice-validation 2026-02-24 02:42:23 +02:00
Ahmed Bouhuolia
2a87103bc8 fix: Add DELETE endpoint for credit notes applied invoices
- Add missing DELETE /credit-notes/applied-invoices/:id endpoint
- Fix CreditNotesApplyInvoice controller to use correct service methods
- Add missing GetCreditNoteAssociatedInvoicesToApply endpoint
- Add proper DTO for ApplyCreditNoteToInvoices
- Update frontend creditNote hook to use correct API paths

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 02:15:32 +02:00
Ahmed Bouhuolia
ce9f2a238f fix: signup confirmation 2026-02-23 00:37:56 +02:00
Yong ke Weng
75b98c39d8 fix: validate credit note per-entry amount against each invoice due amount
The `validateInvoicesRemainingAmount` method was incorrectly comparing the
total credit amount (sum of all entries) against each individual invoice's
due amount. This caused valid credit note applications to be rejected when
applying to multiple invoices where the total exceeded any single invoice's
due amount.

Changed the validation to compare each invoice's due amount against only the
specific entry amount being applied to that invoice.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 09:50:39 -05:00
Ahmed Bouhuolia
de3d4698ea fix: localize hardcoded strings in financial reports
- Fix cash_flow_statement.net_cash_investing not being localized
- Add translation keys for Account name, Total, sheet name, From/To dates
- Create contact_summary_balance.json for Customer/Vendor Balance Summary
- Create trial_balance_sheet.json for Trial Balance Sheet columns
- Create inventory_item_details.json for Inventory Item Details
- Create transactions_by_contact.json for Transactions by Contact
- Fix hardcoded strings in TrialBalanceSheetTable column labels
- Fix hardcoded 'Total' in CustomerBalanceSummary and VendorBalanceSummary
- Fix hardcoded column headers in InventoryItemDetailsTable
- Fix hardcoded Opening/Closing balance strings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 22:07:00 +02:00
Ahmed Bouhuolia
78032d7bfc fix: invite user service issues 2026-02-18 12:32:04 +02:00
Ahmed Bouhuolia
37fa9f9bc6 fix: correct config key for base URL in email services 2026-02-18 01:28:48 +02:00
Ahmed Bouhuolia
17deeb18e3 Merge pull request #965 from bigcapitalhq/fix/ahmedbouhuolia/cashflow-transaction-type-consistency
fix: correct cash flow transaction type naming inconsistencies
2026-02-16 23:05:22 +02:00
Ahmed Bouhuolia
8416b45f4e fix: correct cash flow transaction type naming inconsistencies
- Fix typo ONWERS_DRAWING -> OWNERS_DRAWING in server constants
- Change OwnerDrawing -> owner_drawing for consistency in webapp
- Fix typo TRANSACRIONS_TYPE -> TRANSACTIONS_TYPE
- Fix typo OnwersDrawing -> OwnerDrawing
- Add missing Icon and FDateInput imports
- Add dark mode styling for BranchRowDivider

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-02-16 23:02:38 +02:00
Ahmed Bouhuolia
93711a7bf4 fix: correct queue name, add missing await, and clean up constants 2026-02-16 22:23:41 +02:00
Ahmed Bouhuolia
d5402b6a9b feat: add permission guards to credit note and vendor credit controllers
Add AuthorizationGuard and PermissionGuard to the following controllers:
- CreditNoteRefundsController
- CreditNotesApplyInvoiceController
- VendorCreditApplyBillsController
- VendorCreditsRefundController

Add @RequirePermission decorators with appropriate actions:
- View action for GET endpoints
- Edit action for POST/DELETE endpoints
- Refund action for refund-related operations

Also fixes AuthorizationGuard to use userId from clsService instead of
user.id from request for consistency with the abilities cache.
2026-02-16 20:04:48 +02:00
Ahmed Bouhuolia
8ad1be1d52 fix: correct trial balance sheet filtering logic
- Include child account transactions when filtering parent accounts
- Fix order of operations in accounts section mapping
- Ensure accounts with child transactions are not incorrectly filtered out

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 15:27:33 +02:00
Ahmed Bouhuolia
2d39e38578 fix(server): premissions guard for read and write endpoints 2026-02-15 22:55:10 +02:00