Commit Graph

54 Commits

Author SHA1 Message Date
Knee Cola
1e8a817fcc revert: restore legacy PDF417 barcode generation implementation
Restore custom PDF417 generator, renderer, and component that were previously removed. Update all components to use the legacy Pdf417Barcode instead of Pdf417BarcodeWasm.

Restored files:
- app/lib/pdf/pdf417.ts - Custom PDF417 generator library
- app/lib/pdf/renderBarcode.ts - Canvas-based barcode renderer
- app/ui/Pdf417Barcode.tsx - React component using custom generator

Updated imports in:
- app/ui/BillEditForm.tsx
- app/ui/PrintPreview.tsx
- app/ui/ViewBillCard.tsx
- app/ui/ViewLocationCard.tsx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-21 20:52:04 +01:00
Knee Cola
b8afb2ef0d feat: migrate PDF417 barcode generation to zxing-wasm/writer
Replace custom PDF417 generation (generateBarcode/renderBarcode) with zxing-wasm's writeBarcode for improved reliability and smaller codebase. Updated all 4 components (BillEditForm, PrintPreview, ViewBillCard, ViewLocationCard) to use new Pdf417BarcodeWasm component with ecLevel 5 for error correction.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-20 08:46:38 +01:00
Knee Cola
5b0497891a feat: migrate PDF417 barcode decoder from @zxing/browser to zxing-wasm
Replace @zxing/browser with zxing-wasm for better performance and smaller WebAssembly bundle size (919KB). Added middleware exclusion for .wasm files to prevent i18n routing interference.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 18:01:44 +01:00
7467f9d595 @zxing udpated to latest version 2025-12-19 12:55:49 +01:00
23c3695a89 feat: improve mobile responsiveness across UI components
- Add responsive layout for action buttons (stack vertically on mobile, horizontal on sm+)
- Adjust card max-widths for better mobile display (LocationCard, MultiBillEdit)
- Improve button text sizing with responsive classes (text-sm on mobile, text-xs on sm+)
- Remove width constraints on file inputs and info boxes for full-width mobile layout
- Fine-tune icon positioning for better visual alignment

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-19 09:59:37 +01:00
Knee Cola
e978a5c2bf feat: add debug logging and improve proof-of-payment icon styling
Changes:
- Add console.log statements for shareId validation failures in locationActions
- Replace DocumentIcon with TicketIcon for proof-of-payment downloads (consistency)
- Add teal color to all proof-of-payment icons for visual distinction
- Adjust vertical alignment of icons for better visual alignment with text

Debug logging helps troubleshoot:
- shareId extraction failures
- Checksum validation failures
- Location not found errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-08 01:17:03 +01:00
Knee Cola
cfa6a4c5b7 Add proof of payment display to BillEditForm
Added read-only proof of payment display in bill edit form:
- Shows download link when proofOfPaymentType is "per-bill" and proof exists
- Uses TicketIcon with teal color for visual distinction
- Links to /share/proof-of-payment/per-bill/ download route
- Handles housekeeping case (no display if filename missing)

This allows users to view and download existing proof of payment
while editing a bill, improving transparency and user experience.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-07 16:35:08 +01:00
Knee Cola
7994f9ebdb Add info box for billed-to selection in BillEditForm 2025-12-07 16:02:02 +01:00
Knee Cola
15133286c9 Fix cancel button links in edit forms to redirect to /home
- Update BillEditForm cancel button to redirect to /home
- Update LocationEditForm cancel button to redirect to /home
- Update UserSettingsForm cancel button to redirect to /home

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 21:51:47 +01:00
Knee Cola
b9f73e9a90 Restructure application to use /home for authenticated pages
- Move authenticated home page from /[locale] to /[locale]/home
- Move login page from /[locale]/login to /[locale] (new landing page)
- Move all restricted pages (bill, location, year-month, print, account) under /[locale]/home
- Simplify middleware to protect all routes under /home instead of using publicPages array
- Update auth config: change signIn page from /login to /
- Update SignInButton callback URL to redirect to /home after login
- Update all internal links throughout the application to reflect new structure
- Update server action redirects in navigationActions.ts
- Public share routes (/share/*) remain unchanged

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-25 21:49:01 +01:00
Knee Cola
b650620390 (bugfix) typescript error 2025-11-24 22:19:28 +01:00
Knee Cola
db65d82ab5 (refactor) BillEditForm: billed-to-* converted from radio buttons to select; added info box 2025-11-23 22:49:05 +01:00
Knee Cola
fb3393c985 (bugfix) decoding hub3a from image did not work 2025-11-23 12:53:35 +01:00
Knee Cola
25ae19980a UI: Center-align PDF417 barcode within label containers
Added justify-center class to label elements containing Pdf417Barcode
component for better visual alignment.

Changes:
- BillEditForm: Center barcode in form display
- ViewBillCard: Center barcode in read-only view

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 10:43:33 +01:00
Knee Cola
278976b75b Refactor: Replace barcodeImage with hub3aText in BillEditForm
- Changed from storing base64-encoded bitmap to decoded HUB-3A payment string
- Implemented migration logic to convert legacy barcodeImage to hub3aText on component mount
- Updated state management to use hub3aText instead of barcodeImage
- Replaced image display with Pdf417Barcode component for consistent rendering
- Added error handling for migration promise
- Updated useEffect dependencies to prevent stale closures
- More efficient storage and easier to work with payment data going forward

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-23 08:24:08 +01:00
Knee Cola
2b55ba78d7 Improve billedTo radio buttons layout to single row
Changed the layout to display the label and radio buttons in a single
horizontal row for better visual alignment and more compact design.

Before: Label on separate line above radio buttons
After: Label and radio buttons aligned horizontally

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:50:58 +01:00
Knee Cola
1605eec5fb Replace billedToTenant boolean with billedTo enum
Migrated from boolean checkbox to enum-based radio buttons for better
flexibility and clarity in tracking bill payment responsibility.

Changes:
- Added BilledTo enum with values 'tenant' and 'landlord'
- Replaced Bill.billedToTenant (boolean) with Bill.billedTo (enum)
- Updated BillEditForm to use radio buttons instead of checkbox
- Updated billActions to handle billedTo enum values
- Updated all display filtering to use enum comparison
- Updated printActions barcode filtering
- Updated translations for radio button labels (en/hr)

The billedTo property is optional for backward compatibility -
undefined values default to BilledTo.Tenant, maintaining current
behavior where only tenant bills are displayed and calculated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:48:28 +01:00
Knee Cola
c3b555189b Complete billedToTenant server action implementation
Implemented full server-side persistence for the billedToTenant property:

- Extract billedToTenant from formData in updateOrAddBill action
- Add to MongoDB $set operations for updating existing bills
- Include in new bill creation with value from form
- Set default value (true) for bills added to subsequent months
- Handle undefined values from existing database records using destructuring defaults

This completes the feature - bills can now track whether they should be
paid by the tenant, with backward compatibility for existing data.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:30:47 +01:00
Knee Cola
0ae5140487 Add billedToTenant property to Bill interface with UI support
Added new boolean property to track whether a bill should be paid by the tenant.

Changes:
- Added billedToTenant property to Bill interface in db-types.ts
- Added checkbox UI control in BillEditForm for billedToTenant
- Added state management and change handler for the checkbox
- Added i18n translations (EN: "Billed to tenant", HR: "Plaća podstanar")
- Set default value to true for new bills

Note: Server action implementation pending - property not yet persisted to database.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 13:18:15 +01:00
71895229ec add bulk bill creation across subsequent months
Implement ability to add newly created bills to all subsequent months
with toggle option (disabled by default). Includes duplicate checking
and efficient bulk operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 12:01:18 +02:00
491b11e86d fixing types 2025-07-23 13:40:14 +02:00
36f2f74e64 implemented scanning PDF docs for multiple 2D codes 2025-07-23 13:12:13 +02:00
160c4f00f5 BugFix: delete button did not use locale path prefix 2024-02-19 10:21:25 +01:00
d30bd50e1a enabled i18n for all components 2024-02-16 21:56:41 +01:00
7ef236a557 HotFix: small HTML fixes 2024-02-15 10:04:15 +01:00
66037b7b76 added disclaimer under the 2d bar code 2024-02-15 09:38:29 +01:00
c87f9964c4 BillEditForm: responsive width, white barcoder outline 2024-02-13 11:52:25 +01:00
010bd09d47 BillEditForm: payed amount in same line with checkbox 2024-02-13 11:16:07 +01:00
dc8f7e335a bar code imaghe is saved to DB 2024-02-12 15:29:16 +01:00
c833a4afe6 implemented barcode decoder 2024-02-12 14:58:31 +01:00
84332b81af partial implementation of bar code parsing from PDF 2024-02-09 16:02:18 +01:00
a3c7e8f4c9 removing legacy code 2024-02-06 15:37:37 +01:00
8aaf2a0dea "Cancel" buttons replaced with <Link> 2024-02-06 14:29:58 +01:00
2261e83715 refactoring: changing param list of a fn 2024-02-01 15:07:30 +01:00
a1abc450bf forms: gotoHome activating previously active month 2024-02-01 14:38:26 +01:00
2728b5c302 reduced form BillEditForm with so it fits Samsung Galaxy S22 2024-01-18 16:11:13 +01:00
9deec817b1 fix: bill edit form formatting was falling apart 2024-01-17 16:07:12 +01:00
0eb11e7d02 form action redirects user to tjhe appropriate year 2024-01-17 15:47:55 +01:00
4c6292b6c6 fixed form with on mobile 2024-01-16 14:28:10 +01:00
226beb974f header & footer 2024-01-16 10:24:21 +01:00
dc2c4b9351 BugFix: fixed PDF download URL 2024-01-15 15:12:09 +01:00
1531ef0b7c BugFix: attachment URL fixed 2024-01-15 15:03:56 +01:00
8112c9765d refactoring: actions moved to seprate dir 2024-01-09 15:00:26 +01:00
4ffe89fde6 added payedAmount 2024-01-09 10:22:13 +01:00
f26aae7d66 refactoring: renamed actions tp billActions 2024-01-05 14:30:44 +01:00
245cc38717 implemente bill add 2024-01-05 14:20:00 +01:00
73029fb28a refactoring: changed path to bills 2024-01-05 13:56:38 +01:00
86135199a9 implemented bill deletion + var rename 2024-01-05 13:54:25 +01:00
eea2ca1492 implemente attachemtn download route 2024-01-05 12:39:22 +01:00
8b7cd45087 supported attachment upload 2024-01-05 11:55:33 +01:00