# Pharmacy Bill Number Configuration Guide ## Overview This guide explains how to configure yearly bill number generation for pharmacy modules in HMIS. The system supports both legacy bill number generation methods and new yearly-based bill number generation for better organization and tracking. ## What is Yearly Bill Number Generation? Yearly bill number generation creates bill numbers that reset each year and include the year in the bill numbering sequence. This provides: - **Better Organization**: Bills are grouped by year - **Clear Identification**: Year is included in bill number - **Simplified Tracking**: Easier to track bills within specific years - **Consistent Format**: Unified bill numbering across different bill types ## When to Use Yearly Bill Number Generation Use yearly bill number generation when: - ✅ You want bills organized by year - ✅ You need consistent bill numbering across departments - ✅ You prefer simpler bill number sequences - ✅ You want to start fresh numbering each year Keep legacy generation when: - ❌ You have complex department-specific numbering requirements - ❌ You need separate numbering for different institutions - ❌ You have existing processes that depend on legacy numbering ## Configuration Options ### Available Configuration Settings The following configuration options are available for enabling yearly bill number generation: #### ✅ Configurable Bill Types (Require Configuration) | **Page/Module** | **Configuration Key** | **Default** | **BillTypeAtomic** | |----------------|----------------------|-------------|-------------------| | Pharmacy Retail Sale for Cashier | `Bill Number Generation Strategy For Pharmacy Retail Sale For Cashier Is By Year, Bill Type Atomic And Logged Department` | `false` | `PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER` | | Pharmacy Disposal Issue | `Bill Number Generation Strategy For Pharmacy Disposal Issue Is By Year, Bill Type Atomic And Logged Department` | `false` | `PHARMACY_DISPOSAL_ISSUE` | | Pharmacy Transfer Issue (Direct Department) | `Bill Number Generation Strategy For Pharmacy Transfer Issue Is By Year, Bill Type Atomic And Logged Department` | `false` | `PHARMACY_DIRECT_ISSUE` | | Pharmacy Transfer Issue | `Bill Number Generation Strategy For Pharmacy Transfer Issue Is By Year, Bill Type Atomic And Logged Department` | `false` | `PHARMACY_ISSUE` | #### ✅ Always Using Yearly Generation (No Configuration Needed) | **Page/Module** | **Status** | **BillTypeAtomic** | |----------------|------------|-------------------| | Direct Purchase | ✅ Always yearly | `PHARMACY_DIRECT_PURCHASE` | | Purchase Order Request | ✅ Always yearly | `PHARMACY_ORDER_PRE` | | Purchase Order Approval | ✅ Always yearly | `PHARMACY_ORDER_APPROVAL` | | GRN Return | ✅ Always yearly | `PHARMACY_GRN_RETURN` | | Direct Purchase Return | ✅ Always yearly | `PHARMACY_DIRECT_PURCHASE_REFUND` | ### How to Configure 1. **Access Configuration**: - Navigate to System Administration - Go to Configuration Options - Search for "Bill Number Generation Strategy" 2. **Enable Yearly Generation**: - Find the specific configuration for your bill type - Set the value to `true` - Save the configuration 3. **Test the Configuration**: - Create a test bill of the configured type - Verify the bill number follows the yearly format ### 🔑 Configuration Keys Reference For system administrators, here are the exact configuration keys to add: #### Configuration Keys for Copy-Paste ``` Key 1: Bill Number Generation Strategy For Pharmacy Retail Sale For Cashier Is By Year, Bill Type Atomic And Logged Department Type: Boolean Default: false Description: Enable yearly bill number generation for Pharmacy Retail Sale for Cashier Key 2: Bill Number Generation Strategy For Pharmacy Disposal Issue Is By Year, Bill Type Atomic And Logged Department Type: Boolean Default: false Description: Enable yearly bill number generation for Pharmacy Disposal Issue Key 3: Bill Number Generation Strategy For Pharmacy Transfer Issue Is By Year, Bill Type Atomic And Logged Department Type: Boolean Default: false Description: Enable yearly bill number generation for Pharmacy Transfer Issue (covers both Direct Department and regular Transfer Issue) ``` #### Quick Configuration Setup 1. **Access Configuration Panel**: System Administration → Configuration Options 2. **Add New Configuration**: Use "Add New" or "Create Configuration" button 3. **Enter Details**: Copy the key name exactly as shown above 4. **Set Type**: Select "Boolean" from dropdown 5. **Set Default**: Set to `false` 6. **Save**: Save the configuration 7. **Enable**: Change value to `true` when ready to use yearly generation ### 🎯 Complete Configuration Options List For comprehensive bill number customization, here are all available configuration options: #### Primary Configuration Keys (Enable Yearly Generation) ``` 1. Bill Number Generation Strategy For Pharmacy Retail Sale For Cashier Is By Year, Bill Type Atomic And Logged Department Type: Boolean | Default: false 2. Bill Number Generation Strategy For Pharmacy Disposal Issue Is By Year, Bill Type Atomic And Logged Department Type: Boolean | Default: false 3. Bill Number Generation Strategy For Pharmacy Transfer Issue Is By Year, Bill Type Atomic And Logged Department Type: Boolean | Default: false ``` #### Format Configuration Keys (Customize Appearance) ``` 4. Add the Institution Code to the Bill Number Generator Type: Boolean | Default: true Purpose: Include/exclude institution code in bill numbers 5. Bill Number Suffix for PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER Type: Text | Default: "" (empty) Purpose: Custom suffix for retail sale bills 6. Bill Number Suffix for PHARMACY_DISPOSAL_ISSUE Type: Text | Default: "" (empty) Purpose: Custom suffix for disposal issue bills 7. Bill Number Suffix for PHARMACY_DIRECT_ISSUE Type: Text | Default: "" (empty) Purpose: Custom suffix for direct transfer issue bills 8. Bill Number Suffix for PHARMACY_ISSUE Type: Text | Default: "" (empty) Purpose: Custom suffix for regular transfer issue bills ``` #### Advanced Strategy Configuration Keys (Optional) ``` 9. Bill Number Generation Strategy - Common Bill Number for All Departments, Institutions and Bill Types Type: Boolean | Default: false Purpose: Use single sequence across all departments and bill types 10. Bill Number Generation Strategy - Separate Bill Number for All Departments, Institutions and Bill Types Type: Boolean | Default: false Purpose: Separate sequences for each department-institution-billtype combination 11. Bill Number Generation Strategy - Separate Bill Number for Institutions Only Type: Boolean | Default: false Purpose: Separate sequences per institution only 12. Bill Number Generation Strategy - Separate Bill Number for Departments Only Type: Boolean | Default: false Purpose: Separate sequences per department only 13. Bill Number Generation Strategy - Separate Bill Number for Bill Types Only Type: Boolean | Default: false Purpose: Separate sequences per bill type only ``` #### Configuration Priority Order When multiple strategy configurations are enabled, they are applied in this priority order: 1. **Common Bill Number** (if enabled) - Single sequence for everything 2. **Separate for All** (if enabled) - Department + Institution + Bill Type combination 3. **Institutions Only** (if enabled) - Per institution sequences 4. **Departments Only** (if enabled) - Per department sequences 5. **Bill Types Only** (if enabled) - Per bill type sequences 6. **Default** - Department + Bill Type combination ### 💡 Practical Configuration Examples #### Example 1: Basic Yearly Generation (Recommended) **Goal**: Enable yearly generation with simple format ``` Configuration: - Bill Number Generation Strategy For Pharmacy Retail Sale For Cashier... = true - Add the Institution Code to the Bill Number Generator = false - No bill suffixes configured Result: PHARM/24/000001 ``` #### Example 2: Full Format with Institution Code and Suffixes **Goal**: Complete bill number with all components ``` Configuration: - Bill Number Generation Strategy For Pharmacy Retail Sale For Cashier... = true - Add the Institution Code to the Bill Number Generator = true - Bill Number Suffix for PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER = "PRS" Result: HOSPPHARM/PRS/24/000001 ``` #### Example 3: Department-Only Format (Clean) **Goal**: Simple department-based numbering ``` Configuration: - Bill Number Generation Strategy For Pharmacy Disposal Issue... = true - Add the Institution Code to the Bill Number Generator = false - Bill Number Suffix for PHARMACY_DISPOSAL_ISSUE = "" Result: PHARM/24/000001 ``` #### Example 4: Multiple Bill Types with Different Suffixes **Goal**: Different suffixes for different bill types ``` Configuration: - Enable yearly generation for all desired bill types = true - Add the Institution Code to the Bill Number Generator = true - Bill Number Suffix for PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER = "RS" - Bill Number Suffix for PHARMACY_DISPOSAL_ISSUE = "DI" - Bill Number Suffix for PHARMACY_DIRECT_ISSUE = "TI" Results: - Retail Sale: HOSPPHARM/RS/24/000001 - Disposal: HOSPPHARM/DI/24/000001 - Transfer: HOSPPHARM/TI/24/000001 ``` ## Supported Pharmacy Modules ### ✅ Modules with Yearly Generation Available | Module | Configuration Required | Status | |--------|----------------------|--------| | **Pharmacy Retail Sale for Cashier** | Yes - Enable configuration | ✅ Configurable | | **Pharmacy Disposal Issue** | Yes - Enable configuration | ✅ Configurable | | **Pharmacy Transfer Issue (Direct Department)** | Yes - Enable configuration | ✅ Configurable | | **Pharmacy Transfer Issue** | Yes - Enable configuration | ✅ Configurable | ### ✅ Modules Already Using Yearly Generation | Module | Status | |--------|--------| | **Direct Purchase** | ✅ Always uses yearly generation | | **Purchase Order Request** | ✅ Always uses yearly generation | | **Purchase Order Approval** | ✅ Always uses yearly generation | | **GRN Return** | ✅ Always uses yearly generation | | **Direct Purchase Return** | ✅ Always uses yearly generation | ## Bill Number Format ### Yearly Generation Format When yearly generation is enabled, bill numbers follow this comprehensive pattern: ``` [Institution Code][Department Code]/[Bill Suffix]/[Year]/[Sequential Number] ``` #### Complete Format Structure | Component | Description | Configurable | Example | |-----------|-------------|--------------|---------| | **Institution Code** | Institution identifier | ✅ Optional via config | `HOSP` | | **Department Code** | Department identifier | ✅ Required | `PHARM` | | **Bill Suffix** | Bill type specific suffix | ✅ Optional | `RS` | | **Year** | Last 2 digits of year | ❌ Automatic | `24` | | **Sequential Number** | 6-digit sequence | ❌ Automatic | `000001` | #### Format Examples **With Institution Code + Bill Suffix:** ``` HOSPPHARM/RS/24/000001 ``` **Without Institution Code, With Bill Suffix:** ``` PHARM/RS/24/000001 ``` **Without Bill Suffix:** ``` PHARM/24/000001 ``` **Minimal Format:** ``` PHARM/24/000001 ``` ### Legacy Generation Format Legacy generation uses various patterns depending on configuration: ``` [Institution Code]/[Department Code]/[Sequential Number] ``` Example: `INS001/DEPT001/12345` ### 🔧 Additional Configurable Components #### Institution Code Configuration | Configuration Key | Type | Default | Purpose | |-------------------|------|---------|---------| | `Add the Institution Code to the Bill Number Generator` | Boolean | `true` | Include institution code in bill number | #### Bill Suffix Configuration Individual bill suffixes can be configured for each bill type: | Configuration Key Format | Example Key | Type | Purpose | |--------------------------|-------------|------|---------| | `Bill Number Suffix for [BillTypeAtomic]` | `Bill Number Suffix for PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER` | Text | Custom suffix for specific bill type | | | `Bill Number Suffix for PHARMACY_DISPOSAL_ISSUE` | Text | Custom suffix for disposal issues | | | `Bill Number Suffix for PHARMACY_DIRECT_ISSUE` | Text | Custom suffix for transfer issues | #### Bill Suffix Examples | Bill Type | Suggested Suffix | Example Bill Number | |-----------|------------------|-------------------| | Pharmacy Retail Sale for Cashier | `PRS` | `PHARM/PRS/24/000001` | | Pharmacy Disposal Issue | `PDI` | `PHARM/PDI/24/000001` | | Pharmacy Transfer Issue | `PTI` | `PHARM/PTI/24/000001` | | Direct Purchase | `DP` | `PHARM/DP/24/000001` | ## Best Practices ### Implementation Guidelines 1. **Plan the Migration**: - Enable yearly generation at the beginning of a fiscal year - Communicate the change to all pharmacy staff - Ensure all users understand the new bill number format 2. **Test Before Production**: - Test yearly generation in a development environment - Verify bill numbers are generated correctly - Check integration with reporting systems 3. **Monitor After Implementation**: - Monitor bill generation for the first few days - Ensure no duplicate bill numbers are generated - Verify compatibility with existing processes ### Configuration Management 1. **Document Changes**: - Record when yearly generation was enabled - Note the previous configuration settings - Keep backup of configuration before changes 2. **User Training**: - Train staff on new bill number format - Update standard operating procedures - Provide quick reference guides ## Troubleshooting ### Common Issues **Issue**: Bill numbers are not following yearly format - **Solution**: Verify the configuration is enabled and saved correctly - **Check**: Ensure you're using the correct configuration key name **Issue**: Duplicate bill numbers generated - **Solution**: Check if multiple configurations are conflicting - **Action**: Contact system administrator to reset bill number sequence **Issue**: Old bill number format still appearing - **Solution**: Clear browser cache and restart the application - **Check**: Verify configuration changes were saved properly ### Getting Help If you encounter issues with bill number configuration: 1. **Check Configuration**: Verify all settings are correct 2. **Review Logs**: Check system logs for error messages 3. **Contact Support**: Reach out to your system administrator 4. **Documentation**: Refer to technical documentation for developers ## FAQ **Q: Can I switch back to legacy generation after enabling yearly generation?** A: Yes, you can disable the yearly generation configuration to return to legacy generation. However, plan this carefully as it may affect bill number continuity. **Q: Will yearly generation affect existing bills?** A: No, existing bills keep their original numbers. Only new bills will use the yearly generation format. **Q: Do all pharmacy modules support yearly generation?** A: Most modules support yearly generation, but some may require configuration while others use it by default. See the module list above for details. **Q: What happens to bill numbers when the year changes?** A: The sequential numbering resets to 1 at the beginning of each new year, and the year portion of the bill number updates automatically. **Q: Can I customize the yearly bill number format?** A: The basic format is standardized, but system administrators may be able to customize prefixes and formatting through advanced configuration options. --- *Last Updated: [Current Date]* *Version: 1.0* *Author: System Documentation Team*