Commit Graph

44 Commits

Author SHA1 Message Date
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
64c7ee4474 Bill Edit Form: saving all the fields 2024-01-05 09:38:27 +01:00
79dbe04245 implemented bill update 2024-01-04 16:25:22 +01:00
76ddedf652 Bill Edit Form: dovršen fetch 2024-01-04 15:38:58 +01:00
b168e6086f pojednostavljeni edit form-ovi 2024-01-04 11:31:35 +01:00