Skip to content

feat: implement print button state management across invoice components#325

Open
MohamedAliSmk wants to merge 4 commits into
developfrom
PN-74-Add-Reprint-permission
Open

feat: implement print button state management across invoice components#325
MohamedAliSmk wants to merge 4 commits into
developfrom
PN-74-Add-Reprint-permission

Conversation

@MohamedAliSmk

Copy link
Copy Markdown
Collaborator

Enhanced the invoice printing functionality by introducing a computed property to manage the print button state based on user permissions and invoice data. Updated multiple components (InvoiceDetailDialog, InvoiceManagement, InvoiceHistoryDialog, OfflineInvoicesDialog) to utilize this new state management, ensuring buttons are enabled or disabled appropriately. Added translations for reprint permissions and updated the backend to support role-based reprint access.

@MohamedAliSmk MohamedAliSmk force-pushed the PN-74-Add-Reprint-permission branch from 590bb5b to fc80d4f Compare June 23, 2026 13:28
…ted views

- Added PrintInvoiceButton component to InvoiceDetailDialog, InvoiceManagement, InvoiceHistoryDialog, and OfflineInvoicesDialog for consistent printing functionality.
- Updated component imports and computed properties to manage print permissions and button states.
- Enhanced type definitions in components.d.ts to include PrintInvoiceButton.

Co-authored-by: Cursor <cursoragent@cursor.com>
@MohamedAliSmk MohamedAliSmk force-pushed the PN-74-Add-Reprint-permission branch from fc80d4f to 0a5654c Compare June 23, 2026 13:35
MohamedAliSmk added 3 commits June 23, 2026 16:42
- Updated PrintInvoiceButton to accept an invoice object directly, removing the need for separate props for disabled state, button class, and title.
- Enhanced reprint permission logic by introducing isInvoicePrinted utility function to determine if an invoice has been printed.
- Refactored related components (InvoiceDetailDialog, InvoiceManagement, InvoiceHistoryDialog, OfflineInvoicesDialog) to utilize the new props structure for PrintInvoiceButton, improving code consistency and readability.
…ting logic

- Deleted the PrintInvoiceButton component to streamline the printing process.
- Updated InvoiceDetailDialog, InvoiceManagement, InvoiceHistoryDialog, and OfflineInvoicesDialog to use inline button implementations for printing invoices.
- Integrated reprint permission logic directly into the button components, enhancing user experience and maintaining consistent functionality across invoice-related views.
- Adjusted type definitions in components.d.ts to reflect the removal of PrintInvoiceButton.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant