# POS Order Line Discount This module converts order-level discounts (like global discount and loyalty program reward discount) to order line discounts in the Point of Sale. ## Features - Convert order-level discounts to line-level discounts - Support for loyalty program rewards - Configurable discount distribution methods - Maintain proper tax calculations ## Configuration 1. Go to Point of Sale > Configuration > Point of Sale 2. Select your POS configuration 3. In the Pricing section, you'll find: - **Line Discount Type**: Choose between percentage or fixed amount distribution - **Apply Line Discount on Rewards**: Enable to convert loyalty rewards to line discounts ## How it works The module works by intercepting the reward application process and distributing the discount amount across all order lines instead of creating a separate reward line. This ensures that: 1. All discounts are visible at the line level 2. Tax calculations are properly maintained 3. Reporting shows discounts at the line level ## Technical Details The module patches the following components: 1. **PosOrder model**: Processes rewards as line discounts during order creation 2. **PosConfig model**: Adds configuration options for discount distribution 3. **Order model (JS)**: Overrides reward application to distribute discounts to lines 4. **Orderline model (JS)**: Enhances line discount handling ## Compatibility This module is compatible with Odoo 17 and requires: - point_of_sale - pos_loyalty ## Installation 1. Place the module in your Odoo addons directory 2. Update the apps list 3. Install the "POS Order Line Discount" module 4. Configure your POS settings as needed