Skip to content

11565 create all sales report print view #11566

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2025

Conversation

damithdeshan98
Copy link
Collaborator

@damithdeshan98 damithdeshan98 commented Apr 3, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated printable view for laboratory income reports with a clear, organized layout that presents report headers, data details, and summaries for easy printing.
  • Style

    • Updated button labels and actions on the report page to streamline navigation.
    • Refined the report table's presentation by removing redundant columns and applying enhanced styling adjustments (e.g., zoom and width tweaks) for improved readability.

Copy link
Contributor

coderabbitai bot commented Apr 3, 2025

Walkthrough

This pull request modifies existing XHTML views and introduces a new one for printing laboratory income reports. The primary report file now features an updated print button with a redirection action and the removal of specific columns, while a new print-specific template has been added to handle formatted print views using JSF components and dedicated CSS for print media. Additionally, styling and template references have been adjusted in another print view template to enhance layout formatting.

Changes

File(s) Change Summary
src/main/webapp/reportLab/laboratary_income_report.xhtml Updated the button label from "Print" to "To Print" and added an action attribute for redirection. Removed the <p:printer> component and two data table columns ("Cheque" and "Total"). Also adjusted the data table style to include a zoom effect.
src/main/webapp/reportLab/laboratary_income_report_print.xhtml New file added as a print template for laboratory income reports. Utilizes JSF components (h:form, p:panel, ui:repeat, etc.) and CSS with separate screen and print media styles to organize report content including headers, data tables, and summary footers.
src/main/webapp/reportLab/test_wise_count_print.xhtml Updated the template reference from /reportLab/lab_summeries_index.xhtml to /resources/template/template.xhtml and changed the UI define name from subcontent to content. Adjusted CSS styles: increased zoom (from 1.6 to 2.0), added size: A4 portrait!important;, and tweaked table width for print.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ReportPage as "laboratary_income_report.xhtml"
    participant PrintPage as "laboratary_income_report_print.xhtml"

    User->>ReportPage: Click "To Print" button
    ReportPage->>PrintPage: Redirect using action attribute (faces-redirect=true)
    PrintPage-->>User: Render formatted print view with report data
Loading

Possibly related PRs


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
src/main/webapp/reportLab/laboratary_income_report.xhtml (1)

286-286: Consider using responsive design instead of fixed zoom value

While the zoom value helps with readability, using fixed zoom values might not be optimal for all users and devices. Consider implementing responsive design techniques instead of hardcoding the zoom value.

-style="padding: 2px!important; margin-top: 10px!important; margin: 0px!important; font-size: #{laborataryReportController.fontSizeForScreen}!important; zoom: 1.6;" 
+style="padding: 2px!important; margin-top: 10px!important; margin: 0px!important; font-size: #{laborataryReportController.fontSizeForScreen}!important;" 
src/main/webapp/reportLab/test_wise_count_print.xhtml (1)

46-47: Consider using responsive design instead of fixed zoom value

While increasing the zoom improves visibility, using fixed zoom values might not be optimal for all users and devices. Consider implementing responsive design techniques instead.

-                                    zoom: 2.0
+                                    /* Consider using responsive design techniques instead of fixed zoom */
src/main/webapp/reportLab/laboratary_income_report_print.xhtml (2)

40-121: Comprehensive CSS for both screen and print media

The CSS properly defines styles for both screen viewing and printing, with appropriate settings for page size, table formatting, and text styles. The print media query includes proper page counters for pagination.

However, consider adding print-specific styles to hide navigation elements when printing.

@media print {
+    .no-print {
+        display: none !important;
+    }
    @page {
        @bottom-right {

Then update the header div:

-<div class="d-flex justify-content-between">
+<div class="d-flex justify-content-between no-print">

239-242: Date format could be more consistent with application preferences

The date format is hardcoded as "dd/MM/YY" instead of using the application preference pattern that's used in the header section.

-<f:convertDateTime pattern="dd/MM/YY" />
+<f:convertDateTime pattern="#{sessionController.applicationPreference.shortDateFormat}" />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd9f470 and 0d958f7.

📒 Files selected for processing (3)
  • src/main/webapp/reportLab/laboratary_income_report.xhtml (2 hunks)
  • src/main/webapp/reportLab/laboratary_income_report_print.xhtml (1 hunks)
  • src/main/webapp/reportLab/test_wise_count_print.xhtml (4 hunks)
🔇 Additional comments (8)
src/main/webapp/reportLab/laboratary_income_report.xhtml (1)

264-270: Button label and functionality improved

The button label change from "Print" to "To Print" provides better clarity about the button's action. Adding the redirect action to a dedicated print view page is a good separation of concerns, allowing for optimized print layouts.

src/main/webapp/reportLab/test_wise_count_print.xhtml (3)

10-11: Template structure improved

Changing to a more standardized template and updating the content definition name improves consistency across the application.


83-83: Proper page size definition for printing

Adding explicit page size declaration ensures consistent printing output, which is essential for report formats.


94-94: Table width adjustment for better print layout

Increasing the table width from 99% to 99.9% helps prevent content from being cut off in the print view.

src/main/webapp/reportLab/laboratary_income_report_print.xhtml (4)

14-38: Well-designed header with navigation options

The header provides clear navigation with Print and Back buttons, enhancing user experience. The Print button correctly uses the PrimeFaces printer component targeting the report content.


90-90: Landscape orientation for print format

Using landscape orientation is appropriate for this report given the number of columns. This ensures all data fits properly on the printed page.


227-297: Well-structured data presentation using UI repeat

The table uses ui:repeat to iterate through data rows with proper formatting for dates and currency values. The layout is well-organized with appropriate column widths and text alignment.


299-358: Comprehensive footer with financial summaries

The footer section properly displays summary values for all financial columns, providing a complete overview of the report data.

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.

2 participants