Add to Stock Bills Configuration - hmislk/hmis GitHub Wiki

Add to Stock Bills Report - Configuration Guide

Overview

The Add to Stock Bills Report provides a comprehensive view of pharmacy bills that add stock to the system, displaying detailed cost information including cost rates, purchase values, and financial totals. This report is essential for inventory management and financial reconciliation.

Location: Reports → Inventory Reports → Add to Stock Bills

Report Features

Available Columns

  • Bill Information: Date & Time, Bill Number, Reference Bill details
  • Item Details: Name, Code, Batch Number, Quantity
  • Cost Data:
    • Cost Rate (per unit)
    • Cost Value (quantity × cost rate)
    • Purchase Rate and Purchase Value
    • MRP (Maximum Retail Price) and MRP Value
  • Financial Summary: Net Total, Payment Methods, Discounts
  • Footer Totals: Automatic calculation of cost values and net totals

Add to Stock Bills report showing Cost Rate, Cost Value and the footer totals

The report on screen: Cost Rate and Cost Value sit beside Purchase and MRP for each item, and the footer totals every value column across all bills in the period — not just the current page.

The table is wider than most screens, so it scrolls sideways. The cost columns sit in the middle of the row, between the item's Batch No and its MRP — scroll right from the item name to reach them, or use one of the exports below, which carry the same columns without the scrolling.

Filtering Options

  • Date Range: From Date and To Date filters
  • Institution Filter: Filter by specific institutions
  • Site Filter: Filter by institution sites
  • Department Filter: Conditional department selection based on institution/site

Page Configuration Management

Accessing Configuration

  1. Navigate to Reports → Inventory Reports → Add to Stock Bills
  2. Look for the Config button in the page header (visible only to administrators)
  3. Click Config to open the Page Configuration Management interface
  4. Modify configuration options as needed
  5. Save changes - they take effect immediately

Available Configuration Options

Date Formatting

Configuration Key: Short Date Format Description: Controls the date formatting pattern used in report generation and PDF exports Default: System default date format Effect: Changes how dates appear in exported reports and PDF documents

Required Privileges

Admin Privilege

Privilege Name: Admin Description: Administrative access to system configuration and page management Required For:

  • Viewing the Config button
  • Accessing page configuration interface
  • Modifying configuration options

Data Sources

Cost Rate Information

The report displays cost rate data from the following sources:

  • Source: the Cost Rate of the item batch the bill item was issued from
  • Calculation: Cost Value = Quantity × Cost Rate
  • Missing cost rates: there is no fallback to Purchase Rate. A bill item whose batch has no cost rate contributes 0.00 to Cost Value and to the Total Cost Value, while its Purchase Value is still counted — so a report where the two totals diverge sharply usually points at batches with an unset cost rate rather than at a genuine margin.

Bill Data

  • Bill Type: PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER
  • Data Flow: Database → BillItemDTO → Report Display
  • Financial Totals: Automatically calculated and displayed in footer

Export Options

Available Export Formats

  1. Print All: Browser-based printing of the entire report
  2. Download (Excel): Export to Excel format with all data and calculations
  3. PDF Export: Generate PDF version with formatted layout

Export Columns

Both the Excel and the PDF export carry the same 15 columns, one row per bill item, with the bill-level values (Net Total, Payment Mode, Discount) shown against the first item of each bill:

Date · Doc. No · NAME · CODE · BATCH NO · QTY · COST RATE · COST VALUE · PURCHASE RATE · PURCHASE VALUE · Net Total · Payment Mode/Modes · MRP · MRP Value · Discount

Export Totals

A Total row closes both exports, carrying the same figures as the on-screen footer — Total Cost Value, Total Purchase Value, Total Net Total and Total MRP Value, each under the column it totals. The PDF repeats them in a Summary block beneath the table, together with the bill count.

The totals are the ones accumulated while the report was processed, not a re-sum of the exported rows. This matters because two groups of bills are netted at total level only: reference bills settled outside the selected period are subtracted, and pre-add-to-stock bills are added. A spreadsheet formula summing the Cost Value column will therefore not always match the Total row — the Total row is the correct figure, and it is the one that agrees with the report screen.

Add to Stock Bills PDF export showing the Total row and Summary block

PDF export: the Total row carries Total Cost Value, Total Purchase Value, Net Total and Total MRP Value, repeated in the Summary block below.

Export Configuration

  • Date formatting in exports is controlled by the "Short Date Format" configuration
  • Pagination settings do not limit exports — every bill in the processed result is exported, not just the current page

Troubleshooting

Cost Rate Columns Not Displaying Data

If Cost Rate and Cost Value columns show zeros or are empty:

  1. Check Data Source: Verify that ItemBatch records have populated costRate values
  2. Bill Type Verification: Ensure bills are of the correct type for stock addition
  3. Batch Association: Confirm pharmaceutical bill items are properly linked to item batches
  4. Configuration Check: Review any configuration options that might affect display

Config Button Not Visible

If the Config button doesn't appear:

  1. Privilege Check: Verify user has 'Admin' privilege assigned
  2. User Role: Confirm user is logged in with administrative rights
  3. Page Registration: Ensure page metadata is properly registered in the system

Administrative Notes

Configuration Best Practices

  • Date Format Changes: Test date format changes with small report extracts first
  • Backup Configuration: Document current configuration values before making changes
  • User Communication: Inform users when date formats or display options change

System Impact

  • Configuration changes take effect immediately without requiring server restart
  • Date format changes affect all future report generations
  • No impact on historical data or existing exported reports

Related Documentation

Technical Information

Report Controller: PharmacyReportController Processing Method: processAddToStockBills() Data Retrieval: retrieveBillWithoutReference() Page Path: reports/inventoryReports/add_to_stock_bills

For technical implementation details, refer to the developer documentation in the repository.